Skip to content

Commit fac22df

Browse files
authored
chore: updated ec2 configurations to require imdsv2 (#6005)
1 parent 7ceedbc commit fac22df

File tree

9 files changed

+32
-1
lines changed

9 files changed

+32
-1
lines changed

enos/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ following lines
6666
127.0.0.1 localhost worker
6767
127.0.0.1 localhost vault
6868
```
69+
### AWS Credentials
70+
Copy the AWS Account credentials from doormat and set it in the terminal, where the enos commands are run.
6971

7072
## Executing Scenarios
7173
From the `enos` directory:

enos/modules/aws_boundary/boundary-instances.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ resource "aws_instance" "controller" {
2626
encrypted = true
2727
}
2828

29+
metadata_options {
30+
http_endpoint = "enabled"
31+
http_tokens = "required"
32+
}
33+
2934
tags = merge(local.common_tags,
3035
{
3136
Name = "${local.name_prefix}-boundary-controller-${count.index}-${split(":", data.aws_caller_identity.current.user_id)[1]}"
@@ -54,6 +59,11 @@ resource "aws_instance" "worker" {
5459
encrypted = true
5560
}
5661

62+
metadata_options {
63+
http_endpoint = "enabled"
64+
http_tokens = "required"
65+
}
66+
5767
tags = merge(local.common_tags,
5868
{
5969
Name = "${local.name_prefix}-boundary-worker-${count.index}-${split(":", data.aws_caller_identity.current.user_id)[1]}",

enos/modules/aws_rdp_domain_controller/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ resource "aws_instance" "domain_controller" {
302302

303303
metadata_options {
304304
http_endpoint = "enabled"
305+
http_tokens = "required"
305306
instance_metadata_tags = "enabled"
306307
}
307308
get_password_data = true

enos/modules/aws_rdp_member_server/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ ${var.domain_admin_password}
234234

235235
metadata_options {
236236
http_endpoint = "enabled"
237+
http_tokens = "required"
237238
instance_metadata_tags = "enabled"
238239
}
239240
get_password_data = true

enos/modules/aws_rdp_member_server_with_worker/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ ${var.domain_admin_password}
251251

252252
metadata_options {
253253
http_endpoint = "enabled"
254+
http_tokens = "required"
254255
instance_metadata_tags = "enabled"
255256
}
256257
get_password_data = true

enos/modules/aws_target/main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,18 @@ resource "aws_instance" "target" {
126126
"Type" : "target",
127127
"Project" : "Enos",
128128
"Project Name" : "qti-enos-boundary",
129-
"Environment" : var.environment
129+
"Environment" : var.environment,
130130
"Enos User" : var.enos_user,
131131
})
132132

133133
root_block_device {
134134
encrypted = true
135135
}
136+
137+
metadata_options {
138+
http_endpoint = "enabled"
139+
http_tokens = "required"
140+
}
136141
}
137142

138143
resource "enos_remote_exec" "wait" {

enos/modules/aws_vault/vault-instances.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ resource "aws_instance" "vault_instance" {
1717
Type = local.vault_cluster_tag
1818
},
1919
)
20+
21+
metadata_options {
22+
http_endpoint = "enabled"
23+
http_tokens = "required"
24+
}
2025
}
2126

2227
resource "enos_remote_exec" "install_dependencies" {

enos/modules/aws_windows_client/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ resource "aws_instance" "client" {
253253

254254
metadata_options {
255255
http_endpoint = "enabled"
256+
http_tokens = "required"
256257
instance_metadata_tags = "enabled"
257258
}
258259
get_password_data = true

enos/modules/aws_worker/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ resource "aws_instance" "worker" {
161161
Name = "${var.name_prefix}-boundary-worker-${split(":", data.aws_caller_identity.current.user_id)[1]}",
162162
},
163163
)
164+
165+
metadata_options {
166+
http_endpoint = "enabled"
167+
http_tokens = "required"
168+
}
164169
}
165170

166171
resource "enos_bundle_install" "worker" {

0 commit comments

Comments
 (0)