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 support for AWS MSK serverless cluster type #25684

Merged

Conversation

moremagic
Copy link
Contributor

@moremagic moremagic commented Jul 5, 2022

Community Note

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

Closes #22058

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccKafkaCluster_' PKG=kafka ACCTEST_PARALLELISM=3

...


$ make testacc \
> PKG=kafka ACCTEST_PARALLELISM=3 \
> TESTARGS='-run=TestAccKafkaCluster_Basic_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_Basic_ -timeout 180m
=== RUN   TestAccKafkaCluster_Basic_Provisioned
=== PAUSE TestAccKafkaCluster_Basic_Provisioned
=== RUN   TestAccKafkaCluster_Basic_Serverless
=== PAUSE TestAccKafkaCluster_Basic_Serverless
=== CONT  TestAccKafkaCluster_Basic_Provisioned
=== CONT  TestAccKafkaCluster_Basic_Serverless
--- PASS: TestAccKafkaCluster_Basic_Serverless (401.64s)
--- PASS: TestAccKafkaCluster_Basic_Provisioned (1960.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	1960.622s


$ make testacc PKG=kafka ACCTEST_PARALLELISM=3 TESTARGS='-run=TestAccKafkaCluster_BrokerNodeGroupInfo_' ACCTEST_TIMEOUT=4h
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_BrokerNodeGroupInfo_ -timeout 4h
=== RUN   TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize
=== PAUSE TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize
=== RUN   TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo
=== PAUSE TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo
=== RUN   TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo
=== PAUSE TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo
=== RUN   TestAccKafkaCluster_BrokerNodeGroupInfo_instanceType
=== PAUSE TestAccKafkaCluster_BrokerNodeGroupInfo_instanceType
=== RUN   TestAccKafkaCluster_BrokerNodeGroupInfo_publicAccessSASLIAM
=== PAUSE TestAccKafkaCluster_BrokerNodeGroupInfo_publicAccessSASLIAM
=== CONT  TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize
=== CONT  TestAccKafkaCluster_BrokerNodeGroupInfo_instanceType
=== CONT  TestAccKafkaCluster_BrokerNodeGroupInfo_publicAccessSASLIAM
--- PASS: TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize (2378.66s)
=== CONT  TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo
--- PASS: TestAccKafkaCluster_BrokerNodeGroupInfo_publicAccessSASLIAM (6151.64s)
=== CONT  TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo
--- PASS: TestAccKafkaCluster_BrokerNodeGroupInfo_instanceType (6955.93s)
--- PASS: TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo (4878.60s)
--- PASS: TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo (2392.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	8544.478s


$ make testacc PKG=kafka ACCTEST_PARALLELISM=3 TESTARGS='-run=TestAccKafkaCluster_ClientAuthentication' ACCTEST_TIMEOUT=4h
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_ClientAuthentication -timeout 4h
=== RUN   TestAccKafkaCluster_ClientAuthenticationSASL_scram
=== PAUSE TestAccKafkaCluster_ClientAuthenticationSASL_scram
=== RUN   TestAccKafkaCluster_ClientAuthenticationSASL_iam
=== PAUSE TestAccKafkaCluster_ClientAuthenticationSASL_iam
=== RUN   TestAccKafkaCluster_ClientAuthenticationTLS_certificateAuthorityARNs
=== PAUSE TestAccKafkaCluster_ClientAuthenticationTLS_certificateAuthorityARNs
=== RUN   TestAccKafkaCluster_ClientAuthenticationTLS_initiallyNoAuthentication
=== PAUSE TestAccKafkaCluster_ClientAuthenticationTLS_initiallyNoAuthentication
=== CONT  TestAccKafkaCluster_ClientAuthenticationSASL_iam
=== CONT  TestAccKafkaCluster_ClientAuthenticationSASL_scram
=== CONT  TestAccKafkaCluster_ClientAuthenticationTLS_certificateAuthorityARNs
--- PASS: TestAccKafkaCluster_ClientAuthenticationTLS_certificateAuthorityARNs (2213.09s)
=== CONT  TestAccKafkaCluster_ClientAuthenticationTLS_initiallyNoAuthentication
--- PASS: TestAccKafkaCluster_ClientAuthenticationSASL_scram (3857.07s)
--- PASS: TestAccKafkaCluster_ClientAuthenticationSASL_iam (3862.73s)
--- PASS: TestAccKafkaCluster_ClientAuthenticationTLS_initiallyNoAuthentication (3636.77s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	5849.972s


$  make testacc PKG=kafka ACCTEST_PARALLELISM=3 TESTARGS='-run=TestAccKafkaCluster_EncryptionInfo' ACCTEST_TIMEOUT=4h
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_EncryptionInfo -timeout 4h
=== RUN   TestAccKafkaCluster_EncryptionInfo_encryptionAtRestKMSKeyARN
=== PAUSE TestAccKafkaCluster_EncryptionInfo_encryptionAtRestKMSKeyARN
=== RUN   TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_clientBroker
=== PAUSE TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_clientBroker
=== RUN   TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_inCluster
=== PAUSE TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_inCluster
=== CONT  TestAccKafkaCluster_EncryptionInfo_encryptionAtRestKMSKeyARN
=== CONT  TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_inCluster
=== CONT  TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_clientBroker
--- PASS: TestAccKafkaCluster_EncryptionInfo_encryptionAtRestKMSKeyARN (1655.12s)
--- PASS: TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_inCluster (1655.14s)
--- PASS: TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_clientBroker (1659.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	1659.527s


$ make testacc PKG=kafka TESTARGS='-run=TestAccKafkaCluster_Info_revision'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaCluster_Info_revision -timeout 180m
=== RUN   TestAccKafkaCluster_Info_revision
=== PAUSE TestAccKafkaCluster_Info_revision
=== CONT  TestAccKafkaCluster_Info_revision
--- PASS: TestAccKafkaCluster_Info_revision (2339.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2339.550s


$  make testacc PKG=kafka TESTARGS='-run=TestAccKafkaCluster_tags'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaCluster_tags -timeout 180m
=== RUN   TestAccKafkaCluster_tags
=== PAUSE TestAccKafkaCluster_tags
=== CONT  TestAccKafkaCluster_tags
--- PASS: TestAccKafkaCluster_tags (2183.67s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2183.766s

$ make testacc PKG=kafka TESTARGS='-run=TestAccKafkaCluster_enhancedMonitoring'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaCluster_enhancedMonitoring -timeout 180m
=== RUN   TestAccKafkaCluster_enhancedMonitoring
=== PAUSE TestAccKafkaCluster_enhancedMonitoring
=== CONT  TestAccKafkaCluster_enhancedMonitoring
--- PASS: TestAccKafkaCluster_enhancedMonitoring (1880.49s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	1880.584s


$ make testacc PKG=kafka TESTARGS='-run=TestAccKafkaCluster_openMonitoring'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaCluster_openMonitoring -timeout 180m
=== RUN   TestAccKafkaCluster_openMonitoring
=== PAUSE TestAccKafkaCluster_openMonitoring
=== CONT  TestAccKafkaCluster_openMonitoring
--- PASS: TestAccKafkaCluster_openMonitoring (2904.16s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2904.258s

$ make testacc PKG=kafka TESTARGS='-run=TestAccKafkaCluster_numberOfBrokerNodes'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 20  -run=TestAccKafkaCluster_numberOfBrokerNodes -timeout 180m
=== RUN   TestAccKafkaCluster_numberOfBrokerNodes
=== PAUSE TestAccKafkaCluster_numberOfBrokerNodes
=== CONT  TestAccKafkaCluster_numberOfBrokerNodes
--- PASS: TestAccKafkaCluster_numberOfBrokerNodes (2231.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2231.108s


$ make testacc PKG=kafka ACCTEST_PARALLELISM=3 TESTARGS='-run=TestAccKafkaCluster_loggingInfo'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_loggingInfo -timeout 180m
=== RUN   TestAccKafkaCluster_loggingInfo
=== PAUSE TestAccKafkaCluster_loggingInfo
=== CONT  TestAccKafkaCluster_loggingInfo
--- PASS: TestAccKafkaCluster_loggingInfo (2361.50s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2361.599s


make testacc TESTARGS='-run=TestAccKafkaCluster_kafkaVersion' PKG=kafka ACCTEST_PARALLELISM=3 ACCTEST_TIMEOUT=17h
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kafka/... -v -count 1 -parallel 3  -run=TestAccKafkaCluster_kafkaVersion -timeout 17h
=== RUN   TestAccKafkaCluster_kafkaVersionUpgrade
=== PAUSE TestAccKafkaCluster_kafkaVersionUpgrade
=== RUN   TestAccKafkaCluster_kafkaVersionDowngrade
=== PAUSE TestAccKafkaCluster_kafkaVersionDowngrade
=== RUN   TestAccKafkaCluster_kafkaVersionUpgradeWithInfo
=== PAUSE TestAccKafkaCluster_kafkaVersionUpgradeWithInfo
=== CONT  TestAccKafkaCluster_kafkaVersionUpgradeWithInfo
=== CONT  TestAccKafkaCluster_kafkaVersionUpgrade
=== CONT  TestAccKafkaCluster_kafkaVersionDowngrade
--- PASS: TestAccKafkaCluster_kafkaVersionDowngrade (3293.68s)
--- PASS: TestAccKafkaCluster_kafkaVersionUpgradeWithInfo (6184.09s)
--- PASS: TestAccKafkaCluster_kafkaVersionUpgrade (6185.36s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	6185.560s

@github-actions github-actions bot added service/kafka Issues and PRs that pertain to the kafka service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Jul 5, 2022
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 @moremagic 👋

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

@moremagic moremagic force-pushed the f-aws_msk_cluster-serverless_cluster_type branch from 828e5a7 to 8e31ea8 Compare July 6, 2022 00:04
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Jul 6, 2022
@moremagic moremagic force-pushed the f-aws_msk_cluster-serverless_cluster_type branch from 9fdb962 to 0eb58f6 Compare July 7, 2022 09:08
@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 Jul 7, 2022
@moremagic moremagic force-pushed the f-aws_msk_cluster-serverless_cluster_type branch from 45a9bf7 to a6a9f50 Compare July 12, 2022 03:10
@moremagic moremagic changed the title [WIP] Add support for AWS MSK serverless cluster type Add support for AWS MSK serverless cluster type Jul 12, 2022
Acceptance test output:

% make testacc TESTARGS='-run=TestAccKafkaServerlessCluster_' 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=TestAccKafkaServerlessCluster_ -timeout 180m
=== RUN   TestAccKafkaServerlessCluster_basic
=== PAUSE TestAccKafkaServerlessCluster_basic
=== RUN   TestAccKafkaServerlessCluster_disappears
=== PAUSE TestAccKafkaServerlessCluster_disappears
=== RUN   TestAccKafkaServerlessCluster_tags
=== PAUSE TestAccKafkaServerlessCluster_tags
=== RUN   TestAccKafkaServerlessCluster_securityGroup
=== PAUSE TestAccKafkaServerlessCluster_securityGroup
=== CONT  TestAccKafkaServerlessCluster_basic
=== CONT  TestAccKafkaServerlessCluster_tags
--- PASS: TestAccKafkaServerlessCluster_tags (368.41s)
=== CONT  TestAccKafkaServerlessCluster_disappears
--- PASS: TestAccKafkaServerlessCluster_basic (420.83s)
=== CONT  TestAccKafkaServerlessCluster_securityGroup
--- PASS: TestAccKafkaServerlessCluster_disappears (256.70s)
--- PASS: TestAccKafkaServerlessCluster_securityGroup (367.95s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	792.919s
@github-actions github-actions bot added generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. tags Pertains to resource tagging. labels Aug 17, 2022
@github-actions github-actions bot added the sweeper Pertains to changes to or issues with the sweeper. label Aug 17, 2022
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=TestAccKafkaServerlessCluster_' 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=TestAccKafkaServerlessCluster_ -timeout 180m
=== RUN   TestAccKafkaServerlessCluster_basic
=== PAUSE TestAccKafkaServerlessCluster_basic
=== RUN   TestAccKafkaServerlessCluster_disappears
=== PAUSE TestAccKafkaServerlessCluster_disappears
=== RUN   TestAccKafkaServerlessCluster_tags
=== PAUSE TestAccKafkaServerlessCluster_tags
=== RUN   TestAccKafkaServerlessCluster_securityGroup
=== PAUSE TestAccKafkaServerlessCluster_securityGroup
=== CONT  TestAccKafkaServerlessCluster_basic
=== CONT  TestAccKafkaServerlessCluster_tags
--- PASS: TestAccKafkaServerlessCluster_tags (368.41s)
=== CONT  TestAccKafkaServerlessCluster_disappears
--- PASS: TestAccKafkaServerlessCluster_basic (420.83s)
=== CONT  TestAccKafkaServerlessCluster_securityGroup
--- PASS: TestAccKafkaServerlessCluster_disappears (256.70s)
--- PASS: TestAccKafkaServerlessCluster_securityGroup (367.95s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	792.919s
% make testacc TESTARGS='-run=TestAccKafkaCluster_basic\|TestAccKafkaCluster_disappears' 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=TestAccKafkaCluster_basic\|TestAccKafkaCluster_disappears -timeout 180m
=== RUN   TestAccKafkaCluster_basic
=== PAUSE TestAccKafkaCluster_basic
=== RUN   TestAccKafkaCluster_disappears
=== PAUSE TestAccKafkaCluster_disappears
=== CONT  TestAccKafkaCluster_basic
=== CONT  TestAccKafkaCluster_disappears
--- PASS: TestAccKafkaCluster_basic (2120.84s)
--- PASS: TestAccKafkaCluster_disappears (2129.36s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kafka	2133.839s

@ewbankkit
Copy link
Contributor

@moremagic Thanks for the contribution 🎉 👏.
As serverless cluster configuration is very different from classic, provisioned cluster configuration, and to match the CloudFormation AWS::MSK::ServerlessCluster resource type, the maintainers decided to implement this as a new resource type, aws_msk_serverless_cluster.

@ewbankkit ewbankkit added the new-resource Introduces a new resource. label Aug 17, 2022
@ewbankkit ewbankkit merged commit 526591f into hashicorp:main Aug 17, 2022
@github-actions github-actions bot added this to the v4.27.0 milestone Aug 17, 2022
@github-actions
Copy link

This functionality has been released in v4.27.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 19, 2022
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. generators Relates to code generators. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/kafka Issues and PRs that pertain to the kafka service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. tags Pertains to resource tagging. 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.

Add support for AWS MSK serverless cluster type
4 participants