我正在尝试加密AWS AMI,但出现以下错误。
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"aws_access_key": "xxxxxxxxxxxxxx",
"aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"description": "",
"ec2_url": null,
"encrypted": true,
"kms_key_id": null,
"name": "euwestami1",
"profile": null,
"region": "us-west-2",
"security_token": null,
"source_image_id": "ami-xxxxx",
"source_region": "us-west-2",
"tags": {
"Name": "MyNewWestAMI",
"Service": "TestWestAMIService"
},
"validate_certs": true,
"wait": false,
"wait_timeout": "1200"
}
},
"msg": "Unhandled exception. (('Connection aborted.', error(104, 'Connection reset by peer')))"
}
我的实际代码是:
---
- name: encytption
hosts: localhost
remote_user: root
connection: local
tasks:
- name: copying and encrypting an ami
ec2_ami_copy:
region: "us-west-2"
aws_access_key: "xxxxxxxxxxxxxx"
aws_secret_key: "xxxxxxxxxxxxxx"
encrypted: yes
source_region: "us-west-2"
source_image_id: "ami-28e07e50"
wait: no
name: euwestami1
tags:
Name: MyNewWestAMI
Service: TestWestAMIService
register: instance