Skip to content

Conversation

@vicheey
Copy link
Contributor

@vicheey vicheey commented Jan 7, 2026

Description:

The CapacityProvider schema was too restrictive for list properties when using CloudFormation intrinsic functions, so we updated the schema to support both direct arrays and intrinsic function objects.

Schema validation tests were failing when using intrinsic functions like !Ref for list properties in CapacityProvider resources.

Description of changes

  • Updated aws_serverless_capacity_provider.py schema to wrap list properties with SamIntrinsicable to support both arrays and intrinsic function objects
  • Regenerated JSON schema files (sam.schema.json and schema.json) to reflect the updated Python schema
  • Updated test expectations in error_capacity_provider_multiple_resources_validation.json to match new validation error messages that now say "value must be dictionary or list" instead of "value is not a valid list"

Before (not supported):

Resources:
 MyCapacityProvider:
   Type: AWS::Serverless::CapacityProvider
   Properties:
     VpcConfig:
       SecurityGroupIds: !Ref SecurityGroupIdList  # Failed validation
       SubnetIds: !Ref SubnetIdList                 # Failed validation
     InstanceRequirements:
       Architectures: !Ref ArchitecturesList       # Failed validation

After (now supported):

Resources:
 MyCapacityProvider:
   Type: AWS::Serverless::CapacityProvider
   Properties:
     VpcConfig:
       SecurityGroupIds: !Ref SecurityGroupIdList  #  Now works
       SubnetIds: !Ref SubnetIdList                 #  Now works
     InstanceRequirements:
       Architectures: !Ref ArchitecturesList       # Now works
       # Direct arrays still work too:
       AllowedTypes: ["c5.large", "c5.xlarge"]     #  Still works

Description of how you validated change

# Verified schema validation test passes
$ python -m pytest tests/schema/test_validate_schema.py::TestValidateSchema::test_validate_schema_032__
Volumes_workplace_LambdaTooling_aws_serverless_application_model_tests_translator_input_capacity_
provider_with_intrinsics_yaml -v

# Verified error validation test passes  
$ python -m pytest tests/translator/test_translator.py::test_transform_invalid_document[error_capacity_
provider_multiple_resources_validation] -v

Checklist

@vicheey vicheey requested a review from a team as a code owner January 7, 2026 22:49
…stanceRequirements list properties

Update schema to allow both arrays and objects (for intrinsic functions) in list properties, and update corresponding test expectations.
@vicheey vicheey force-pushed the support-intrinsic-functions-CapacityProvider-VpcConfig-nstanceRequirements-list-properties branch from 89048f2 to 16ba761 Compare January 7, 2026 22:54
@vicheey vicheey requested a review from bnusunny January 7, 2026 23:26
@vicheey vicheey requested a review from Vandita2020 January 8, 2026 17:54
@vicheey vicheey merged commit 5c61dee into develop Jan 8, 2026
7 checks passed
@vicheey vicheey deleted the support-intrinsic-functions-CapacityProvider-VpcConfig-nstanceRequirements-list-properties branch January 8, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants