Skip to content

Commit

Permalink
tests/appstream/fleet: Update subnet configs, timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 22, 2021
1 parent 84d1b94 commit b769f29
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 30 deletions.
4 changes: 2 additions & 2 deletions aws/internal/service/appstream/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const (
StackOperationTimeout = 4 * time.Minute

// FleetStateTimeout Maximum amount of time to wait for the FleetState to be RUNNING or STOPPED
FleetStateTimeout = 60 * time.Minute
FleetStateTimeout = 180 * time.Minute
// FleetOperationTimeout Maximum amount of time to wait for Fleet operation eventual consistency
FleetOperationTimeout = 4 * time.Minute
FleetOperationTimeout = 15 * time.Minute
)

// StackStateDeleted waits for a deleted stack
Expand Down
71 changes: 43 additions & 28 deletions aws/resource_aws_appstream_fleet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,18 @@ resource "aws_appstream_fleet" "test" {
}

func testAccAwsAppStreamFleetConfigComplete(name, description, fleetType, instanceType string) string {
return fmt.Sprintf(`
data "aws_availability_zones" "available" {
state = "available"
}
resource "aws_vpc" "example" {
cidr_block = "192.168.0.0/16"
return composeConfig(
testAccAvailableAZsNoOptInConfig(),
fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "example" {
availability_zone = data.aws_availability_zones.available.names[0]
cidr_block = "192.168.0.0/24"
vpc_id = aws_vpc.example.id
resource "aws_subnet" "test" {
count = 2
availability_zone = data.aws_availability_zones.available.names[count.index]
cidr_block = "10.0.${count.index}.0/24"
vpc_id = aws_vpc.test.id
}
resource "aws_appstream_fleet" "test" {
Expand All @@ -342,26 +341,25 @@ resource "aws_appstream_fleet" "test" {
max_user_duration_in_seconds = 1000
vpc_config {
subnet_ids = [aws_subnet.example.id]
subnet_ids = aws_subnet.test.*.id
}
}
`, name, description, fleetType, instanceType)
`, name, description, fleetType, instanceType))
}

func testAccAwsAppStreamFleetConfigCompleteWithoutStopping(name, description, fleetType, instanceType, displayName string) string {
return fmt.Sprintf(`
data "aws_availability_zones" "available" {
state = "available"
return composeConfig(
testAccAvailableAZsNoOptInConfig(),
fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
}
resource "aws_vpc" "example" {
cidr_block = "192.168.0.0/16"
}
resource "aws_subnet" "example" {
availability_zone = data.aws_availability_zones.available.names[0]
cidr_block = "192.168.0.0/24"
vpc_id = aws_vpc.example.id
resource "aws_subnet" "test" {
count = 2
availability_zone = data.aws_availability_zones.available.names[count.index]
cidr_block = "10.0.${count.index}.0/24"
vpc_id = aws_vpc.test.id
}
resource "aws_appstream_fleet" "test" {
Expand All @@ -381,14 +379,27 @@ resource "aws_appstream_fleet" "test" {
max_user_duration_in_seconds = 1000
vpc_config {
subnet_ids = [aws_subnet.example.id]
subnet_ids = aws_subnet.test.*.id
}
}
`, name, description, fleetType, instanceType, displayName)
`, name, description, fleetType, instanceType, displayName))
}

func testAccAwsAppStreamFleetConfigWithTags(name, description, fleetType, instanceType, displayName string) string {
return fmt.Sprintf(`
return composeConfig(
testAccAvailableAZsNoOptInConfig(),
fmt.Sprintf(`
resource "aws_vpc" "test" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "test" {
count = 2
availability_zone = data.aws_availability_zones.available.names[count.index]
cidr_block = "10.0.${count.index}.0/24"
vpc_id = aws_vpc.test.id
}
resource "aws_appstream_fleet" "test" {
name = %[1]q
image_name = "Amazon-AppStream2-Sample-Image-02-04-2019"
Expand All @@ -408,6 +419,10 @@ resource "aws_appstream_fleet" "test" {
tags = {
Key = "value"
}
vpc_config {
subnet_ids = aws_subnet.test.*.id
}
}
`, name, description, fleetType, instanceType, displayName)
`, name, description, fleetType, instanceType, displayName))
}

0 comments on commit b769f29

Please sign in to comment.