Skip to content

feat(events-targets): use IAM role for SnsTopic target #34259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,53 @@
"Arn": {
"Ref": "MyTopic86869434"
},
"Id": "Target0"
"Id": "Target0",
"RoleArn": {
"Fn::GetAtt": [
"MyPipelineSourceCodeCommitSourceOnActionStateChangeEventsRoleD56C86B6",
"Arn"
]
}
}
]
}
},
"MyPipelineSourceCodeCommitSourceOnActionStateChangeEventsRoleD56C86B6": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"MyPipelineSourceCodeCommitSourceOnActionStateChangeEventsRoleDefaultPolicy4701CFE4": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "sns:Publish",
"Effect": "Allow",
"Resource": {
"Ref": "MyTopic86869434"
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "MyPipelineSourceCodeCommitSourceOnActionStateChangeEventsRoleDefaultPolicy4701CFE4",
"Roles": [
{
"Ref": "MyPipelineSourceCodeCommitSourceOnActionStateChangeEventsRoleD56C86B6"
}
]
}
Expand Down Expand Up @@ -554,7 +600,53 @@
"Arn": {
"Ref": "MyTopic86869434"
},
"Id": "Target0"
"Id": "Target0",
"RoleArn": {
"Fn::GetAtt": [
"MyPipelineSourceOnSourceStateChangeEventsRole79DEE677",
"Arn"
]
}
}
]
}
},
"MyPipelineSourceOnSourceStateChangeEventsRole79DEE677": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"MyPipelineSourceOnSourceStateChangeEventsRoleDefaultPolicy616A885B": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "sns:Publish",
"Effect": "Allow",
"Resource": {
"Ref": "MyTopic86869434"
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "MyPipelineSourceOnSourceStateChangeEventsRoleDefaultPolicy616A885B",
"Roles": [
{
"Ref": "MyPipelineSourceOnSourceStateChangeEventsRole79DEE677"
}
]
}
Expand Down Expand Up @@ -670,11 +762,57 @@
"detail-state": "$.detail.state"
},
"InputTemplate": "\"Pipeline <detail-pipeline> changed state to <detail-state>\""
},
"RoleArn": {
"Fn::GetAtt": [
"MyPipelineOnPipelineStateChangeEventsRoleDFA9E661",
"Arn"
]
}
}
]
}
},
"MyPipelineOnPipelineStateChangeEventsRoleDFA9E661": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"MyPipelineOnPipelineStateChangeEventsRoleDefaultPolicy53C4E1C5": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "sns:Publish",
"Effect": "Allow",
"Resource": {
"Ref": "MyTopic86869434"
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "MyPipelineOnPipelineStateChangeEventsRoleDefaultPolicy53C4E1C5",
"Roles": [
{
"Ref": "MyPipelineOnPipelineStateChangeEventsRoleDFA9E661"
}
]
}
},
"CodeCommitRepoDC6A41F9": {
"Type": "AWS::CodeCommit::Repository",
"Properties": {
Expand Down Expand Up @@ -921,4 +1059,4 @@
]
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading