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

IncorrectARNoutputforaws_ssm_parameter

TerraformVersionTerraformv0.11.0provider.awsv1.5.0


Terraform Version


  • Terraform v0.11.0

  • provider.aws v1.5.0

Affected Resource(s)


1
aws_ssm_parameter

Terraform confg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
hcl

resource "aws_ssm_parameter" "some_key" {

  name      = "/some/path"

  type      = "SecureString"

  value     = "${var.some_key}"

  overwrite = true

}



resource "aws_iam_role_policy" "some_policy" {

...

{

  "Effect": "Allow",

  "Resource": [

    "${aws_ssm_parameter.some_key.arn}",

  ],

   "Action": [

     "ssm:GetParameter*"

  ]

}

...

ARN exported for this type of resource has a double slash (

1
//

) after the word

1
parameter

. I've tried creating a parameter without the leading slash but Terraform throws an AWS API error:

1
aws_ssm_parameter.some_key: [ERROR] Error creating SSM parameter: ValidationException: Parameter name must be a fully qualified name.

The double slash is a problem because when I include the ARN into a policy for an IAM role, I get "unauthorized" response from AWS. Permissions work once one of the slashes is manually removed.

Perhaps this is caused by the trailing slash after

1
parameter

in https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_ssm_parameter.go#L94

The obvious workaround is to manually construct the ARN or use

1
replace

function.

该提问来源于开源项目: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
kg810219_447
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有