构建AMI时aws配置文件的问题

时间:2018-01-23 03:40:01

标签: amazon-web-services devops ami packer

我在使用带有packer的AWS配置文件构建AMI时遇到了问题。 Packer配置文件未使用默认凭据识别AWS配置文件。

.aws /配置

3.0.0-beta4

.aws / credentials(非真实密钥)

[default]
output = json
region = us-east-2

[profile test]
output = json
region = us-east-2

[profile test-dev]
output = json
region = us-east-2

config.json

[default]
aws_access_key_id =
aws_secret_access_key =

[test]
aws_access_key_id = 1fsfsfsd9898sf
aws_secret_access_key = 123456789fsdfsf8fs080sd8

[test-dev]
aws_access_key_id = fdafda8f0s80d8f0
aws_secret_access_key = fdsflsjlfjsl908809830sfjsdjl

它采用test而不是test-dev

的值

1 个答案:

答案 0 :(得分:0)

您的模板显示为:

"profile": "{{user `profile`}}"

但是应该引用用户var:

"profile": "{{user `aws_profile`}}"