Open gionn opened 2 years ago
A better workaround seems to set name
attribute in the ec2_instance
so there is no need to fiddle with filters
that documentation says it's needed just to decide if creating a new instance or update an existing one, and the default is to look for a matching Name
tag value, but it needs to be specified with name
otherwise it won't work if defined in tags alone.
- name: Create ephemeral EC2 instance(s)
ec2_instance:
profile: "{{ item.aws_profile | default(omit) }}"
region: "{{ item.region | default(omit) }}"
instance_type: "{{ item.instance_type }}"
image_id: "{{ platform_image_id }}"
vpc_subnet_id: "{{ item.vpc_subnet_id }}"
security_groups: "{{ platform_security_groups }}"
network:
assign_public_ip: "{{ item.assign_public_ip }}"
volumes: "{{ item.volumes }}"
key_name: "{{ (item.key_inject_method == 'ec2') | ternary(item.key_name, omit) }}"
name: "{{ platform_tags['Name'] }}"
tags: "{{ platform_tags }}"
user_data: "{{ platform_user_data }}"
wait: true
Hello,
I tried to create a new scenario with
molecule init scenario -d ec2
, and then runningmolecule create
:I always get an AWS client exception (truncate output for readability):
Relevant dependencies:
Workaround is to remove the
filters
attribute in theec2_instance
resource in theCreate ephemeral EC2 instance(s)
step increate.yml
: