version: 0.2 phases: install: commands: # Install dependencies needed for running tests - npm install --prefix ./nodejs # Upgrade AWS CLI to the latest version - pip install --upgrade awscli pre_build: commands: # Discover and run unit tests in the 'tests' directory #- npm test build: commands: # Use AWS SAM to package the application by using AWS CloudFormation - aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml - sam package --template-file template.yml --s3-bucket $S3_BUCKET --output-template-file package.yml post_build: commands: # Do not remove this statement. This command is required for AWS CodeStar projects. # Update the AWS Partition, AWS Region, account ID and project ID in the project ARN on template-configuration.json file so AWS CloudFormation can tag project resources. - sed -i.bak 's/\$PARTITION\$/'${PARTITION}'/g;s/\$AWS_REGION\$/'${AWS_REGION}'/g;s/\$ACCOUNT_ID\$/'${ACCOUNT_ID}'/g;s/\$PROJECT_ID\$/'${PROJECT_ID}'/g' template-configuration.json artifacts: type: zip files: - template-export.yml - template-configuration.json