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

r/aws_efs_replication_configuration: support an existing FS as destination #34955

Merged

Conversation

yaronya
Copy link
Contributor

@yaronya yaronya commented Dec 16, 2023

Description

AWS now supports EFS replication to an existing file system, and won't force you to replicate your source FS into a new one.

This PR takes the existing computed file_system_id attribute of aws_efs_replication_configuration resource and sets it to be also optional and sends it in the CreateReplicationConfiguration API call

Relations

Closes #34863

References

Output from Acceptance Testing

╰─❯ make testacc TESTS=TestAccEFSReplicationConfiguration_existingDestination PKG=efs

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20 -run='TestAccEFSReplicationConfiguration_existingDestination'  -timeout 360m
=== RUN   TestAccEFSReplicationConfiguration_existingDestination
=== PAUSE TestAccEFSReplicationConfiguration_existingDestination
=== CONT  TestAccEFSReplicationConfiguration_existingDestination
--- PASS: TestAccEFSReplicationConfiguration_existingDestination (1432.67s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/efs        1434.962s

...

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/efs Issues and PRs that pertain to the efs service. size/XS Managed by automation to categorize the size of a PR. labels Dec 16, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 16, 2023
@yaronya yaronya marked this pull request as draft December 16, 2023 20:35
@yaronya yaronya force-pushed the f/efs-replication-config-destination-fs-id branch from 719e81e to d84a349 Compare December 16, 2023 20:39
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @yaronya 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@yaronya yaronya changed the title Add file system id attribute to destination block of resource aws_efs_replication_configuration resource Add FS ID attribute to destination block of resource aws_efs_replication_configuration Dec 16, 2023
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Dec 16, 2023
@yaronya yaronya changed the title Add FS ID attribute to destination block of resource aws_efs_replication_configuration r/aws_efs_replication_configuration - support an existing FS as destination Dec 16, 2023
@yaronya yaronya changed the title r/aws_efs_replication_configuration - support an existing FS as destination r/aws_efs_replication_configuration: support an existing FS as destination Dec 16, 2023
@yaronya yaronya force-pushed the f/efs-replication-config-destination-fs-id branch from 2ce8fc2 to 2fea129 Compare December 16, 2023 21:01
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 18, 2023
@yaronya
Copy link
Contributor Author

yaronya commented Dec 23, 2023

Waiting on #35029 to complete tests

yaronya and others added 8 commits January 4, 2024 21:58
…ion_configuration resource

Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
@yaronya yaronya force-pushed the f/efs-replication-config-destination-fs-id branch from c67748b to 8b05dc2 Compare January 4, 2024 20:00
…tion test

Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
@yaronya
Copy link
Contributor Author

yaronya commented Jan 4, 2024

Hey @justinretzolk @ewbankkit
After #35029 was merged, I was able to set up a test that forms a replication between two file systems, but now I encounter an issue where it takes a lot for the replication to finish and become "enabled".
How should I tackle such issue where an acceptance test might take a very long time?

See logs:

─❯ make testacc TESTS=TestAccEFSReplicationConfiguration_existingDestination PKG=efs

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20 -run='TestAccEFSReplicationConfiguration_existingDestination'  -timeout 360m
=== RUN   TestAccEFSReplicationConfiguration_existingDestination
=== PAUSE TestAccEFSReplicationConfiguration_existingDestination
=== CONT  TestAccEFSReplicationConfiguration_existingDestination

    replication_configuration_test.go:142: Step 1/1 error: Error running apply: exit status 1
        
        Error: waiting for EFS Replication Configuration (fs-0e8ac485cdff85d96) create: timeout while waiting for state to become 'ENABLED' (last state: 'ENABLING', timeout: 10m0s)
        
          with aws_efs_replication_configuration.test,
          on terraform_plugin_test.tf line 23, in resource "aws_efs_replication_configuration" "test":
          23: resource "aws_efs_replication_configuration" "test" {
        

Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
@ewbankkit
Copy link
Contributor

@yaronya If there is a better default timeout value then you can change the value in internal/service/efs/replication_configuration.go and just let the acceptance test(s) run.
Otherwise you can add an explicit timeouts block to the acceptance test configuration.

Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
…ternate region

Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Jan 6, 2024
@yaronya yaronya marked this pull request as ready for review January 6, 2024 22:47
Signed-off-by: Yaron Yarimi <yaron.yarimi@env0.com>
@yaronya yaronya force-pushed the f/efs-replication-config-destination-fs-id branch from fae2a6d to 13b9fa2 Compare January 6, 2024 22:52
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccEFSMountTarget_disappears' PKG=efs ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 2  -run=TestAccEFSMountTarget_disappears -timeout 360m
=== RUN   TestAccEFSMountTarget_disappears
=== PAUSE TestAccEFSMountTarget_disappears
=== CONT  TestAccEFSMountTarget_disappears
--- PASS: TestAccEFSMountTarget_disappears (123.10s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/efs	132.496s
% make testacc TESTARGS='-run=TestAccEFSReplicationConfiguration_basic\|TestAccEFSReplicationConfiguration_disappears' PKG=efs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20  -run=TestAccEFSReplicationConfiguration_basic\|TestAccEFSReplicationConfiguration_disappears -timeout 360m
=== RUN   TestAccEFSReplicationConfiguration_basic
=== PAUSE TestAccEFSReplicationConfiguration_basic
=== RUN   TestAccEFSReplicationConfiguration_disappears
=== PAUSE TestAccEFSReplicationConfiguration_disappears
=== CONT  TestAccEFSReplicationConfiguration_basic
=== CONT  TestAccEFSReplicationConfiguration_disappears
--- PASS: TestAccEFSReplicationConfiguration_disappears (462.95s)
--- PASS: TestAccEFSReplicationConfiguration_basic (547.15s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/efs	553.120s
% make testacc TESTARGS='-run=TestAccEFSReplicationConfiguration_allAttributes' PKG=efs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20  -run=TestAccEFSReplicationConfiguration_allAttributes -timeout 360m
=== RUN   TestAccEFSReplicationConfiguration_allAttributes
=== PAUSE TestAccEFSReplicationConfiguration_allAttributes
=== CONT  TestAccEFSReplicationConfiguration_allAttributes
--- PASS: TestAccEFSReplicationConfiguration_allAttributes (544.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/efs	551.105s
% make testacc TESTARGS='-run=TestAccEFSReplicationConfiguration_existingDestination' PKG=efs
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/efs/... -v -count 1 -parallel 20  -run=TestAccEFSReplicationConfiguration_existingDestination -timeout 360m
=== RUN   TestAccEFSReplicationConfiguration_existingDestination
=== PAUSE TestAccEFSReplicationConfiguration_existingDestination
=== CONT  TestAccEFSReplicationConfiguration_existingDestination
--- PASS: TestAccEFSReplicationConfiguration_existingDestination (1437.97s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/efs	1443.721s

@ewbankkit
Copy link
Contributor

@yaronya Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit aa8dd58 into hashicorp:main Jan 11, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.32.0 milestone Jan 11, 2024
Copy link

This functionality has been released in v5.32.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/efs Issues and PRs that pertain to the efs service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Support EFS destination filesystem ID for EFS replication configuration
3 participants