https://github.com/sampreethas/aws_cloudformation_iac
https://github.com/sampreethas/aws_cloudformation_iac
aws yaml
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sampreethas/aws_cloudformation_iac
- Owner: sampreethas
- License: mit
- Created: 2025-02-16T20:03:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-16T20:33:15.000Z (over 1 year ago)
- Last Synced: 2025-05-14T06:28:08.324Z (about 1 year ago)
- Topics: aws, yaml
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌩 AWS CloudFormation IaC with a simple template
This guide demonstrates how to use **AWS CloudFormation** for **Infrastructure as Code (IaC)** to provision and manage AWS resources using the **AWS CLI**.
## Features
- **Declarative Infrastructure** – Define resources using YAML
- **Automated Deployment** – Use ```aws cloudformation deploy```
- **Change Management** – Update stacks with version control
- **Rollback Support** – Automatic rollback on failure
## Prerequisites
Before you begin, ensure you have:
- **AWS CLI** → [Install Here](https://aws.amazon.com/cli/)
- **AWS IAM Permissions** (To create and manage CloudFormation stacks)
- **An S3 Bucket** (For storing CloudFormation templates if needed)
- **YAML/JSON CloudFormation Template**
## Getting Started
IAC can be provisioned using AWS Console or AWS CLI
### 1. Create a CloudFormation Template
Save the **YAML** template as `template.yaml`.
### 2. Run the following command to create the stack
```
aws cloudformation create-stack --stack-name MySimpleApp --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM
```
### 3. Use the following to update the stack
```
aws cloudformation update-stack --stack-name MySimpleApp --template-body file://template.yaml
```
### 4. Delete the stack using this command
**Note**: Do not forget to delete the resources after usage
```
aws cloudformation delete-stack --stack-name MySimpleApp
```
## Console output - Stack created based on the template
