File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 1
- data "template_file" "userdata" {
2
- count = var. fargate_only ? 0 : 1
3
- template = file (" ${ path . module } /userdata.tpl" )
4
-
5
- vars = {
6
- tf_cluster_name = var.name
7
- tf_efs_id = aws_efs_file_system.ecs[0 ].id
8
- userdata_extra = var.userdata
9
- }
10
- }
11
-
12
1
resource "aws_launch_template" "ecs" {
13
2
count = var. fargate_only ? 0 : 1
14
3
name_prefix = " ecs-${ var . name } -"
@@ -32,7 +21,11 @@ resource "aws_launch_template" "ecs" {
32
21
33
22
vpc_security_group_ids = concat ([aws_security_group . ecs_nodes . id ], var. security_group_ids )
34
23
35
- user_data = base64encode (data. template_file . userdata [0 ]. rendered )
24
+ user_data = base64encode (templatefile (" ${ path . module } /userdata.tpl" , {
25
+ tf_cluster_name = var.name
26
+ tf_efs_id = aws_efs_file_system.ecs[0 ].id
27
+ userdata_extra = var.userdata
28
+ }))
36
29
37
30
key_name = var. ec2_key_enabled ? aws_key_pair. generated_key [0 ]. key_name : null
38
31
You can’t perform that action at this time.
0 commit comments