# Infrastructure as Code Awareness — AWS

Source: https://www.geekswithgeeks.com/en/aws/aws-iac

> Describing your AWS resources as reviewable, repeatable code.

## Why IaC

**Infrastructure as Code** describes your AWS resources in a file instead of clicking through the console — so infra changes go through review, version control, and repeatable deploys, like application code.

## A minimal snippet

Defining one S3 bucket declaratively with Terraform.

```hcl
resource "aws_s3_bucket" "app" {
  bucket = "my-app-bucket"
}
```

Output:

```
terraform apply creates (or updates) exactly this bucket
```

## CloudFormation vs Terraform

**CloudFormation** is AWS-native, no extra tooling needed. **Terraform** is a popular third-party tool that works across multiple clouds using the same language — pick based on whether you need multi-cloud.

**Quiz:** What is the main benefit of describing infrastructure as code instead of clicking through the console?

- [ ] It makes servers run faster
- [x] Changes become reviewable, versioned, and repeatable
- [ ] It removes the need for IAM permissions

*Answer:* Changes become reviewable, versioned, and repeatable. IaC turns infrastructure changes into code that can be reviewed, versioned, and reliably reapplied.
