gsantovena / infrastructure-as-code-example

Example of how to use AWS CodePipeline and AWS CloudFormation together for IaC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

infrastructure-as-code-example

Example of how to use AWS CodePipeline and AWS CloudFormation together for IaC

Sample Template

Requirements

We need to create two roles, one for CodePipeline and one for CloudFormation:

aws iam create-role \
    --role-name MyPipelineRole \
    --assume-role-policy file://pipeline-trust-policy.json

aws iam put-role-policy \
    --role-name MyPipelineRole \
    --policy-name MyPipelinePolicy \
    --policy-document file://pipeline-role-policy.json
aws iam create-role \
    --role-name MyCloudFormationRole \
    --assume-role-policy file://cfn-trust-policy.json

aws iam put-role-policy \
    --role-name MyCloudFormationRole \
    --policy-name MyCloudFormationPolicy \
    --policy-document file://cfn-role-policy.json

About

Example of how to use AWS CodePipeline and AWS CloudFormation together for IaC