Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⭐️ aws cloudformation provider #4105

Merged
merged 3 commits into from
May 28, 2024
Merged

Conversation

chris-rock
Copy link
Member

@chris-rock chris-rock commented May 26, 2024

This PR adds support for AWS Cloudformation templates and AWS SAM templates.

cnquery shell cloudformation providers/cloudformation/testdata/cloudformation.yaml
→ loaded configuration from /Users/chris/.config/mondoo/mondoo.yml using source default
→ connected to AWS Cloudformation
  ___ _ __   __ _ _   _  ___ _ __ _   _ 
 / __| '_ \ / _` | | | |/ _ \ '__| | | |
| (__| | | | (_| | |_| |  __/ |  | |_| |
 \___|_| |_|\__, |\__,_|\___|_|   \__, |
  mondoo™      |_|                |___/  interactive shell

cnquery> asset { name platform }
asset: {
  platform: "cloudformation"
  name: "Cloudformation Static Analysis cloudformation"
}

cnquery> cloudformation.template { * }
cloudformation.template: {
  mappings: {
    RegionMap: {
      ap-northeast-1: {
        AMI: "ami-06cd52961ce9f0d85"
      }
      ap-southeast-1: {
        AMI: "ami-08569b978cc4dfa10"
      }
      ap-southeast-2: {
        AMI: "ami-09b42976632b27e9b"
      }
      eu-west-1: {
        AMI: "ami-047bb4163c506cd98"
      }
      sa-east-1: {
        AMI: "ami-07b14488da8ea02a0"
      }
      us-east-1: {
        AMI: "ami-0ff8a91507f77f867"
      }
      us-west-1: {
        AMI: "ami-0bdb828fd58c52235"
      }
      us-west-2: {
        AMI: "ami-a0cfeed8"
      }
    }
  }
  parameters: {
    EnvType: {
      AllowedValues: [
        0: "prod"
        1: "dev"
        2: "test"
      ]
      ConstraintDescription: "must specify prod, dev, or test."
      Default: "test"
      Description: "Environment type."
      Type: "String"
    }
  }
  resources: [
    0: cloudformation.resource name="EC2Instance"
    1: cloudformation.resource name="MountPoint"
    2: cloudformation.resource name="NewVolume"
  ]
  globals: {}
  metadata: {}
  conditions: {
    CreateDevResources: {
      Fn::Equals: [
        0: {
          Ref: "EnvType"
        }
        1: "dev"
      ]
    }
    CreateProdResources: {
      Fn::Equals: [
        0: {
          Ref: "EnvType"
        }
        1: "prod"
      ]
    }
  }
  description: ""
  types: [
    0: "AWS::EC2::Instance"
    1: "AWS::EC2::VolumeAttachment"
    2: "AWS::EC2::Volume"
  ]
  transform: null
  outputs: []
  version: "2010-09-09"
}

This comment has been minimized.

@chris-rock chris-rock changed the title ⭐️ cloudformation provider ⭐️ aws cloudformation provider May 26, 2024

This comment has been minimized.

Copy link
Contributor

github-actions bot commented May 26, 2024

Test Results

3 011 tests  +11   3 010 ✅ +11   1m 40s ⏱️ +11s
  337 suites + 6       1 💤 ± 0 
   24 files   + 1       0 ❌ ± 0 

Results for commit 81f2ce4. ± Comparison against base commit 98bd4ad.

♻️ This comment has been updated with latest results.

@tas50
Copy link
Member

tas50 commented May 28, 2024

@chris-rock can we make sure we also get these into Atlas

@chris-rock
Copy link
Member Author

@chris-rock can we make sure we also get these into Atlas

Cannot be done here :-)

@chris-rock chris-rock merged commit 54cecba into main May 28, 2024
15 checks passed
@chris-rock chris-rock deleted the chris-rock/cloudformation branch May 28, 2024 06:56
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants