Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asifcopilot/aws-ansible-vpc
https://github.com/asifcopilot/aws-ansible-vpc
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/asifcopilot/aws-ansible-vpc
- Owner: asifcopilot
- Created: 2023-07-09T18:08:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-12T11:44:31.000Z (over 1 year ago)
- Last Synced: 2024-08-22T12:03:55.463Z (4 months ago)
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Complete ansible automation setup
![Cloud Architecture](https://github.com/GitPit-ak/aws-ansible-vpc/assets/44562876/d5d34464-8382-4d17-933e-64cdc3546ebd)### Prerequisite
Launch a control machine provision ansible playbook (Manual)
requirement:
- ansible
- awscli
- iam user role with admin access attached into ec2
- clone this repo### What will we have in this setup.
We have set up two private running web servers in separate availability zones (AZs) within our own Virtual Private Cloud (VPC). These servers are located in private subnets and are not directly accessible from the internet. Instead, we have a bastion/frontend server that acts as a gateway and is exposed to the internet.To enable load balancing and distribute traffic evenly between the two web servers, we have configured an Elastic Load Balancer (ELB) using the round-robin method. The ELB sits in the public subnet and forwards incoming requests to the web servers in the private subnets.
Overall, our setup ensures that our web servers are kept safe within the private subnets while still allowing controlled access via the bastion/frontend server and load balancing through the ELB.
### Flow of execution
- Install ansible
- goto repo folder and run the main.yml
#######This playbook will setup
- Complete Own VPC with NAT GW
- Security groups for public and private ec2 instances
- key-pair for our ec2 instances
- launch 1 public(bastion) instance & 2 private Instance(web server's)
- Create varible file which will execute on next step and copied into bastion home directory.- Login into bastion server
- You will get the repo folder on your home directory
- move to provision-ec2 folder and run the main.yml after instaling ansible on this server.#######This playbook will setup
- Install requied pakages for web server
- download dependency from the internet
- setup and start the web server
### Flow of Plan
Devops-VPC (ansible)
- vpc
- subnetting
- 2 pubsub
- 2 privpub
- IGW
- route Tables
- attached igw into 2 pubsub
- NAT GW in public subnet
- attached 2 priv subnet into NATGWSecurity Groups (ansible)
- ELB-SG and Bastion Host-SG
- private server security groupsCreate key pairs for ec2 intances
- bastion host
- 2 private serversEc2 (ansible)
- bastion host in public subnet
- 2 web server on each subnetprovision (ansible)
- write playbook to setup web server