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

aws_msk_cluster: support Cluster expansion and Open Monitoring #11451

Merged
merged 4 commits into from
Feb 21, 2020

Conversation

marcoreni
Copy link
Contributor

@marcoreni marcoreni commented Jan 2, 2020

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: #11215
Closes: #10553
Relates: #10673 (fix acceptance tests)

Release note for CHANGELOG:

resource/aws_msk_cluster: support cluster expansion without cluster recreation [GH-10553]
resource/aws_msk_cluster: support changes to `enhanced_monitoring` without cluster recreation
resource/aws_msk_cluster: support `open_monitoring` configuration [GH-11215]

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSMskCluster_'
...
--- PASS: TestAccAWSMskCluster_basic (911.50s)
--- PASS: TestAccAWSMskCluster_BrokerNodeGroupInfo_EbsVolumeSize (1229.32s)
--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_ClientBroker (875.43s)
--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_InCluster (942.38s)
--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionAtRestKmsKeyArn (1005.02s)
--- PASS: TestAccAWSMskCluster_EnhancedMonitoring (1151.67s)
--- PASS: TestAccAWSMskCluster_OpenMonitoring (1300.95s)
--- PASS: TestAccAWSMskCluster_NumberOfBrokerNodes (1575.17s)
--- PASS: TestAccAWSMskCluster_Tags (876.30s)
...

Since enhanced monitoring is update via the same API call of open monitoring, this came free.

In order to make the acceptance tests pass I explicitly declared encryption_info configuration for all test templates. I don't know if it may be useful to write some notes inside the tests to specify this behavior.

I also fixed some tests & docs that were probably outdated (zookeeper_connect_string is now a list of hostnames and ports).

@marcoreni marcoreni requested a review from a team January 2, 2020 08:14
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/kafka Issues and PRs that pertain to the kafka service. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 2, 2020
@r3kzi
Copy link

r3kzi commented Jan 23, 2020

any news about this?

@@ -205,7 +204,54 @@ func resourceAwsMskCluster() *schema.Resource {
"number_of_broker_nodes": {
Type: schema.TypeInt,
Required: true,
ForceNew: true,
Copy link

Choose a reason for hiding this comment

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

I believe that MSK allows you to increase, but not decrease this value. Probably due to how Kafka requires partition reassignment when the cluster make up changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. The same applies to the broker storage size (you can expand it but you cannot decrease it). However, no special validation rules have been applied in that case, so I assume that the same can be done here.

Copy link
Contributor

Choose a reason for hiding this comment

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

If a CustomizeDiff function is added then we can ForceNew if the number of broker nodes is decreased.
A similar example:
https://github.com/terraform-providers/terraform-provider-aws/blob/4acecb05959a9e9b07bea9afb87d760ea887da07/aws/resource_aws_elasticsearch_domain.go#L31-L54

aws/resource_aws_msk_cluster.go Outdated Show resolved Hide resolved
@anoop2811
Copy link

Hi, is there any update on this PR getting merged?

@ghost
Copy link

ghost commented Feb 6, 2020

Hello, we are also waiting on this PR to be merged.

@dennisotugo
Copy link

Hello, waiting for this. :)

@bflad bflad 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 Feb 21, 2020
@bflad bflad self-assigned this Feb 21, 2020
@bflad bflad added this to the v2.51.0 milestone Feb 21, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

This looks fantastic, thanks for this @marcoreni 🚀

Output from acceptance testing:

--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_ClientBroker (888.98s)
--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_InCluster (986.84s)
--- PASS: TestAccAWSMskCluster_EncryptionInfo_EncryptionAtRestKmsKeyArn (990.02s)
--- PASS: TestAccAWSMskCluster_Tags (996.50s)
--- PASS: TestAccAWSMskCluster_basic (1047.46s)
--- PASS: TestAccAWSMskCluster_EnhancedMonitoring (1065.19s)
--- PASS: TestAccAWSMskCluster_OpenMonitoring (1134.00s)
--- PASS: TestAccAWSMskCluster_NumberOfBrokerNodes (1273.72s)
--- PASS: TestAccAWSMskCluster_BrokerNodeGroupInfo_EbsVolumeSize (1308.71s)

@bflad bflad merged commit 3ed0f60 into hashicorp:master Feb 21, 2020
bflad added a commit that referenced this pull request Feb 21, 2020
@ghost
Copy link

ghost commented Feb 28, 2020

This has been released in version 2.51.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 23, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 23, 2020
@marcoreni marcoreni deleted the feature/gh-11215 branch March 23, 2020 15:49
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. 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.

Open Monitoring (Prometheus) isn't available for aws_msk_cluster Amazon MSK cluster expansion
10 participants