Skip to content

Commit 1da4140

Browse files
author
Aman Brar
authored
added env vars command to canary test (#170)
1 parent e108f4f commit 1da4140

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

terraform/canary/amis.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ variable "ami_family" {
77
otconfig_destination = "/tmp/ot-default.yml"
88
download_command_pattern = "wget %s"
99
install_command = "sudo rpm -Uvh aws-otel-collector.rpm"
10+
set_env_var_command = "sudo chmod 777 /opt/aws/aws-otel-collector/etc/.env && sudo echo 'SAMPLE_APP_HOST=%s' >> /opt/aws/aws-otel-collector/etc/.env && sudo echo 'SAMPLE_APP_PORT=%s' >> /opt/aws/aws-otel-collector/etc/.env"
1011
start_command = "sudo /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -c /tmp/ot-default.yml -a start"
1112
connection_type = "ssh"
1213
user_data = ""
@@ -18,6 +19,7 @@ variable "ami_family" {
1819
otconfig_destination = "C:\\ot-default.yml"
1920
download_command_pattern = "powershell -command \"Invoke-WebRequest -Uri %s -OutFile C:\\aws-otel-collector.msi\""
2021
install_command = "msiexec /i C:\\aws-otel-collector.msi"
22+
set_env_var_command = "powershell \"[System.Environment]::SetEnvironmentVariable('SAMPLE_APP_HOST', '%s', [System.EnvironmentVariableTarget]::Machine); [System.Environment]::SetEnvironmentVariable('SAMPLE_APP_PORT', '%s', [System.EnvironmentVariableTarget]::Machine)\""
2123
start_command = "powershell \"& 'C:\\Program Files\\Amazon\\AwsOtelCollector\\aws-otel-collector-ctl.ps1' -ConfigLocation C:\\ot-default.yml -Action start\""
2224
connection_type = "winrm"
2325
user_data = <<EOF

0 commit comments

Comments
 (0)