Skip to content

Commit

Permalink
Merge pull request #4 from WadeBarnes/feature/require-imdsv2
Browse files Browse the repository at this point in the history
Make IMDSv2 required by default
  • Loading branch information
SylvainMartel authored Oct 5, 2022
2 parents f9c477c + 0e8cf2c commit d253690
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 9 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ variable "ec2_instance_type" {
description = "Type of instance ec2"
}


variable "iam_profile" {
description = "The IAM profile to attach to the ec2 instance."
default = null
Expand Down Expand Up @@ -65,7 +64,6 @@ variable "ssh_source_address" {
description = "The source IP address for SSH connections, in CIDR notation."
}


variable "client_port" {
description = "The port, within the indy range of 9700 to 9799, on which the client interface will listen."
default = "9702"
Expand All @@ -78,15 +76,22 @@ variable "node_port" {

variable "vpc_node_cidr_block" {
description = "VPC IP CIDR"

}

variable "ssh_key_name" {
description = "Name of the EC2 ssh public key to use to ssh in"

}

variable "zone" {
description = "Availability zone where to deploy the VM"
}

variable "http_tokens" {
description = "Whether or not the instance metadata service requires session tokens (IMDSv2). Valid values include 'optional' or 'required'."
default = "required"
}

variable "http_endpoint" {
description = "Whether the metadata service is available. Valid values include enabled or disabled."
default = "enabled"
}
5 changes: 5 additions & 0 deletions vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ resource "aws_instance" "indy_node" {
device_index = 0
}

metadata_options {
http_tokens = var.http_tokens
http_endpoint = var.http_endpoint
}

depends_on = [
aws_internet_gateway.node_gateway
]
Expand Down

0 comments on commit d253690

Please sign in to comment.