Hi,
I created a vpc using ec2_vpc module. Now after the VPC is being created, I would like to tag it using ec2_tag module.
---
- name: Playbook to create an AWS VPC
hosts: local
connection: local
tasks:
- name: Creating a VPC
action:
module: ec2_vpc
state: present
aws_access_key: XXXX
aws_secret_key: XXXX
region: us-east-1
instance_tenancy: default
dns_hostnames: yes
dns_support: yes
register: new_vpc
- name: Tag the newly Created VPC
action:
module: ec2_tag
aws_access_key: XXXX
aws_secret_key: XXXX
region: us-east-1
state: present
args:
tags:
Name: TestVPC101
with_items: new_vpc
But when I executed the playbook, the tagging task failed saying item resource not found.