Created
November 14, 2019 16:44
-
-
Save Sam-Martin/9cf1be30b45852830ccbfd801a05cf2f to your computer and use it in GitHub Desktop.
EC2 Userdata for proxy setup of SSM Agent on Amazon Linux 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mkdir -p /etc/systemd/system/amazon-ssm-agent.service.d | |
echo "[Service]" > /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="https_proxy=http://proxy:3128"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="http_proxy=http://proxy:3128"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="no_proxy=169.254.169.254"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
chmod 777 /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
systemctl stop amazon-ssm-agent | |
systemctl daemon-reload | |
systemctl restart amazon-ssm-agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment