作者:夏目nyako酱丶 | 来源:互联网 | 2023-10-16 20:26
Terraform Version
Terraform v0.9.11
Affected Resource(s)
Please list the resources as a list, for example:
- aws_alb
Terraform Configuration Files
Input variable subnet/security_groups is a comma-separated list of ids coming from a data source. Setting default to see example
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| hcl
variable "security_groups" {
default = "sg-12345678"
}
variable "subnets" {
default = "subnet-12345678,subnet-87654321"
}
resource "aws_alb" "alb" {
name = "alb-test"
internal = "false"
security_groups = ["${var.security_groups}"]
subnets = ["${var.subnets}"]
} |
Expected Behavior
Plan should see two subnets with different IDs
Actual Behavior
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| + module.alb.aws_alb.alb
arn: ""
arn_suffix: ""
dns_name: ""
enable_deletion_protection: "false"
idle_timeout: "60"
internal: "false"
ip_address_type: ""
name: "alb-test"
security_groups.#: "1"
security_groups.4279578247: "sg-12345678"
subnets.#: "1"
subnets.2530630612: "subnet-65d0d813,subnet-e159bd86"
vpc_id: ""
zone_id: ""
|
Terraform apply then fails with the error
1
| aws_alb.alb: Error creating Application Load Balancer: ValidationError: At least two subnets in two different Availability Zones must be specified |
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
1.
2.
该提问来源于开源项目:hashicorp/terraform-provider-aws
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!