Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support to tag default route table #545

Closed
wants to merge 2 commits into from

Conversation

lays147
Copy link

@lays147 lays147 commented Dec 17, 2020

Signed-off-by: Lays Rodrigues laysrodriguessilva@gmail.com

Description

Add support to tag default route table since PR #147 is getting dust.

Motivation and Context

So far this is the only resource on this module that has not set a Name by default. And I like my resources tagged :3

Breaking Changes

Not that I know.

How Has This Been Tested?

Used terraform 0.14

terraform fmt
terraform validate
terraform plan
terraform apply
  # module.vpc.aws_default_route_table.default[0] must be replaced
-/+ resource "aws_default_route_table" "default" {
      + default_route_table_id = "rtb-id"
      + id                     = (known after apply)
      + owner_id               = (known after apply)
      + route                  = (known after apply)
      + tags                   = {
          + "Name"                            = "my-rt-name"
          + "environment"                     = "development"
          + "kubernetes.io/cluster/beira-rio" = "shared"
        }
      + vpc_id                 = (known after apply)
    }
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>
@lays147 lays147 changed the title Add support to tag default route table feat: Add support to tag default route table Dec 17, 2020
@lays147
Copy link
Author

lays147 commented Dec 18, 2020

ping @antonbabenko

@egarbi
Copy link

egarbi commented Dec 29, 2020

Have you tried running this over an already created VPC?
Since default_route_table is created by default by aws_vpc resource, adding this piece of code after, it may cause conflicts trying to create a route that is already created.
If this is true, one would have to use an import to solve the issue, something like:

terraform import aws_default_route_table.default aws_vpc.this.id

This can be tricky for people trying to update the module to a newer version.

@daroga0002
Copy link

aws_default-route_table is special resource and it is not creating any new route table but is used to pull existing one and manage it using terraform.

As per:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_route_table

Each VPC created in AWS comes with a Default Route Table that can be managed, but not destroyed. This is an advanced resource, and has special caveats to be aware of when using it. ```

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants