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 support for single scram secret association #37056

Merged

Conversation

dstrates
Copy link
Contributor

@dstrates dstrates commented Apr 23, 2024

Description

The current aws_msk_scram_secret_association resource is not flexible and tightly couples the management of secret associations to MSK clusters. This causes issues when attempting to manage secret associations separately from the cluster creation, as it removes all existing secret associations created out of band.

The proposed change implements @bflad's suggestions in #16832 (review), adding an optional secret_arn argument to the aws_msk_scram_secret_association resource.

Relations

Closes #16791.
Closes #40217.
Relates #16832.

Output from Acceptance Testing

% make testacc TESTS=TestAccXXX PKG=ec2

...

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 service/kafka Issues and PRs that pertain to the kafka service. size/S Managed by automation to categorize the size of a PR. labels Apr 23, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 23, 2024
@dstrates dstrates force-pushed the feat/single-scram-secret-association branch from e3244bf to 9893d09 Compare April 23, 2024 07:09
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 @dstrates 👋

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

@dstrates dstrates force-pushed the feat/single-scram-secret-association branch 3 times, most recently from 19a1fa5 to 9e57560 Compare April 23, 2024 11:07
@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 Apr 23, 2024
@dstrates dstrates force-pushed the feat/single-scram-secret-association branch from 9e57560 to cd554fc Compare April 24, 2024 03:48
@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. and removed size/S Managed by automation to categorize the size of a PR. labels Apr 24, 2024
@dstrates dstrates force-pushed the feat/single-scram-secret-association branch from 072d758 to d5ed84b Compare April 24, 2024 06:10
@dstrates dstrates marked this pull request as ready for review April 24, 2024 06:12
@dstrates dstrates force-pushed the feat/single-scram-secret-association branch from d5ed84b to f1e2cab Compare April 24, 2024 06:30
@SuSaiGit
Copy link

SuSaiGit commented Jun 5, 2024

When will this be merged?

@sbrnunes
Copy link

Hi everyone.

This is causing serious problems in our case, and considering the upvotes in this issue and in #16791, it appears to be affecting a lot of people.

If this PR fixes it, when can we see it reviewed, merged and released?

@ewbankkit ewbankkit requested a review from a team as a code owner December 10, 2024 22:50
% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccKafkaSCRAMSecretAssociation_\|TestAccKafkaSingleSCRAMSecretAssociation_' PKG=kafka ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaSCRAMSecretAssociation_\|TestAccKafkaSingleSCRAMSecretAssociation_ -timeout 720m
2024/12/10 16:15:38 Initializing Terraform AWS Provider...
=== RUN   TestAccKafkaSCRAMSecretAssociation_basic
=== PAUSE TestAccKafkaSCRAMSecretAssociation_basic
=== RUN   TestAccKafkaSCRAMSecretAssociation_update
=== PAUSE TestAccKafkaSCRAMSecretAssociation_update
=== RUN   TestAccKafkaSCRAMSecretAssociation_disappears
=== PAUSE TestAccKafkaSCRAMSecretAssociation_disappears
=== RUN   TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== PAUSE TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== RUN   TestAccKafkaSingleSCRAMSecretAssociation_basic
=== PAUSE TestAccKafkaSingleSCRAMSecretAssociation_basic
=== RUN   TestAccKafkaSingleSCRAMSecretAssociation_disappers
=== PAUSE TestAccKafkaSingleSCRAMSecretAssociation_disappers
=== CONT  TestAccKafkaSCRAMSecretAssociation_basic
=== CONT  TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== CONT  TestAccKafkaSCRAMSecretAssociation_disappears
--- PASS: TestAccKafkaSCRAMSecretAssociation_disappears (735.21s)
=== CONT  TestAccKafkaSCRAMSecretAssociation_update
--- PASS: TestAccKafkaSCRAMSecretAssociation_basic (736.26s)
=== CONT  TestAccKafkaSingleSCRAMSecretAssociation_disappers
--- PASS: TestAccKafkaSCRAMSecretAssociation_Disappears_cluster (741.23s)
--- PASS: TestAccKafkaSingleSCRAMSecretAssociation_basic (1750.17s)
--- PASS: TestAccKafkaSCRAMSecretAssociation_update (1958.65s)
--- PASS: TestAccKafkaSingleSCRAMSecretAssociation_disappers (1957.62s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2699.414s
ewbankkit
ewbankkit previously approved these changes Dec 11, 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 🚀.

% ACCTEST_TIMEOUT=720m make testacc TESTARGS='-run=TestAccKafkaSCRAMSecretAssociation_\|TestAccKafkaSingleSCRAMSecretAssociation_' PKG=kafka ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaSCRAMSecretAssociation_\|TestAccKafkaSingleSCRAMSecretAssociation_ -timeout 720m
2024/12/11 06:00:54 Initializing Terraform AWS Provider...
=== RUN   TestAccKafkaSCRAMSecretAssociation_basic
=== PAUSE TestAccKafkaSCRAMSecretAssociation_basic
=== RUN   TestAccKafkaSCRAMSecretAssociation_update
=== PAUSE TestAccKafkaSCRAMSecretAssociation_update
=== RUN   TestAccKafkaSCRAMSecretAssociation_disappears
=== PAUSE TestAccKafkaSCRAMSecretAssociation_disappears
=== RUN   TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== PAUSE TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== RUN   TestAccKafkaSingleSCRAMSecretAssociation_basic
=== PAUSE TestAccKafkaSingleSCRAMSecretAssociation_basic
=== RUN   TestAccKafkaSingleSCRAMSecretAssociation_multiple
=== PAUSE TestAccKafkaSingleSCRAMSecretAssociation_multiple
=== RUN   TestAccKafkaSingleSCRAMSecretAssociation_disappears
=== PAUSE TestAccKafkaSingleSCRAMSecretAssociation_disappears
=== CONT  TestAccKafkaSCRAMSecretAssociation_basic
=== CONT  TestAccKafkaSingleSCRAMSecretAssociation_basic
=== CONT  TestAccKafkaSingleSCRAMSecretAssociation_disappears
--- PASS: TestAccKafkaSCRAMSecretAssociation_basic (676.66s)
=== CONT  TestAccKafkaSCRAMSecretAssociation_disappears
--- PASS: TestAccKafkaSingleSCRAMSecretAssociation_basic (678.48s)
=== CONT  TestAccKafkaSCRAMSecretAssociation_Disappears_cluster
=== CONT  TestAccKafkaSCRAMSecretAssociation_update
--- PASS: TestAccKafkaSingleSCRAMSecretAssociation_disappears (685.36s)
--- PASS: TestAccKafkaSCRAMSecretAssociation_disappears (291.45s)
=== CONT  TestAccKafkaSingleSCRAMSecretAssociation_multiple
--- PASS: TestAccKafkaSCRAMSecretAssociation_Disappears_cluster (300.89s)
--- PASS: TestAccKafkaSCRAMSecretAssociation_update (325.08s)
--- PASS: TestAccKafkaSingleSCRAMSecretAssociation_multiple (325.05s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	1298.437s

@github-actions github-actions bot added the generators Relates to code generators. label Dec 11, 2024
…source name: aws_msk_single_scram_secret_association'.
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

I think the resource name is reasonable given the misnaming of the original, which should have been an "exclusive" variant had it not predated us publishing a formal definition for those resource types.

@ewbankkit
Copy link
Contributor

@dstrates Thanks for the contribution 🎉 👏.
We decided to implement this single association functionality as a new resource, aws_msk_single_scram_secret_association.

@ewbankkit ewbankkit added the new-resource Introduces a new resource. label Dec 11, 2024
@ewbankkit ewbankkit merged commit 759eabf into hashicorp:main Dec 11, 2024
48 checks passed
@github-actions github-actions bot added this to the v5.81.0 milestone Dec 11, 2024
Copy link

This functionality has been released in v5.81.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. generators Relates to code generators. new-resource Introduces a new resource. service/kafka Issues and PRs that pertain to the kafka 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.

aws_msk_scram_secret_association overrides/removes existing secret associations
6 participants