Skip to content

Instantly share code, notes, and snippets.

@henhal
Created April 20, 2017 06:01
Show Gist options
  • Save henhal/782dac50ba53ae164af0e95a41108af5 to your computer and use it in GitHub Desktop.
Save henhal/782dac50ba53ae164af0e95a41108af5 to your computer and use it in GitHub Desktop.
Transferring SSH keys to Elastic Beanstalk in order to access private gits (for npm etc)
Resources:
AWSEBAutoScalingGroup:
Metadata:
? "AWS::CloudFormation::Authentication"
:
S3Auth:
buckets:
- <my-bucket>
roleName:
? "Fn::GetOptionSetting"
:
DefaultValue: aws-elasticbeanstalk-ec2-role
Namespace: "aws:asg:launchconfiguration"
OptionName: IamInstanceProfile
type: s3
files:
/root/.ssh/github-eb-key:
authentication: S3Auth
mode: "000600"
owner: root
group: root
source: "https://s3-eu-west-1.amazonaws.com/<my-bucket>/github-eb-key"
/root/.ssh/config:
mode: "000600"
owner: root
group: root
content: |
Host github.com
IdentityFile /root/.ssh/github-eb-key
IdentitiesOnly yes
UserKnownHostsFile=/dev/null
StrictHostKeyChecking no
@tobsn
Copy link

tobsn commented Oct 3, 2019

@henhal yeah it somehow started working... must have been the mode settings, idk... :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment