作者:沙楽33 | 来源:互联网 | 2023-10-16 19:31
This issue was originally opened by as hashicorp/terraform#5664. It was migrated here as part of the provider split. The original body of the issue is below.
Hey!
I created an aws_lambda_alias with a dynamic name:
1 2 3 4 5 6
| resource "aws_lambda_alias" "assessment-trait-scores-scaler" {
name = "${consul_keys.assessment-trait-scores-scaler.var.version}"
description = "Git Hash ${consul_keys.assessment-trait-scores-scaler.var.version}"
function_name = "${aws_lambda_function.assessment-trait-scores-scaler.arn}"
function_version = "$LATEST"
} |
The intention was to have an alias named after the git hash of the jar being generated. This would create a new alias each time the jar is updated (I realize there are some issues with this - this was an early exploration). Unfortunately, I get the following error after the first run:
1 2
| * aws_lambda_alias.assessment-trait-scores-scaler: ResourceNotFoundException: Cannot find alias arn: arn:aws:lambda:us-east-1:xxxxxxx
:function:assessment-trait-scores-scaler-prod:ae91e35ffdc42c614fad63983d39ff5f21ff2fb1 |
Which is true, but not at all what I expected. I expected it to remove the old alias, and create a new one, rather than attempting to "update" the new alias (which doesn't exist yet). To resole this, I had to manually delete the entries out of the state file.
Thanks!
Dan
该提问来源于开源项目:hashicorp/terraform-provider-aws
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!