AWSTemplateFormatVersion: '2010-09-09' Description: CodeBuild IAM Setup template Parameters: EnvironmentName: Description: An environment name that is prefixed to resource names Type: String Default: Poc Resources: CodeDeployRole: Type: AWS::IAM::Role Properties: RoleName: !Join ['-', [!Ref EnvironmentName, codedeployRole]] AssumeRolePolicyDocument: Statement: - Effect: Allow Principal: Service: codedeploy.amazonaws.com Action: 'sts:AssumeRole' ManagedPolicyArns: - 'arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS' - 'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole'