From 3b5b570432ac435c3530d8f525e08c18094e0f3c Mon Sep 17 00:00:00 2001 From: tajewole-moj Date: Wed, 11 Oct 2023 16:20:17 +0100 Subject: [PATCH] re using file function --- terraform/environments/apex/ec2.tf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/terraform/environments/apex/ec2.tf b/terraform/environments/apex/ec2.tf index 01ec38bb7f9..ba3a46d6db0 100644 --- a/terraform/environments/apex/ec2.tf +++ b/terraform/environments/apex/ec2.tf @@ -22,7 +22,7 @@ resource "aws_instance" "apex_db_instance" { monitoring = true subnet_id = data.aws_subnet.private_subnets_a.id iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile.id - user_data = data.template_file.user_data.rendered + user_data = "${file("run.sh")}" root_block_device { delete_on_termination = false @@ -47,10 +47,6 @@ data "local_file" "cloudwatch_agent" { filename = "${path.module}/cloudwatch_agent_config.json" } -data "template_file" "user_data" { - template = "${file("run.sh")}" -} - resource "aws_security_group" "ec2" { name = local.application_name description = "APEX DB Server Security Group"