File tree 13 files changed +58
-2
lines changed
internal/service/ec2/testdata
13 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ resource "aws_instance" "web" {
46
46
instance_type = " t2.small"
47
47
ami = data. aws_ami . ubuntu . id
48
48
49
+ # Force IMDSv2.
50
+ metadata_options {
51
+ http_tokens = " required"
52
+ }
53
+
49
54
# This will create 4 instances
50
55
count = 4
51
56
}
Original file line number Diff line number Diff line change @@ -67,7 +67,12 @@ resource "aws_instance" "web" {
67
67
# this should be on port 80
68
68
user_data = file (" userdata.sh" )
69
69
70
- # Instance tags
70
+ # Force IMDSv2.
71
+ metadata_options {
72
+ http_tokens = " required"
73
+ }
74
+
75
+ # Instance tags.
71
76
tags = {
72
77
Name = " eip-example"
73
78
}
Original file line number Diff line number Diff line change @@ -172,7 +172,12 @@ resource "aws_instance" "web" {
172
172
subnet_id = aws_subnet. tf_test_subnet . id
173
173
user_data = file (" userdata.sh" )
174
174
175
- # Instance tags
175
+ # Force IMDSv2.
176
+ metadata_options {
177
+ http_tokens = " required"
178
+ }
179
+
180
+ # Instance tags
176
181
177
182
tags = {
178
183
Name = " elb-example"
Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ resource "aws_instance" "web" {
136
136
# backend instances.
137
137
subnet_id = aws_subnet. default . id
138
138
139
+ # Force IMDSv2.
140
+ metadata_options {
141
+ http_tokens = " required"
142
+ }
143
+
139
144
# We run a remote provisioner on the instance after creating it.
140
145
# In this case, we just install nginx and start it. By default,
141
146
# this should be on port 80
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ resource "aws_instance" "test" {
10
10
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
11
11
instance_type = " t4g.nano"
12
12
13
+ metadata_options {
14
+ http_tokens = " required"
15
+ }
16
+
13
17
tags = var. resource_tags
14
18
}
15
19
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ resource "aws_instance" "test" {
16
16
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
17
17
instance_type = " t4g.nano"
18
18
19
+ metadata_options {
20
+ http_tokens = " required"
21
+ }
22
+
19
23
tags = var. resource_tags
20
24
}
21
25
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ resource "aws_instance" "test" {
19
19
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
20
20
instance_type = " t4g.nano"
21
21
22
+ metadata_options {
23
+ http_tokens = " required"
24
+ }
25
+
22
26
tags = var. resource_tags
23
27
}
24
28
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ resource "aws_instance" "test" {
5
5
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
6
6
instance_type = " t4g.nano"
7
7
8
+ metadata_options {
9
+ http_tokens = " required"
10
+ }
11
+
8
12
tags = var. resource_tags
9
13
}
10
14
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ resource "aws_instance" "test" {
7
7
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
8
8
instance_type = " t4g.nano"
9
9
10
+ metadata_options {
11
+ http_tokens = " required"
12
+ }
13
+
10
14
tags = {
11
15
(var. unknownTagKey ) = null_resource.test.id
12
16
}
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ resource "aws_instance" "test" {
7
7
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
8
8
instance_type = " t4g.nano"
9
9
10
+ metadata_options {
11
+ http_tokens = " required"
12
+ }
13
+
10
14
tags = {
11
15
(var. unknownTagKey ) = null_resource.test.id
12
16
(var. knownTagKey ) = var.knownTagValue
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ resource "aws_instance" "test" {
11
11
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
12
12
instance_type = " t4g.nano"
13
13
14
+ metadata_options {
15
+ http_tokens = " required"
16
+ }
17
+
14
18
tags = var. resource_tags
15
19
}
16
20
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ resource "aws_instance" "test" {
14
14
ami = data. aws_ami . amzn2-ami-minimal-hvm-ebs-arm64 . id
15
15
instance_type = " t4g.nano"
16
16
17
+ metadata_options {
18
+ http_tokens = " required"
19
+ }
20
+
17
21
tags = var. resource_tags
18
22
}
19
23
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ resource "aws_instance" "test" {
2
2
ami = data. aws_ami. amzn2- ami- minimal- hvm- ebs- arm64. id
3
3
instance_type = " t4g.nano"
4
4
5
+ metadata_options {
6
+ http_tokens = " required"
7
+ }
8
+
5
9
{{- template " tags" . }}
6
10
}
7
11
You can’t perform that action at this time.
0 commit comments