Summary
Terraform currently JSON-encodes the merged parameter_store_tags map and injects the complete payload into SSM_PARAMETER_STORE_TAGS for the scale-up and pool Lambdas.
AWS Lambda limits all environment variables associated with a function to 4 KB in aggregate. As the configured tag set grows, this JSON payload competes with the rest of the Lambda configuration and can cause function creation or updates to fail.
Store the JSON-encoded tag payload in SSM Parameter Store and expose only its parameter path to the Lambdas.
Proposed direction
- Keep the public
parameter_store_tags map input unchanged.
- Create a module-managed parameter under the existing runner configuration path, for example
${ssm_config_path}/parameter_store_tags.
- Store the current
{ Key, Value }[] JSON representation in that parameter.
- Replace the inline JSON environment value with the parameter path through an explicit variable such as
SSM_PARAMETER_STORE_TAGS_PATH.
- Have both the scale-up and pool Lambdas retrieve the value through the shared SSM utility and validate it with the existing tag validation.
- Keep access within the existing runner-config-path IAM scope; do not broaden the Lambda permissions.
- Preserve current empty-map behavior and the public Terraform contract.
- Explicitly handle the selected Parameter Store representation's value-size limit through validation, tier selection, or chunking so oversized tag payloads fail clearly rather than silently moving the limit.
Acceptance criteria
Related work
Summary
Terraform currently JSON-encodes the merged
parameter_store_tagsmap and injects the complete payload intoSSM_PARAMETER_STORE_TAGSfor the scale-up and pool Lambdas.AWS Lambda limits all environment variables associated with a function to 4 KB in aggregate. As the configured tag set grows, this JSON payload competes with the rest of the Lambda configuration and can cause function creation or updates to fail.
Store the JSON-encoded tag payload in SSM Parameter Store and expose only its parameter path to the Lambdas.
Proposed direction
parameter_store_tagsmap input unchanged.${ssm_config_path}/parameter_store_tags.{ Key, Value }[]JSON representation in that parameter.SSM_PARAMETER_STORE_TAGS_PATH.Acceptance criteria
SSM_PARAMETER_STORE_TAGS.parameter_store_tagsinput behavior.Related work
RUNNER_CONFIGout of Lambda environment variables.