terraform-aws-control_tower_account_factory icon indicating copy to clipboard operation
terraform-aws-control_tower_account_factory copied to clipboard

Metadata SSM fails for non-strings

Open jarrod-lowe opened this issue 2 years ago • 1 comments

AFT Version: 1.6.0

Bug Description In the metadata SSM lambda, if the custom_fields is not strictly a map of strings, the SSM apply fails.

To Reproduce Steps to reproduce the behavior: In the terraform for the account request, set custom_fields to something with a non-string, i.e.: custom_fields = {"foo": [1, 2]} Create the account, or invoke the customisation. You'll get an error in aft-account-provisioning-framework-account-metadata-ssm

Expected behavior No error

Related Logs Invalid type for parameter Value, value: [1,2], type: <class 'list'>, valid types: <class 'str'>

Additional context Workaround: Modify the lambda to add the line: custom_fields = {key: str(value) for (key, value) in custom_fields.items() Arguably, a better solution would be a string of JSON.

jarrod-lowe avatar Jul 25 '22 23:07 jarrod-lowe

@jarrod-lowe thank you for reaching out. Currently this behavior is as per design, however, we do have an existing backlog to support structured JSON as input to custom_fields

snebhu3 avatar Aug 02 '22 17:08 snebhu3