Comments (5)
I am also noticing this inheritance issue related to project_code
as well; in that the parent overrides the child.
from sceptre.
Hi Dan, I'm not sure how what you're experiencing is happening. I can say that we have several projects that override project_code in child configs (among other settings).
I would ask, however: Do you happen to have AWS environment variables set that might be directing your AWS environment to that profile (i.e. AWS_PROFILE environment variable, default profile on your aws config file, etc...)? Right now, if you explicitly specify a profile, Sceptre will use that. But if you do not specify a profile, Sceptre will use whatever your environment is set up to use. I can imagine scenarios where it may seem like the parent is overriding the child, but your specific AWS environment settings might be interfering.
from sceptre.
Ok I have more information. My original reproduction case wasn't detailed enough. consider this:
config/
|_ config.yaml
|_ shared.yaml
|_ /childconfig
|_ sometemplate.yaml
|_ config.yaml
templates/
|_ shared.yaml
|_ sometemplate.yaml
What's happening is that the resource creation for sometemplate.yaml
is having all the inheritance from the child config applied to the config from the parent (/childconfig/config.yaml
vs /config.yaml
); the child one wins.
HOWEVER
shared.yaml does not have settings from /childconfig/config.yaml
applied to config.yaml
, even though my command specified to launch childconfig
.
I suppose I might have a misunderstanding of how the inheritance works with StackGroup config. My expectation was that:
- my
project_code
would be overridden for all stacks created, since I specifiedchildconfig
as a launch param. - The profile set in
/childconfig/config.yaml
would override for the entire process, but since I have a global stack config for one of my stacks, it wants to use the profile defined in the parent for it instead of using the one profile for the entire process.
I was hoping to be able to do something like change the project_code and profile used for the entire deployment based on the configuration I use at launch, not where the config exists in relation to where the template's config is defined. I wanted to keep the shared.yaml
global, because all its doing is making a bucket, and its the same for every environment/configuration.
TL;DR: seems like StackGroup config and Stack config have a bit of a coupling issue?
Am I perhaps approaching this the wrong way, or is this more of a feature request than anything?
from sceptre.
Oh, what you've described is how Sceptre is supposed to work. shared.yaml
shouldn't be affected at all by the StackConfig of /childconfig/config.yaml
. Children don't change their aunts and uncles.
I would recommend one of the following:
- Set the
profile
in the parent config like like this:profile: {{var.profile}}
and then you can runsceptre --var profile=dev launch ...
and everything will get that profile - Don't use a profile on your Stack Configs at all and instead just set the
AWS_PROFILE
environment variable before running Sceptre.
from sceptre.
I suppose that makes sense, although it does feel a bit weird that something like profile
can't be globally overridden. Now that I understand the behavior though, I was able to get around it via the following:
- setting the profile via variable like you suggested, and using
default
in cases where i dont want a specific profile - using a Jinja2 conditional to control the
project_code
based on the existence of another variable
for anyone who finds this via a search, it item 2 looks something like:
project_code: {% if var.owner is defined %} {{var.owner}}-some-service {% else %} someservice {% endif %}
Thanks for the help @jfalkenstein !
from sceptre.
Related Issues (20)
- Why does black use Python 3.10? HOT 2
- announcements to twitter (X) is broken HOT 4
- Document `j2_environment` `autoescape` setting to control Jinja2 escaping HOT 4
- Drop support for Python 3.7 HOT 4
- test_hook_writes_to_stderr failure "/bin/sh command not found" HOT 4
- Not enough values to unpack given a badly formatted stack ref
- Bug in hooks test on MacOS HOT 2
- Setup build workflow without secrets HOT 2
- Provide a formatted_yaml template handler HOT 1
- CI: make integration tests run faster HOT 5
- Stack differ raises AttributeError if a values is a bool
- Input parameters should be validated
- Cyclic dependencies should result in a clearer error message
- j2_environment extensions not available while generating config HOT 2
- List outputs is eating ExpiredToken messages and possibly others
- `NO_ECHO_REPLACEMENT` causing false positive diffs
- Diff fails if stack Ignore parameter set to True HOT 2
- List proposed order of operations for `sceptre launch`
- AWS STS Session hard limit duration of 1 hour for chained roles HOT 1
- Reimplement #1443 - parameter Schema Validation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sceptre.