You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package/awsclCross-cutting issues related to the AWS Construct Librarypr/breaking-changeThis PR is a breaking change. It needs to be modified to be allowed in the current major version.
We have an interface called IDependable, but It's not a nice API and very explicit. I wonder if it will be sufficient to automatically just add all resources that are children of a dependency target instead, so when you do source.addDependency(target), the tree under target is inspected and any construct that has a logicalId under that tree will be automatically added.
Propagation as dependencies of all low-level constructs of the composite we depend on to DependsOn section.
-- Pros: simple, natural, no cryptic artifacts in the resulting CFN document
-- Cons: bloats (sometimes exponentially) each DependsOn section of individual simple construct or every DependsOn section of a composite if we establish dependencies between composites
Creating fake barrier artifacts and put dependencies on those
Let me describe it in more details. You need to create two nodes in CFN document - entry node for start barrier and exit nodes for completion barrier. If a composite depends on something, in CFN it will be reflected as start barrier node DependsOn this thing. If there are dependencies on the composite then those dependencies are reflected with DependsOn on completion node (barrier).
-- Pros: potentially better size optimization of the template, more direct mapping between model and representation.
-- Cons: presence of obscure barrier nodes in the output document, need to write optimizing algorithms to tree-shake useless barrier nodes if they don't have any dependencies, flatten dependency tree if needed to optimize resource usage, resource number limit exhaustion.
Oh, and another dimension to consider is nested stacks (they make sense after particular size threshold). However, it introduces value/attribute propagation problems between them.
package/awsclCross-cutting issues related to the AWS Construct Librarypr/breaking-changeThis PR is a breaking change. It needs to be modified to be allowed in the current major version.
Activity
[-]Reconsider IDependable[/-][+]Dependencies between constructs and resources[/+]buffovich commentedon Aug 29, 2018
Two strategies might be considered:
-- Pros: simple, natural, no cryptic artifacts in the resulting CFN document
-- Cons: bloats (sometimes exponentially) each DependsOn section of individual simple construct or every DependsOn section of a composite if we establish dependencies between composites
Let me describe it in more details. You need to create two nodes in CFN document - entry node for start barrier and exit nodes for completion barrier. If a composite depends on something, in CFN it will be reflected as start barrier node DependsOn this thing. If there are dependencies on the composite then those dependencies are reflected with DependsOn on completion node (barrier).
-- Pros: potentially better size optimization of the template, more direct mapping between model and representation.
-- Cons: presence of obscure barrier nodes in the output document, need to write optimizing algorithms to tree-shake useless barrier nodes if they don't have any dependencies, flatten dependency tree if needed to optimize resource usage, resource number limit exhaustion.
In https://github.com/awslabs/cloud-templates-ruby we chose the latter because of some important metrics of the templates we already have. For instance size limit becomes a serious problem for us shall we propagate dependencies. However, it's in no way optimal approach for everybody.
So, looking forward to developments on this front.
buffovich commentedon Aug 29, 2018
Oh, and another dimension to consider is nested stacks (they make sense after particular size threshold). However, it introduces value/attribute propagation problems between them.
feat(core): generalization of dependencies (#1583)
feat(core): generalization of dependencies (aws#1583)
feat(core): generalization of dependencies (aws#1583)