1
votes

I am trying to create an interface type kms endpoint in terraform on aws. While doing so, I get the following error -

Error creating VPC Endpoint: InvalidParameter: Subnet: subnet- does not have corresponding zone in the service com.amazonaws.ap-southeast-1.kms

My endpoint resource looks like --

    resource "aws_vpc_endpoint" "kms" {
  vpc_id            = "${aws_vpc.main.id}"
  service_name      = "com.amazonaws.${var.aws_region}.kms"
  vpc_endpoint_type = "Interface"

  subnet_ids = [
<my subnet ids>
  ]

  security_group_ids = [ <my sg ids> ]
  private_dns_enabled = true
} 

Anyone any clue on what I might be missing. Just FYI -- I haven't added any route53 record for kms. Do i need to?

Looking forward to any replies.

Thanks Avi

2

2 Answers

0
votes

If you have not created the private DNS in Route53, set private_dns_enabled=false . Otherwise create the private zone first.

0
votes

I solved this issue by creating multiple endpoint resources for different subnets.