terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

[Docs]: Resource: aws_msk_cluster

Open DhanukaSonicLabs opened this issue 2 years ago • 7 comments

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_cluster#broker_node_group_info-connectivity_info-argument-reference

Description

Using documentation I have applied aws msk cluster resource and I want to added public access configuration to it... You have clearly added the field to the doc as ( broker_node_group_info.connectivity_info.public_access.type ) and it can be changed by SERVICE_PROVIDED_EIPS....

But when I am applying that configuration I get this error...

│ Error: Unsupported argument
│
│   on 07-msk-scram.tf line 100, in resource "aws_msk_cluster" "msk_cluster_scram":
│  100:     connectivity_info = {
│
│ An argument named "connectivity_info" is not expected here.

I have tried many ways to solve that issue but always I had get the same issue... I am sending you the terraform resource code snippet below and can you tell me whats happen on it.... I have tried all your updated versions.

CODE THAT I HAVE BEEN USED

resource "aws_msk_cluster" "msk_cluster_scram" {
  cluster_name           = var.kafka_cluster_name
  kafka_version          = "4.31.0"
  number_of_broker_nodes = 3

  configuration_info {
    arn      = aws_msk_configuration.mks_config_scram.arn
    revision = 1
  }

  broker_node_group_info {
    instance_type   = "kafka.t3.small"
    ebs_volume_size = 50
    client_subnets = [
      aws_subnet.subnet_az1.id,
      aws_subnet.subnet_az2.id,
      aws_subnet.subnet_az3.id
    ]
    security_groups = [
      aws_security_group.sg.id
    ]
    connectivity_info = {
      public_access = {
        type = "SERVICE_PROVIDED_EIPS"
      }
    }
  }

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/msk_cluster#type

Would you like to implement a fix?

No

DhanukaSonicLabs avatar Sep 20 '22 17:09 DhanukaSonicLabs

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

github-actions[bot] avatar Sep 20 '22 17:09 github-actions[bot]

👍

sajsoniclabs avatar Sep 20 '22 17:09 sajsoniclabs

👍

DhanukaSonicLabs avatar Sep 20 '22 17:09 DhanukaSonicLabs

Hey @DhanukaLunatech 👋 Thank you for taking the time to raise this! It looks like you've provided connectivity_info as a a map rather than as a block. The same is then true for the public_access block; you've passed a map rather than a block. I believe the correct syntax, using your example, would be:

resource "aws_msk_cluster" "msk_cluster_scram" {
  cluster_name           = var.kafka_cluster_name
  kafka_version          = "4.31.0"
  number_of_broker_nodes = 3

  configuration_info {
    arn      = aws_msk_configuration.mks_config_scram.arn
    revision = 1
  }

  broker_node_group_info {
    instance_type   = "kafka.t3.small"
    ebs_volume_size = 50

    client_subnets = [
      aws_subnet.subnet_az1.id,
      aws_subnet.subnet_az2.id,
      aws_subnet.subnet_az3.id
    ]

    security_groups = [
      aws_security_group.sg.id
    ]

    connectivity_info {
      public_access {
        type = "SERVICE_PROVIDED_EIPS"
      }
    }
  }

justinretzolk avatar Sep 20 '22 18:09 justinretzolk

👍

Duwini avatar Sep 20 '22 19:09 Duwini

@justinretzolk same error showing by this type of using...

│ Error: Unsupported block type │ │ on 07-msk-scram.tf line 80, in resource "aws_msk_cluster" "msk_cluster_scram": │ 80: connectivity_info { │ │ Blocks of type "connectivity_info" are not expected here.

DhanukaSonicLabs avatar Sep 21 '22 03:09 DhanukaSonicLabs

Hey @DhanukaLunatech 👋 What version of the AWS provider are you running? That functionality was added in 4.13.0.

justinretzolk avatar Sep 21 '22 19:09 justinretzolk