Created
March 19, 2016 11:24
-
-
Save rohang07/fdf1d1caf0048968424d to your computer and use it in GitHub Desktop.
eb extension for pulling ssh config from s3
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
--- | |
Resources: | |
AWSEBAutoScalingGroup: | |
Metadata: | |
? "AWS::CloudFormation::Authentication" | |
: | |
S3Auth: | |
buckets: | |
- bucket-name | |
roleName: | |
? "Fn::GetOptionSetting" | |
: | |
DefaultValue: aws-elasticbeanstalk-ec2-role | |
Namespace: "aws:asg:launchconfiguration" | |
OptionName: IamInstanceProfile | |
type: s3 | |
files: | |
/tmp/.ssh/deploy_key: | |
authentication: S3Auth | |
mode: "000600" | |
owner: ec2-user | |
source: "S3-file-URL" | |
/tmp/.ssh/config: | |
authentication: S3Auth | |
mode: "000600" | |
owner: ec2-user | |
source: "S3-file-URL" |
This will overwrite /tmp/.ssh/config - you shouldn't really be depending on a config file in /tmp anyway, but a workaround would be getting the file and concatenating in the existing file using ebextensions 'commands'
I ran into this issue and found the following solution: https://stackoverflow.com/questions/43497663/setting-up-ssh-keys-for-github-private-repo-access-on-elastic-beanstalk
That thread suggests that /tmp/.ssh/ should be /root/.ssh/. Have you run into this?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Elastic beanstalk runs npm install as the user 'nodejs' with home directory /tmp.
The ssh config needs to be in the /tmp/.ssh folder