Skip to content

Commit 8f6f7db

Browse files
author
jsf9k
committed
2 parents b82a0e6 + 5d0ecd2 commit 8f6f7db

File tree

6 files changed

+43
-14
lines changed

6 files changed

+43
-14
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ __pycache__
99

1010
## Terraform ##
1111
.terraform
12-
.terraform.lock.hcl
1312
terraform.tfstate
1413
terraform.tfstate.backup
1514
*.tfvars

examples/basic_usage/.terraform.lock.hcl

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic_usage/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Note that this example may create resources which cost money. Run
1414
| Name | Version |
1515
|------|---------|
1616
| terraform | ~> 1.1 |
17-
| aws | ~> 4.9 |
17+
| aws | ~> 6.7 |
1818

1919
## Providers ##
2020

2121
| Name | Version |
2222
|------|---------|
23-
| aws | ~> 4.9 |
23+
| aws | ~> 6.7 |
2424

2525
## Modules ##
2626

examples/basic_usage/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
provider "aws" {
2-
# Our primary provider uses our terraform role
2+
# Our primary provider uses our Terraform role
33
assume_role {
44
role_arn = var.tf_role_arn
55
session_name = "terraform-example"

examples/basic_usage/versions.tf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@ terraform {
33
# major version currently being used. This practice will help us
44
# avoid unwelcome surprises.
55
required_providers {
6-
# Version 4.9 of the Terraform AWS provider made changes to the S3 bucket
7-
# refactor that is in place for versions 4.0-4.8 of the provider. With v4.9
8-
# only non-breaking changes and deprecation notices are introduced. Using
9-
# this version will simplify migration to the new, broken out AWS S3 bucket
10-
# configuration resources. Please see
11-
# https://github.com/hashicorp/terraform-provider-aws/pull/23985
12-
# for more information about the changes in v4.9 and
13-
# https://www.hashicorp.com/blog/terraform-aws-provider-4-0-refactors-s3-bucket-resource
14-
# for more information about the S3 bucket refactor.
6+
# We have verified that our code works with version 6.7 of this
7+
# Terraform provider.
158
aws = {
169
source = "hashicorp/aws"
17-
version = "~> 4.9"
10+
version = "~> 6.7"
1811
}
1912
}
2013

main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ resource "aws_instance" "example" {
4444
instance_type = "t3.micro"
4545
subnet_id = var.subnet_id
4646

47+
# AWS Instance Metadata Service (IMDS) options
48+
metadata_options {
49+
# Enable IMDS (this is the default value)
50+
http_endpoint = "enabled"
51+
# Restrict put responses from IMDS to a single hop (this is the
52+
# default value). This effectively disallows the retrieval of an
53+
# IMDSv2 token via this machine from anywhere else.
54+
http_put_response_hop_limit = 1
55+
# Require IMDS tokens AKA require the use of IMDSv2
56+
http_tokens = "required"
57+
}
58+
4759
# The tag or tags specified here will be merged with the provider's
4860
# default tags.
4961
tags = {

0 commit comments

Comments
 (0)