aws / aws/aws-cdk

StackSet/Conformance Packs support - make stacks available as an asset

Open
#11,896 28 comments 15 reactions 0 assignees View on GitHub
@aws-cdk/core effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

A stack should be made available as an asset. At the moment it's not possible to add the generated template file as asset in another stack, as the file does not exist at this point in time.

### Use Case
If you want to deploy a StackSet or ServiceCatalog Product (in a pipeline) two stacks are used. One stack contains the StackSet construct and the other stack (let's call it template stack) is the one which should be deployed in target accounts via StackSet. This template stack will never deployed directly but just synthesized. The StackSet stack needs an s3 url of the template stack.

This could be also related to an integration with Proton where it's also the synthesized stack template needs to be available as asset as well.

### Proposed Solution
The usage could look like this:

```typescript
export interface StackSetStackProps extends cdk.StackProps {
stack: cdk.Stack
...
}

export class StackSetStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props: StackSetStackProps) {
super(scope, id, props);

new cfn.CfnStackSet(this, 'StackSet', {
...
templateUrl: new s3assets.Asset(props.stack),
});
}
}
```

Not sure how the implementation could look like.

### Other

* [x] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change

---

This is a :rocket: Feature Request

Contributor guide

Open the contributing guide

Research direction

Start by reading the Stack, CfnStackSet, and s3assets.Asset entry points named in the proposal, then trace when synthesized stack templates become available. Clarify how a synthesized template can be exposed as an asset and referenced by its S3 URL. Done means the proposed StackSet usage works without deploying the template stack directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.