From 6cbcdefc69043ce6c86edfdd1ab72e7cd5bba978 Mon Sep 17 00:00:00 2001 From: Mitsuaki Ito Date: Wed, 6 Jul 2022 19:17:26 +0900 Subject: [PATCH] Updated documentation --- website/docs/d/msk_cluster.html.markdown | 5 +- website/docs/r/msk_cluster.html.markdown | 109 +++++++++++++---------- 2 files changed, 67 insertions(+), 47 deletions(-) diff --git a/website/docs/d/msk_cluster.html.markdown b/website/docs/d/msk_cluster.html.markdown index e02f9c3bc33..f6eee41387a 100644 --- a/website/docs/d/msk_cluster.html.markdown +++ b/website/docs/d/msk_cluster.html.markdown @@ -23,6 +23,9 @@ data "aws_msk_cluster" "example" { The following arguments are supported: * `cluster_name` - (Required) Name of the cluster. +* `cluster_type` - (Required) Type of the MSK cluster. Valid values: PROVISIONED, SERVERLESS. +* `provisioned` - (Optional) Configuration block for the provisioned type of the Kafka cluster. +* `serverless` - (Optional) Configuration block for the serverless type of the Kafka cluster. ## Attribute Reference @@ -36,8 +39,6 @@ In addition to all arguments above, the following attributes are exported: * `bootstrap_brokers_sasl_iam` - One or more DNS names (or IP addresses) and SASL IAM port pairs. For example, `b-1.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9098,b-2.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9098,b-3.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9098`. This attribute will have a value if `encryption_info.0.encryption_in_transit.0.client_broker` is set to `TLS_PLAINTEXT` or `TLS` and `client_authentication.0.sasl.0.iam` is set to `true`. The resource sorts the list alphabetically. AWS may not always return all endpoints so the values may not be stable across applies. * `bootstrap_brokers_sasl_scram` - One or more DNS names (or IP addresses) and SASL SCRAM port pairs. For example, `b-1.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9096,b-2.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9096,b-3.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9096`. This attribute will have a value if `encryption_info.0.encryption_in_transit.0.client_broker` is set to `TLS_PLAINTEXT` or `TLS` and `client_authentication.0.sasl.0.scram` is set to `true`. The resource sorts the list alphabetically. AWS may not always return all endpoints so the values may not be stable across applies. * `bootstrap_brokers_tls` - One or more DNS names (or IP addresses) and TLS port pairs. For example, `b-1.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094,b-2.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094,b-3.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094`. This attribute will have a value if `encryption_info.0.encryption_in_transit.0.client_broker` is set to `TLS_PLAINTEXT` or `TLS`. The resource sorts the list alphabetically. AWS may not always return all endpoints so the values may not be stable across applies. -* `kafka_version` - Apache Kafka version. -* `number_of_broker_nodes` - Number of broker nodes in the cluster. * `tags` - Map of key-value pairs assigned to the cluster. * `zookeeper_connect_string` - A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster. The returned values are sorted alphbetically. The AWS API may not return all endpoints, so this value is not guaranteed to be stable across applies. * `zookeeper_connect_string_tls` - A comma separated list of one or more hostname:port pairs to use to connect to the Apache Zookeeper cluster via TLS. The returned values are sorted alphabetically. The AWS API may not return all endpoints, so this value is not guaranteed to be stable across applies. diff --git a/website/docs/r/msk_cluster.html.markdown b/website/docs/r/msk_cluster.html.markdown index 58465ae7f61..7fd91595fa3 100644 --- a/website/docs/r/msk_cluster.html.markdown +++ b/website/docs/r/msk_cluster.html.markdown @@ -104,56 +104,59 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { resource "aws_msk_cluster" "example" { cluster_name = "example" - kafka_version = "3.2.0" - number_of_broker_nodes = 3 - - broker_node_group_info { - instance_type = "kafka.m5.large" - client_subnets = [ - aws_subnet.subnet_az1.id, - aws_subnet.subnet_az2.id, - aws_subnet.subnet_az3.id, - ] - storage_info { - ebs_storage_info { - volume_size = 1000 + cluster_type = "PROVISIONED" + + provisioned { + kafka_version = "3.2.0" + number_of_broker_nodes = 3 + broker_node_group_info { + instance_type = "kafka.m5.large" + client_subnets = [ + aws_subnet.subnet_az1.id, + aws_subnet.subnet_az2.id, + aws_subnet.subnet_az3.id, + ] + storage_info { + ebs_storage_info { + volume_size = 1000 + } } + security_groups = [aws_security_group.sg.id] } - security_groups = [aws_security_group.sg.id] - } - encryption_info { - encryption_at_rest_kms_key_arn = aws_kms_key.kms.arn - } + encryption_info { + encryption_at_rest_kms_key_arn = aws_kms_key.kms.arn + } - open_monitoring { - prometheus { - jmx_exporter { - enabled_in_broker = true - } - node_exporter { - enabled_in_broker = true + open_monitoring { + prometheus { + jmx_exporter { + enabled_in_broker = true + } + node_exporter { + enabled_in_broker = true + } } } - } - logging_info { - broker_logs { - cloudwatch_logs { - enabled = true - log_group = aws_cloudwatch_log_group.test.name - } - firehose { - enabled = true - delivery_stream = aws_kinesis_firehose_delivery_stream.test_stream.name - } - s3 { - enabled = true - bucket = aws_s3_bucket.bucket.id - prefix = "logs/msk-" + logging_info { + broker_logs { + cloudwatch_logs { + enabled = true + log_group = aws_cloudwatch_log_group.test.name + } + firehose { + enabled = true + delivery_stream = aws_kinesis_firehose_delivery_stream.test_stream.name + } + s3 { + enabled = true + bucket = aws_s3_bucket.bucket.id + prefix = "logs/msk-" + } } } - } + } tags = { foo = "bar" @@ -161,7 +164,7 @@ resource "aws_msk_cluster" "example" { } output "zookeeper_connect_string" { - value = aws_msk_cluster.example.zookeeper_connect_string + value = aws_msk_cluster.example.provisioned.zookeeper_connect_string } output "bootstrap_brokers_tls" { @@ -203,17 +206,33 @@ resource "aws_msk_cluster" "example" { The following arguments are supported: -* `broker_node_group_info` - (Required) Configuration block for the broker nodes of the Kafka cluster. * `cluster_name` - (Required) Name of the MSK cluster. +* `cluster_type` - (Required) Type of the MSK cluster. Valid values: PROVISIONED, SERVERLESS. +* `provisioned` - (Optional) Configuration block for the provisioned type of the Kafka cluster. +* `serverless` - (Optional) Configuration block for the serverless type of the Kafka cluster. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### provisioned Argument Reference + * `kafka_version` - (Required) Specify the desired Kafka software version. * `number_of_broker_nodes` - (Required) The desired total number of broker nodes in the kafka cluster. It must be a multiple of the number of specified client subnets. +* `broker_node_group_info` - (Required) Configuration block for the broker nodes of the Kafka cluster. * `client_authentication` - (Optional) Configuration block for specifying a client authentication. See below. * `configuration_info` - (Optional) Configuration block for specifying a MSK Configuration to attach to Kafka brokers. See below. * `encryption_info` - (Optional) Configuration block for specifying encryption. See below. * `enhanced_monitoring` - (Optional) Specify the desired enhanced MSK CloudWatch monitoring level. See [Monitoring Amazon MSK with Amazon CloudWatch](https://docs.aws.amazon.com/msk/latest/developerguide/monitoring.html) * `open_monitoring` - (Optional) Configuration block for JMX and Node monitoring for the MSK cluster. See below. * `logging_info` - (Optional) Configuration block for streaming broker logs to Cloudwatch/S3/Kinesis Firehose. See below. -* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. + +### serverless Argument Reference + +* `client_authentication` - (Optional) Configuration block for specifying a client authentication. See below. +* `vpc_configs` - (Required) Configuration block for specifying a vpc. See below. + +### vpc_configs Argument Reference + +* `security_group_ids` - (Optional) Identifiers of the security groups for the serverless cluster. +* `subnet_ids` - (Required) A list of VPC subnet IDs. ### broker_node_group_info Argument Reference @@ -255,7 +274,7 @@ The following arguments are supported: #### client_authentication sasl Argument Reference -* `iam` - (Optional) Enables IAM client authentication. Defaults to `false`. +* `iam` - (Optional) Enables IAM client authentication. Defaults to `false` for provisioned types. Defaults to `true` for serverless types. * `scram` - (Optional) Enables SCRAM client authentication via AWS Secrets Manager. Defaults to `false`. #### client_authentication tls Argument Reference