-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cloudformation inllining #65
Conversation
37d36cb
to
358f2e6
Compare
358f2e6
to
ae4cb75
Compare
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.
Looks good other changes request :)
README.md
Outdated
@@ -683,6 +683,46 @@ CfhighlanderTemplate do | |||
end | |||
|
|||
``` | |||
## Render mode for components | |||
|
|||
Rendering component resources in resulting cloudformation stack is available in 2 modes. This modes |
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.
s/This/These
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.
updated
vpc_config = { 'maximum_availability_zones' => 5 } | ||
|
||
hosted_zone = FnJoin('.',[Ref('AWS::Region'), Ref('AWS::AccountId'), 'cfhighlander.info']) | ||
vpc_template = 'github:toshke/hl-component-vpc#inline_poc' |
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.
maybe push these to a branch on the upstream repos and they update the test. We can then update the tests once they are merged. Or should be even reference external components in the core tests? maybe create a seperate testsuite?
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.
test.cfhighlander.rb
is actually not used in rspec tests - c.cfhighlander.rb
is. i've removed this file for commit - it was there as an example.
aea16a8
to
548ca5f
Compare
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.
LGTM
Improvements
Docker image updated to run of ruby 2.5
cfpublish
command will show both launch stack url and template url for updating the stackMappingParam
changes - if there is no mapping (e.g.EnvironmentType
) for given mapping parameter, it will bubble to outer component, like rest of the parameters, rather than failing on compilation.Cfhighlander::Util::Debug
class available for core developers, to dump cloudformation model at any stage of compilation at the disk. This was useful during this feature development, to narrow down bug hunt to particular compilation phase.New Features
FnJoin
FnJoin
added as available intrinsic function in highlander templates.Implements #27 - Render mode for components
Rendering component resources in resulting cloudformation stack is available in 2 modes. This modes
are controlled using
render
keyword ofComponent
DSL statementSubstack
- creates additional substack for cfhighlander component and points to it using CloudFormationStack resource type
This is also default render mode - if no render mode is specified
Substack
will be usedInline
- places all defined resources from inner component in outer component cloudformation template. Resources,Outputs, Conditions, Parameters and Mappings are all inlined - please note that some of the template elements may be renamed in this
process in order to assure unique names.
There are some limitations when using inline components - Inlined component parameters, having values as outputs from another component (inlined or not)
can't be referenced in component conditions. However, conditions referencing mapping values or parameters passed as mapping values,
are allowed.
SIDE EFFECTS
Side effect of moving from substack based to fully inlined stack may be revealing some of the implicit dependencies within an environmentExample: Component A defines Hosted Zone, while component B defines Record Set for given hosted zone. Record set is defined
by referencing Zone Name (rather than ZoneId), meaning there is no explicit dependency between the resources. When both components
are rendered as substack, implicit dependency is created if there is at least one output from component A passed as parameter
to component B. Rendering components inlined removes this implicitly defined dependency, as a consequence stack deletion or creation
may be halted, as record set is being created/deleted before prior the record set.
WARNING
Be aware of resource, condition, parameter, output and mapping limits on a single templatewhen rendering inner components inlined.
EXAMPLE
All of the VPC resources will be rendered in outer component template, while bastionwill be referenced as substack in example below.