|
|
@ -656,7 +656,7 @@ def main():
|
|
|
|
virtualization_type=dict(default='hvm'),
|
|
|
|
virtualization_type=dict(default='hvm'),
|
|
|
|
root_device_name=dict(),
|
|
|
|
root_device_name=dict(),
|
|
|
|
delete_snapshot=dict(default=False, type='bool'),
|
|
|
|
delete_snapshot=dict(default=False, type='bool'),
|
|
|
|
name=dict(default=''),
|
|
|
|
name=dict(),
|
|
|
|
wait=dict(type='bool', default=False),
|
|
|
|
wait=dict(type='bool', default=False),
|
|
|
|
wait_timeout=dict(default=900, type='int'),
|
|
|
|
wait_timeout=dict(default=900, type='int'),
|
|
|
|
description=dict(default=''),
|
|
|
|
description=dict(default=''),
|
|
|
@ -680,6 +680,11 @@ def main():
|
|
|
|
]
|
|
|
|
]
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Using a required_one_of=[['name', 'image_id']] overrides the message that should be provided by
|
|
|
|
|
|
|
|
# the required_if for state=absent, so check manually instead
|
|
|
|
|
|
|
|
if not any([module.params['image_id'], module.params['name']]):
|
|
|
|
|
|
|
|
module.fail_json(msg="one of the following is required: name, image_id")
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
|
|
|
|
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module, boto3=True)
|
|
|
|
connection = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, **aws_connect_kwargs)
|
|
|
|
connection = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, **aws_connect_kwargs)
|
|
|
|