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

Invoke Customisation Step Function exceeded maximum output limit

Open lawliet89 opened this issue 2 years ago • 8 comments

Terraform Version & Prov:

AFT Version: (Can be found in the AFT Management Account in the SSM Parameter /aft/config/aft/version)

1.7.0

Terraform Version & Provider Versions Please provide the outputs of terraform version and terraform providers from within your AFT environment

terraform version

1.3.7

terraform providers

provider[registry.terraform.io/hashicorp/aws] ~> 4.26

Bug Description

When I invoke a customisation step that involves many accounts, I run into a quota of Step Functions, namely the "Maximum input or output size for a task, state, or execution"

{
  "Error": "States.DataLimitExceeded",
  "Cause": "The state/task 'arn:aws:lambda:ap-southeast-1:123456789012:function:aft-customizations-identify-targets' returned a result with a size exceeding the maximum number of bytes service limit."
}

This is a combination of the large number of accounts (100+) and the amount of data we have in custom fields.

To Reproduce Steps to reproduce the behavior:

  1. Create large number of accounts.
  2. Fill account requests with sufficient amount of custom fields
  3. Invoke Customisation to target a large number of accounts
  4. See error
{
  "Error": "States.DataLimitExceeded",
  "Cause": "The state/task 'arn:aws:lambda:ap-southeast-1:123456789012:function:aft-customizations-identify-targets' returned a result with a size exceeding the maximum number of bytes service limit."
}

Expected behavior

To not fail

Related Logs

I can provide the lambda logs in a more private method if you need it.

Additional context

The recommended solution from the Step Functions documentation is to store the data somewhere else (e.g. S3) and pass around the ARN instead of raw JSON.

lawliet89 avatar Jan 18 '23 02:01 lawliet89

Hey @lawliet89!

Thank you for pointing out this issue! I went ahead and created an item in our backlog for this issue. Thanks!!

hanafya avatar Jan 18 '23 19:01 hanafya

May I suggest you use a DynamoDB table rather than an S3 bucket for this? The former is lightweight and fast, the latter is more work to manage.

On Wed, 18 Jan 2023 at 20:45, hanafya @.***> wrote:

Hey @lawliet89 https://github.com/lawliet89!

Thank you for pointing out this issue! I went ahead and created an item in our backlog for this issue. Thanks!!

— Reply to this email directly, view it on GitHub https://github.com/aws-ia/terraform-aws-control_tower_account_factory/issues/298#issuecomment-1387675539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAA6OJBITDLLNCAVXHTFFTWTBB6DANCNFSM6AAAAAAT6RED3M . You are receiving this because you are subscribed to this thread.Message ID: <aws-ia/terraform-aws-control_tower_account_factory/issues/298/1387675539@ github.com>

PeterBengtson avatar Jan 18 '23 19:01 PeterBengtson

Encountering the same issue, any delivery date for the fix ? Many thanks !

sl-ediquas avatar Jan 30 '23 09:01 sl-ediquas

Having the same issue, any delivery date for the fix ? Thanks !

gsl-ghassengabsi avatar Jan 30 '23 09:01 gsl-ghassengabsi

What's going on with this bug? This causes a hard fail on the entire step function and prevents any customization from being applied. This is causing a hard limit on the number of accounts we can manage with AFT even with limited custom field data.

seantibor avatar May 31 '23 15:05 seantibor

This starts to cause hard failures in our environment with even a modest number of accounts processing at once... I've seen it fail with even 15 or so accounts. This is a major scalability problem in the platform and should be addressed.

We would be able to put in a PR for this issue.... if AFT was open for collaboration.

cdhesse avatar May 31 '23 15:05 cdhesse

Just bumping this thread up as we are facing the same issue on account of having a large number of accounts

shashanklmurthy avatar Jan 09 '24 09:01 shashanklmurthy