-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(ecs): reduce ecs service task role cloudwatch permissions when no log configured (under feature flag) #31475
Conversation
...s/@aws-cdk-testing/framework-integ/test/aws-ecs/test/fargate/integ.enable-execute-command.ts
Show resolved
Hide resolved
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #31397
Reason for this change
If a FargateService or EC2 Service has
enableExecuteCommand: true
and the ECS cluster it runs on hasexecuteCommandConfiguration.logging
set to anything butecs.ExecuteCommandLogging.NONE
then the CDK automatically grants the underlying TaskDefinition overly broad cloudwatch logs permissions regardless of need even if the logging configuration has no cloudwatch logs config set.This is not right behaviour as these permissions are not needed.
Description of changes
Add feature flag and if feature flag is on and cloudwatch log is configured, reduce the permissions.
Description of how you validated changes
New unit tests, integration tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license