Terraform-provider-aws: Support Tagging for VPC Endpoints (Gateway Endpoints, Interface Endpoints and Endpoint Services)

Created on 14 May 2019  ·  10Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS just announced support for tagging of VPC Endpoints (Gateway Endpoints, Interface Endpoints, and Endpoint Services).

Tags can be used to search, filter, and organize VPC endpoints and endpoint services, but more importantly, tags can clearly organize the charges for these resources in the cost explorer and allow better cost attribution and chargebacks in environments with large shared accounts and multiple accounts.

New or Affected Resource(s)

  • aws_vpc_endpoint
  • aws_vpc_endpoint_service

Potential Terraform Configuration

resource "aws_vpc_endpoint" "s3" {
  vpc_id            = "${aws_vpc.main.id}"
  service_name      = "com.amazonaws.us-west-2.s3"
  vpc_endpoint_type = "Gateway"

  tags = {
    Name        = "S3 VPC Endpoint Gateway"
    Environment = "production"
    CostCenter  = "abc"
    ManagedBy   = "terraform"
  }
}

resource "aws_vpc_endpoint" "app_interface" {
  vpc_id             = "${aws_vpc.main.id}"
  subnet_ids         = ["${local.vpce_subnet_ids}"]
  security_group_ids = ["${local.security_group_ids}"]
  service_name       = "${local.service_provider_name}"
  vpc_endpoint_type  = "Interface"

  tags = {
    Name        = "Custom Service VPC Endpoint Interface"
    Environment = "production"
    CostCenter  = "xyz"
    ManagedBy   = "terraform"
  }
}

resource "aws_vpc_endpoint_service" "app_service" {
  acceptance_required        = false
  network_load_balancer_arns = ["${aws_lb.test.arn}"]

  tags = {
    Name        = "Custom Service VPC Endpoint Service"
    Environment = "production"
    CostCenter  = "abc"
    ManagedBy   = "terraform"
  }
}

References

enhancement servicec2

Most helpful comment

Support for tag management of VPC Endpoints has been merged and will release with version 2.16.0 of the Terraform AWS Provider, likely tomorrow. 👍

All 10 comments

We need this one so I'll take it on if nobody else has started.

Also update the associated data sources.

It looks like the tags on these resources are controlled via the EC2 DescribeTags, CreateTags and DeleteTags APIs.

Better support in the EC2 API now available with AWS SDK v1.19.31:

Adding tagging support for VPC Endpoints and VPC Endpoint Services.

Requires:

Can this move forward now that the SDK update has been merged?

Hi, Any updates about it?

Any ideas on how this is going? Any ETA?

Support for tag management of VPC Endpoints has been merged and will release with version 2.16.0 of the Terraform AWS Provider, likely tomorrow. 👍

This has been released in version 2.16.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings