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

fix(efs): FileSystem deployment fails if vpcSubnets is changed #26155

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

ahmetsoykan
Copy link
Contributor

@ahmetsoykan ahmetsoykan commented Jun 28, 2023

Changing Logical IDs for EfsMountTarget

While using the forEach, index will be added as a suffix to logical id of EfsMountTarget
this is causing an error when the subnets array in the props has changed.

Closes #25099


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

@gitpod-io
Copy link

gitpod-io bot commented Jun 28, 2023

@github-actions github-actions bot added repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Jun 28, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team June 28, 2023 20:27
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.

@ahmetsoykan ahmetsoykan changed the title fix(aws-efs): change logical id for EfsMountTarget fix(efs): change logical id for EfsMountTarget Jun 28, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 30, 2023 12:00

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 30, 2023
@ahmetsoykan ahmetsoykan force-pushed the 25099 branch 4 times, most recently from d65c0ca to 4e66d80 Compare July 7, 2023 06:32
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

2 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@@ -559,4 +559,62 @@ test('imported file system can not add statements to file system policy', () =>
expect(importedFileSystemResult).toStrictEqual({
statementAdded: false,
});
});

test('mountTargetOrderInsensitiveLogicalId flag is true', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update the test to use custom subnets to check that the subnet ID is used as a suffix?

For example:

new FileSystem(customVpc, 'EfsFileSystem', {
  vpc: customVpc,
  vpcSubnets: { subnets: [ec2.Subnet.fromSubnetId(stack, 'SubnetExample', 'subnet-1')] },
});

Copy link
Contributor Author

@ahmetsoykan ahmetsoykan Jul 30, 2023

Choose a reason for hiding this comment

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

@lpizzinidev hello, when checking subnetID from created VPC, SubnetID attr tokenised and hard to correlate with template output in this test.

I think with this PR, we're actually not passing SubnetID attribute to MountTarget's logical IDs, we're passing ${subnet.node.id} which i believe sort of concatenation like ${subnetgroupname}Subnet${index}. So i'm a bit unsure passing subnet selection to FileSystem Contruct. Did you want me to do this because of some future changes that might have happened in VPC definitions in this repository cause test failure?

Isn't it a good method that checking generated logical ids of mount target from resulting different cfn templates regarding to this feature flag?

thank you for your review.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification.
I probably interpreted the test case in the wrong way.

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 for opening a new PR! 👍
Looks good overall, just a small change on the test.

@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 30, 2023
@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-maintainer-review This PR needs a review from a Core Team Member labels Aug 16, 2023
fix(aws-efs): change logical id for EfsMountTarget

fix(efs): recreate integ.ecs-job-definition

fix(efs): recreate integ.ecs-job-definition

fix(efs): recreate integ.ecs-job-definition

fix(aws-efs): change logical id for EfsMountTarget

Revert "chore(release): 2.87.0"

This reverts commit 2879e47.
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 19, 2023
@rix0rrr rix0rrr changed the title fix(efs): change logical id for EfsMountTarget fix(efs): FileSystem deployment fails if vpcSubnets is changed Aug 22, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

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 Aug 22, 2023
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0b4541d
  • 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 d54b67d into aws:main Aug 22, 2023
12 checks passed
@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-efs): EFS mount target will fail on subnet change
4 participants