Closed balq60 closed 2 years ago
@balq60 Sorry the documentation is not clear enough about this.
examples/complete
is intended to be Terraformed with -var-file fixtures.us-east-2.tfvars
. One of
alias
namespace
environment
stage
name
needs to be set in order for the key to have a valid alias name. Cloud Posse modules in general expect one of the context/null-label labels to be set. It is such a universal requirement that we do not always point it out that clearly.
Found a bug? Maybe our Slack Community can help.
Describe the Bug
I started with this - https://github.com/cloudposse/terraform-aws-kms-key/tree/0.12.1/examples/complete
Expected Behavior
I expected the KMS Key to be generated
Steps to Reproduce
Steps to reproduce the behavior:
Admin:~/environment/ModuleTemplate/LearnModules/modules/kms-key (aws-s3-bucket2) $ terraform plan var.region Enter a value: us-east-1
╷ │ Error: "name" must begin with 'alias/' and be comprised of only [a-zA-Z0-9/_-] │ │ with module.kms_key.aws_kms_alias.default[0], │ on .terraform/modules/kms_key/main.tf line 15, in resource "aws_kms_alias" "default": │ 15: name = coalesce(var.alias, format("alias/%v", module.this.id)) │
When I hard coded the value on line 15 to be alias/123 it Worked!
Also running the simplified example works as well....
Screenshots
If applicable, add screenshots or logs to help explain your problem.
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Additional Context
Add any other context about the problem here.