Skip to content
Snippets Groups Projects
Commit 8ce2ccd0 authored by Kenneth's avatar Kenneth
Browse files

WOrking terraform

parent 81b23d04
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -107,27 +107,7 @@ resource "aws_security_group_rule" "ssh_api_from_bastion" {
####################################
# Subnets (A et B) - 2 AZ différentes
####################################
resource "aws_subnet" "private_subnet_a" {
vpc_id = data.aws_vpc.this.id
cidr_block = "10.0.35.0/24" # 1er bloc
availability_zone = data.aws_availability_zones.available.names[0]
map_public_ip_on_launch = false
tags = {
Name = upper("${var.identifiant}_${terraform.workspace}_PRIVATE_SUBNET_A")
}
}
resource "aws_subnet" "private_subnet_b" {
vpc_id = data.aws_vpc.this.id
cidr_block = "10.0.36.0/24" # 2e bloc
availability_zone = data.aws_availability_zones.available.names[1]
map_public_ip_on_launch = true
tags = {
Name = upper("${var.identifiant}_${terraform.workspace}_PRIVATE_SUBNET_B")
}
}
####################################
# Security Groups
......@@ -175,14 +155,33 @@ resource "aws_security_group" "sg_api" {
# ON autorise la connexion vers le RDS
egress {
description = "Allow traffic to RDS (5432)"
from_port = 5432
to_port = 5432
protocol = "tcp"
from_port = 5432 # 0
to_port = 5432 #0
protocol = "tcp" #-1
cidr_blocks = [data.aws_subnet.private-a.cidr_block]
/*data.aws.subnet.private_subnet_a.cidr_blocks*/
}
egress {
description = "Allow traffic to RDS (5432)"
from_port = 80 # 0
to_port = 80 #0
protocol = "tcp" #-1
cidr_blocks = ["0.0.0.0/0"]
/*data.aws.subnet.private_subnet_a.cidr_blocks*/
}
egress {
description = "Allow traffic to RDS (5432)"
from_port = 443 # 0
to_port = 443 #0
protocol = "tcp" #-1
cidr_blocks = ["0.0.0.0/0"]
/*data.aws.subnet.private_subnet_a.cidr_blocks*/
}
tags = {
Name = upper("${var.identifiant}_${terraform.workspace}_SG_API")
}
......@@ -246,7 +245,7 @@ resource "aws_instance" "client" {
key_name = aws_key_pair.ec2.id
# On la met, par exemple, dans le subnet A
subnet_id = aws_subnet.private_subnet_a.id
subnet_id = data.aws_subnet.private-a.id
vpc_security_group_ids = [aws_security_group.sg_client.id]
tags = {
......@@ -261,7 +260,7 @@ resource "aws_instance" "api" {
key_name = aws_key_pair.ec2.id
# On peut la mettre aussi dans le subnet A (ou B, au choix)
subnet_id = aws_subnet.private_subnet_a.id
subnet_id = data.aws_subnet.private-a.id
vpc_security_group_ids = [aws_security_group.sg_api.id]
tags = {
......@@ -277,8 +276,8 @@ resource "aws_db_subnet_group" "this" {
name = lower("${var.identifiant}_${terraform.workspace}_rds_subnet_group")
# RDS exige au moins 2 subnets dans 2 AZ différentes
subnet_ids = [
aws_subnet.private_subnet_a.id,
aws_subnet.private_subnet_b.id
data.aws_subnet.private-a.id,
data.aws_subnet.private-b.id
]
tags = {
......
{
"version": 4,
"terraform_version": "1.10.5",
"serial": 113,
"serial": 240,
"lineage": "eded4345-a67f-9a4a-9ad8-c68c205f47c2",
"outputs": {},
"resources": [
......@@ -169,7 +169,7 @@
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"available_ip_address_count": 240,
"available_ip_address_count": 241,
"cidr_block": "10.0.1.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
......@@ -219,7 +219,7 @@
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3b",
"availability_zone_id": "euw3-az2",
"available_ip_address_count": 245,
"available_ip_address_count": 246,
"cidr_block": "10.0.2.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
......@@ -269,7 +269,7 @@
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"available_ip_address_count": 248,
"available_ip_address_count": 247,
"cidr_block": "10.0.0.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
......@@ -418,7 +418,7 @@
"availability_zone": "eu-west-3a",
"backup_retention_period": 0,
"backup_target": "region",
"backup_window": "08:12-08:42",
"backup_window": "13:47-14:17",
"blue_green_update": [],
"ca_cert_identifier": "rds-ca-rsa2048-g1",
"character_set_name": "",
......@@ -432,11 +432,11 @@
"deletion_protection": false,
"domain": "",
"domain_auth_secret_arn": "",
"domain_dns_ips": [],
"domain_dns_ips": null,
"domain_fqdn": "",
"domain_iam_role_name": "",
"domain_ou": "",
"enabled_cloudwatch_logs_exports": [],
"enabled_cloudwatch_logs_exports": null,
"endpoint": "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com:5432",
"engine": "postgres",
"engine_lifecycle_support": "open-source-rds-extended-support",
......@@ -445,7 +445,7 @@
"final_snapshot_identifier": null,
"hosted_zone_id": "ZMESEXB7ZGGQ3",
"iam_database_authentication_enabled": false,
"id": "db-OVJD44ND4UJCBJPN7LPVEZT6CE",
"id": "db-BLJUB6CY35LFI47TPFTUAAPAEM",
"identifier": "kennethhugo-dev-rds-instance",
"identifier_prefix": "",
"instance_class": "db.t3.micro",
......@@ -454,7 +454,7 @@
"latest_restorable_time": "",
"license_model": "postgresql-license",
"listener_endpoint": [],
"maintenance_window": "sun:05:13-sun:05:43",
"maintenance_window": "fri:01:14-fri:01:44",
"manage_master_user_password": null,
"master_user_secret": [],
"master_user_secret_kms_key_id": null,
......@@ -475,7 +475,7 @@
"replica_mode": "",
"replicas": [],
"replicate_source_db": "",
"resource_id": "db-OVJD44ND4UJCBJPN7LPVEZT6CE",
"resource_id": "db-BLJUB6CY35LFI47TPFTUAAPAEM",
"restore_to_point_in_time": [],
"s3_import": [],
"skip_final_snapshot": true,
......@@ -495,7 +495,7 @@
"upgrade_storage_config": null,
"username": "postgres",
"vpc_security_group_ids": [
"sg-0501c21c134e1b1e5"
"sg-024d12e63d1848aa9"
]
},
"sensitive_attributes": [
......@@ -512,10 +512,9 @@
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"aws_security_group.sg_rds",
"aws_subnet.private_subnet_a",
"aws_subnet.private_subnet_b",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_subnet.private-a",
"data.aws_subnet.private-b",
"data.aws_vpc.this"
]
}
......@@ -536,8 +535,8 @@
"name": "kennethhugo_dev_rds_subnet_group",
"name_prefix": "",
"subnet_ids": [
"subnet-0052f34d50c7c6db5",
"subnet-063715ef5e9c6cb64"
"subnet-002aaa6589cef6028",
"subnet-0fc06a60f4305264c"
],
"supported_network_types": [
"IPV4"
......@@ -553,10 +552,8 @@
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"aws_subnet.private_subnet_a",
"aws_subnet.private_subnet_b",
"data.aws_availability_zones.available",
"data.aws_vpc.this"
"data.aws_subnet.private-a",
"data.aws_subnet.private-b"
]
}
]
......@@ -571,7 +568,7 @@
"schema_version": 1,
"attributes": {
"ami": "ami-03f3bb80e24b71cd8",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-04e9a490e913eb4aa",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-02e89522bfb642607",
"associate_public_ip_address": false,
"availability_zone": "eu-west-3a",
"capacity_reservation_specification": [
......@@ -610,7 +607,7 @@
"host_id": "",
"host_resource_group_arn": null,
"iam_instance_profile": "",
"id": "i-04e9a490e913eb4aa",
"id": "i-02e89522bfb642607",
"instance_initiated_shutdown_behavior": "stop",
"instance_lifecycle": "",
"instance_market_options": [],
......@@ -640,8 +637,8 @@
"password_data": "",
"placement_group": "",
"placement_partition_number": 0,
"primary_network_interface_id": "eni-043877caa26c09fd3",
"private_dns": "ip-10-0-35-75.eu-west-3.compute.internal",
"primary_network_interface_id": "eni-0a1ab6f36a391ccd9",
"private_dns": "ip-10-0-1-93.eu-west-3.compute.internal",
"private_dns_name_options": [
{
"enable_resource_name_dns_a_record": false,
......@@ -649,7 +646,7 @@
"hostname_type": "ip-name"
}
],
"private_ip": "10.0.35.75",
"private_ip": "10.0.1.93",
"public_dns": "",
"public_ip": "",
"root_block_device": [
......@@ -662,7 +659,7 @@
"tags": {},
"tags_all": {},
"throughput": 0,
"volume_id": "vol-0018f0ca34c3fd476",
"volume_id": "vol-04ebf95bebb7bd2e6",
"volume_size": 8,
"volume_type": "gp2"
}
......@@ -671,7 +668,7 @@
"security_groups": [],
"source_dest_check": true,
"spot_instance_request_id": "",
"subnet_id": "subnet-063715ef5e9c6cb64",
"subnet_id": "subnet-002aaa6589cef6028",
"tags": {
"Name": "KENNETHHUGO_DEV_API_VM"
},
......@@ -685,7 +682,7 @@
"user_data_replace_on_change": false,
"volume_tags": null,
"vpc_security_group_ids": [
"sg-08abb0531ca48d02b"
"sg-01d8d54afaa2f5990"
]
},
"sensitive_attributes": [],
......@@ -694,10 +691,9 @@
"aws_key_pair.ec2",
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"aws_subnet.private_subnet_a",
"data.aws_ami.amazon_linux_2",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_subnet.private-a",
"data.aws_vpc.this"
]
}
......@@ -713,7 +709,7 @@
"schema_version": 1,
"attributes": {
"ami": "ami-03f3bb80e24b71cd8",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-02e813c204183c9ab",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-0d38a82ef96bf25c8",
"associate_public_ip_address": false,
"availability_zone": "eu-west-3a",
"capacity_reservation_specification": [
......@@ -752,7 +748,7 @@
"host_id": "",
"host_resource_group_arn": null,
"iam_instance_profile": "",
"id": "i-02e813c204183c9ab",
"id": "i-0d38a82ef96bf25c8",
"instance_initiated_shutdown_behavior": "stop",
"instance_lifecycle": "",
"instance_market_options": [],
......@@ -782,8 +778,8 @@
"password_data": "",
"placement_group": "",
"placement_partition_number": 0,
"primary_network_interface_id": "eni-0ac8c529a1deb3ebb",
"private_dns": "ip-10-0-35-59.eu-west-3.compute.internal",
"primary_network_interface_id": "eni-048525466703b6e30",
"private_dns": "ip-10-0-1-17.eu-west-3.compute.internal",
"private_dns_name_options": [
{
"enable_resource_name_dns_a_record": false,
......@@ -791,7 +787,7 @@
"hostname_type": "ip-name"
}
],
"private_ip": "10.0.35.59",
"private_ip": "10.0.1.17",
"public_dns": "",
"public_ip": "",
"root_block_device": [
......@@ -804,7 +800,7 @@
"tags": {},
"tags_all": {},
"throughput": 0,
"volume_id": "vol-0ef9ef21efc35bacc",
"volume_id": "vol-0fe139030c8af9988",
"volume_size": 8,
"volume_type": "gp2"
}
......@@ -813,7 +809,7 @@
"security_groups": [],
"source_dest_check": true,
"spot_instance_request_id": "",
"subnet_id": "subnet-063715ef5e9c6cb64",
"subnet_id": "subnet-002aaa6589cef6028",
"tags": {
"Name": "KENNETHHUGO_DEV_CLIENT_VM"
},
......@@ -827,7 +823,7 @@
"user_data_replace_on_change": false,
"volume_tags": null,
"vpc_security_group_ids": [
"sg-046489925f564ec8c"
"sg-0d8ac4e5a30387e18"
]
},
"sensitive_attributes": [],
......@@ -835,10 +831,9 @@
"dependencies": [
"aws_key_pair.ec2",
"aws_security_group.sg_client",
"aws_subnet.private_subnet_a",
"data.aws_ami.amazon_linux_2",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_subnet.private-a",
"data.aws_vpc.this"
]
}
......@@ -858,10 +853,10 @@
"id": "kennethhugo_key",
"key_name": "kennethhugo_key",
"key_name_prefix": "",
"key_pair_id": "key-04e026cd6bf95d78f",
"key_pair_id": "key-0dc72c68c6af39fbb",
"key_type": "rsa",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdgUoVRIPCQHlBoaz6UfrvQ4gw2sxeV3PIgCmCSXUW+I9beSfrBs4ELbiuUsV33Y8rKRNQBxa60+J0bEwNtIXRARN7bfdVmukoIJ/LBPcj1XzjmcVE4RJCxSRQbiMYnbUG6Ps5m1sMXsGf0WoPuXIsYoRKHa4QtcqSqqm/G/BW4a0Kvwdfww2dYCKhNoniSPAnDGPowQpGzTc3nvO/ED7polY9T1b6kqaw5WSCWic/qUfgJ2Lxn+bus72vgelhqZhFSqJgTL2e3xPmqtmrUO/4U2kjF3YH120syEfvQFIg/PozQqfkupbDPB1Cx7/1ThZLpJT5Dv1I/kCuZQuNNZj7",
"tags": {},
"tags": null,
"tags_all": {}
},
"sensitive_attributes": [],
......@@ -878,10 +873,10 @@
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-021210d8e4366b0bd",
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-0c5ea597dc0f43e11",
"description": "ec2 Security Group",
"egress": [],
"id": "sg-021210d8e4366b0bd",
"id": "sg-0c5ea597dc0f43e11",
"ingress": [],
"name": "KENNETHHUGO_SG_EC2",
"name_prefix": "",
......@@ -914,7 +909,7 @@
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-08abb0531ca48d02b",
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-01d8d54afaa2f5990",
"description": "Managed by Terraform",
"egress": [
{
......@@ -922,6 +917,32 @@
"0.0.0.0/0"
],
"description": "Allow traffic to RDS (5432)",
"from_port": 443,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [],
"self": false,
"to_port": 443
},
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "Allow traffic to RDS (5432)",
"from_port": 80,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [],
"self": false,
"to_port": 80
},
{
"cidr_blocks": [
"10.0.1.0/24"
],
"description": "Allow traffic to RDS (5432)",
"from_port": 5432,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
......@@ -931,7 +952,7 @@
"to_port": 5432
}
],
"id": "sg-08abb0531ca48d02b",
"id": "sg-01d8d54afaa2f5990",
"ingress": [
{
"cidr_blocks": [],
......@@ -941,8 +962,8 @@
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-046489925f564ec8c",
"sg-0a7ccf14d1b6468fa"
"sg-0a7ccf14d1b6468fa",
"sg-0d8ac4e5a30387e18"
],
"self": false,
"to_port": 5000
......@@ -966,6 +987,7 @@
"dependencies": [
"aws_security_group.sg_client",
"data.aws_security_group.bastion",
"data.aws_subnet.private-a",
"data.aws_vpc.this"
]
}
......@@ -980,7 +1002,7 @@
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-046489925f564ec8c",
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-0d8ac4e5a30387e18",
"description": "Managed by Terraform",
"egress": [
{
......@@ -995,7 +1017,7 @@
"to_port": 80
}
],
"id": "sg-046489925f564ec8c",
"id": "sg-0d8ac4e5a30387e18",
"ingress": [
{
"cidr_blocks": [],
......@@ -1042,7 +1064,7 @@
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-0501c21c134e1b1e5",
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-024d12e63d1848aa9",
"description": "Managed by Terraform",
"egress": [
{
......@@ -1059,7 +1081,7 @@
"to_port": 0
}
],
"id": "sg-0501c21c134e1b1e5",
"id": "sg-024d12e63d1848aa9",
"ingress": [
{
"cidr_blocks": [],
......@@ -1069,7 +1091,7 @@
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-08abb0531ca48d02b",
"sg-01d8d54afaa2f5990",
"sg-0a7ccf14d1b6468fa"
],
"self": false,
......@@ -1095,6 +1117,7 @@
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"data.aws_security_group.bastion",
"data.aws_subnet.private-a",
"data.aws_vpc.this"
]
}
......@@ -1112,12 +1135,12 @@
"cidr_blocks": null,
"description": null,
"from_port": 22,
"id": "sgrule-2888270446",
"id": "sgrule-3761056161",
"ipv6_cidr_blocks": null,
"prefix_list_ids": null,
"protocol": "tcp",
"security_group_id": "sg-021210d8e4366b0bd",
"security_group_rule_id": "sgr-0bd2166515e8bdb08",
"security_group_id": "sg-0c5ea597dc0f43e11",
"security_group_rule_id": "sgr-0b47fae14beb384ea",
"self": false,
"source_security_group_id": "sg-0a7ccf14d1b6468fa",
"timeouts": null,
......@@ -1146,12 +1169,12 @@
"cidr_blocks": null,
"description": "SSH from Bastion to API",
"from_port": 22,
"id": "sgrule-922087700",
"id": "sgrule-3893508927",
"ipv6_cidr_blocks": null,
"prefix_list_ids": null,
"protocol": "tcp",
"security_group_id": "sg-08abb0531ca48d02b",
"security_group_rule_id": "sgr-021ea52c24d07985f",
"security_group_id": "sg-01d8d54afaa2f5990",
"security_group_rule_id": "sgr-09515b862f42d0f70",
"self": false,
"source_security_group_id": "sg-0a7ccf14d1b6468fa",
"timeouts": null,
......@@ -1164,98 +1187,7 @@
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_subnet",
"name": "private_subnet_a",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-063715ef5e9c6cb64",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"cidr_block": "10.0.35.0/24",
"customer_owned_ipv4_pool": "",
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"id": "subnet-063715ef5e9c6cb64",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": false,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"tags": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_A"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_A"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"data.aws_availability_zones.available",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_subnet",
"name": "private_subnet_b",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-0052f34d50c7c6db5",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3b",
"availability_zone_id": "euw3-az2",
"cidr_block": "10.0.36.0/24",
"customer_owned_ipv4_pool": "",
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"id": "subnet-0052f34d50c7c6db5",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": true,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"tags": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_B"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_B"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"data.aws_availability_zones.available",
"data.aws_subnet.private-a",
"data.aws_vpc.this"
]
}
......
{
"version": 4,
"terraform_version": "1.10.5",
"serial": 108,
"serial": 228,
"lineage": "eded4345-a67f-9a4a-9ad8-c68c205f47c2",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "aws_ami",
"name": "amazon_linux_2",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"architecture": "x86_64",
"arn": "arn:aws:ec2:eu-west-3::image/ami-03f3bb80e24b71cd8",
"block_device_mappings": [
{
"device_name": "/dev/xvda",
"ebs": {
"delete_on_termination": "true",
"encrypted": "false",
"iops": "0",
"snapshot_id": "snap-07655f7a65903bcc5",
"throughput": "0",
"volume_size": "8",
"volume_type": "gp2"
},
"no_device": "",
"virtual_name": ""
}
],
"boot_mode": "",
"creation_date": "2025-01-23T03:26:36.000Z",
"deprecation_time": "2025-07-01T00:00:00.000Z",
"description": "Amazon Linux 2 AMI 2.0.20250123.4 x86_64 HVM gp2",
"ena_support": true,
"executable_users": null,
"filter": [
{
"name": "name",
"values": [
"amzn2-ami-hvm*"
]
},
{
"name": "owner-alias",
"values": [
"amazon"
]
}
],
"hypervisor": "xen",
"id": "ami-03f3bb80e24b71cd8",
"image_id": "ami-03f3bb80e24b71cd8",
"image_location": "amazon/amzn2-ami-hvm-2.0.20250123.4-x86_64-gp2",
"image_owner_alias": "amazon",
"image_type": "machine",
"imds_support": "",
"include_deprecated": false,
"kernel_id": "",
"most_recent": true,
"name": "amzn2-ami-hvm-2.0.20250123.4-x86_64-gp2",
"name_regex": null,
"owner_id": "137112412989",
"owners": null,
"platform": "",
"platform_details": "Linux/UNIX",
"product_codes": [],
"public": true,
"ramdisk_id": "",
"root_device_name": "/dev/xvda",
"root_device_type": "ebs",
"root_snapshot_id": "snap-07655f7a65903bcc5",
"sriov_net_support": "simple",
"state": "available",
"state_reason": {
"code": "UNSET",
"message": "UNSET"
},
"tags": {},
"timeouts": null,
"tpm_support": "",
"uefi_data": null,
"usage_operation": "RunInstances",
"virtualization_type": "hvm"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_availability_zones",
"name": "available",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"all_availability_zones": null,
"exclude_names": null,
"exclude_zone_ids": null,
"filter": null,
"group_names": [
"eu-west-3-zg-1"
],
"id": "eu-west-3",
"names": [
"eu-west-3a",
"eu-west-3b",
"eu-west-3c"
],
"state": "available",
"timeouts": null,
"zone_ids": [
"euw3-az1",
"euw3-az2",
"euw3-az3"
]
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_security_group",
"name": "bastion",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-0a7ccf14d1b6468fa",
"description": "ec2 Security Group",
"filter": [
{
"name": "tag:Name",
"values": [
"SG_BASTION_EC2"
]
}
],
"id": "sg-0a7ccf14d1b6468fa",
"name": "SG_BASTION_EC2",
"tags": {
"Name": "SG_BASTION_EC2"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_subnet",
"name": "private-a",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-002aaa6589cef6028",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"available_ip_address_count": 241,
"cidr_block": "10.0.1.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"filter": [
{
"name": "tag:Name",
"values": [
"PRIVATE_SUBNET_A"
]
}
],
"id": "subnet-002aaa6589cef6028",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": false,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"state": "available",
"tags": {
"Name": "PRIVATE_SUBNET_A",
"Private": "yes"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_subnet",
"name": "private-b",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-0fc06a60f4305264c",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3b",
"availability_zone_id": "euw3-az2",
"available_ip_address_count": 246,
"cidr_block": "10.0.2.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"filter": [
{
"name": "tag:Name",
"values": [
"PRIVATE_SUBNET_B"
]
}
],
"id": "subnet-0fc06a60f4305264c",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": false,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"state": "available",
"tags": {
"Name": "PRIVATE_SUBNET_B",
"Private": "yes"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_subnet",
"name": "public",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-0d9d21b769bca92d7",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"available_ip_address_count": 248,
"cidr_block": "10.0.0.0/24",
"customer_owned_ipv4_pool": "",
"default_for_az": false,
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"filter": [
{
"name": "tag:Name",
"values": [
"PUBLIC_SUBNET"
]
}
],
"id": "subnet-0d9d21b769bca92d7",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": false,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"state": "available",
"tags": {
"Name": "PUBLIC_SUBNET",
"Private": "no"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": []
}
]
},
{
"mode": "data",
"type": "aws_vpc",
"name": "this",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:vpc/vpc-08da87242304c9723",
"cidr_block": "10.0.0.0/16",
"cidr_block_associations": [
{
"association_id": "vpc-cidr-assoc-0fd519069ef9f4ba9",
"cidr_block": "10.0.0.0/16",
"state": "associated"
}
],
"default": false,
"dhcp_options_id": "dopt-06fac3b0fae017c99",
"enable_dns_hostnames": false,
"enable_dns_support": true,
"enable_network_address_usage_metrics": false,
"filter": [
{
"name": "tag:Name",
"values": [
"VPC"
]
}
],
"id": "vpc-08da87242304c9723",
"instance_tenancy": "default",
"ipv6_association_id": "",
"ipv6_cidr_block": "",
"main_route_table_id": "rtb-06b8cc99d46258d59",
"owner_id": "920373009484",
"state": null,
"tags": {
"Name": "VPC"
},
"timeouts": null
},
"sensitive_attributes": []
}
]
},
{
"mode": "managed",
"type": "aws_db_instance",
"name": "mydb",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 2,
"attributes": {
"address": "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com",
"allocated_storage": 5,
"allow_major_version_upgrade": null,
"apply_immediately": false,
"arn": "arn:aws:rds:eu-west-3:920373009484:db:kennethhugo-dev-rds-instance",
"auto_minor_version_upgrade": true,
"availability_zone": "eu-west-3a",
"backup_retention_period": 0,
"backup_target": "region",
"backup_window": "08:12-08:42",
"blue_green_update": [],
"ca_cert_identifier": "rds-ca-rsa2048-g1",
"character_set_name": "",
"copy_tags_to_snapshot": false,
"custom_iam_instance_profile": "",
"customer_owned_ip_enabled": false,
"db_name": "mydb_HK",
"db_subnet_group_name": "kennethhugo_dev_rds_subnet_group",
"dedicated_log_volume": false,
"delete_automated_backups": true,
"deletion_protection": false,
"domain": "",
"domain_auth_secret_arn": "",
"domain_dns_ips": [],
"domain_fqdn": "",
"domain_iam_role_name": "",
"domain_ou": "",
"enabled_cloudwatch_logs_exports": [],
"endpoint": "kennethhugo-dev-rds-instance.cx4q20s8stp5.eu-west-3.rds.amazonaws.com:5432",
"engine": "postgres",
"engine_lifecycle_support": "open-source-rds-extended-support",
"engine_version": "14.15",
"engine_version_actual": "14.15",
"final_snapshot_identifier": null,
"hosted_zone_id": "ZMESEXB7ZGGQ3",
"iam_database_authentication_enabled": false,
"id": "db-OVJD44ND4UJCBJPN7LPVEZT6CE",
"identifier": "kennethhugo-dev-rds-instance",
"identifier_prefix": "",
"instance_class": "db.t3.micro",
"iops": 0,
"kms_key_id": "",
"latest_restorable_time": "",
"license_model": "postgresql-license",
"listener_endpoint": [],
"maintenance_window": "sun:05:13-sun:05:43",
"manage_master_user_password": null,
"master_user_secret": [],
"master_user_secret_kms_key_id": null,
"max_allocated_storage": 0,
"monitoring_interval": 0,
"monitoring_role_arn": "",
"multi_az": false,
"nchar_character_set_name": "",
"network_type": "IPV4",
"option_group_name": "default:postgres-14",
"parameter_group_name": "default.postgres14",
"password": "mysecretpassword",
"performance_insights_enabled": false,
"performance_insights_kms_key_id": "",
"performance_insights_retention_period": 0,
"port": 5432,
"publicly_accessible": false,
"replica_mode": "",
"replicas": [],
"replicate_source_db": "",
"resource_id": "db-OVJD44ND4UJCBJPN7LPVEZT6CE",
"restore_to_point_in_time": [],
"s3_import": [],
"skip_final_snapshot": true,
"snapshot_identifier": null,
"status": "available",
"storage_encrypted": false,
"storage_throughput": 0,
"storage_type": "gp2",
"tags": {
"Name": "KENNETHHUGO_DEV_RDS_INSTANCE"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_RDS_INSTANCE"
},
"timeouts": null,
"timezone": "",
"upgrade_storage_config": null,
"username": "postgres",
"vpc_security_group_ids": [
"sg-0501c21c134e1b1e5"
]
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "password"
}
]
],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInVwZGF0ZSI6NDgwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9",
"dependencies": [
"aws_db_subnet_group.this",
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"aws_security_group.sg_rds",
"aws_subnet.private_subnet_a",
"aws_subnet.private_subnet_b",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_db_subnet_group",
"name": "this",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:rds:eu-west-3:920373009484:subgrp:kennethhugo_dev_rds_subnet_group",
"description": "Managed by Terraform",
"id": "kennethhugo_dev_rds_subnet_group",
"name": "kennethhugo_dev_rds_subnet_group",
"name_prefix": "",
"subnet_ids": [
"subnet-0052f34d50c7c6db5",
"subnet-063715ef5e9c6cb64"
],
"supported_network_types": [
"IPV4"
],
"tags": {
"Name": "KENNETHHUGO_DEV_RDS_SUBNET_GROUP"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_RDS_SUBNET_GROUP"
},
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"aws_subnet.private_subnet_a",
"aws_subnet.private_subnet_b",
"data.aws_availability_zones.available",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_instance",
"name": "api",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"ami": "ami-03f3bb80e24b71cd8",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-04e9a490e913eb4aa",
"associate_public_ip_address": false,
"availability_zone": "eu-west-3a",
"capacity_reservation_specification": [
{
"capacity_reservation_preference": "open",
"capacity_reservation_target": []
}
],
"cpu_core_count": 1,
"cpu_options": [
{
"amd_sev_snp": "",
"core_count": 1,
"threads_per_core": 1
}
],
"cpu_threads_per_core": 1,
"credit_specification": [
{
"cpu_credits": "standard"
}
],
"disable_api_stop": false,
"disable_api_termination": false,
"ebs_block_device": [],
"ebs_optimized": false,
"enable_primary_ipv6": null,
"enclave_options": [
{
"enabled": false
}
],
"ephemeral_block_device": [],
"get_password_data": false,
"hibernation": false,
"host_id": "",
"host_resource_group_arn": null,
"iam_instance_profile": "",
"id": "i-04e9a490e913eb4aa",
"instance_initiated_shutdown_behavior": "stop",
"instance_lifecycle": "",
"instance_market_options": [],
"instance_state": "running",
"instance_type": "t2.micro",
"ipv6_address_count": 0,
"ipv6_addresses": [],
"key_name": "kennethhugo_key",
"launch_template": [],
"maintenance_options": [
{
"auto_recovery": "default"
}
],
"metadata_options": [
{
"http_endpoint": "enabled",
"http_protocol_ipv6": "disabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional",
"instance_metadata_tags": "disabled"
}
],
"monitoring": false,
"network_interface": [],
"outpost_arn": "",
"password_data": "",
"placement_group": "",
"placement_partition_number": 0,
"primary_network_interface_id": "eni-043877caa26c09fd3",
"private_dns": "ip-10-0-35-75.eu-west-3.compute.internal",
"private_dns_name_options": [
{
"enable_resource_name_dns_a_record": false,
"enable_resource_name_dns_aaaa_record": false,
"hostname_type": "ip-name"
}
],
"private_ip": "10.0.35.75",
"public_dns": "",
"public_ip": "",
"root_block_device": [
{
"delete_on_termination": true,
"device_name": "/dev/xvda",
"encrypted": false,
"iops": 100,
"kms_key_id": "",
"tags": {},
"tags_all": {},
"throughput": 0,
"volume_id": "vol-0018f0ca34c3fd476",
"volume_size": 8,
"volume_type": "gp2"
}
],
"secondary_private_ips": [],
"security_groups": [],
"source_dest_check": true,
"spot_instance_request_id": "",
"subnet_id": "subnet-063715ef5e9c6cb64",
"tags": {
"Name": "KENNETHHUGO_DEV_API_VM"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_API_VM"
},
"tenancy": "default",
"timeouts": null,
"user_data": null,
"user_data_base64": null,
"user_data_replace_on_change": false,
"volume_tags": null,
"vpc_security_group_ids": [
"sg-08abb0531ca48d02b"
]
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"aws_key_pair.ec2",
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"aws_subnet.private_subnet_a",
"data.aws_ami.amazon_linux_2",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_instance",
"name": "client",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"ami": "ami-03f3bb80e24b71cd8",
"arn": "arn:aws:ec2:eu-west-3:920373009484:instance/i-02e813c204183c9ab",
"associate_public_ip_address": false,
"availability_zone": "eu-west-3a",
"capacity_reservation_specification": [
{
"capacity_reservation_preference": "open",
"capacity_reservation_target": []
}
],
"cpu_core_count": 1,
"cpu_options": [
{
"amd_sev_snp": "",
"core_count": 1,
"threads_per_core": 1
}
],
"cpu_threads_per_core": 1,
"credit_specification": [
{
"cpu_credits": "standard"
}
],
"disable_api_stop": false,
"disable_api_termination": false,
"ebs_block_device": [],
"ebs_optimized": false,
"enable_primary_ipv6": null,
"enclave_options": [
{
"enabled": false
}
],
"ephemeral_block_device": [],
"get_password_data": false,
"hibernation": false,
"host_id": "",
"host_resource_group_arn": null,
"iam_instance_profile": "",
"id": "i-02e813c204183c9ab",
"instance_initiated_shutdown_behavior": "stop",
"instance_lifecycle": "",
"instance_market_options": [],
"instance_state": "running",
"instance_type": "t2.micro",
"ipv6_address_count": 0,
"ipv6_addresses": [],
"key_name": "kennethhugo_key",
"launch_template": [],
"maintenance_options": [
{
"auto_recovery": "default"
}
],
"metadata_options": [
{
"http_endpoint": "enabled",
"http_protocol_ipv6": "disabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional",
"instance_metadata_tags": "disabled"
}
],
"monitoring": false,
"network_interface": [],
"outpost_arn": "",
"password_data": "",
"placement_group": "",
"placement_partition_number": 0,
"primary_network_interface_id": "eni-0ac8c529a1deb3ebb",
"private_dns": "ip-10-0-35-59.eu-west-3.compute.internal",
"private_dns_name_options": [
{
"enable_resource_name_dns_a_record": false,
"enable_resource_name_dns_aaaa_record": false,
"hostname_type": "ip-name"
}
],
"private_ip": "10.0.35.59",
"public_dns": "",
"public_ip": "",
"root_block_device": [
{
"delete_on_termination": true,
"device_name": "/dev/xvda",
"encrypted": false,
"iops": 100,
"kms_key_id": "",
"tags": {},
"tags_all": {},
"throughput": 0,
"volume_id": "vol-0ef9ef21efc35bacc",
"volume_size": 8,
"volume_type": "gp2"
}
],
"secondary_private_ips": [],
"security_groups": [],
"source_dest_check": true,
"spot_instance_request_id": "",
"subnet_id": "subnet-063715ef5e9c6cb64",
"tags": {
"Name": "KENNETHHUGO_DEV_CLIENT_VM"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_CLIENT_VM"
},
"tenancy": "default",
"timeouts": null,
"user_data": null,
"user_data_base64": null,
"user_data_replace_on_change": false,
"volume_tags": null,
"vpc_security_group_ids": [
"sg-046489925f564ec8c"
]
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMCwicmVhZCI6OTAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"aws_key_pair.ec2",
"aws_security_group.sg_client",
"aws_subnet.private_subnet_a",
"data.aws_ami.amazon_linux_2",
"data.aws_availability_zones.available",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_key_pair",
"name": "ec2",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:key-pair/kennethhugo_key",
"fingerprint": "a0:93:64:56:10:f9:c5:24:e8:83:68:f5:4f:db:83:fd",
"id": "kennethhugo_key",
"key_name": "kennethhugo_key",
"key_name_prefix": "",
"key_pair_id": "key-04e026cd6bf95d78f",
"key_type": "rsa",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdgUoVRIPCQHlBoaz6UfrvQ4gw2sxeV3PIgCmCSXUW+I9beSfrBs4ELbiuUsV33Y8rKRNQBxa60+J0bEwNtIXRARN7bfdVmukoIJ/LBPcj1XzjmcVE4RJCxSRQbiMYnbUG6Ps5m1sMXsGf0WoPuXIsYoRKHa4QtcqSqqm/G/BW4a0Kvwdfww2dYCKhNoniSPAnDGPowQpGzTc3nvO/ED7polY9T1b6kqaw5WSCWic/qUfgJ2Lxn+bus72vgelhqZhFSqJgTL2e3xPmqtmrUO/4U2kjF3YH120syEfvQFIg/PozQqfkupbDPB1Cx7/1ThZLpJT5Dv1I/kCuZQuNNZj7",
"tags": null,
"tags_all": {}
},
"sensitive_attributes": [],
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
},
{
"mode": "managed",
"type": "aws_security_group",
"name": "sg_api",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-08abb0531ca48d02b",
"description": "Managed by Terraform",
"egress": [
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "Allow traffic to RDS (5432)",
"from_port": 5432,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [],
"self": false,
"to_port": 5432
}
],
"id": "sg-08abb0531ca48d02b",
"ingress": [
{
"cidr_blocks": [],
"description": "Allow API requests from client",
"from_port": 5000,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-046489925f564ec8c",
"sg-0a7ccf14d1b6468fa"
],
"self": false,
"to_port": 5000
}
],
"name": "KENNETHHUGO_DEV_SG_API",
"name_prefix": "",
"owner_id": "920373009484",
"revoke_rules_on_delete": false,
"tags": {
"Name": "KENNETHHUGO_DEV_SG_API"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_SG_API"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=",
"dependencies": [
"aws_security_group.sg_client",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_security_group",
"name": "sg_client",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-046489925f564ec8c",
"description": "Managed by Terraform",
"egress": [
{
"cidr_blocks": [],
"description": "",
"from_port": 80,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [],
"self": false,
"to_port": 80
}
],
"id": "sg-046489925f564ec8c",
"ingress": [
{
"cidr_blocks": [],
"description": "Allow HTTP from anywhere",
"from_port": 80,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-0a7ccf14d1b6468fa"
],
"self": false,
"to_port": 80
}
],
"name": "KENNETHHUGO_DEV_SG_CLIENT",
"name_prefix": "",
"owner_id": "920373009484",
"revoke_rules_on_delete": false,
"tags": {
"Name": "KENNETHHUGO_DEV_SG_CLIENT"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_SG_CLIENT"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=",
"dependencies": [
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_security_group",
"name": "sg_rds",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:security-group/sg-0501c21c134e1b1e5",
"description": "Managed by Terraform",
"egress": [
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "",
"from_port": 0,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "-1",
"security_groups": [],
"self": false,
"to_port": 0
}
],
"id": "sg-0501c21c134e1b1e5",
"ingress": [
{
"cidr_blocks": [],
"description": "Allow Postgres from API",
"from_port": 5432,
"ipv6_cidr_blocks": [],
"prefix_list_ids": [],
"protocol": "tcp",
"security_groups": [
"sg-08abb0531ca48d02b",
"sg-0a7ccf14d1b6468fa"
],
"self": false,
"to_port": 5432
}
],
"name": "KENNETHHUGO_DEV_SG_RDS",
"name_prefix": "",
"owner_id": "920373009484",
"revoke_rules_on_delete": false,
"tags": {
"Name": "KENNETHHUGO_DEV_SG_RDS"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_SG_RDS"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6OTAwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIxIn0=",
"dependencies": [
"aws_security_group.sg_api",
"aws_security_group.sg_client",
"data.aws_security_group.bastion",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_subnet",
"name": "private_subnet_a",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-063715ef5e9c6cb64",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3a",
"availability_zone_id": "euw3-az1",
"cidr_block": "10.0.35.0/24",
"customer_owned_ipv4_pool": "",
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"id": "subnet-063715ef5e9c6cb64",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": false,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"tags": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_A"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_A"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"data.aws_availability_zones.available",
"data.aws_vpc.this"
]
}
]
},
{
"mode": "managed",
"type": "aws_subnet",
"name": "private_subnet_b",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ec2:eu-west-3:920373009484:subnet/subnet-0052f34d50c7c6db5",
"assign_ipv6_address_on_creation": false,
"availability_zone": "eu-west-3b",
"availability_zone_id": "euw3-az2",
"cidr_block": "10.0.36.0/24",
"customer_owned_ipv4_pool": "",
"enable_dns64": false,
"enable_lni_at_device_index": 0,
"enable_resource_name_dns_a_record_on_launch": false,
"enable_resource_name_dns_aaaa_record_on_launch": false,
"id": "subnet-0052f34d50c7c6db5",
"ipv6_cidr_block": "",
"ipv6_cidr_block_association_id": "",
"ipv6_native": false,
"map_customer_owned_ip_on_launch": false,
"map_public_ip_on_launch": true,
"outpost_arn": "",
"owner_id": "920373009484",
"private_dns_hostname_type_on_launch": "ip-name",
"tags": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_B"
},
"tags_all": {
"Name": "KENNETHHUGO_DEV_PRIVATE_SUBNET_B"
},
"timeouts": null,
"vpc_id": "vpc-08da87242304c9723"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9",
"dependencies": [
"data.aws_availability_zones.available",
"data.aws_vpc.this"
]
}
]
}
],
"resources": [],
"check_results": null
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment