Skip to content

Commit

Permalink
Add availability zone config func
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Aug 11, 2020
1 parent 2e94da5 commit ada6d8d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions aws/resource_aws_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3280,6 +3280,19 @@ data "aws_availability_zones" "available" {
`, strings.Join(excludeZoneIds, "\", \""))
}

func testAccAvailableAZsNoOptInConfig() string {
return `
data "aws_availability_zones" "available" {
state = "available"
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}
`
}

func testAccInstanceConfigInDefaultVpcBySgName(rName string) string {
return testAccAvailableAZsNoOptInDefaultExcludeConfig() +
testAccLatestAmazonLinuxHvmEbsAmiConfig() +
Expand Down Expand Up @@ -4886,16 +4899,7 @@ resource "aws_subnet" "test" {
}

func testAccAwsInstanceVpcConfigBasic(rName string) string {
return fmt.Sprintf(`
data "aws_availability_zones" "available" {
state = "available"
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}
return testAccAvailableAZsNoOptInConfig() + fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
Expand Down

0 comments on commit ada6d8d

Please sign in to comment.