jorgebastida / gordon

λ Gordon is a tool to create, wire and deploy AWS Lambdas using CloudFormation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to share settings.xml

ahl opened this issue · comments

I used gordon (love it!) to build a little project that I wanted to share, but realized that I'd need users to edit settings.yml to update the code-bucket or else gordon apply would fail (because S3 has a shared namespace). I did something gross to work around this:

$ echo gordon-project-$(date +%s) >code-bucket
$ grep code-bucket settings.yml
code-bucket: !!python/object/apply:subprocess.check_output [[perl, -pe, 's/\n//', code-bucket]]

Is there a better mechanism for this?

Perhaps an alternative would be to allow code-bucket-file as an alternative or some sort of import syntax to allow private settings to reside elsewhere.

Answering my own question:

Tests already do this in a pretty clever way, with ref:// variables and the common.yml file:

mkdir parameters
echo CodeBucketName: gordon-project-$(date +%s) >parameters/common.yml

Then set code-bucket to ref://CodeBucketName.