Closed CaerusKaru closed 2 years ago
cc @skinny85 @eladb
I am trying to wrap my head around the proposed API. Can you provide a more complete example?
Something like this:
const otherAccountStack = Stack.external(this.node.root, '12345678', 'us-west-2');
const roleId = 'DelegateHostRole';
const hostRole: Role = otherAccountStack.node.tryFindChild(roleId) as Role | undefined || new Role(otherAccountStack, roleId, {...});
EDIT: Sorry, that comment only made partially sense here. Moved it into a new issue https://github.com/aws/aws-cdk/issues/8776
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Currently
aws-codepipeline-actions
has a utility that enables generating resources for cross-account deployments. It does this by creating a stack in the necessary account that the CDK can deploy to setup the resources for later use.However, if people writing other constructs wish to take on likewise actions, for say cross-account DNS delegation, they are stuck needing to duplicate the logic for that package, leading to two separate stacks for the same account (with the same goal in mind – cross-account resources).
I'm proposing creating a utility, possibly a static method on the
Stack
class that can return the resource stack for cross-account/cross-region purposes.Use Case
I'm writing a cross-account DNS domain delegation construct that would benefit from not duplicating this logic.
Proposed Solution
Something like this:
Other
This is a :rocket: Feature Request