Я пытаюсь создать простой AWS_ALB через terraform, я создал отдельный VP C с publi c и частными подсетями, но создание ALB дает мне invalidSu bnet error
resource "aws_alb" "test" {
name = "test-alb-tf"
internal = false
security_groups = ["sg-0385b126e18d3ca67"]
subnets = ["192.168.11.0/24"]
}
Publi c подсети создаются, как показано ниже
{
"MapPublicIpOnLaunch": true,
"AvailabilityZoneId": "use1-az2",
"Tags": [
{
"Value": "staging",
"Key": "Environment"
},
{
"Value": "secure-public-us-east-1a",
"Key": "Name"
},
{
"Value": "true",
"Key": "Terraform"
}
],
"AvailableIpAddressCount": 250,
"DefaultForAz": false,
"SubnetArn": "arn:aws:ec2:us-east-1:041840987519:subnet/subnet-03757baf0df052c07",
"Ipv6CidrBlockAssociationSet": [],
"VpcId": "vpc-00689d5ff034a0c99",
"State": "available",
"AvailabilityZone": "us-east-1a",
"SubnetId": "subnet-03757baf0df052c07",
"OwnerId": "041840987519",
"CidrBlock": "192.168.11.0/24",
"AssignIpv6AddressOnCreation": false
},
Это то, что показывает план terraform
# aws_alb.test will be created
+ resource "aws_alb" "test" {
+ arn = (known after apply)
+ arn_suffix = (known after apply)
+ dns_name = (known after apply)
+ enable_deletion_protection = false
+ enable_http2 = true
+ id = (known after apply)
+ idle_timeout = 60
+ internal = false
+ ip_address_type = (known after apply)
+ load_balancer_type = "application"
+ name = "test-alb-tf"
+ security_groups = [
+ "sg-0385b126e18d3ca67",
]
+ subnets = [
+ "192.168.11.0/24",
]
+ vpc_id = (known after apply)
+ zone_id = (known after apply)
+ subnet_mapping {
+ allocation_id = (known after apply)
+ subnet_id = (known after apply)
}
}
, и это ошибка, которую я получаю
Error: Error creating application Load Balancer: InvalidSubnet: The subnet ID '192.168.11.0/24' is not valid
status code: 400, request id: 5521ae30-dc0b-4f4c-ae89-47eb729126c7
Кто-нибудь понял, что мне не хватает