Skip to content

Commit 1dd47d1

Browse files
Merge pull request #22 from depot/aws-6
2 parents c810099 + b866b49 commit 1dd47d1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ resource "aws_launch_template" "x86" {
151151
ebs_optimized = true
152152
instance_type = var.instance-types.x86
153153
tags = var.tags
154-
user_data = base64encode(templatefile("${path.module}/user-data.sh.tftpl", { DEPOT_CLOUD_CONNECTION_ID = var.connection-id }))
154+
user_data = templatefile("${path.module}/user-data.sh.tftpl", { DEPOT_CLOUD_CONNECTION_ID = var.connection-id })
155155
update_default_version = true
156156

157157
iam_instance_profile {
@@ -188,7 +188,7 @@ resource "aws_launch_template" "arm" {
188188
ebs_optimized = true
189189
instance_type = var.instance-types.arm
190190
tags = var.tags
191-
user_data = base64encode(templatefile("${path.module}/user-data.sh.tftpl", { DEPOT_CLOUD_CONNECTION_ID = var.connection-id }))
191+
user_data = templatefile("${path.module}/user-data.sh.tftpl", { DEPOT_CLOUD_CONNECTION_ID = var.connection-id })
192192
update_default_version = true
193193

194194
iam_instance_profile {
@@ -308,16 +308,16 @@ resource "aws_iam_policy" "cloud-agent" {
308308
aws_launch_template.x86[0].arn,
309309
aws_security_group.instance-buildkit[0].arn,
310310
aws_security_group.instance-default[0].arn,
311-
"arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:network-interface/*",
312-
"arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:volume/*",
313-
"arn:aws:ec2:${data.aws_region.current.name}::image/*",
311+
"arn:aws:ec2:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:network-interface/*",
312+
"arn:aws:ec2:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:volume/*",
313+
"arn:aws:ec2:${data.aws_region.current.region}::image/*",
314314
], [for s in aws_subnet.public : s.arn])
315315
},
316316

317317
{
318318
Action = ["ec2:RunInstances"]
319319
Effect = "Allow"
320-
Resource = "arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:instance/*",
320+
Resource = "arn:aws:ec2:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:instance/*",
321321
Condition = {
322322
StringEquals = {
323323
"aws:RequestTag/depot-connection" = var.connection-id,
@@ -447,7 +447,7 @@ resource "aws_ecs_task_definition" "cloud-agent" {
447447
logConfiguration = {
448448
logDriver = "awslogs"
449449
options = {
450-
"awslogs-region" = "${data.aws_region.current.name}"
450+
"awslogs-region" = "${data.aws_region.current.region}"
451451
"awslogs-group" = "${aws_cloudwatch_log_group.connection[0].name}"
452452
"awslogs-stream-prefix" = "cloud-agent"
453453
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.99"
7+
version = ">= 6.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)