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, 2020 in Ansible by akhtar
• 38,170 points
164 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, 2020 by MD
• 95,060 points

Related Questions In Ansible

0 votes
1 answer

How to create an Elastic Load Balancer in AWS with Ansible Playbook?

Hi@akhtar, You can find one module in ansible ...READ MORE

answered Oct 12, 2020 in Ansible by MD
• 95,060 points
137 views
0 votes
1 answer

How to create an encrypted bucket in AWS using Ansible Playbook?

Hi@akhtar, Sometimes it is required to encrypt the ...READ MORE

answered Dec 4, 2020 in Ansible by MD
• 95,060 points
38 views
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, 2020 in Ansible by MD
• 95,060 points
461 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, 2020 in Ansible by MD
• 95,060 points
100 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
947 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, 2020 in Ansible by MD
• 95,060 points
91 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, 2020 in Ansible by MD
• 95,060 points
628 views