awslabs / aws-service-catalog-products

This repository contains a number of CloudFormation templates which can be used independently or as Products with AWS Service Catalog including the Open Source Tools AWS Service Catalog Factory and AWS Service Catalog Puppet. The templates include a number of the foundational AWS Services you may choose to manage Account Compliance including AWS Config, AWS CloudTrail and GuardDuty
MIT No Attribution
162 stars 36 forks source link

move-to-ou being invoked with null for account_id #49

Open puddleglum1904 opened 3 years ago

puddleglum1904 commented 3 years ago

On a new account creation run using AVM, the move-to-ou function fails on the first run with a null value passed:

Sample log snippet:

START RequestId: 12ca5541-e4de-46a0-b495-f2614f2e9412 Version: $LATEST
--
[INFO]  2020-12-08T21:40:48.967Z    12ca5541-e4de-46a0-b495-f2614f2e9412    Create
[INFO]  2020-12-08T21:40:49.253Z    12ca5541-e4de-46a0-b495-f2614f2e9412    Found credentials in environment variables.
[INFO]  2020-12-08T21:40:50.513Z    12ca5541-e4de-46a0-b495-f2614f2e9412    list_parents: {'ChildId': 'null'}
[INFO]  2020-12-08T21:40:50.514Z    12ca5541-e4de-46a0-b495-f2614f2e9412    searching, NextToken: FirstPage
[ERROR] 2020-12-08T21:40:50.713Z    12ca5541-e4de-46a0-b495-f2614f2e9412    An error occurred (InvalidInputException) when calling the ListParents operation: You provided a value that does not match the required pattern.
[INFO]  2020-12-08T21:40:50.982Z    12ca5541-e4de-46a0-b495-f2614f2e9412    Status message: OK 200
END RequestId: 12ca5541-e4de-46a0-b495-f2614f2e9412
REPORT RequestId: 12ca5541-e4de-46a0-b495-f2614f2e9412  Duration: 2026.49 ms    Billed Duration: 2027 ms    Memory Size: 128 MB Max Memory Used: 76 MB  Init Duration: 567.75 ms

If the AVM product is run a second time it works w/o issue.

eamonnfaherty commented 3 years ago

I think this may have been due to #46

When this occurred what was the outputs value for AccountId in the account creation product?

puddleglum1904 commented 3 years ago

@eamonnfaherty we had already applied the fix you pushed up for account-creation-shared when this error occurred.