Environment variables with AWS SSM Run Command

后端 未结 1 1801
深忆病人
深忆病人 2021-01-28 13:39

I am using AWS SSM Run Command with the AWS-RunShellScript document to run a script on an AWS Linux 1 instance. Part of the script includes using an environment variable. When I

相关标签:
1条回答
  • 2021-01-28 14:02

    SSM does not open an actual SSH session so passing environment variables won't work. It's essential a daemon running on the box that's taking your requests and processing them. It's a very basic product: it doesn't support any of the standard features that come with SSH such as SCP, port forwarding, tunneling, passing of env variables etc. An alternative way of passing a value you need to a script would be to store it in AWS Systems Manager Parameter Store, and have your script pull the variable from the store.
    You'll need to update your instance role permissions to have access to ssm:GetParameters for the script you run to access the value stored.

    0 讨论(0)
提交回复
热议问题