Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Example: Set global environment variables for AWS PCS

Focus mode
Example: Set global environment variables for AWS PCS - AWS PCS

Provide this script as the value of "userData" in your launch template. For more information, see Working with Amazon EC2 user data for AWS PCS.

The following example uses /etc/profile.d to set global variables on node group instances.

MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==MYBOUNDARY==" --==MYBOUNDARY== Content-Type: text/x-shellscript; charset="us-ascii" #!/bin/bash touch /etc/profile.d/awspcs-userdata-vars.sh echo MY_GLOBAL_VAR1=100 >> /etc/profile.d/awspcs-userdata-vars.sh echo MY_GLOBAL_VAR2=abc >> /etc/profile.d/awspcs-userdata-vars.sh --==MYBOUNDARY==--
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.