Skip to content

Commit

Permalink
update test configuration and add metadata_options to resource launch…
Browse files Browse the repository at this point in the history
… config md
  • Loading branch information
jaysiyani committed Dec 14, 2020
1 parent bccbb1f commit 1991d26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
11 changes: 7 additions & 4 deletions aws/data_source_aws_launch_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,13 @@ data "aws_launch_configuration" "foo" {
}

func testAccLaunchConfigurationDataSourceConfig_metadataOptions(rName string) string {
return fmt.Sprintf(`
return composeConfig(
testAccLatestAmazonLinuxHvmEbsAmiConfig(),
fmt.Sprintf(`
resource "aws_launch_configuration" "test" {
name = %[1]q
image_id = data.aws_ami.amzn-ami-minimal-hvm-ebs.id
instance_type = "t3.nano"
name = %[1]q
metadata_options {
http_endpoint = "enabled"
http_tokens = "required"
Expand All @@ -177,7 +180,7 @@ resource "aws_launch_configuration" "test" {
data "aws_launch_configuration" "test" {
name = aws_launch_configuration.test.name
}
`, rName)
`, rName))
}

func testAccLaunchConfigurationDataSourceConfigEbsNoDevice(rName string) string {
Expand Down
11 changes: 6 additions & 5 deletions aws/resource_aws_launch_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,19 +715,20 @@ resource "aws_launch_configuration" "test" {
}

func testAccAWSLaunchConfigurationConfigMetadataOptions(rName string) string {
return fmt.Sprintf(`
return composeConfig(
testAccLatestAmazonLinuxHvmEbsAmiConfig(),
fmt.Sprintf(`
resource "aws_launch_configuration" "test" {
name = %[1]q
image_id = "${data.aws_ami.ubuntu.id}"
image_id = data.aws_ami.amzn-ami-minimal-hvm-ebs.id
instance_type = "t3.nano"
name = %[1]q
metadata_options {
http_endpoint = "enabled"
http_tokens = "required"
http_put_response_hop_limit = 2
}
}
`, rName)
`, rName))
}

func testAccAWSLaunchConfigurationConfig() string {
Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/launch_configuration.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ The following arguments are supported:
* `iam_instance_profile` - (Optional) The name attribute of the IAM instance profile to associate
with launched instances.
* `key_name` - (Optional) The key name that should be used for the instance.
* `metadata_options` - The metadata options for the instance.
* `http_endpoint` - The state of the metadata service: `enabled`, `disabled`.
* `http_tokens` - If session tokens are required: `optional`, `required`.
* `http_put_response_hop_limit` - The desired HTTP PUT response hop limit for instance metadata requests.
* `security_groups` - (Optional) A list of associated security group IDS.
* `associate_public_ip_address` - (Optional) Associate a public ip address with an instance in a VPC.
* `vpc_classic_link_id` - (Optional) The ID of a ClassicLink-enabled VPC. Only applies to EC2-Classic instances. (eg. `vpc-2730681a`)
Expand Down

0 comments on commit 1991d26

Please sign in to comment.