-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_spot_instance_request: Add import support and refactor t…
…ests (#12787) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSEIPAssociation_spotInstance (324.66s) --- PASS: TestAccAWSSpotInstanceRequest_basic (343.84s) --- PASS: TestAccAWSSpotInstanceRequest_disappears (313.80s) --- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (212.62s) --- PASS: TestAccAWSSpotInstanceRequest_InterruptHibernate (327.43s) --- PASS: TestAccAWSSpotInstanceRequest_InterruptStop (88.75s) --- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (341.21s) --- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (351.06s) --- PASS: TestAccAWSSpotInstanceRequest_tags (152.64s) --- PASS: TestAccAWSSpotInstanceRequest_validUntil (339.82s) --- PASS: TestAccAWSSpotInstanceRequest_vpc (341.75s) --- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (333.88s) --- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (308.06s) --- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (79.75s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSEIPAssociation_spotInstance (139.29s) --- PASS: TestAccAWSSpotInstanceRequest_basic (127.90s) --- PASS: TestAccAWSSpotInstanceRequest_disappears (309.16s) --- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (203.89s) --- PASS: TestAccAWSSpotInstanceRequest_InterruptHibernate (125.23s) --- PASS: TestAccAWSSpotInstanceRequest_InterruptStop (105.36s) --- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (138.38s) --- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (140.94s) --- PASS: TestAccAWSSpotInstanceRequest_tags (186.82s) --- PASS: TestAccAWSSpotInstanceRequest_validUntil (317.22s) --- PASS: TestAccAWSSpotInstanceRequest_vpc (120.42s) --- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (326.41s) --- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (315.90s) --- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (100.39s) ```
- Loading branch information
Showing
4 changed files
with
380 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
```release-note:enhancement | ||
resource/aws_spot_instance_request: Add import support | ||
``` | ||
```release-note:enhancement | ||
resource/aws_spot_instance_request: Add plan time validation for `spot_type` and `block_duration_minutes` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ func TestAccAWSEIPAssociation_ec2Classic(t *testing.T) { | |
|
||
func TestAccAWSEIPAssociation_spotInstance(t *testing.T) { | ||
var a ec2.Address | ||
rInt := acctest.RandInt() | ||
rName := acctest.RandomWithPrefix("tf-acc-test") | ||
resourceName := "aws_eip_association.test" | ||
|
||
resource.ParallelTest(t, resource.TestCase{ | ||
|
@@ -129,7 +129,7 @@ func TestAccAWSEIPAssociation_spotInstance(t *testing.T) { | |
CheckDestroy: testAccCheckAWSEIPAssociationDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccAWSEIPAssociationConfig_spotInstance(rInt), | ||
Config: testAccAWSEIPAssociationConfig_spotInstance(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckAWSEIPExists("aws_eip.test", &a), | ||
testAccCheckAWSEIPAssociationExists(resourceName, &a), | ||
|
@@ -419,7 +419,7 @@ resource "aws_eip_association" "test" { | |
`) | ||
} | ||
|
||
func testAccAWSEIPAssociationConfig_spotInstance(rInt int) string { | ||
func testAccAWSEIPAssociationConfig_spotInstance(rName string) string { | ||
return composeConfig( | ||
testAccLatestAmazonLinuxHvmEbsAmiConfig(), | ||
testAccAvailableEc2InstanceTypeForAvailabilityZone("aws_subnet.test.availability_zone", "t3.micro", "t2.micro"), | ||
|
@@ -440,7 +440,7 @@ resource "aws_internet_gateway" "test" { | |
} | ||
resource "aws_key_pair" "test" { | ||
key_name = "tmp-key-%d" | ||
key_name = %[1]q | ||
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 [email protected]" | ||
} | ||
|
@@ -461,7 +461,7 @@ resource "aws_eip_association" "test" { | |
allocation_id = aws_eip.test.id | ||
instance_id = aws_spot_instance_request.test.spot_instance_id | ||
} | ||
`, rInt)) | ||
`, rName)) | ||
} | ||
|
||
func testAccAWSEIPAssociationConfig_instance() string { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.