question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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:

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

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:13
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
eladbcommented, Dec 8, 2020

@pgarbe I am curious if you can use addFileAsset() to achieve this?

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);

    const template = stack.addFileAsset({
      packaging: cdk.FileAssetPackaging.FILE,
      sourceHash: 'git-commit',
      fileName: props.stack.templateFile,
    });

    new cfn.CfnStackSet(this, 'StackSet', {
      ...
      templateUrl: template.s3ObjectUrl
    });
  }
}

I’d be interested in adding official support for StackSets so let’s figure the right model and add it.

3reactions
0xjjoyycommented, Aug 20, 2021

Making the stack available as an asset use cases is also needed for AWS Config conformance packs.

https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-config.CfnOrganizationConformancePack.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

StackSets concepts - AWS CloudFormation
For stack sets with service-managed permissions, the administrator account ... A stack set lets you create stacks in AWS accounts across regions by...
Read more >
AWS CLI Command Reference Guide A - K - Hava.io
This guide details all of the commands available starting with A - K for each AWS service supported by the AWS command line...
Read more >
Azure Stack
Azure Stack Edge. Run edge-computing workloads. Get rapid insights with an Azure managed appliance using compute and hardware-accelerated machine learning at ...
Read more >
Verify the data input for AWS in Data Manager
Ask Questions, Get Help about Data Manager for Spl.. ... Not Found status means that the AWS stack set or the stack instances...
Read more >
CloudGuard Administration Guide - Check Point
Supported Packages. 379. Workflow. 379. CLI Tool Update. 379. CI/CD Tool Installation. 380. Image Scan Configuration in CloudGuard.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found