-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/elasticache_subnet_group: appropriately ignore default tags configuration in default
resource
#19267
Conversation
c9f26a9
to
7d350f8
Compare
default
resourcedefault
resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% terraform init
Initializing the backend...
Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "aws" (hashicorp/aws) 3.40.0...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.aws: version = "~> 3.40"
Terraform has been successfully initialized!
% terraform import aws_elasticache_subnet_group.default default
aws_elasticache_subnet_group.default: Importing from ID "default"...
aws_elasticache_subnet_group.default: Import prepared!
Prepared aws_elasticache_subnet_group for import
aws_elasticache_subnet_group.default: Refreshing state... [id=default]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
% terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.aws_subnet_ids.test: Refreshing state...
aws_elasticache_subnet_group.default: Refreshing state... [id=default]
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_elasticache_subnet_group.default will be updated in-place
~ resource "aws_elasticache_subnet_group" "default" {
arn = "arn:aws:elasticache:us-west-2:123456789012:subnetgroup:default"
description = "Default CacheSubnetGroup"
id = "default"
name = "default"
subnet_ids = [
"subnet-xxxxxxxxxxxxxxxxx",
"subnet-xxxxxxxxxxxxxxxxx",
"subnet-xxxxxxxxxxxxxxxxx",
"subnet-xxxxxxxxxxxxxxxxx",
]
tags = {}
~ tags_all = {
+ "Name" = "terraform-default"
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
% terraform apply
aws_elasticache_subnet_group.default: Modifying... [id=default]
Error: error updating tags: error tagging resource (arn:aws:elasticache:us-west-2:123456789012:subnetgroup:default): InvalidParameterValue: Tagging on default resources is not supported
status code: 400, request id: 1ae50517-5045-46e5-8765-216055db901a
on main.tf line 11, in resource "aws_elasticache_subnet_group" "default":
11: resource "aws_elasticache_subnet_group" "default" {
% terraform init --plugin-dir=$HOME/go/bin
Initializing the backend...
Initializing provider plugins...
Terraform has been successfully initialized!
% terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.aws_subnet_ids.test: Refreshing state...
aws_elasticache_subnet_group.default: Refreshing state... [id=default]
------------------------------------------------------------------------
No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
This has been released in version 3.42.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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. |
Community Note
Closes #19213
Notes
ignore_changes
totags_all
(on pre-existing resources)Using the following config with reference to the default ElastiCacheSubnetGroup in
us-west-2
:With
v3.38.0
of the provider, Terraform plan after import returns:With provider built from this branch, Terraform plan after import returns:
Output from acceptance testing: