skills sourced live from GitHub · all skills listed are free · each skill is provided under its author's license.
home / DevOps / Terraform AWS Skill by @BagelHole
The skill is the infrastructure/cloud-aws/terraform-aws folder inside that repository. Copy it into the folder your agent loads skills from; check your agent's documentation for where that is.
Provision AWS infrastructure with Terraform. Create modules, manage state, and implement IaC best practices.
Provisions AWS infrastructure with Terraform: provider configuration, example resources, modules, state management and infrastructure-as-code practices.
The original SKILL.md is organised into these sections:
Written and maintained by @BagelHole. It is published under the MIT license, which allows reuse with attribution. SkillDirectory does not claim authorship: this page adds our own review and links back to the original, and the skill's text belongs to its author.
# Terraform AWS
Provision and manage AWS infrastructure with Terraform.
## Provider Configuration
```hcl
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}
provider "aws" {
region = var.region
default_tags {
tags = {
Environment = var.environment
ManagedBy = "terraform"
}
}
}
```
## Example Resources
```hcl
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
tags = { Name = "main-vpc" }
}
resource "aws_instance" "web" {
ami = data.aws_ami.amazon_linux.id
instance_type = "t3.micro"
subnet_id = aws_subnet.public.id
tags = { Name = "web-server" }
}
```
## Modules
```hcl
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = "my-vpc"
cidr = "10.0.0.0/16"
…
Excerpt only, quoted from the author's repository. Open the repository for the complete file.