Skip to content

Commit e0ef9be

Browse files
committed
chore: updated ec2 configurations to require imdsv2
1 parent bd4dd98 commit e0ef9be

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
@@ -281,6 +281,7 @@ resource "aws_instance" "domain_controller" {
281281

282282
metadata_options {
283283
http_endpoint = "enabled"
284+
http_tokens = "required"
284285
instance_metadata_tags = "enabled"
285286
}
286287
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
@@ -207,6 +207,7 @@ ${var.domain_admin_password}
207207

208208
metadata_options {
209209
http_endpoint = "enabled"
210+
http_tokens = "required"
210211
instance_metadata_tags = "enabled"
211212
}
212213
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
@@ -222,6 +222,7 @@ ${var.domain_admin_password}
222222

223223
metadata_options {
224224
http_endpoint = "enabled"
225+
http_tokens = "required"
225226
instance_metadata_tags = "enabled"
226227
}
227228
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
@@ -247,6 +247,7 @@ resource "aws_instance" "client" {
247247

248248
metadata_options {
249249
http_endpoint = "enabled"
250+
http_tokens = "required"
250251
instance_metadata_tags = "enabled"
251252
}
252253
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)