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

aws_elasticache_subnet_group missing tags property #18884

Closed
ghost opened this issue Apr 15, 2021 · 4 comments · Fixed by #19119
Closed

aws_elasticache_subnet_group missing tags property #18884

ghost opened this issue Apr 15, 2021 · 4 comments · Fixed by #19119
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service.
Milestone

Comments

@ghost
Copy link

ghost commented Apr 15, 2021

This issue was originally opened by @NJITman as hashicorp/terraform#28380. It was migrated here as a result of the provider split. The original body of the issue is below.


The aws_elasticache_subnet_group resource is missing the tags argument. The tags can be entered using the AWS console or via the AWS CLI or API.

[Terraform Docs] (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_subnet_group)

[AWS CLI2 Docs] (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/elasticache/create-cache-subnet-group.html)

[AWS API Docs] (https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSubnetGroup.html)

Example resource block with tags argument added using list format shown in AWS CLI2 doc.

locals {
  cluster_name = "redis-dev"
  private_subnet_ids = [ "subnet-03020100" ]
}

resource "aws_elasticache_subnet_group" "subnet_group" {
  name        = "subnet-group-${local.cluster_name}"
  description = "Subnet Group (${local.cluster_name})"
  subnet_ids  = local.private_subnet_ids
  tags = [
    {
      "key"                 = "Name"
      "value"               = "subnet-group-${local.cluster_name}"
    }
  ]

Terraform Version

Terraform v0.14.10
+ provider registry.terraform.io/hashicorp/aws v3.35.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/template v2.2.0

Terraform Configuration Files

terraform {
  backend "s3" {
    bucket         = "bucket_name"
    key            = "terraform-state.tf"
    dynamodb_table = table_name"
  }
  required_providers {
    aws = {
      version = ">= 3.34.0"
      source  = "hashicorp/aws"
    }
  }
}

Debug Output

Error: Unsupported argument

  on modules\redis\main.tf line 13, in resource "aws_elasticache_subnet_group" "subnet_group":
  13:   tags = [

An argument named "tags" is not expected here.

Expected Behavior

Terraform should have created the subnet group resource with the associated tags.

Actual Behavior

Terraform failed with an error (see above).

Steps to Reproduce

  1. terraform init
  2. terraform plan
@ghost ghost added bug Addresses a defect in current functionality. new labels Apr 15, 2021
@ghost ghost added the service/elasticache Issues and PRs that pertain to the elasticache service. label Apr 15, 2021
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. and removed bug Addresses a defect in current functionality. labels Apr 15, 2021
@NJITman
Copy link

NJITman commented Apr 15, 2021

See screenshot of AWS Console below. The cluster was setup with TF, but I was not able to employ my "tag everything" philosophy. 😔

EC_Subnet_Group_Console

@anGie44 anGie44 added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 16, 2021
@NJITman
Copy link

NJITman commented Apr 20, 2021

In testing other aspects of the project design, I have run into a few other resources that throw an error when tags attributes are applied, even though the Terraform and AWS documentation indicate tags are a valid attribute.

aws_codedeploy_app

[Terraform Docs] (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codedeploy_app)
[AWS CLI2] (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-application.html)

Error: Unsupported argument

  on modules\code-pipeline-vm\main.tf line 75, in resource "aws_codedeploy_app" "deployment_app":
  75:   tags = {

An argument named "tags" is not expected here.

aws_codedeploy_deployment_group

[Terraform Docs] (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codedeploy_deployment_group)
[AWS CLI2] (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/deploy/create-deployment-group.html)

Error: Unsupported argument

  on modules\code-pipeline-vm\main.tf line 106, in resource "aws_codedeploy_deployment_group" "deployment_group":
 106:   tags = {

An argument named "tags" is not expected here.

All other conditions apply as the OP (same project).

Although these tags are shown as valid in the docs, you cannot enter them via the console. I was going to try adding tags to the resources in AWS and then importing them back into the TF state to see if the tags would come along.

@ghost
Copy link
Author

ghost commented Apr 30, 2021

This has been released in version 3.38.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!

@github-actions
Copy link

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 have found a problem that seems similar to this, 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 May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants