# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to use, copy, modify, # merge, publish, distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. version: 0.2 phases: install: runtime-versions: java: corretto11.x python: 3.8 commands: - echo "Install Prequisites" - echo $TF_SOURCE_CODE_FOLDER - echo $TF_BACKEND_S3_BUCKET - echo $PATH - yum install jq -y - yum install unzip -y - mkdir download - cd download - wget https://releases.hashicorp.com/terraform/0.12.29/terraform_0.12.29_linux_amd64.zip - unzip terraform_0.12.29_linux_amd64.zip - ls -l - mv ./terraform /usr/local/bin/ - terraform -v - pip install terraform-compliance - terraform-compliance -v - ls $CODEBUILD_SRC_DIR - cd $CODEBUILD_SRC_DIR - chmod +x aws-profile-setup.sh - chmod +x compliance-check.sh - mkdir -p $HOME/reports build: commands: - echo "Start Compliance Check" - cd $CODEBUILD_SRC_DIR - ls -l ${!TF_SOURCE_CODE_FOLDER} # Execute Compliance Check - . ./compliance-check.sh ${!TF_SOURCE_CODE_FOLDER} "$HOME/reports" - ls -l "$HOME/reports" reports: TerraformComplianceReportGroup: files: - test.json base-directory: $HOME/reports discard-paths: yes file-format: CucumberJson artifacts: files: # Build Artifact containing cucumber html report and json report - 'reports/**/*' discard-paths: no base-directory: $HOME