awslabs / aws-service-catalog-factory

This is a framework where you define a Service Catalog portfolio, products and versions using YAML. For versions of your products you specify where the source code for them can be found and the framework publishes the portfolio, products and versions in every* AWS Region after validating, linting and testing them.
Apache License 2.0
136 stars 44 forks source link

Lambda servicecatalog-tools--StartCDKDeploy crhelper errors #252

Open CrazyCatMandy opened 2 years ago

CrazyCatMandy commented 2 years ago

Please ensure you are using the latest version and have tried to run a validate command on your source files

Steps to reproduce

  1. Empty clean account that has only had the following run: Puppet bootstrap for account to create puppet role cdk support iam run in account cdk support bootstrap run in account
  2. Manually add system parameter for /cdk-bootstrap/hnb659fds/version and set to be 12
  3. create lambda layer for crhelper and add to lambda servicecatalog-tools--StartCDKDeploy
  4. trigger a package deployment in service catalog that was for a basic cdk package (in my case one to just create an s3 bucket)
  5. Inspect the cloudwatch log for the lambda in step3

Expected results

Lambda should run to completion

Actual results

image

Comments

This looks to be complaining about the helper code. I am using crhelper-2.0.5.dist-info. In this the PutRule operation on the Parameter ScheduleExpression seems to point to a self._polling_interval that is originally set at the top of the code resource_helper.py to be 2.

Is this an issue with the crhelper lambda layer version or something else? Would help if the lambda application for the account cdk bootstrapping code included the crhelper elements that it needed to avoid such issues.

Thanks

CrazyCatMandy commented 2 years ago

Have done some of my own debugging on this and it seems that setting the polling_interval=1 at the start of the start_cdk_deploy lambda can cause issues with crhelper. This is because the standard crhelper code using minutes (pleural) in the regular expression and for the value to be 1 it would have to use minute (singular). Not found a version of crhelper code that deals with that situation as yet.

robbrad commented 2 years ago

@CrazyCatMandy - Have you raise an issue on https://github.com/aws-cloudformation/custom-resource-helper/issues ? Where in the crhelper source code is the regex?