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
          cidr_block: 172.23.0.0/16
          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
         resource: '{{item.id}}'
     args:
         tags:
            Name: TestVPC101
     with_items: new_vpc

But when I executed the playbook, the tagging task failed saying item 
resource not found.



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a9464844-698e-4164-bee4-76265eed413c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to