aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

Stabilize AWS Service Catalog module #6874

Open SomayaB opened 4 years ago

SomayaB commented 4 years ago

Add your +1 đź‘Ť to help us prioritize high-level constructs for this service


Overview:

AWS Service Catalog enables organizations to create and manage catalogs of products that are approved for use on AWS.

AWS Docs

Maturity: CloudFormation Resources Only

See the AWS Construct Library Module Lifecycle doc for more information about maturity levels.

Implementation:

See the CDK API Reference for more implementation details.

Issue list:

AlexRex commented 4 years ago

@SomayaB I am wondering how far is this being implemented/designed? Currently, we would like to use CDK for creating some products in a service catalog, but we're facing a major issue being that first we need to publish the YAML templates to S3.

So it would be great if it would be possible to do something like this:

import * as cdk from '@aws-cdk/core';
import { CfnCloudFormationProduct } from '@aws-cdk/aws-servicecatalog';
import { CfnParameter, CfnOutput, Fn } from '@aws-cdk/core';
import { Bucket } from '@aws-cdk/aws-s3';

class S3Stack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const bucketName = new CfnParameter(this, 'BucketName');

    this.templateOptions.metadata = {
      'AWS::CloudFormation::Interface': {
        ParameterGroups: [
          {
            Label: { default: 'Bucket Configuration' },
            Parameters: [bucketName.logicalId]
          }
        ],
        ParameterLabels: {
          [bucketName.logicalId]: {
            default: 'Which name should the bucket have'
          }
        }
      }
    }

    const bucket = new Bucket(this, 'test-bucket', {
      bucketName: bucketName.valueAsString
    });

    new CfnOutput(this, 'S3Id', {
      value: bucket.bucketArn,
      exportName: Fn.sub('${AWS::StackName}-S3Id')
    })
  }
}

export class EmptyCdkStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const product = new CfnCloudFormationProduct(this, 's3-product', {
      name: 'S3 Product',
      description: 'This is an s3 product',
      owner: 'whoever',
      provisioningArtifactParameters: [
        {
          info: S3Stack
        }
      ]
    });
  }
}

The major issue here is that:

      provisioningArtifactParameters: [
        {
          info: S3Stack
        }
      ]

expects a "LoadTemplateFromURL": "https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/..." property instead, being the URL a template in an S3 bucket.

AlexRex commented 4 years ago

If someone is reaching here and needs some light on how to achieve my previous comment until there's some development in the CDK project I put together a project to showcase it: https://github.com/AlexRex/cdk-service-catalog

The idea is to create a stack inside a stack (which won't be deployed) and get the resulting JSON template out of it (https://github.com/AlexRex/cdk-service-catalog/blob/master/src/products/s3-bucket/s3-bucket.product.ts#L11).

I hope it helps.

MrArnoldPalmer commented 4 years ago

@AlexRex this isn't currently being worked on by the core team, but we are always accepting contributions if you're interested in pushing this forward.

You can look at the roadmap to see which modules the core team is working on developing at any given time.

alisade commented 3 years ago

+1

arcrank commented 3 years ago

@AlexRex pleased to share that we have released new feature with this latest PR that allows you to create a product version/artifact from what we call a ProductStack.

evgenyka commented 1 year ago

Graduated as GA: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_servicecatalog-readme.html

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

chris-bateman commented 1 year ago

@TheRealAmazonKendra what else would need to be done to stablize this AWS feature?

This issue is a major missing feature - https://github.com/aws/aws-cdk/issues/24757

github-actions[bot] commented 8 months ago

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.