Terraform infrastructure as code including modules, state management, and cloud provisioning. Activate for tf files, IaC, infrastructure provisioning, and cloud resource management.
Provides comprehensive Terraform infrastructure as code capabilities for the Golden Armada AI Agent Fleet Platform.
Activate this skill when working with:
```bash
terraform init terraform init -upgrade
terraform plan terraform plan -out=tfplan terraform plan -var="environment=prod"
terraform apply terraform apply tfplan terraform apply -auto-approve
terraform destroy terraform destroy -target=aws_instance.example
terraform state list terraform state show <resource> terraform state mv <source> <destination> terraform state rm <resource>
terraform workspace list terraform workspace new dev terraform workspace select prod
terraform fmt -recursive terraform validate ```
``` terraform/ ├── main.tf ├── variables.tf ├── outputs.tf ├── providers.tf ├── versions.tf ├── terraform.tfvars ├── environments/ │ ├── dev.tfvars │ └── prod.tfvars └── modules/ ├── networking/ ├── compute/ └── database/ ```
```hcl
terraform { required_version = ">= 1.0.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "> 5.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "> 2.0"
}
}
backend "s3" { bucket = "golden-armada-terraform-state" key = "state/terraform.tfstate" region = "us-west-2" encrypt = true dynamodb_table = "terraform-locks" } }
provider "aws" { region = var.aws_region
default_tags { tags = { Project = "golden-armada" Environment = var.environment ManagedBy = "terraform" } } } ```
```hcl
variable "environment" { description = "Environment name" type = string validation { condition = contains(["dev", "staging", "prod"], var.environment) error_message = "Environment must be dev, staging, or prod." } }
variable "instance_count" { description = "Number of instances" type = number default = 2 }
variable "tags" { description = "Resource tags" type = map(string) default = {} }
environment = "dev" instance_count = 2 ```
```hcl
resource "aws_eks_cluster" "main" { name = "${var.project}-${var.environment}" role_arn = aws_iam_role.cluster.arn version = var.kubernetes_version
vpc_config { subnet_ids = var.subnet_ids endpoint_private_access = true endpoint_public_access = var.public_access }
tags = var.tags }
variable "project" { type = string }
variable "environment" { type = string }
variable "kubernetes_version" { type = string default = "1.28" }
module "eks" { source = "./modules/eks-cluster"
project = "golden-armada" environment = var.environment subnet_ids = module.vpc.private_subnets kubernetes_version = "1.28" tags = local.tags } ```