id: aws-code-env info: name: AWS Cloud Environment Validation author: princechaddha severity: info description: | Checks if AWS CLI is set up and all necessary tools are installed on the environment. reference: - https://aws.amazon.com/cli/ tags: cloud,devops,aws,amazone,aws-cloud-config variables: region: "us-east-1" flow: code(1) && code(2) self-contained: true code: - engine: - sh - bash source: | aws sts get-caller-identity --output json matchers: - type: word internal: true words: - '"UserId"' extractors: - type: json name: account internal: true json: - '.Account' - engine: - sh - bash source: | jq --version >/dev/null 2>&1 && echo "jq is installed." || echo "jq is not installed." matchers: - type: word words: - "jq is installed" extractors: - type: dsl dsl: - '"AWS CLI is properly configured for account \"" + account + "\" and all the necessary tools required are installed"' # digest: 4b0a00483046022100a05a196d8113f7a6f2a0ad341f9cecb882fe6fb7067812b6fc3d60482a736759022100a2d1867891aecfc696770bef70553de20c1cf97b6dbb29a4158fee3a08522c69:922c64590222798bb761d5b6d8e72950