Replies: 10 comments
-
We are using |
Beta Was this translation helpful? Give feedback.
-
The way we do it is pretty similar to yours @include
You can utilise |
Beta Was this translation helpful? Give feedback.
-
Hi guys, thanks for your feedback. @1oglop1 , I had bad experience in the past using git submodules. I try to avoid them... my bad :) @nabeelamjad , that struct is built in the same git repo or do you have different git repos for each environment? I think each major struct should have a specific git repository, say, prod, stage, templates or even a third party / contrib. |
Beta Was this translation helpful? Give feedback.
-
@include That's why we are using subtrees https://codewinsarguments.co/2016/05/01/git-submodules-vs-git-subtrees/ |
Beta Was this translation helpful? Give feedback.
-
@include we divide our apps/workers/etc in separate repos, but all environments (dev/staging/prod/test) lives in the same app repo, primarily because the only difference between them is the use of a different AWS account config (and the empty config file for the stack). |
Beta Was this translation helpful? Give feedback.
-
I am going to replicate this at home, perhaps using this https://github.com/ingydotnet/git-subrepo/blob/master/ReadMe.pod. Meanwhile, do you run any CI/CD on top of this? (cnf-lint and friends) in a Jenkins pipeline? |
Beta Was this translation helpful? Give feedback.
-
Great conversation on a similar subject is anyone using hooks to decide which environment to deploy too? For example you may have many environments i.e. dev/qa/prod. Using the Prod key and deploying to dev would install dev to the prod account. Any idea's about managing the deployment methods or solutions to manage multiple accounts would be great. Support for assuming roles would be cool too. |
Beta Was this translation helpful? Give feedback.
-
We use git submodules for common cf-templates, common policies, hooks, resolvers, etc. (Hopefully the number of submodules is reduced with sceptre v2, by having better support for pip-installable hooks/resolvers.) These submodules are used inside a parent repo, which contains one or more environment folders somewhere. Some environments seem to deserve a stand-alone repo, some environments are co-hosted, and how this part is structured comes down to externalities like whether we want CI over the environment infra or whether/how we want restrict owners/commits over the repo. Someone always hates it, but submodules / subtrees do seem pretty inevitable when it comes to reusable templates. There's no language-level package manager for |
Beta Was this translation helpful? Give feedback.
-
@mattvonrocketstein I see myself using those common tools/templates under a submodule too but without refer any environment flag on them. I see this as "shared libs" which are injected into each environment. They must not impose environment behaviour; be the most agnostic possible. In fact I see environments as a number (eg. I have X number of environments) not a "string"; the biggest difference is that one of them is not supposed to be deleted/broken - prod. :)
This takes me to pick-up what you've said above: stand-alone repos and to have or not CI/CD on each env. Under our organization we will have dozens of developers writing cfn (pro's and n00bs) and deploying apps into our multiple AWS accounts. In two years I see a complete mess if we don't decouple things ups and drop "shared resources" like security groups and so. To prepare our ops team to this avalanche of good and bad changes I think one major security measure is to disallow CD to prod without any ops/human review. x) fetching specific version of external module from dir:https://www.terraform.io/docs/modules/usage.html
Fetching specific version of external module from git sourcehttps://www.terraform.io/docs/modules/sources.html
|
Beta Was this translation helpful? Give feedback.
-
Note that terraform's approach is basically equivalent, it just abstracts away the detail of the submodule management from you for better or worse. Under the hood I think it just manages the submodule itself, checks it out during EDIT: Thinking more about this, you could build something equivalent with sceptre using a resolver. inside |
Beta Was this translation helpful? Give feedback.
-
How can I split and organize my sceptre into multiple repositories, one per account/environment?
Lets say I have dev, stage, prod and finally a services account for shared services.
Git repositories:
With this in mind, how should I organize my project?
How can I reutilize a global templates repository and how can I use this schema in a secure and wise way?
KISS ideas are welcome :)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions