hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.15k forks source link

aws_synthetics_canary cannot be capitals #19073

Closed brendan-sherrin closed 3 years ago

brendan-sherrin commented 3 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

Terraform v0.12.30

Affected Resource(s)

aws_cloudwatch_metric_alarm

Terraform Configuration Files

Debug Output

Error: invalid value for name (must contain only alphanumeric, hyphen, underscore.)

on synthetics_canary\cloudwatch_canary.tf line 41, in resource "aws_synthetics_canary" "canary_api": 41: name = lookup(each.value, "friendly_name")

Panic Output

Expected Behavior

Either of:

  1. The canary should be created with upper case
  2. The error message should include that the canary name needs to be in lower case in addition to alphanumeric and either underscore or dash.

Actual Behavior

I recieved an error message that didn't tell me what the actual problem was.

Steps to Reproduce

  1. Try to create an aws_synthetics_canary with capital letters in the name field
  2. Run a terraform apply

Important Factoids

References

The doco here just mentions the name needs to be unique, nothing about a requirment to be lower case only: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm

gdavison commented 3 years ago

Thanks for reporting this, @brendan-sherrin. The AWS documentation doesn't specify it, but the AWS Console says "A name consists of up to 21 lowercase letters, numbers, hyphens or underscores with no spaces." We will update the error message and the Terraform documentation.

ghost commented 3 years ago

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[bot] commented 3 years ago

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.