aws-ia / terraform-aws-control_tower_account_factory

AWS Control Tower Account Factory
Apache License 2.0
644 stars 446 forks source link

module 'aft_common.feature_options' has no attribute 'get_target_account_and_customization_id_from_event' #507

Open jo-koe opened 1 week ago

jo-koe commented 1 week ago

Terraform Version & Prov:

AFT Version: 1.13.2

Terraform Version & Provider Versions N/A

terraform version N/A

terraform providers N/A

Bug Description We see below error if an existing Account Request JSON is updated:

{"errorMessage": "module 'aft_common.feature_options' has no attribute 'get_target_account_and_customization_id_from_event'", "errorType": "AttributeError", "requestId": "be0a3bd9-1c8c-49e4-9578-6e770320387d", "stackTrace": ["  File \"/var/task/aft_enroll_support.py\", line 27, in lambda_handler\n    feature_options.get_target_account_and_customization_id_from_event(event=event)\n"]}

To Reproduce Update an existing account request JSON file and merge/push into main which triggers the Step Function.

Expected behavior No error message is thrown.

Related Logs See below.

Additional context

It seems this function was introduced in the last AFT version: https://github.com/aws-ia/terraform-aws-control_tower_account_factory/commit/cd751f4f455e7220cf8e20d07ef4397f7187750f#diff-181cd51b57200d31062c6f0aa61f3410cfee32f29248c3e1211401c344158b05R27

floryut commented 16 hours ago

We got the same issue here.

Had to comment the function to make a quick&dirty workaround.

    #request_id, target_account_id = (
    #    feature_options.get_target_account_and_customization_id_from_event(event=event)
    #)

Looks like the aft-common-1-13-2 package does not include those 2 new function.