commit 7b04f46e5410b4ec275d5b949f29511f37070cef Author: gitops_test Date: Thu Jun 11 11:01:52 2026 +0000 Add AWS_Superset_20260611_110151.TF diff --git a/AWS_Superset_20260611_110151.TF b/AWS_Superset_20260611_110151.TF new file mode 100644 index 0000000..97da7b4 --- /dev/null +++ b/AWS_Superset_20260611_110151.TF @@ -0,0 +1,111 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + } +} + +provider "aws" { + region = "eu-west-1" +} + +resource "aws_vpc" "simpl_vpc" { + cidr_block = "10.0.0.0/16" + enable_dns_support = true + enable_dns_hostnames = true + + tags = { + Name = "simpl-vpc-{UUID}" + } +} + +resource "aws_subnet" "simpl_subnet" { + vpc_id = aws_vpc.simpl_vpc.id + cidr_block = "10.0.1.0/24" + map_public_ip_on_launch = true + + tags = { + Name = "simpl-subnet-{UUID}" + } +} + +resource "aws_internet_gateway" "simpl_igw" { + vpc_id = aws_vpc.simpl_vpc.id + + tags = { + Name = "simpl-igw-{UUID}" + } +} + +resource "aws_route_table" "simpl_rt" { + vpc_id = aws_vpc.simpl_vpc.id + + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.simpl_igw.id + } + + tags = { + Name = "simpl-rt-{UUID}" + } +} + +resource "aws_route_table_association" "simpl_rta" { + subnet_id = aws_subnet.simpl_subnet.id + route_table_id = aws_route_table.simpl_rt.id +} + +resource "aws_security_group" "simpl_sg" { + count = 1 + name = "simpl-sg-{UUID}" + description = "SIMPL security group" + vpc_id = aws_vpc.simpl_vpc.id + + ingress { + description = "SSH" + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + dynamic "ingress" { + for_each = toset(["8088"]) + content { + from_port = tonumber(ingress.value) + to_port = tonumber(ingress.value) + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_instance" "simpl_vm" { + ami = "ami-02ad7d74d71067c63" + instance_type = "t3.small" + subnet_id = aws_subnet.simpl_subnet.id + vpc_security_group_ids = 1 > 0 ? [aws_security_group.simpl_sg[0].id] : [] + user_data_base64 = "var.simpl_cloud_init" + + root_block_device { + volume_size = 30 + } + + tags = { + Name = "offering-enterprise-server-{UUID}-terraform" + } +} + +output "vmIps" { + depends_on = [aws_instance.simpl_vm] + value = [aws_instance.simpl_vm.public_ip] +}