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

Add missing transfer server security policy TransferSecurityPolicy-Restricted-2024-06 #39871

Merged
merged 6 commits into from
Oct 25, 2024

Conversation

itd-seb
Copy link
Contributor

@itd-seb itd-seb commented Oct 24, 2024

Description

This PR is to add support for the following security policies which are missing for the aws_transfer_server resource:

  • TransferSecurityPolicy-Restricted-2024-06

References

This security group is not yet mentioned on the AWS website, but you can check with aws transfer list-security-policies

{
    "SecurityPolicyNames": [
        "TransferSFTPConnectorSecurityPolicy-2023-07",
        "TransferSFTPConnectorSecurityPolicy-2024-03",
        "TransferSFTPConnectorSecurityPolicy-FIPS-2024-10",
        "TransferSecurityPolicy-2018-11",
        "TransferSecurityPolicy-2020-06",
        "TransferSecurityPolicy-2022-03",
        "TransferSecurityPolicy-2023-05",
        "TransferSecurityPolicy-2024-01",
        "TransferSecurityPolicy-PQ-SSH-Experimental-2023-04",
        "TransferSecurityPolicy-Restricted-2018-11",
        "TransferSecurityPolicy-Restricted-2020-06",
        "TransferSecurityPolicy-Restricted-2024-06"
    ]
}

The policy adds support for the following ssh macs to TransferSecurityPolicy-2024-01:

  • hmac-sha2-256
  • hmac-sha2-512

@itd-seb itd-seb requested a review from a team as a code owner October 24, 2024 13:50
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/transfer Issues and PRs that pertain to the transfer service. needs-triage Waiting for first response or review from a maintainer. labels Oct 24, 2024
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 @itd-seb 👋

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! 😃

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Oct 24, 2024
@ewbankkit ewbankkit self-assigned this Oct 24, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 24, 2024
@ewbankkit
Copy link
Contributor

% make testacc TESTARGS='-run=TestAccTransfer_serial/^Server$$/^SecurityPolicy$$' PKG=transfer
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/transfer/... -v -count 1 -parallel 20  -run=TestAccTransfer_serial/^Server$/^SecurityPolicy$ -timeout 360m
2024/10/24 10:33:26 Initializing Terraform AWS Provider...
=== RUN   TestAccTransfer_serial
=== PAUSE TestAccTransfer_serial
=== CONT  TestAccTransfer_serial
=== RUN   TestAccTransfer_serial/Server
=== RUN   TestAccTransfer_serial/Server/SecurityPolicy
    server_test.go:221: Step 10/10 error: Error running apply: exit status 1
        
        Error: updating Transfer Server (s-e400378fd7b144e49): operation error Transfer: UpdateServer, https response error StatusCode: 400, RequestID: 41d575ff-fa72-40c0-9b53-072c09a6368a, InvalidRequestException: Unknown SecurityPolicy
        
          with aws_transfer_server.test,
          on terraform_plugin_test.tf line 12, in resource "aws_transfer_server" "test":
          12: resource "aws_transfer_server" "test" {
        
--- FAIL: TestAccTransfer_serial (242.46s)
    --- FAIL: TestAccTransfer_serial/Server (242.46s)
        --- FAIL: TestAccTransfer_serial/Server/SecurityPolicy (242.46s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/transfer	247.510s
FAIL
make: *** [testacc] Error 1
% aws transfer list-security-policies
{
    "SecurityPolicyNames": [
        "TransferSFTPConnectorSecurityPolicy-2023-07",
        "TransferSFTPConnectorSecurityPolicy-2024-03",
        "TransferSFTPConnectorSecurityPolicy-FIPS-2024-10",
        "TransferSecurityPolicy-2018-11",
        "TransferSecurityPolicy-2020-06",
        "TransferSecurityPolicy-2022-03",
        "TransferSecurityPolicy-2023-05",
        "TransferSecurityPolicy-2024-01",
        "TransferSecurityPolicy-FIPS-2020-06",
        "TransferSecurityPolicy-FIPS-2023-05",
        "TransferSecurityPolicy-FIPS-2024-01",
        "TransferSecurityPolicy-FIPS-2024-05",
        "TransferSecurityPolicy-PQ-SSH-Experimental-2023-04",
        "TransferSecurityPolicy-PQ-SSH-FIPS-Experimental-2023-04",
        "TransferSecurityPolicy-Restricted-2018-11",
        "TransferSecurityPolicy-Restricted-2020-06"
    ]
}

@itd-seb
Copy link
Contributor Author

itd-seb commented Oct 24, 2024

Thats strange, is it possible that the policy is only available in eu-central-1?

@itd-seb
Copy link
Contributor Author

itd-seb commented Oct 24, 2024

Looks like it is only available to certain AWS accounts. I will talk to AWS then...

@ewbankkit ewbankkit removed their assignment Oct 24, 2024
@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 25, 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$$/^SecurityPolicy$$' PKG=transfer
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/transfer/... -v -count 1 -parallel 20  -run=TestAccTransfer_serial/^Server$/^SecurityPolicy$ -timeout 360m
2024/10/25 08:35:23 Initializing Terraform AWS Provider...
=== RUN   TestAccTransfer_serial
=== PAUSE TestAccTransfer_serial
=== CONT  TestAccTransfer_serial
=== RUN   TestAccTransfer_serial/Server
=== RUN   TestAccTransfer_serial/Server/SecurityPolicy
--- PASS: TestAccTransfer_serial (239.32s)
    --- PASS: TestAccTransfer_serial/Server (239.32s)
        --- PASS: TestAccTransfer_serial/Server/SecurityPolicy (239.32s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/transfer	244.657s

@itd-seb
Copy link
Contributor Author

itd-seb commented Oct 25, 2024

Thanks for the changes, much appreciated! And sorry for the typo 😄

@ewbankkit
Copy link
Contributor

@itd-seb Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 97f91bb into hashicorp:main Oct 25, 2024
48 checks passed
@github-actions github-actions bot added this to the v5.74.0 milestone Oct 25, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 31, 2024
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/transfer Issues and PRs that pertain to the transfer service. 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.

2 participants