AWS - Cloud Formation
AWS CloudFormation
Speed up cloud provisioning with infrastructure as code
Prerequisite :
- Download and Install VSCode
- Add CloudFormation Linter Extension to VSCode
- Python latest version is to be installed on your system
Example: Create an EC2 instance using CloudFormation Template.
Step 1 Open a file .yaml is visual studio code.
Step 2: Add CloudFormation Linter Extenstion to your VSCode
Step 3: Run the following commands in the terminal
pip install cfn-lint.
pip install pydot
Step 4: Create a new file with extension .yaml or .yml (main.yml)
Step 5: Write the below sample code to create an EC2 instance using the Cloudformation template (change the imageid and keyname accordingly)
Step 6: Goto Cloudformation Service.
Step 7: Click on Create Stack button.
Select option Template is ready
Select Upload a Template file
Choose your file
Step 8: Click on Next
Step 9: Provide Stack name and Click on Next
Step 10: Review and Create the stack.
Step 11: Verify the Events and once All the resources (EC2 instance) get created then check in the EC2 instance that EC2 -Demo got created or not.
Experiment:- Delete Stack and Check the EC2 instance also get deleted.
Example Create 2 resources EC2 instance and S3 bucket. Follow the same steps are metnioned in Example1 for execution.
Exercise:
Create EC2 instance and attach a Security group with EC2 instance.
Create an IAM Group and Add a user to that group
Example
Serverless End to End Web application deployment using Beanstalk
Check the BeanStalk Env and application these should be created and you will be able to access the application on browse