{"action":"created","issue":{"url":"https://api.github.com/repos/cloudtools/stacker/issues/618","repository_url":"https://api.github.com/repos/cloudtools/stacker","labels_url":"https://api.github.com/repos/cloudtools/stacker/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/cloudtools/stacker/issues/618/comments","events_url":"https://api.github.com/repos/cloudtools/stacker/issues/618/events","html_url":"https://github.com/cloudtools/stacker/pull/618","id":338064900,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MDkxMTU0","number":618,"title":"Formalize the existence of external (read-only) stacks","user":{"login":"danielkza","id":747342,"node_id":"MDQ6VXNlcjc0NzM0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/747342?v=4","gravatar_id":"","url":"https://api.github.com/users/danielkza","html_url":"https://github.com/danielkza","followers_url":"https://api.github.com/users/danielkza/followers","following_url":"https://api.github.com/users/danielkza/following{/other_user}","gists_url":"https://api.github.com/users/danielkza/gists{/gist_id}","starred_url":"https://api.github.com/users/danielkza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielkza/subscriptions","organizations_url":"https://api.github.com/users/danielkza/orgs","repos_url":"https://api.github.com/users/danielkza/repos","events_url":"https://api.github.com/users/danielkza/events{/privacy}","received_events_url":"https://api.github.com/users/danielkza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-03T21:46:48Z","updated_at":"2018-10-14T21:48:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/cloudtools/stacker/pulls/618","html_url":"https://github.com/cloudtools/stacker/pull/618","diff_url":"https://github.com/cloudtools/stacker/pull/618.diff","patch_url":"https://github.com/cloudtools/stacker/pull/618.patch"},"body":"Currently, the `ref` and `xref` lookups always use the same AWS profile and region that Stacker is initialized with. That means they cannot access outputs in other accounts or regions. It is possible to create a stack that will just \"pull\" those outputs by adding `locked: true` to it. But that still does not make it possible to reference a stack outside of the current namespace, if one is configured. Additionally, options that should never take effect for a \"read-only\" stack were allowed, such as `class_path` or `stack_policy_path`.\r\n\r\nTo handle that use case, introduce and document the `external: yes` option for stacks. External stacks do not have any of the options related to creating or updating resources, such as `class_path` and `template_path`, and are used only as sources of values to other stacks (through outputs and lookups).\r\nAdditionally, add an `fqn` option to external stacks to fix the namespace issue.\r\n\r\n# Internal changes\r\n\r\nTo ensure the separation has the desired effect, enable `strict` mode while parsing configuration into models, but *only* for non-top-level keys. Achieve it by manually filtering unrecognized top-level keys before forwarding the data for parsing.\r\n\r\nTo better separate external and managed stacks in config, rework the model hierarchy a little: add `BaseStack` that only contains the shared config options between both stack types, make it a superclass of `Stack`, and introduce `ExternalStack`. Unfortunately Schematics 2.0 has a bug where it did not validate models parsed using polymorphism, so upgrade to version 2.1.\r\n\r\nMove decisions on whether a stack needs to be submitted or updated to the `stacker.stack.Stack` class, to simply the logic and allow it to differ between external and managed stacks. Introduce `stacker.stack.ExternalStack` with \"empty\" implementations of all the methods/properties related to templates, blueprints and updates.\r\n\r\n# Documentation updates\r\n\r\nRework the Stack documentation to list options allowed for all stacks, external and managed stacks separately. Document everything in YAML format, so that people can copy snippets to their configs from the different parts. Fix some typos and clarify some details in the process.\r\n\r\n# Open questions\r\n\r\nThe `external/managed` terminology is the best I could come up with, but I still feel it can be improved. Any suggestions of alternatives are welcome!\r\n\r\n# Notes\r\n\r\nI ran functional tests manually on my all account and they passed - I even had to fix one that had `stack_policy_path` misspelled and was no longer accepted due to strict parsing.\r\n"},"comment":{"url":"https://api.github.com/repos/cloudtools/stacker/issues/comments/429666125","html_url":"https://github.com/cloudtools/stacker/pull/618#issuecomment-429666125","issue_url":"https://api.github.com/repos/cloudtools/stacker/issues/618","id":429666125,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTY2NjEyNQ==","user":{"login":"danielkza","id":747342,"node_id":"MDQ6VXNlcjc0NzM0Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/747342?v=4","gravatar_id":"","url":"https://api.github.com/users/danielkza","html_url":"https://github.com/danielkza","followers_url":"https://api.github.com/users/danielkza/followers","following_url":"https://api.github.com/users/danielkza/following{/other_user}","gists_url":"https://api.github.com/users/danielkza/gists{/gist_id}","starred_url":"https://api.github.com/users/danielkza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielkza/subscriptions","organizations_url":"https://api.github.com/users/danielkza/orgs","repos_url":"https://api.github.com/users/danielkza/repos","events_url":"https://api.github.com/users/danielkza/events{/privacy}","received_events_url":"https://api.github.com/users/danielkza/received_events","type":"User","site_admin":false},"created_at":"2018-10-14T21:48:41Z","updated_at":"2018-10-14T21:48:41Z","author_association":"CONTRIBUTOR","body":"I also found some issues running the functional tests, good thing we have those!"}}
{"actor":{"display_login":"danielkza"}}