Skip to content

Instantly share code, notes, and snippets.

@josjaf
Last active August 15, 2019 21:56
Show Gist options
  • Save josjaf/bf1e4403c3e1648dc42b381702e7b46d to your computer and use it in GitHub Desktop.
Save josjaf/bf1e4403c3e1648dc42b381702e7b46d to your computer and use it in GitHub Desktop.
cdkout
{
"Resources": {
"CodepipelineRole3288BFBB": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"codepipeline.",
{
"Ref": "AWS::URLSuffix"
}
]
]
},
"AWS": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
{
"Ref": "AWS::AccountId"
},
":root"
]
]
}
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/AdministratorAccess"
]
]
}
],
"MaxSessionDuration": 3600
},
"Metadata": {
"aws:cdk:path": "test-repokid-pipeline/CodepipelineRole/Resource"
}
},
"CodepipelineRoleDefaultPolicy114DD585": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"s3:GetObject*",
"s3:GetBucket*",
"s3:List*",
"s3:DeleteObject*",
"s3:PutObject*",
"s3:Abort*"
],
"Effect": "Allow",
"Resource": [
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
{
"Fn::Join": [
"",
[
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
"/*"
]
]
}
]
},
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"CodepipelineRole3288BFBB",
"Arn"
]
}
},
{
"Action": [
"s3:GetObject*",
"s3:GetBucket*",
"s3:List*"
],
"Effect": "Allow",
"Resource": [
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
{
"Fn::Join": [
"",
[
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
"/*"
]
]
}
]
},
{
"Action": [
"s3:DeleteObject*",
"s3:PutObject*",
"s3:Abort*"
],
"Effect": "Allow",
"Resource": [
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
{
"Fn::Join": [
"",
[
{
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
},
"/*"
]
]
}
]
},
{
"Action": [
"codebuild:BatchGetBuilds",
"codebuild:StartBuild",
"codebuild:StopBuild"
],
"Effect": "Allow"
}
],
"Version": "2012-10-17"
},
"PolicyName": "CodepipelineRoleDefaultPolicy114DD585",
"Roles": [
{
"Ref": "CodepipelineRole3288BFBB"
}
]
},
"Metadata": {
"aws:cdk:path": "test-repokid-pipeline/CodepipelineRole/DefaultPolicy/Resource"
}
},
"codepipelinerolepolicies3D8B71B7": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "codebuild:*",
"Effect": "Allow",
"Resource": "*"
},
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": {
"Fn::ImportValue": "test-repokid-roles:ExportsOutputFnGetAttSourceBucketDDD2130AArn02858302"
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "cdk",
"Roles": [
{
"Ref": "CodepipelineRole3288BFBB"
}
]
},
"Metadata": {
"aws:cdk:path": "test-repokid-pipeline/codepipelinerolepolicies/Resource"
}
},
"PipelineC660917D": {
"Type": "AWS::CodePipeline::Pipeline",
"Properties": {
"RoleArn": {
"Fn::GetAtt": [
"CodepipelineRole3288BFBB",
"Arn"
]
},
"Stages": [
{
"Actions": [
{
"ActionTypeId": {
"Category": "Source",
"Owner": "AWS",
"Provider": "S3",
"Version": "1"
},
"Configuration": {
"S3Bucket": {
"Fn::ImportValue": "test-repokid-roles:ExportsOutputRefSourceBucketDDD2130AFF6DDDA5"
},
"S3ObjectKey": "source.zip"
},
"InputArtifacts": [],
"Name": "S3Source",
"OutputArtifacts": [
{
"Name": "source"
}
],
"RoleArn": {
"Fn::GetAtt": [
"CodepipelineRole3288BFBB",
"Arn"
]
},
"RunOrder": 1
}
],
"Name": "Source"
},
{
"Actions": [
{
"ActionTypeId": {
"Category": "Build",
"Owner": "AWS",
"Provider": "CodeBuild",
"Version": "1"
},
"Configuration": {},
"InputArtifacts": [
{
"Name": "source"
}
],
"Name": "DockerBuildImages",
"OutputArtifacts": [],
"RoleArn": {
"Fn::GetAtt": [
"CodepipelineRole3288BFBB",
"Arn"
]
},
"RunOrder": 1
}
],
"Name": "Build"
}
],
"ArtifactStore": {
"Location": {
"Fn::ImportValue": "test-repokid-roles:ExportsOutputRefSourceBucketDDD2130AFF6DDDA5"
},
"Type": "S3"
},
"Name": "test"
},
"DependsOn": [
"CodepipelineRoleDefaultPolicy114DD585",
"CodepipelineRole3288BFBB"
],
"Metadata": {
"aws:cdk:path": "test-repokid-pipeline/Pipeline/Resource"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment