热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Creatingdynamicallynamedaws_lambda_aliasresultsinbadness

Thisissuewasoriginallyopenedbyashashicorp/terraform#5664.Itwasmigratedhe

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!


   



推荐阅读
author-avatar
沙楽33
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有