File tree Expand file tree Collapse file tree 6 files changed +43
-14
lines changed Expand file tree Collapse file tree 6 files changed +43
-14
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ __pycache__
99
1010# # Terraform ##
1111.terraform
12- .terraform.lock.hcl
1312terraform.tfstate
1413terraform.tfstate.backup
1514* .tfvars
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11provider "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"
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 = {
You can’t perform that action at this time.
0 commit comments