AWS Amazon MSK Configuration

This page shows how to write Terraform and CloudFormation for Amazon MSK Configuration and write them securely.

aws_msk_configuration (Terraform)

The Configuration in Amazon MSK can be configured in Terraform with the resource name aws_msk_configuration. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

vf_kafka_configuration.tf#L1
resource "aws_msk_configuration" "vf-msk-config" {
  kafka_versions = ["2.2.1"]
  name           = format("vf-%s-%s-kafka-configuration", var.account_environment, var.vf_region)

  server_properties = <<PROPERTIES
auto.create.topics.enable=true
msk.tf#L24
resource "aws_msk_configuration" "main_config" {
  kafka_versions = ["2.6.1"]
  name           = "main-config"

  server_properties = <<PROP
auto.create.topics.enable = true
msk.tf#L24
resource "aws_msk_configuration" "main_config" {
  kafka_versions = ["2.6.1"]
  name           = "main-config"

  server_properties = <<PROP
auto.create.topics.enable = true
main.tf#L1
resource "aws_msk_configuration" "msk_gg_demo_conf" {
  kafka_versions = ["2.6.1"]
  name           = "msk-ggdemo-conf"

  server_properties = <<PROPERTIES
    auto.create.topics.enable=true

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an Amazon Managed Streaming for Kafka configuration. More information can be found on the MSK Developer Guide.

AWS::MSK::Cluster ConfigurationInfo (CloudFormation)

The Cluster ConfigurationInfo in MSK can be configured in CloudFormation with the resource name AWS::MSK::Cluster ConfigurationInfo. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Arn The Amazon Resource Name (ARN) of the MSK configuration to use. For example, arn:aws:kafka:us-east-1:123456789012:configuration/example-configuration-name/abcdabcd-1234-abcd-1234-abcd123e8e8e-1.
Required: Yes
Type: String
Update requires: No interruption

Revision The revision of the Amazon MSK configuration to use.
Required: Yes
Type: Integer
Update requires: No interruption

Explanation in CloudFormation Registry

Specifies the Amazon MSK configuration to use for the brokers.

Frequently asked questions

What is AWS Amazon MSK Configuration?

AWS Amazon MSK Configuration is a resource for Amazon MSK of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon MSK Configuration?

For Terraform, the shubhamnegi1/test-jenky, zerosoftwere/terraform-ecs-msk-ssm-demo and zerosoftwere/aws-msk-demo source code examples are useful. See the Terraform Example section for further details.