Skip to content
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

feat(ecs): add fargate ephemeral storage encryption to cluster settings #30759

Merged

Conversation

jaecktec
Copy link
Contributor

@jaecktec jaecktec commented Jul 5, 2024

Issue # (if applicable)

Closes #30721

Reason for this change

Expose api on ECS L2 Cluster construct to encrypt fargate ephemeral storage

Description of changes

adds new property to pass key for encrypton.
Updates key policy according to developer documentation

Description of how you validated changes

Added unit tests to validate cases where cluster has a generated name or a specified name.

When name is random, the key policy can't be as restrictive since it will generate a cyclic dependency issue due to the Key Policy being inline in KMS

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team July 5, 2024 11:35
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jul 5, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch from 09a2fa0 to 440799d Compare July 5, 2024 11:44
@jaecktec jaecktec changed the title feat(ecs) add fargate ephemeral storage encryption to cluster settings feat(ecs): add fargate ephemeral storage encryption to cluster settings Jul 5, 2024
@aws-cdk-automation aws-cdk-automation added the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label Jul 5, 2024
@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch from 36c3324 to f0e72cd Compare July 8, 2024 11:43
@aws-cdk-automation aws-cdk-automation removed the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label Jul 8, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review July 8, 2024 13:35

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@jaecktec jaecktec marked this pull request as draft July 9, 2024 06:16
@jaecktec jaecktec marked this pull request as ready for review July 9, 2024 06:46
@aws-cdk-automation aws-cdk-automation added the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label Jul 11, 2024
@aws-cdk-automation aws-cdk-automation added pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. and removed pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run labels Jul 19, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍 Left some comments for adjustments

packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated Show resolved Hide resolved
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 29, 2024
@jaecktec jaecktec marked this pull request as draft August 9, 2024 13:26
@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch 3 times, most recently from 2a1f506 to 4030fb1 Compare August 16, 2024 13:05
@jaecktec
Copy link
Contributor Author

jaecktec commented Aug 16, 2024

TBH this integration test stuff is so frustrating.. it works on my machine + account. I have no idea why it always fails in the pipeline.... the logs are not very helpful either

@daschaa
Copy link
Contributor

daschaa commented Aug 20, 2024

@jaecktec Other snapshots have changed (I guess due to your changes). Just make sure to update those and I think you're good to go.

Below I added a snippet of some changes, there are more in the logs.

@aws-cdk-testing/framework-integ:   CHANGED    aws-stepfunctions-tasks/test/ecs/integ.fargate-task 1.141s
@aws-cdk-testing/framework-integ:       Resources
@aws-cdk-testing/framework-integ: [~] AWS::ECS::Cluster FargateCluster7CCD5F93 
@aws-cdk-testing/framework-integ:  └─ [+] Configuration
@aws-cdk-testing/framework-integ:      └─ {}
@aws-cdk-testing/framework-integ:   UNCHANGED  aws-stepfunctions-tasks/test/emr/integ.emr-create-cluster-add-step-runtime-role 1.112s
@aws-cdk-testing/framework-integ:   CHANGED    aws-stepfunctions-tasks/test/ecs/integ.fargate-run-task 1.219s
@aws-cdk-testing/framework-integ:       Resources
@aws-cdk-testing/framework-integ: [~] AWS::ECS::Cluster FargateCluster7CCD5F93 
@aws-cdk-testing/framework-integ:  └─ [+] Configuration
@aws-cdk-testing/framework-integ:      └─ {}
@aws-cdk-testing/framework-integ:   CHANGED    aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task 1.426s
@aws-cdk-testing/framework-integ:       Resources
@aws-cdk-testing/framework-integ: [~] AWS::ECS::Cluster Ec2ClusterEE43E89D 
@aws-cdk-testing/framework-integ:  └─ [+] Configuration
@aws-cdk-testing/framework-integ:      └─ {}
@aws-cdk-testing/framework-integ:   CHANGED    aws-stepfunctions-tasks/test/ecs/integ.ec2-task 1.39s
@aws-cdk-testing/framework-integ:       Resources
@aws-cdk-testing/framework-integ: [~] AWS::ECS::Cluster FargateCluster7CCD5F93 
@aws-cdk-testing/framework-integ:  └─ [+] Configuration
@aws-cdk-testing/framework-integ:      └─ {}

@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch from 2419cdd to 43456d9 Compare August 20, 2024 13:21
@jaecktec jaecktec marked this pull request as ready for review August 20, 2024 13:59
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 21, 2024
@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch 2 times, most recently from fc2ed05 to a3d6207 Compare September 21, 2024 10:48
also return undefined if neither storage nor executeCommand config are set
@jaecktec jaecktec force-pushed the 30721-enable-fargate-ephemeral-storage-encryption branch from 412c29e to f0389ec Compare October 1, 2024 11:41
GavinZZ
GavinZZ previously approved these changes Oct 7, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for contributing!

Copy link
Contributor

mergify bot commented Oct 7, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 7, 2024
Copy link
Contributor

mergify bot commented Oct 7, 2024

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).

@mergify mergify bot dismissed GavinZZ’s stale review October 7, 2024 21:49

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 7, 2024
Copy link
Contributor

mergify bot commented Oct 7, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 7, 2024
Copy link
Contributor

mergify bot commented Oct 7, 2024

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 2d6f003
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 642a944 into aws:main Oct 8, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Oct 8, 2024

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).

Copy link

github-actions bot commented Oct 8, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2024
@jaecktec jaecktec deleted the 30721-enable-fargate-ephemeral-storage-encryption branch October 8, 2024 07:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-ecs: Enable Ephemeral storage encryption in ECS Cluster L2 construct
5 participants