-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws-codepipeline-actions: Lack of CodePipeline permissions when ECS Resource Tagging Authorization is enabled #25768
Comments
According to the README here:
I believe when you provide the custom role, you will need to attach required permissions to it. Interesting I can't find |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
@pahud ECS Tagging Authorization is a new feature that will become effective gradually by July 17, 2023. Without the Also, adding |
@pahud I was wondering if there has been any progress on this issue? Your feedback would be greatly appreciated. |
At the time of posting this issue, deployments were failing due to the following error, but at this time, perhaps because the CodePipeline service has been modified, the ecs:TagResource privilege is now required at AssumeRole, and the error no longer occurs. {
"eventVersion": "1.08",
"userIdentity": {
"type": "AssumedRole",
"principalId": "xxxxxxxxxxxxxx:0000000000",
"arn": "arn:aws:sts::000000000000:assumed-role/Stack-DeployRoleXXX/0000",
"accountId": "000000000000",
"accessKeyId": "XXX",
"sessionContext": {
"sessionIssuer": {
"type": "Role",
"principalId": "XXX",
"arn": "arn:aws:iam::000000000000:role/Stack-DeployRoleXXX",
"accountId": "000000000000",
"userName": "Stack-DeployRoleXXX"
},
"webIdFederationData": {},
"attributes": {
"creationDate": "2023-05-21T16:40:53Z",
"mfaAuthenticated": "false"
}
},
"invokedBy": "codepipeline.amazonaws.com"
},
"eventTime": "2023-05-21T16:40:53Z",
"eventSource": "ecs.amazonaws.com",
"eventName": "RegisterTaskDefinition",
"awsRegion": "ap-northeast-1",
"sourceIPAddress": "codepipeline.amazonaws.com",
"userAgent": "codepipeline.amazonaws.com",
"errorCode": "AccessDenied",
"errorMessage": "User: arn:aws:sts::000000000000:assumed-role/Stack-DeployRoleXXX/000000000000 is not authorized to perform: ecs:TagResource on resource: arn:aws:ecs:ap-northeast-1:000000000000:task-definition/StackTaskDefinitionXXX because no session policy allows the ecs:TagResource action",
"requestParameters": null,
"responseElements": null,
"requestID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"eventID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
"readOnly": false,
"eventType": "AwsApiCall",
"managementEvent": true,
"recipientAccountId": "000000000000",
"eventCategory": "Management"
} |
|
Describe the bug
When creating a Task definition with tags using
EcsDeployAction
, I get an error because I don't haveecs:TagResource
permission.(ECS Resource Tagging Authorization is enabled)
Expected Behavior
Task definitions with tags are created without explicitly adding IAM policies
Current Behavior
Need to explicitly allow
ecs:TagResource
in the IAM role forEcsDeployAction
.Even if I allow
ecs:TagResource
, CodePipeline still fails because I don't have enough permissions in the session policy for AssumeRole.Session policies taken from the Event Record.
Reproduction Steps
Enable ECS Resource Tagging Authorization setting.
Deploy and execute pipeline.
bin/app.ts
lib/my-stack.ts
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.80.0 (build bbdb16a)
Framework Version
No response
Node.js Version
v18.12.0
OS
macOS 13.3.1 (a)
Language
Typescript
Language Version
TypeScript(5.0.4)
Other information
No response
The text was updated successfully, but these errors were encountered: