Skip to content

CapacityProvider includes null values for optional ScalingConfig property #3855

@vicheey

Description

@vicheey

Description

When using AWS::Serverless::CapacityProvider with optional ScalingConfig properties, the SAM translator incorrectly includes None/null values in the generated CloudFormation template, causing deployment failures or unexpected behavior.

Steps to reproduce

  1. Create a SAM template with AWS::Serverless::CapacityProvider
  2. Define ScalingConfig with only MaxVCpuCount (without AverageCPUUtilization)
  3. Or define InstanceRequirements with only some properties (e.g., only AllowedTypes)
  4. Run sam build and sam deploy
  5. The generated CloudFormation template includes null values for omitted properties

Observed result

The generated CloudFormation template contains null/None values for optional properties that were not specified in the SAM template, potentially causing validation errors or unexpected behavior during deployment.

Expected result

Optional properties that are not specified in the SAM template should be completely excluded from the generated CloudFormation template, not included with null values.

Additional environment details

  1. OS: macOS
  2. If using the SAM CLI, sam --version: 1.149.0
  3. AWS region: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions