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

Adding new resource aws_msk_cluster_policy #32848

Merged
merged 11 commits into from
Aug 11, 2023

Conversation

nrajb
Copy link
Contributor

@nrajb nrajb commented Aug 3, 2023

Description

Adds support for MSK Resource Policy

Relations

Closes #31062.

References

go reference: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/kafka
api reference: https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-policy.html

Output from Acceptance Testing

make testacc TESTARGS='-run=TestAccKafkaClusterPolicy_basic' PKG=kafka  ACCTEST_PARALLELISM=2                                       

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 2  -run=TestAccKafkaClusterPolicy_basic -timeout 180m
=== RUN   TestAccKafkaClusterPolicy_basic
=== PAUSE TestAccKafkaClusterPolicy_basic
=== CONT  TestAccKafkaClusterPolicy_basic
--- PASS: TestAccKafkaClusterPolicy_basic (41.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kafka      44.285s

...

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

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/XL 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/kafka Issues and PRs that pertain to the kafka service. client-connections Pertains to the AWS Client and service connections. generators Relates to code generators. needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 4, 2023
@ewbankkit ewbankkit self-assigned this Aug 7, 2023
@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 Aug 7, 2023
@nrajb
Copy link
Contributor Author

nrajb commented Aug 10, 2023

@ewbankkit Happy to resubmit the PR with clean branch now that #32775 is merged, please let me know.. 🙏

@ewbankkit
Copy link
Contributor

@nrajb Don't worry -- I'll do the merge tomorrow and push the branch.

@ewbankkit ewbankkit marked this pull request as ready for review August 11, 2023 12:51
@github-actions github-actions bot removed the client-connections Pertains to the AWS Client and service connections. label Aug 11, 2023
@vishwa-trulioo
Copy link

Looking forward to the aws_msk_cluster_policy resource soon. You rock!

@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 11, 2023

% make testacc TESTARGS='-run=TestAccKafkaClusterPolicy_' PKG=kafka
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaClusterPolicy_ -timeout 180m
=== RUN   TestAccKafkaClusterPolicy_basic
=== PAUSE TestAccKafkaClusterPolicy_basic
=== RUN   TestAccKafkaClusterPolicy_disappears
=== PAUSE TestAccKafkaClusterPolicy_disappears
=== CONT  TestAccKafkaClusterPolicy_basic
=== CONT  TestAccKafkaClusterPolicy_disappears
=== NAME  TestAccKafkaClusterPolicy_basic
    cluster_policy_test.go:29: Step 1/2 error: Error running apply: exit status 1
        
        Error: setting MSK Cluster Policy (arn:aws:kafka:us-west-2:123456789012:cluster/tf-acc-test-5857099149822587167/ceefe3b8-6bfe-4ee2-8b15-d6dabb49c660-12): operation error Kafka: PutClusterPolicy, https response error StatusCode: 400, RequestID: da71570f-4bd1-436b-ac53-19def7536c45, BadRequestException: The cluster must have multi-VPC private connectivity enabled for its cluster policy.
        
          with aws_msk_cluster_policy.test,
          on terraform_plugin_test.tf line 62, in resource "aws_msk_cluster_policy" "test":
          62: resource "aws_msk_cluster_policy" "test" {
        
=== NAME  TestAccKafkaClusterPolicy_disappears
    cluster_policy_test.go:62: Step 1/1 error: Error running apply: exit status 1
        
        Error: setting MSK Cluster Policy (arn:aws:kafka:us-west-2:123456789012:cluster/tf-acc-test-2225640158714645767/eeaf73af-5bc9-4772-a3ba-654701643429-12): operation error Kafka: PutClusterPolicy, https response error StatusCode: 400, RequestID: 3397791b-439b-46a4-8fcf-d4735abd15f4, BadRequestException: The cluster must have multi-VPC private connectivity enabled for its cluster policy.
        
          with aws_msk_cluster_policy.test,
          on terraform_plugin_test.tf line 62, in resource "aws_msk_cluster_policy" "test":
          62: resource "aws_msk_cluster_policy" "test" {
        
--- FAIL: TestAccKafkaClusterPolicy_basic (2417.74s)
--- FAIL: TestAccKafkaClusterPolicy_disappears (2428.68s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2434.239s
FAIL
make: *** [testacc] Error 1

…have multi-VPC private connectivity enabled for its cluster policy' for acceptance tests.
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=360m make testacc TESTARGS='-run=TestAccKafkaClusterPolicy_' PKG=kafka ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 1  -run=TestAccKafkaClusterPolicy_ -timeout 360m
=== RUN   TestAccKafkaClusterPolicy_basic
=== PAUSE TestAccKafkaClusterPolicy_basic
=== RUN   TestAccKafkaClusterPolicy_disappears
=== PAUSE TestAccKafkaClusterPolicy_disappears
=== CONT  TestAccKafkaClusterPolicy_basic
--- PASS: TestAccKafkaClusterPolicy_basic (6802.15s)
=== CONT  TestAccKafkaClusterPolicy_disappears
--- PASS: TestAccKafkaClusterPolicy_disappears (6762.53s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	13844.376s

@ewbankkit
Copy link
Contributor

@nrajb Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 1bedef1 into hashicorp:main Aug 11, 2023
41 checks passed
@github-actions github-actions bot added this to the v5.13.0 milestone Aug 11, 2023
@github-actions
Copy link

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

@github-actions
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 Sep 18, 2023
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. generators Relates to code generators. new-resource Introduces a new resource. partner Contribution from a partner. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/kafka Issues and PRs that pertain to the kafka service. size/XL 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.

Amazon MSK multi-VPC private connectivity and cross-account access
4 participants