Is there a method to pass a SSH Key through to a Cloudformation script for custom recipes repo when configuring an Amazon Web Services OpsWorks stack besides mangling the newline characters and placing value directly in the JSON script? I've been going around in circles with this so just in case I appear to be blathering:
- CloudFormation script
- Creates OpsWorks Stack
- Stack has a custom Chef cookbook configured as a Git(Hub) repo
- Repo needs a SSH key
The only way I have found to get this to work so far is to convert the new lines of the SSH key to \r\n and put the key directly into the CloudFormation JSON script. Not ideal!!
-Cloudformation Snippet-
...
"UseOpsworksSecurityGroups": "false",
"CustomCookbooksSource": {
"Revision": {
"Ref": "GitRepoRevision"
},
"SshKey": "-----BEGIN RSA PRIVATE KEY-----\r\nasdf123asdf123asdf123...\r\n-----END RSA PRIVATE KEY-----",
"Type": "git",
"Url": {
"Ref": "GitRepoURL"
}
}
...