Run solution in VPC without Internet gateway and on-premises proxy
Closed this issue · 2 comments
Hi,
we have a setup with a on-premises ntml proxy solution through a VPN connection. We have no Internet gateway in our VPC. I have spent days trying to get the solution to work in this situation and have solved all but one issue now.
My biggest problem has been to get the proxy environment variables to work everywhere for the AWS CLI command to work. For most of the things I have solved it by creating VPC endpoints in the VPC but for aws autoscaling command there is no endpoint available.
My final problem no is in the ssm.sh script that is sent to the EC2 instance when the backup is done. It can run all but the last aws autoscaling command, hence the instance is not shutdown directly, it has to wait until the stop_backup rule is triggered. Not a major problem but something I would love to solve.
The problem with the ssm.sh script seems to be that it's executed in a shell which dosen't pick up the proxy enviornments that I have configured in the UserData that is executed when the instance starts up. I have tried to insert variables in /etc/profile, /etc/bashrc, /etc/bash.bashrv and so on but it seems they are not picked up when the ssm.sh is executed.
I can of course go in to the lambda function and edit the ssm.sh file manually, but I would like to automate the installation fully and then that will not work since the file is downloaded from AWS when the solution is built, I can't see any way to edit it in yaml file.
Please advice how I should solve this issue.
Best regards,
Staffan
Hello,
Apologies for delayed response. As per my understanding you want to make proxy environment variables available to the ssm.sh script and automate the deployment. If you are still encountering the issue, there are couple of things that can be done here:
- You can customize the ssm script and stage the artifacts locally in your account. When you do this, the solution would no longer download the scripts from AWS, rather use your customized artifacts. For modifying solution and using custom built assets in solution please refer to readme instructions.
- Additionally, to use environment variable in your deployment, you can leverage lambda environment variables or ssm parameter store.
Let us know if this helps.
Hi @StaffanOlofsson - Closing this due to inactivity but please let us know if you still need assistance.