CloudFormation - AWS
Created an vpc, subnets, internet gateway, routes, security group, EC2 instance, policies, roles, attached policies to exiting IAM user, and route table using aws cloudformation
- Install and configure AWS Command Line Interface (CLI) on your development machine (laptop) from AWS Website.
- Create AWS CLI user profiles in dev and demo account. Create secret key and download the csv file.
- Create dev profile for your dev AWS account and demo profile for your production AWS account.
- Both dev and demo AWS CLI profiles should be set to use the
us-east-1region or the region closest to you. - Clone the repository into your local machine using git clone command.
- Go to your project folder using cd
- Make a
parameter.jsonfile for configuration of the infra in which you want to build all your resources. - Make a
ghparamter.jsonfile for configuration of the infra in which you want to build all your resources. - Set
export AWS_PROFILE=demoor it can be any environment of your choice - Set
export AWS_REGION=us-east-1or it can be any region of your choice - Write command
aws cloudformation create-stack --stack-name [stack name] --template-body file://githubPolicy.yml --parameters file://ghparamter.json --capabilities CAPABILITY_NAMED_IAMto create stack and start the creation of the resources in aws - Write command
aws cloudformation create-stack --stack-name [stack name] --template-body file://csye6225-infra.yml --parameters file://parameter.json --capabilities CAPABILITY_NAMED_IAMto create stack and start the creation of the resources in aws - Write command
aws cloudformation update-stack --stack-name [stack name] --template-body file://githubPolicy.yml --parameters file://ghparamter.json --capabilities CAPABILITY_NAMED_IAMto update exit stack and its resources - Write command
aws cloudformation update-stack --stack-name [stack name] --template-body file://csye6225-infra.yml --parameters file://parameter.json --capabilities CAPABILITY_NAMED_IAMto update exit stack and its resources - Write command
aws cloudformation delete-stack --stack-name [stack name]to delete the stack and its resources - Write command
aws s3 rm s3://bucket-name --recursiveto delete data from s3 - Write command
aws acm import-certificate --certificate fileb://prod_yj1995_me/prod_yj1995_me.crt --certificate-chain fileb://prod_yj1995_me/prod_yj1995_me.ca-bundle --private-key fileb://prod_yj1995_me/privateKey.keyto import certificate
- csye6225-infra.yml : It has it's logic to create vpc, subnets, internet gateways, routes, route table,security group, Db security group, S3, RDS instance, IAM Role, Policy, Auto Scaling, Load Balancer, userData, and attachment.
- githubPolicy.yml : It has it's logic to create policy and attaching in to the exiting IAM user.
- AWS CloudFormation
- AWS CLI
- Create, Update, and Delete stack and its resources using cloud formation