Hi Everyone,
I am trying to create a VPC using Ansible however I am having trouble in tagging resoruces
`
- name: Create a VPC
register: vpc
ec2_vpc:
state: present
cidr_block: 10.0.0.0/16
resource_tags: { Environmenti: Development }
subnets:
- cidr: 10.0.0.0/24
az: us-east-1a
resource_tags:
Name: Development Public Subnet - cidr: 10.0.1.0/24
az: us-east-1b
resource_tags:
Name: Development Private Subnet A - cidr: 10.0.2.0/24
az: us-east-1d
resource_tags:
Name: Development Private Subnet B
wait: yes
region: us-east-1
internet_gateway: yes
`
With the above code getting executed successfully, still the subnets dont have the Tag of " Name ", the Tag gets created but its value remains empty
Also If I try to tag the VPC, I get the following error with the below code
`
- name: Create a VPC
register: vpc
ec2_vpc:
state: present
cidr_block: 10.0.0.0/16
resource_tags: { Environmenti: Development }
subnets: - cidr: 10.0.0.0/24
az: us-east-1a
resource_tags:
Name: Development Public Subnet - cidr: 10.0.1.0/24
az: us-east-1b
resource_tags:
Name: Development Private Subnet A - cidr: 10.0.2.0/24
az: us-east-1d
resource_tags:
Name: Development Private Subnet B
wait: yes
region: us-east-1
internet_gateway: yes
`
PLAY [local] ******************************************************************
TASK: [Create a VPC] **********************************************************
failed: [localhost] => {“failed”: true}
msg: unsupported parameter for module: resource_tags
FATAL: all hosts have already failed – aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/root/main.retry
Can anyone point out what I am doing wrong.Thank you