-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
EC2 Default User
committed
Apr 23, 2019
1 parent
3e77fd2
commit 791b83a
Showing
23 changed files
with
3,291 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "Role to be assumed by CodePipeline service cross account", | ||
"Parameters": { | ||
"S3BucketName": { | ||
"Description": "S3 Bucket in CICD Account, which holds the CodePipeline artifacts.", | ||
"Type": "String" | ||
}, | ||
"CicdAccount": { | ||
"Description": "AWS AccountNumber for CICD Account.", | ||
"Type": "Number" | ||
}, | ||
"KmsCmkArn": { | ||
"Description": "ARN of the KMS CMK creates in CICD account.", | ||
"Type": "String" | ||
}, | ||
"Environment": { | ||
"Description": "Environment", | ||
"Type": "String" | ||
} | ||
}, | ||
"Resources": { | ||
"IamRoleCodeBuild": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"RoleName": { | ||
"Fn::Sub": "${AWS::StackName}-CodeBuildRole" | ||
}, | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "codebuild.amazonaws.com" | ||
}, | ||
"Action": [ | ||
"sts:AssumeRole" | ||
] | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": [ | ||
{ | ||
"Ref": "CicdAccount" | ||
} | ||
] | ||
}, | ||
"Action": [ | ||
"sts:AssumeRole" | ||
] | ||
} | ||
] | ||
}, | ||
"Path": "/", | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Ref": "IamPolicyBaseline" | ||
} | ||
] | ||
} | ||
}, | ||
"IamRoleCodePipeline": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"RoleName": { | ||
"Fn::Sub": "${AWS::StackName}-CodePipelineRole" | ||
}, | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": [ | ||
{ | ||
"Ref": "CicdAccount" | ||
} | ||
] | ||
}, | ||
"Action": [ | ||
"sts:AssumeRole" | ||
] | ||
} | ||
] | ||
}, | ||
"Path": "/", | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Ref": "IamPolicyBaseline" | ||
} | ||
] | ||
} | ||
}, | ||
"IamRoleCloudFormation": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"RoleName": { | ||
"Fn::Sub": "${AWS::StackName}-CloudFormationRole" | ||
}, | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"cloudformation.amazonaws.com" | ||
] | ||
}, | ||
"Action": [ | ||
"sts:AssumeRole" | ||
] | ||
} | ||
] | ||
}, | ||
"Path": "/", | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Ref": "IamPolicyBaseline" | ||
} | ||
] | ||
} | ||
}, | ||
"IamPolicyBaseline": { | ||
"Type": "AWS::IAM::ManagedPolicy", | ||
"Properties": {. | ||
"ManagedPolicyName": { | ||
"Fn::Sub": "${AWS::StackName}-IamPolicyBaseline" | ||
} | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "Admin", | ||
"Effect": "Allow", | ||
"Action": "*", | ||
"Resource": "*" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.