You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. apply a SSM parameter store config on EC2 instance and restart the agent afterwards:
@@ -57,6 +58,7 @@ UsageString="
57
58
append-config: append json config with the existing json configs if any, followed by -c. Target config can be based on the location (ssm parameter store name, file name), or 'default'.
58
59
remove-config: remove config for agent, followed by -c. Target config can be based on the location (ssm parameter store name, file name), or 'all'.
59
60
set-log-level: sets the log level, followed by -l to provide the level in all caps.
61
+
set-env: sets an environment variable for the agent process, followed by -e to provide KEY=VALUE.
60
62
61
63
-m: mode
62
64
ec2: indicate this is on ec2 host.
@@ -78,6 +80,12 @@ UsageString="
78
80
-l: log level to set the agent to INFO, DEBUG, WARN, ERROR, or OFF
79
81
this parameter is used for 'set-log-level' only.
80
82
83
+
-e: environment variable to set for the agent process, in KEY=VALUE format
84
+
this parameter is used for 'set-env' only.
85
+
note: values that are also produced by agent config translation (such as
86
+
proxy, CA bundle, and log level settings) are overwritten from the agent
87
+
configuration on each fetch-config/append-config or agent restart.
1. apply a SSM parameter store config on EC2 instance and restart the agent afterwards:
@@ -53,6 +56,7 @@ $UsageString = @"
53
56
append-config: append json config with the existing json configs if any, followed by -c. Target config can be based on the location (ssm parameter store name, file name), or 'default'.
54
57
remove-config: remove config for agent, followed by -c. Target config can be based on the location (ssm parameter store name, file name), or 'all'.
55
58
set-log-level: sets the log level, followed by -l to provide the level in all caps.
59
+
set-env: sets an environment variable for the agent process, followed by -e to provide KEY=VALUE.
56
60
57
61
-m: mode
58
62
ec2: indicate this is on ec2 host.
@@ -74,6 +78,12 @@ $UsageString = @"
74
78
-l: log level to set the agent to INFO, DEBUG, WARN, ERROR, or OFF
75
79
this parameter is used for 'set-log-level' only.
76
80
81
+
-e: environment variable to set for the agent process, in KEY=VALUE format
82
+
this parameter is used for 'set-env' only.
83
+
note: values that are also produced by agent config translation (such as
84
+
proxy, CA bundle, and log level settings) are overwritten from the agent
85
+
configuration on each fetch-config/append-config or agent restart.
86
+
77
87
"@
78
88
79
89
$CWAServiceName='AmazonCloudWatchAgent'
@@ -442,6 +452,18 @@ Function SetLogLevelAll() {
442
452
CheckCMDResult """Set CWAGENT_LOG_LEVEL to ${LogLevel}"
0 commit comments