@@ -151,7 +151,7 @@ resource "aws_launch_template" "x86" {
151
151
ebs_optimized = true
152
152
instance_type = var. instance-types . x86
153
153
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 })
155
155
update_default_version = true
156
156
157
157
iam_instance_profile {
@@ -188,7 +188,7 @@ resource "aws_launch_template" "arm" {
188
188
ebs_optimized = true
189
189
instance_type = var. instance-types . arm
190
190
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 })
192
192
update_default_version = true
193
193
194
194
iam_instance_profile {
@@ -308,16 +308,16 @@ resource "aws_iam_policy" "cloud-agent" {
308
308
aws_launch_template . x86 [0 ]. arn ,
309
309
aws_security_group . instance-buildkit [0 ]. arn ,
310
310
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/*" ,
314
314
], [for s in aws_subnet . public : s . arn ])
315
315
},
316
316
317
317
{
318
318
Action = [" ec2:RunInstances" ]
319
319
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/*" ,
321
321
Condition = {
322
322
StringEquals = {
323
323
" aws:RequestTag/depot-connection" = var.connection- id,
@@ -447,7 +447,7 @@ resource "aws_ecs_task_definition" "cloud-agent" {
447
447
logConfiguration = {
448
448
logDriver = " awslogs"
449
449
options = {
450
- " awslogs-region" = " ${ data . aws_region . current . name } "
450
+ " awslogs-region" = " ${ data . aws_region . current . region } "
451
451
" awslogs-group" = " ${ aws_cloudwatch_log_group . connection [0 ]. name } "
452
452
" awslogs-stream-prefix" = " cloud-agent"
453
453
}
0 commit comments