From a826bd55b1e5fa9f6abead365e2a0cc348eb545f Mon Sep 17 00:00:00 2001 From: jjllee Date: Sat, 16 Mar 2024 01:39:24 -0700 Subject: [PATCH] use 'wget cwagent' command in ec2 terraform --- terraform/ec2/main.tf | 2 +- terraform/python/ec2/main.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/ec2/main.tf b/terraform/ec2/main.tf index b3bc009cb..ff289d0c5 100644 --- a/terraform/ec2/main.tf +++ b/terraform/ec2/main.tf @@ -177,7 +177,7 @@ resource "null_resource" "remote_service_setup" { "echo $agent_config > amazon-cloudwatch-agent.json", # Get and run CW agent rpm - "${var.get_cw_agent_rpm_command}", + "${var.get_cw_agent_rpm_command}", "sudo rpm -U ./cw-agent.rpm", "sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:./amazon-cloudwatch-agent.json", diff --git a/terraform/python/ec2/main.tf b/terraform/python/ec2/main.tf index 9305351a1..84f8164d9 100644 --- a/terraform/python/ec2/main.tf +++ b/terraform/python/ec2/main.tf @@ -115,7 +115,7 @@ resource "null_resource" "main_service_setup" { "echo $agent_config > amazon-cloudwatch-agent.json", # Get and run CW agent rpm - "wget -O cw-agent.rpm https://amazoncloudwatch-agent-us-east-1.s3.us-east-1.amazonaws.com/amazon_linux/amd64/1.300033.0b462/amazon-cloudwatch-agent.rpm", + "${var.get_cw_agent_rpm_command}", "sudo rpm -U ./cw-agent.rpm", "sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:./amazon-cloudwatch-agent.json", @@ -191,7 +191,7 @@ resource "null_resource" "remote_service_setup" { "echo $agent_config > amazon-cloudwatch-agent.json", # Get and run CW agent rpm - "wget -O cw-agent.rpm https://amazoncloudwatch-agent-us-east-1.s3.us-east-1.amazonaws.com/amazon_linux/amd64/1.300033.0b462/amazon-cloudwatch-agent.rpm", + "${var.get_cw_agent_rpm_command}", "sudo rpm -U ./cw-agent.rpm", "sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:./amazon-cloudwatch-agent.json",