mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
feat: Add sample Terraform code for HCL language testing
This commit is contained in:
parent
1408fb41b8
commit
a58293f04b
2 changed files with 53 additions and 0 deletions
|
@ -303,6 +303,7 @@ class TestRepoMapAllLanguages(unittest.TestCase):
|
|||
"elisp": ("el", "greeter"),
|
||||
"elm": ("elm", "Person"),
|
||||
"go": ("go", "Greeter"),
|
||||
"hcl": ("tf", "aws_vpc"),
|
||||
}
|
||||
|
||||
fixtures_dir = Path(__file__).parent.parent / "fixtures" / "languages"
|
||||
|
|
52
tests/fixtures/languages/hcl/teraform.tf
vendored
52
tests/fixtures/languages/hcl/teraform.tf
vendored
|
@ -0,0 +1,52 @@
|
|||
# Variables
|
||||
variable "aws_region" {
|
||||
description = "AWS region for resources"
|
||||
type = string
|
||||
default = "us-west-2"
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
description = "Environment name"
|
||||
type = string
|
||||
default = "dev"
|
||||
}
|
||||
|
||||
# Provider configuration
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
# Resource definitions
|
||||
resource "aws_vpc" "main" {
|
||||
cidr_block = "10.0.0.0/16"
|
||||
enable_dns_hostnames = true
|
||||
enable_dns_support = true
|
||||
|
||||
tags = {
|
||||
Name = "${var.environment}-vpc"
|
||||
Environment = var.environment
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_subnet" "public" {
|
||||
vpc_id = aws_vpc.main.id
|
||||
cidr_block = "10.0.1.0/24"
|
||||
availability_zone = "${var.aws_region}a"
|
||||
map_public_ip_on_launch = true
|
||||
|
||||
tags = {
|
||||
Name = "${var.environment}-public-subnet"
|
||||
Environment = var.environment
|
||||
}
|
||||
}
|
||||
|
||||
# Output values
|
||||
output "vpc_id" {
|
||||
description = "ID of the created VPC"
|
||||
value = aws_vpc.main.id
|
||||
}
|
||||
|
||||
output "subnet_id" {
|
||||
description = "ID of the public subnet"
|
||||
value = aws_subnet.public.id
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue