【发布时间】:2019-01-14 08:03:44
【问题描述】:
我正在使用打包程序构建 Windows 服务器 AMI。它适用于硬编码密码,但我正在尝试创建 AMI 以便自动生成密码。我尝试了下面的建议,打包程序日志看起来不错,它有密码。
How to create windows image in packer using the keypair
但是,当我在 terraform 中从 AMI 创建 EC2 实例时,与 Windows 密码的连接丢失并且无法检索。这里缺少什么?
打包器 json
{
"builders": [
{
"profile" : "blah",
"type": "amazon-ebs",
"region": "eu-west-1",
"instance_type": "t2.micro",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "*Windows_Server-2012-R2*English-64Bit-Base*",
"root-device-type": "ebs"
},
"most_recent": true,
"owners": "amazon"
},
"ssh_keypair_name" : "shared.key",
"ssh_private_key_file" : "./common/sharedkey.pem",
"ssh_agent_auth" : "true",
"ami_name": "test-{{timestamp}}",
"user_data_file": "./common/bootstrap_win.txt",
"communicator": "winrm",
"winrm_username": "Administrator"
}
]
}
【问题讨论】:
标签: passwords windows-server-2012-r2 private-key amazon-ami packer