-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add YAML environment file support #740
Conversation
Environment files ending in .yaml or .yml will be rendered using a different strategy. The env file is treated as a dict, with the value for each key being a parsed YAML object. After parsing the config, we look for things that look like variable references, and replace the references with objects.
Now with the correct version of flake8
Moto is requiring policy documents to be at least version 2012-10-17, so add that property.
Python 2.7 strings and Python 3 strings work differently, and regular expression matching is different too. Rewrite in a way which works with both language versions.
Moto is requiring policy documents to be at least version 2012-10-17, so add that property.
When checking for yaml suffixes on environment files, ignore case.
Environment files ending in .yaml or .yml will be rendered using a different strategy. The env file is treated as a dict, with the value for each key being a parsed YAML object. After parsing the config, we look for things that look like variable references, and replace the references with objects.
Now with the correct version of flake8
Python 2.7 strings and Python 3 strings work differently, and regular expression matching is different too. Rewrite in a way which works with both language versions.
When checking for yaml suffixes on environment files, ignore case.
When this is merged will we be able to define list object and lists of objects in these yaml files for parsing later on? |
docs/environments.rst
Outdated
We've defined a stack which expects a list of ingress CIDR's allowed access to | ||
each port. Our environment files would look like this:: | ||
|
||
# in the file: stage.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this doc state stage.yml and not stage.env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, will update shortly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small documentation issue.
Yaml config example should use .yml file suffix, not .env
So, guys, what's the verdict on this PR? |
Any thoughts on merging this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks @mromaszewicz - and sorry for the delay.
Environment files ending in .yaml or .yml will be rendered using
a different strategy. The env file is treated as a dict, with
the value for each key being a parsed YAML object. After parsing
the config, we look for things that look like variable references,
and replace the references with objects.