Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default values present in launch template #30545

Merged

Conversation

Indresh2410
Copy link
Contributor

Description

Remove default values present in launch template

Relations

Closes #30519

References

Output from Acceptance Testing

$  make testacc TESTS=TestAccEC2LaunchTemplate_metadataOptions PKG=ec2

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2LaunchTemplate_metadataOptions'  -timeout 180m
=== RUN   TestAccEC2LaunchTemplate_metadataOptions
=== PAUSE TestAccEC2LaunchTemplate_metadataOptions
=== CONT  TestAccEC2LaunchTemplate_metadataOptions
--- PASS: TestAccEC2LaunchTemplate_metadataOptions (57.47s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        57.570s

...

@github-actions
Copy link

github-actions bot commented Apr 8, 2023

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Apr 8, 2023
@@ -2958,7 +2958,7 @@ func TestAccEC2LaunchTemplate_metadataOptions(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "metadata_options.0.http_endpoint", "enabled"), //Setting any of the values in metadata options will set the http_endpoint to enabled, you will not see it via the Console, but will in the API for any instance made from the template
resource.TestCheckResourceAttr(resourceName, "metadata_options.0.http_tokens", "required"),
resource.TestCheckResourceAttr(resourceName, "metadata_options.0.http_put_response_hop_limit", "2"),
resource.TestCheckResourceAttr(resourceName, "metadata_options.0.http_protocol_ipv6", "disabled"),
resource.TestCheckResourceAttr(resourceName, "metadata_options.0.http_protocol_ipv6", "enabled"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since test case is for checking whether it works fine by not setting http_endpoint to true, and we have set computed for http_protocol_ipv6 to true, by default for http_protocol_ipv6 , the value is set to
"enabled". Verified by removing instance_metadata_tags as well and tests passed (Value expected was enabled)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @Indresh2410 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. and removed documentation Introduces or discusses updates to documentation. labels Apr 8, 2023
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 11, 2023
@scotthesterberg
Copy link

scotthesterberg commented May 2, 2023

Very interested in seeing this merged, would fix an issue I am encountering with this incorrectly defaulting variable in a region where this metdata option (http_protocol_ipv6) is not settable.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. and removed documentation Introduces or discusses updates to documentation. labels May 23, 2023
@nam054
Copy link
Contributor

nam054 commented May 23, 2023

LGTM! 🚀

...
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_allowedInstanceTypes (73.24s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_acceleratorTotalMemoryMiB (102.88s)
--- PASS: TestAccEC2LaunchTemplate_description (57.61s)
--- PASS: TestAccEC2LaunchTemplate_NetworkInterface_ipv6AddressCount (30.38s)
--- PASS: TestAccEC2LaunchTemplate_data (33.83s)
--- PASS: TestAccEC2LaunchTemplate_tags (84.30s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_burstablePerformance (102.37s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_bareMetal (100.50s)
--- PASS: TestAccEC2LaunchTemplate_NetworkInterface_ipv6Addresses (28.64s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_baselineEBSBandwidthMbps (101.50s)
--- PASS: TestAccEC2LaunchTemplate_privateDNSNameOptions (28.82s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_memoryMiBAndVCPUCount (50.92s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_acceleratorNames (51.75s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_acceleratorManufacturers (48.59s)
--- PASS: TestAccEC2LaunchTemplate_update (77.85s)
--- PASS: TestAccEC2LaunchTemplate_instanceRequirements_acceleratorCount (59.24s)
--- PASS: TestAccEC2LaunchTemplate_instanceMarketOptions (62.09s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        248.810s

@nam054 nam054 merged commit 5675259 into hashicorp:main May 23, 2023
@github-actions github-actions bot added this to the v5.0.0 milestone May 23, 2023
@github-actions
Copy link

This functionality has been released in v5.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect defaults for aws_launch_template.metadata_options
4 participants