How to create VPC in AWS from Ansible controller node?

0 votes

Hi Guys,

I am able to launch an EC2 instance in AWS from Ansible-Playbook. But I want to create one VPC first and then I want to launch one instance inside this VPC. Can anyone tell me how can I do that?

Aug 13 in Ansible by akhtar
• 25,030 points
119 views

1 answer to this question.

0 votes

Hi@akhtar,

You can find one module named ec2_vpc in Ansible. This module is used to create a VPC on AWS. I have attached one playbook below for your reference.

    - ec2_vpc:
        state: present
        cidr_block: 172.23.0.0/16
        resource_tags: { "Environment":"Development" }
        region: us-west-2
answered Aug 13 by MD
• 56,480 points

Related Questions In Ansible

0 votes
1 answer

How to install httpd web server in remote node using Ansible?

Hi@akhtar, You need to use the package module in Ansible. ...READ MORE

answered Jul 29 in Ansible by MD
• 56,480 points
97 views
0 votes
1 answer

How to create a group of Managed Nodes in Ansible?

Hi@akhtar, You can use tags in your inventory ...READ MORE

answered Aug 1 in Ansible by MD
• 56,480 points
42 views
0 votes
1 answer

How to create a variable in Ansible Playbook?

Hi@akhtar, Variable in playbooks are very similar to using variables in ...READ MORE

answered Aug 2 in Ansible by MD
• 56,480 points
54 views
0 votes
1 answer

How to create template in Ansible?

Hi@akhtar, A template in Ansible is a file ...READ MORE

answered Aug 2 in Ansible by MD
• 56,480 points
83 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
677 views
+2 votes
1 answer
0 votes
1 answer

How to delete a key pair in AWS from Ansible-Playbook?

Hi@akhtar, You can use the ec2_key module in ...READ MORE

answered Aug 12 in Ansible by MD
• 56,480 points
37 views
0 votes
1 answer

How to create a security group in AWS using Ansible-Playbook?

Hi@akhtar, You can use the ec2_group module in ...READ MORE

answered Aug 13 in Ansible by MD
• 56,480 points
129 views