Skip to content

Commit 14dfd78

Browse files
Add connection tag to root volume
1 parent 0989ca1 commit 14dfd78

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main.tf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ resource "aws_launch_template" "x86" {
186186

187187
tag_specifications {
188188
resource_type = "volume"
189-
tags = var.tags
189+
tags = merge(var.tags, { "depot-connection" = var.connection-id })
190190
}
191191
}
192192

@@ -232,7 +232,7 @@ resource "aws_launch_template" "arm" {
232232

233233
tag_specifications {
234234
resource_type = "volume"
235-
tags = var.tags
235+
tags = merge(var.tags, { "depot-connection" = var.connection-id })
236236
}
237237
}
238238

@@ -363,12 +363,12 @@ resource "aws_iam_role" "cloud-agent" {
363363
Action = ["ec2:CreateTags"],
364364
Effect = "Allow",
365365
Resource = "arn:aws:ec2:*:*:*/*",
366-
# Condition = {
367-
# StringEquals = {
368-
# "aws:RequestTag/depot-connection" = var.connection-id,
369-
# "ec2:CreateAction" = ["CreateVolume", "RunInstances"],
370-
# }
371-
# }
366+
Condition = {
367+
StringEquals = {
368+
"aws:RequestTag/depot-connection" = var.connection-id,
369+
"ec2:CreateAction" = ["CreateVolume", "RunInstances"],
370+
}
371+
}
372372
},
373373

374374
{

0 commit comments

Comments
 (0)