Skip to content

Commit

Permalink
re using file function
Browse files Browse the repository at this point in the history
  • Loading branch information
tajewole-moj committed Oct 11, 2023
1 parent 0a45dd1 commit 3b5b570
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions terraform/environments/apex/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 3b5b570

Please sign in to comment.