Merge pull request #5058 from tpounds/cleanup-aws-asg-acc-tests
provider/aws: Cleanup ASG acceptance tests
This commit is contained in:
commit
571027bae6
|
@ -89,7 +89,6 @@ func TestAccAWSAutoScalingGroup_autoGeneratedName(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccAWSAutoScalingGroup_tags(t *testing.T) {
|
func TestAccAWSAutoScalingGroup_tags(t *testing.T) {
|
||||||
|
@ -153,13 +152,11 @@ func TestAccAWSAutoScalingGroup_VpcUpdates(t *testing.T) {
|
||||||
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
|
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
|
||||||
testAccCheckAWSAutoScalingGroupAttributesVPCZoneIdentifer(&group),
|
testAccCheckAWSAutoScalingGroupAttributesVPCZoneIdentifer(&group),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_autoscaling_group.bar", "availability_zones.#", "2"),
|
"aws_autoscaling_group.bar", "availability_zones.#", "1"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_autoscaling_group.bar", "availability_zones.2487133097", "us-west-2a"),
|
"aws_autoscaling_group.bar", "availability_zones.2487133097", "us-west-2a"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_autoscaling_group.bar", "availability_zones.221770259", "us-west-2b"),
|
"aws_autoscaling_group.bar", "vpc_zone_identifier.#", "1"),
|
||||||
resource.TestCheckResourceAttr(
|
|
||||||
"aws_autoscaling_group.bar", "vpc_zone_identifier.#", "2"),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -411,21 +408,10 @@ resource "aws_launch_configuration" "foobar" {
|
||||||
|
|
||||||
resource "aws_autoscaling_group" "bar" {
|
resource "aws_autoscaling_group" "bar" {
|
||||||
availability_zones = ["us-west-2a"]
|
availability_zones = ["us-west-2a"]
|
||||||
max_size = 1
|
desired_capacity = 0
|
||||||
min_size = 1
|
max_size = 0
|
||||||
health_check_grace_period = 300
|
min_size = 0
|
||||||
health_check_type = "ELB"
|
|
||||||
desired_capacity = 1
|
|
||||||
force_delete = true
|
|
||||||
termination_policies = ["OldestInstance","ClosestToNextInstanceHour"]
|
|
||||||
|
|
||||||
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
||||||
|
|
||||||
tag {
|
|
||||||
key = "Foo"
|
|
||||||
value = "foo-bar"
|
|
||||||
propagate_at_launch = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -589,29 +575,18 @@ resource "aws_subnet" "main" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_subnet" "alt" {
|
|
||||||
vpc_id = "${aws_vpc.default.id}"
|
|
||||||
cidr_block = "10.0.2.0/24"
|
|
||||||
availability_zone = "us-west-2b"
|
|
||||||
tags {
|
|
||||||
Name = "asg-vpc-thing"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_launch_configuration" "foobar" {
|
resource "aws_launch_configuration" "foobar" {
|
||||||
image_id = "ami-b5b3fc85"
|
image_id = "ami-b5b3fc85"
|
||||||
instance_type = "t2.micro"
|
instance_type = "t2.micro"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_autoscaling_group" "bar" {
|
resource "aws_autoscaling_group" "bar" {
|
||||||
availability_zones = ["us-west-2a"]
|
availability_zones = [
|
||||||
max_size = 2
|
"us-west-2a"
|
||||||
min_size = 1
|
]
|
||||||
health_check_grace_period = 300
|
desired_capacity = 0
|
||||||
health_check_type = "ELB"
|
max_size = 0
|
||||||
desired_capacity = 1
|
min_size = 0
|
||||||
force_delete = true
|
|
||||||
termination_policies = ["OldestInstance"]
|
|
||||||
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
@ -633,15 +608,6 @@ resource "aws_subnet" "main" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_subnet" "alt" {
|
|
||||||
vpc_id = "${aws_vpc.default.id}"
|
|
||||||
cidr_block = "10.0.2.0/24"
|
|
||||||
availability_zone = "us-west-2b"
|
|
||||||
tags {
|
|
||||||
Name = "asg-vpc-thing"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_launch_configuration" "foobar" {
|
resource "aws_launch_configuration" "foobar" {
|
||||||
image_id = "ami-b5b3fc85"
|
image_id = "ami-b5b3fc85"
|
||||||
instance_type = "t2.micro"
|
instance_type = "t2.micro"
|
||||||
|
@ -650,15 +616,10 @@ resource "aws_launch_configuration" "foobar" {
|
||||||
resource "aws_autoscaling_group" "bar" {
|
resource "aws_autoscaling_group" "bar" {
|
||||||
vpc_zone_identifier = [
|
vpc_zone_identifier = [
|
||||||
"${aws_subnet.main.id}",
|
"${aws_subnet.main.id}",
|
||||||
"${aws_subnet.alt.id}",
|
|
||||||
]
|
]
|
||||||
max_size = 2
|
desired_capacity = 0
|
||||||
min_size = 1
|
max_size = 0
|
||||||
health_check_grace_period = 300
|
min_size = 0
|
||||||
health_check_type = "ELB"
|
|
||||||
desired_capacity = 1
|
|
||||||
force_delete = true
|
|
||||||
termination_policies = ["OldestInstance"]
|
|
||||||
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
launch_configuration = "${aws_launch_configuration.foobar.name}"
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
@ -666,7 +627,7 @@ resource "aws_autoscaling_group" "bar" {
|
||||||
const testAccAWSAutoScalingGroupConfig_withPlacementGroup = `
|
const testAccAWSAutoScalingGroupConfig_withPlacementGroup = `
|
||||||
resource "aws_launch_configuration" "foobar" {
|
resource "aws_launch_configuration" "foobar" {
|
||||||
image_id = "ami-21f78e11"
|
image_id = "ami-21f78e11"
|
||||||
instance_type = "c3.large"
|
instance_type = "t2.micro"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_placement_group" "test" {
|
resource "aws_placement_group" "test" {
|
||||||
|
|
Loading…
Reference in New Issue