|
| 1 | +output "arn" { |
| 2 | + description = "The ARN of the MSK cluster." |
| 3 | + value = aws_msk_cluster.this.arn |
| 4 | +} |
| 5 | + |
| 6 | +output "name" { |
| 7 | + description = "The MSK cluster name." |
| 8 | + value = var.name |
| 9 | +} |
| 10 | + |
| 11 | +output "version" { |
| 12 | + description = "Current version of the MSK Cluster used for updates." |
| 13 | + value = aws_msk_cluster.this.current_version |
| 14 | +} |
| 15 | + |
| 16 | +output "kafka_version" { |
| 17 | + description = "The MSK cluster version." |
| 18 | + value = var.kafka_version |
| 19 | +} |
| 20 | + |
| 21 | +output "kafka_config" { |
| 22 | + description = "The MSK configuration." |
| 23 | + value = { |
| 24 | + arn = aws_msk_configuration.this.arn |
| 25 | + name = aws_msk_configuration.this.name |
| 26 | + latest_revision = aws_msk_configuration.this.latest_revision |
| 27 | + properties = aws_msk_configuration.this.server_properties |
| 28 | + } |
| 29 | +} |
| 30 | + |
| 31 | +output "broker_security_group_id" { |
| 32 | + description = "The id of security group that were created for the MSK cluster." |
| 33 | + value = try(module.security_group[*].id[0], null) |
| 34 | +} |
| 35 | + |
| 36 | +output "broker_nodes" { |
| 37 | + description = "The information of broker nodes in the kafka cluster." |
| 38 | + value = data.aws_msk_broker_nodes.this.node_info_list |
| 39 | +} |
| 40 | + |
| 41 | +output "broker" { |
| 42 | + description = <<EOF |
| 43 | + A configuration for brokers of the Kafka cluster. |
| 44 | + `size` - The number of broker nodes in the kafka cluster. |
| 45 | + `instance_type` - The instance type used by the kafka brokers. |
| 46 | +
|
| 47 | + `public_access_enabled` - Whether public access to MSK brokers is enabled. |
| 48 | + `security_groups` - A list of the security groups associated with the MSK cluster. |
| 49 | +
|
| 50 | + `volume` - A EBS volume information for MSK brokers. |
| 51 | + EOF |
| 52 | + value = { |
| 53 | + size = aws_msk_cluster.this.number_of_broker_nodes |
| 54 | + instance_type = aws_msk_cluster.this.broker_node_group_info[0].instance_type |
| 55 | + |
| 56 | + subnets = aws_msk_cluster.this.broker_node_group_info[0].client_subnets |
| 57 | + public_access_enabled = var.broker_public_access_enabled |
| 58 | + security_groups = aws_msk_cluster.this.broker_node_group_info[0].security_groups |
| 59 | + default_security_group_id = try(module.security_group[*].id[0], null) |
| 60 | + |
| 61 | + volume = { |
| 62 | + size = aws_msk_cluster.this.broker_node_group_info[0].storage_info[0].ebs_storage_info[0].volume_size |
| 63 | + provisioned_throughput = { |
| 64 | + enabled = try(aws_msk_cluster.this.broker_node_group_info[0].storage_info[0].ebs_storage_info[0].provisioned_throughput[0].enabled, false) |
| 65 | + throughput = try(aws_msk_cluster.this.broker_node_group_info[0].storage_info[0].ebs_storage_info[0].provisioned_throughput[0].volume_throughput, null) |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | +} |
| 70 | + |
| 71 | +output "auth" { |
| 72 | + description = "A configuration for authentication of the Kafka cluster." |
| 73 | + value = { |
| 74 | + unauthenticated_access = { |
| 75 | + enabled = aws_msk_cluster.this.client_authentication[0].unauthenticated |
| 76 | + } |
| 77 | + sasl = { |
| 78 | + iam = { |
| 79 | + enabled = aws_msk_cluster.this.client_authentication[0].sasl[0].iam |
| 80 | + } |
| 81 | + scram = { |
| 82 | + enabled = aws_msk_cluster.this.client_authentication[0].sasl[0].scram |
| 83 | + kms_key = var.auth_sasl_scram_kms_key |
| 84 | + users = var.auth_sasl_scram_users |
| 85 | + } |
| 86 | + } |
| 87 | + tls = { |
| 88 | + enabled = var.auth_tls_enabled |
| 89 | + acm_ca_arns = try(aws_msk_cluster.this.client_authentication[0].tls[0].certificate_authority_arns, []) |
| 90 | + } |
| 91 | + } |
| 92 | +} |
| 93 | + |
| 94 | +output "encryption" { |
| 95 | + description = <<EOF |
| 96 | + A configuration for encryption of the Kafka cluster. |
| 97 | + `at_rest` - The configuration for encryption at rest. |
| 98 | + `in_transit` - The configuration for encryption in transit. |
| 99 | + EOF |
| 100 | + value = { |
| 101 | + at_rest = { |
| 102 | + kms_key = aws_msk_cluster.this.encryption_info[0].encryption_at_rest_kms_key_arn |
| 103 | + } |
| 104 | + in_transit = { |
| 105 | + in_cluster_enabled = aws_msk_cluster.this.encryption_info[0].encryption_in_transit[0].in_cluster |
| 106 | + client_mode = aws_msk_cluster.this.encryption_info[0].encryption_in_transit[0].client_broker |
| 107 | + } |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +output "logging" { |
| 112 | + description = <<EOF |
| 113 | + A configuration for logging of the Kafka cluster. |
| 114 | + `cloudwatch` - The configuration for MSK broker logs to CloudWatch Logs. |
| 115 | + `firehose` - The configuration for MSK broker logs to Kinesis Firehose. |
| 116 | + `s3` - The configuration for MSK broker logs to S3 Bucket. |
| 117 | + EOF |
| 118 | + value = { |
| 119 | + cloudwatch = { |
| 120 | + enabled = aws_msk_cluster.this.logging_info[0].broker_logs[0].cloudwatch_logs[0].enabled |
| 121 | + log_group = aws_msk_cluster.this.logging_info[0].broker_logs[0].cloudwatch_logs[0].log_group |
| 122 | + } |
| 123 | + firehose = { |
| 124 | + enabled = aws_msk_cluster.this.logging_info[0].broker_logs[0].firehose[0].enabled |
| 125 | + delivery_stream = aws_msk_cluster.this.logging_info[0].broker_logs[0].firehose[0].delivery_stream |
| 126 | + } |
| 127 | + s3 = { |
| 128 | + enabled = aws_msk_cluster.this.logging_info[0].broker_logs[0].s3[0].enabled |
| 129 | + bucket = aws_msk_cluster.this.logging_info[0].broker_logs[0].s3[0].bucket |
| 130 | + prefix = aws_msk_cluster.this.logging_info[0].broker_logs[0].s3[0].prefix |
| 131 | + } |
| 132 | + } |
| 133 | +} |
| 134 | + |
| 135 | +output "monitoring" { |
| 136 | + description = <<EOF |
| 137 | + A configuration for monitoring of the Kafka cluster. |
| 138 | + `cloudwatch` - The configuration for MSK CloudWatch Metrics. |
| 139 | + `prometheus` - The configuration for Prometheus open monitoring. |
| 140 | + EOF |
| 141 | + value = { |
| 142 | + cloudwatch = { |
| 143 | + level = aws_msk_cluster.this.enhanced_monitoring |
| 144 | + } |
| 145 | + prometheus = { |
| 146 | + jmx_exporter_enabled = aws_msk_cluster.this.open_monitoring[0].prometheus[0].jmx_exporter[0].enabled_in_broker |
| 147 | + node_exporter_enabled = aws_msk_cluster.this.open_monitoring[0].prometheus[0].node_exporter[0].enabled_in_broker |
| 148 | + } |
| 149 | + } |
| 150 | +} |
| 151 | + |
| 152 | +output "bootstrap_brokers" { |
| 153 | + description = <<EOF |
| 154 | + A configuration for connecting to the Kafka cluster. |
| 155 | + `plaintext` - A comma separated list of one or more hostname:port pairs of kafka brokers suitable to boostrap connectivity to the kafka cluster. Only contains value if `client_encryption_in_transit_mode` is set to PLAINTEXT or TLS_PLAINTEXT. AWS may not always return all endpoints so the values may not be stable across applies. |
| 156 | + `sasl_iam` - A comma separated list of one or more DNS names (or IPs) and SASL IAM port pairs. Only contains value if `client_encryption_in_transit_mode` is set to TLS_PLAINTEXT or TLS. AWS may not always return all endpoints so the values may not be stable across applies. |
| 157 | + `sasl_scram` - A comma separated list of one or more DNS names (or IPs) and SASL SCRAM port pairs. Only contains value if `client_encryption_in_transit_mode` is set to TLS_PLAINTEXT or TLS. AWS may not always return all endpoints so the values may not be stable across applies. |
| 158 | + `tls` - A comma separated list of one or more DNS names (or IPs) and TLS port pairs kafka brokers suitable to boostrap connectivity to the kafka cluster. Only contains value if `client_encryption_in_transit_mode is set to TLS_PLAINTEXT or TLS. AWS may not always return all endpoints so the values may not be stable across applies. |
| 159 | + `public_sasl_iam` - A comma separated list of one or more DNS names (or IPs) and SASL IAM port pairs. Only contains value if `client_encryption_in_transit_mode` is set to TLS_PLAINTEXT or TLS and `auth_sasl_iam_enabled` is `true` and `broker_public_access_enabled` is `true`. AWS may not always return all endpoints so the values may not be stable across applies. |
| 160 | + `public_sasl_scram` - A comma separated list of one or more DNS names (or IPs) and SASL SCRAM port pairs. Only contains value if `client_encryption_in_transit_mode` is set to TLS_PLAINTEXT or TLS and `auth_sasl_scram_enabled` is `true` and `broker_public_access_enabled` is `true`. AWS may not always return all endpoints so the values may not be stable across applies. |
| 161 | + `public_tls` - A comma separated list of one or more DNS names (or IPs) and TLS port pairs. Only contains value if `client_encryption_in_transit_mode` is set to TLS_PLAINTEXT or TLS and `broker_public_access_enabled` is `true`. AWS may not always return all endpoints so the values may not be stable across applies. |
| 162 | + EOF |
| 163 | + value = { |
| 164 | + plaintext = aws_msk_cluster.this.bootstrap_brokers |
| 165 | + sasl_iam = aws_msk_cluster.this.bootstrap_brokers_sasl_iam |
| 166 | + sasl_scram = aws_msk_cluster.this.bootstrap_brokers_sasl_scram |
| 167 | + tls = aws_msk_cluster.this.bootstrap_brokers_tls |
| 168 | + |
| 169 | + public_sasl_iam = aws_msk_cluster.this.bootstrap_brokers_public_sasl_iam |
| 170 | + public_sasl_scram = aws_msk_cluster.this.bootstrap_brokers_public_sasl_scram |
| 171 | + public_tls = aws_msk_cluster.this.bootstrap_brokers_public_tls |
| 172 | + } |
| 173 | +} |
| 174 | + |
| 175 | +output "zookeeper_connections" { |
| 176 | + description = <<EOF |
| 177 | + A configuration for connecting to the Apache Zookeeper cluster. |
| 178 | + `tcp` - A comma separated list of one or more IP:port pairs to use to connect to the Apache Zookeeper cluster. |
| 179 | + `tls` - A comma separated list of one or more IP:port pairs to use to connect to the Apache Zookeeper cluster via TLS. |
| 180 | + EOF |
| 181 | + value = { |
| 182 | + tcp = aws_msk_cluster.this.zookeeper_connect_string |
| 183 | + tls = aws_msk_cluster.this.zookeeper_connect_string_tls |
| 184 | + } |
| 185 | +} |
0 commit comments