stelligent / mu

A full-stack DevOps on AWS framework
https://getmu.io
MIT License
974 stars 135 forks source link

How to use AWS Parameter Store in mu.yml #397

Closed danielpetroianu closed 5 years ago

danielpetroianu commented 5 years ago

I'm trying to use AWS Parameter Store as described in this video / sample https://youtu.be/mfRkQpZjEHo?t=665 https://github.com/stelligent/mu/blob/develop/examples/database/mu.yml

My mu.yml is in the form of:

environments:
  - name: acceptance
    provider: ecs
service:
      name: sample-app
      #...
      environment:
        DATABASE_URI: 
          acceptance: mongodb://${acceptance_DATABASE_USERNAME}:${acceptance_DATABASE_PASSWORD}@domain...
          production: mongodb://${production_DATABASE_USERNAME}:${production_DATABASE_PASSWORD}@domain...

But in my Code Build mu-pipeline-sample-app-deploy-acceptance I get this error

ERROR ·ValidationError: Template format error: Unresolved resource dependencies [acceptance_DATABASE_PASSWORD, acceptance_DATABASE_USERNAME] in the Resources block of the template
status code: 400, request id:...

What is the problem, do I need to configure something before hand?

mneil commented 5 years ago

${acceptance_DATABASE_USERNAME} is not a set variable.

${DATABASE_USERNAME}

I'm not 100% sure on what the ways are to use a separate password per environment. However, I do know that if you have two ssm secure params in System Manager you can tell MU to use those instead. by setting database.masterPasswordSSMParam: ssm-param-name. DATABASE_PASSWORD would be set to that param per environment.

cplee commented 5 years ago

Question answered by Michael Neil