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: Add s3_storage_options configuration block for aws_transfer_server #36664

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Mar 31, 2024

Description

This PR adds the s3_storage_options configuration block to the aws_transfer_server resource.

IMPLEMENTATION CAVEAT

The s3_storage_options configuration block and its arguments are set as Optional and Computed, which means if the block is not provided Terraform will store the value read from the API into the state. Originally I avoided using Computed thinking that omitting the block from the update operation will remove the settings, however the UpdateServer API does NOT remove the settings or set DirectoryListingOptmization to DISABLED.

Consequently, if user set s3_storage_options and directory_listing_optimization to ENABLED, the only way to disable it is to explicitly set dierctory_listing_optimization to DISABLED. I am not sure if there are better ways to address this, in which case I am option to suggestions.

Relations

Closes #35851

References

Referred to CreateServer for specs and descriptions.

Output from Acceptance Testing

$ make testacc TESTS=TestAccTransfer_serial/Server PKG=transfer
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 20 -run='TestAccTransfer_serial/Server'  -timeout 360m
=== RUN   TestAccTransfer_serial
=== PAUSE TestAccTransfer_serial
=== CONT  TestAccTransfer_serial
=== RUN   TestAccTransfer_serial/Server
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypePublicToVPCAddressAllocationIDs
=== RUN   TestAccTransfer_serial/Server/VPCAddressAllocationIDs
=== RUN   TestAccTransfer_serial/Server/Protocols
=== RUN   TestAccTransfer_serial/Server/DirectoryService
=== RUN   TestAccTransfer_serial/Server/Domain
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypePublicToVPC
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPCAddressAllocationIDs
=== RUN   TestAccTransfer_serial/Server/APIGateway
=== RUN   TestAccTransfer_serial/Server/tags
=== RUN   TestAccTransfer_serial/Server/AuthenticationLoginBanners
=== RUN   TestAccTransfer_serial/Server/DataSourceAPIGateway
=== RUN   TestAccTransfer_serial/Server/ForceDestroy
=== RUN   TestAccTransfer_serial/Server/S3StorageOptions
=== RUN   TestAccTransfer_serial/Server/SecurityPolicy
=== RUN   TestAccTransfer_serial/Server/SecurityPolicyFIPS
=== RUN   TestAccTransfer_serial/Server/disappears
=== RUN   TestAccTransfer_serial/Server/VPCSecurityGroupIDs
=== RUN   TestAccTransfer_serial/Server/VPCAddressAllocationIDsSecurityGroupIDs
=== RUN   TestAccTransfer_serial/Server/StructuredLogDestinations
=== RUN   TestAccTransfer_serial/Server/APIGatewayForceDestroy
=== RUN   TestAccTransfer_serial/Server/HostKey
=== RUN   TestAccTransfer_serial/Server/LambdaFunction
=== RUN   TestAccTransfer_serial/Server/DataSourceServiceManaged
=== RUN   TestAccTransfer_serial/Server/ProtocolDetails
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPCSecurityGroupIDs
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypeVPCToPublic
=== RUN   TestAccTransfer_serial/Server/Workflow
=== RUN   TestAccTransfer_serial/Server/basic
=== RUN   TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPC
=== RUN   TestAccTransfer_serial/Server/VPC
=== RUN   TestAccTransfer_serial/Server/VPCEndpointID
=== RUN   TestAccTransfer_serial/Server/DataSourceBasic
--- PASS: TestAccTransfer_serial (11002.28s)
    --- PASS: TestAccTransfer_serial/Server (11002.28s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypePublicToVPCAddressAllocationIDs (566.08s)
        --- PASS: TestAccTransfer_serial/Server/VPCAddressAllocationIDs (523.37s)
        --- PASS: TestAccTransfer_serial/Server/Protocols (882.59s)
        --- PASS: TestAccTransfer_serial/Server/DirectoryService (1066.42s)
        --- PASS: TestAccTransfer_serial/Server/Domain (178.87s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypePublicToVPC (378.08s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPCAddressAllocationIDs (402.10s)
        --- PASS: TestAccTransfer_serial/Server/APIGateway (385.58s)
        --- PASS: TestAccTransfer_serial/Server/tags (244.37s)
        --- PASS: TestAccTransfer_serial/Server/AuthenticationLoginBanners (176.52s)
        --- PASS: TestAccTransfer_serial/Server/DataSourceAPIGateway (376.22s)
        --- PASS: TestAccTransfer_serial/Server/ForceDestroy (270.46s)
        --- PASS: TestAccTransfer_serial/Server/S3StorageOptions (200.34s)
        --- PASS: TestAccTransfer_serial/Server/SecurityPolicy (299.42s)
        --- PASS: TestAccTransfer_serial/Server/SecurityPolicyFIPS (225.90s)
        --- PASS: TestAccTransfer_serial/Server/disappears (205.29s)
        --- PASS: TestAccTransfer_serial/Server/VPCSecurityGroupIDs (257.52s)
        --- PASS: TestAccTransfer_serial/Server/VPCAddressAllocationIDsSecurityGroupIDs (490.08s)
        --- PASS: TestAccTransfer_serial/Server/StructuredLogDestinations (328.49s)
        --- PASS: TestAccTransfer_serial/Server/APIGatewayForceDestroy (387.47s)
        --- PASS: TestAccTransfer_serial/Server/HostKey (176.68s)
        --- PASS: TestAccTransfer_serial/Server/LambdaFunction (348.20s)
        --- PASS: TestAccTransfer_serial/Server/DataSourceServiceManaged (216.98s)
        --- PASS: TestAccTransfer_serial/Server/ProtocolDetails (226.69s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPCSecurityGroupIDs (272.95s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypeVPCToPublic (292.13s)
        --- PASS: TestAccTransfer_serial/Server/Workflow (308.15s)
        --- PASS: TestAccTransfer_serial/Server/basic (241.12s)
        --- PASS: TestAccTransfer_serial/Server/UpdateEndpointTypeVPCEndpointToVPC (306.01s)
        --- PASS: TestAccTransfer_serial/Server/VPC (335.93s)
        --- PASS: TestAccTransfer_serial/Server/VPCEndpointID (214.36s)
        --- PASS: TestAccTransfer_serial/Server/DataSourceBasic (217.93s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/transfer   11002.375s

$

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 size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/transfer Issues and PRs that pertain to the transfer service. labels Mar 31, 2024
@terraform-aws-provider terraform-aws-provider bot added needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Mar 31, 2024
@acwwat acwwat force-pushed the f-aws_transfer_server-add_s3_storage_options_block branch from b88d525 to e8c0d62 Compare March 31, 2024 05:21
@acwwat acwwat changed the title [WIP] feat: Add s3_storage_options configuration block for aws_transfer_server feat: Add s3_storage_options configuration block for aws_transfer_server Mar 31, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Apr 1, 2024
@ewbankkit ewbankkit self-assigned this Apr 1, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 1, 2024
@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 1, 2024
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=TestAccTransfer_serial/Server/basic\|TestAccTransfer_serial/Server/S3StorageOptions' PKG=transfer
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/transfer/... -v -count 1 -parallel 20  -run=TestAccTransfer_serial/Server/basic\|TestAccTransfer_serial/Server/S3StorageOptions -timeout 360m
=== RUN   TestAccTransfer_serial
=== PAUSE TestAccTransfer_serial
=== CONT  TestAccTransfer_serial
=== RUN   TestAccTransfer_serial/Server
=== RUN   TestAccTransfer_serial/Server/basic
=== RUN   TestAccTransfer_serial/Server/S3StorageOptions
--- PASS: TestAccTransfer_serial (402.04s)
    --- PASS: TestAccTransfer_serial/Server (402.04s)
        --- PASS: TestAccTransfer_serial/Server/basic (208.22s)
        --- PASS: TestAccTransfer_serial/Server/S3StorageOptions (193.82s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/transfer	413.321s

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 0bc3a39 into hashicorp:main Apr 1, 2024
81 checks passed
@github-actions github-actions bot added this to the v5.44.0 milestone Apr 1, 2024
@acwwat acwwat deleted the f-aws_transfer_server-add_s3_storage_options_block branch April 1, 2024 19:33
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

This functionality has been released in v5.44.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

github-actions bot commented May 7, 2024

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 May 7, 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. external-maintainer Contribution from a trusted external contributor. service/transfer Issues and PRs that pertain to the transfer service. size/L 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]: add support for S3StorageOptions in aws_transfer_server resource
2 participants