aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

feat(servicecatalog): Add Product Stack Asset Support

Open imanolympic opened this issue 3 years ago • 3 comments

Description

  • Draft pull request for product stack asset support feature, as referenced by issue #20690.
  • This PR is dependent on changes to the S3 deployment module. The changes were included in this PR but will be isolated to a separate PR soon. This issue can be referenced here #8065

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

imanolympic avatar Aug 08 '22 16:08 imanolympic

gitpod-io[bot] avatar Aug 08 '22 16:08 gitpod-io[bot]

Great, I will replace the unit test accounts with the dummy account value.

The reason we need an actual account id for the integration tests is that one of our constructs (product-stack-asset-bucket) creates an s3 bucket and the name of this bucket relies on the untokenized account id. Because the account id can't be a token, it is necessary for the account id to be defined in the stack environment. The user can do this in one of two ways:

  1. explicitly - env: { account: 'xxxxxxxxxxxxx', region: 'us-east-1' }
  2. implicitly - env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }

This being said, I did try referencing the account id implicitly. Even though I set up my local credentials, the integration test stack didn't pick up the local credentials (I am not sure why) and our new construct threw the following error: CDK Account ID must be defined in the application environment. This forced me to explicitly include the account id.

I imagine even if there was a dummy account id for the integration tests it wouldn't matter being that the names of our buckets in the CFN stack template would change depending on the account defined in the environment. Moreover, CDK complained when my local credentials didn't match the account id defined in the environment, forcing me to believe that in order to run integ tests, the local account credentials must match the environment account.

For the reasons above, It seems it may not be feasible to test this new feature in integration tests. What are your thoughts?

imanolympic avatar Aug 08 '22 21:08 imanolympic

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: c31fad148e366490385e542d039b4178fd8ace89
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

aws-cdk-automation avatar Aug 09 '22 03:08 aws-cdk-automation

Hi @imanolympic Is there any progress on this one?

padaszewski avatar Aug 27 '22 13:08 padaszewski

Hi @imanolympic Is there any progress on this one?

Yes, we have split this PR into two. The S3 PR will be out this week, and the SC PR will follow promptly. On a good note, we managed to find a way to support both the user passing in a product stack asset bucket and SC creating it in the background.

imanolympic avatar Aug 27 '22 15:08 imanolympic

This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

aws-cdk-automation avatar Aug 30 '22 17:08 aws-cdk-automation

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

aws-cdk-automation avatar Sep 06 '22 20:09 aws-cdk-automation