mirror of
https://github.com/mr-vercetti/tf-aws-demo.git
synced 2025-01-18 19:35:34 +01:00
41 lines
713 B
Terraform
41 lines
713 B
Terraform
|
data "aws_vpc" "vpc" {
|
||
|
tags = {
|
||
|
Name = var.VPC_NAME
|
||
|
}
|
||
|
}
|
||
|
|
||
|
data "aws_subnets" "private_subnets" {
|
||
|
filter {
|
||
|
name = "vpc-id"
|
||
|
values = [data.aws_vpc.vpc.id]
|
||
|
}
|
||
|
|
||
|
filter {
|
||
|
name = "tag:Name"
|
||
|
values = ["${var.VPC_NAME}-private*"]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
data "aws_subnets" "public_subnets" {
|
||
|
filter {
|
||
|
name = "vpc-id"
|
||
|
values = [data.aws_vpc.vpc.id]
|
||
|
}
|
||
|
|
||
|
filter {
|
||
|
name = "tag:Name"
|
||
|
values = ["${var.VPC_NAME}-public*"]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
data "aws_subnet" "bastion_host_subnet" {
|
||
|
filter {
|
||
|
name = "vpc-id"
|
||
|
values = [data.aws_vpc.vpc.id]
|
||
|
}
|
||
|
|
||
|
filter {
|
||
|
name = "tag:Name"
|
||
|
values = ["${var.VPC_NAME}-public-${var.BASTION_HOST_AZ}"]
|
||
|
}
|
||
|
}
|