Skip to content

Added encryptionconfiguration support for WS::Serverless::StateMachine#3932

Open
VanditGupta wants to merge 1 commit into
aws:developfrom
VanditGupta:feature/3925-statemachine-encryption-configuration
Open

Added encryptionconfiguration support for WS::Serverless::StateMachine#3932
VanditGupta wants to merge 1 commit into
aws:developfrom
VanditGupta:feature/3925-statemachine-encryption-configuration

Conversation

@VanditGupta
Copy link
Copy Markdown

Summary

Passthrough EncryptionConfiguration from AWS::Serverless::StateMachine to AWS::StepFunctions::StateMachine, enabling customer-managed KMS encryption for Step Functions state machines defined in SAM templates.

Issue

Fixes #3925

Description of changes

  • Added EncryptionConfiguration as a pass-through property on AWS::Serverless::StateMachine (sam_resources.py).
  • Updated StateMachineGenerator to set EncryptionConfiguration on the generated AWS::StepFunctions::StateMachine resource (generators.py, stepfunctions/resources.py).
  • Updated SAM schema and documentation:
    • samtranslator/internal/schema_source/aws_serverless_statemachine.py
    • samtranslator/internal/schema_source/sam-docs.json
    • Regenerated schema_source/sam.schema.json and samtranslator/schema/schema.json
  • Added translator test case state_machine_with_encryption_configuration (input + expected output for aws, aws-cn, and aws-us-gov).

Example SAM usage:

MyStateMachine:
  Type: AWS::Serverless::StateMachine
  Properties:
    Definition:
      StartAt: Hello
      States:
        Hello:
          Type: Pass
          End: true
    EncryptionConfiguration:
      Type: CUSTOMER_MANAGED_KMS_KEY
      KmsKeyId: !GetAtt MyKmsKey.Arn
      KmsDataKeyReusePeriodSeconds: 300
    Policies:
      - ...

Transforms to AWS::StepFunctions::StateMachine with the same EncryptionConfiguration block, aligned with CloudFormation EncryptionConfiguration.

Description of how you validated changes

  • Ran translator tests for the new fixture across partitions:

    pytest tests/translator/test_translator.py -k state_machine_with_encryption_configuration -o addopts=

    (3 passed: aws, aws-cn, aws-us-gov)

  • Ran existing state machine generator unit tests:

    pytest tests/model/stepfunctions/test_state_machine_generator.py -o addopts=

    (15 passed)

  • Regenerated schemas and confirmed they match committed files:

    python3 -m samtranslator.internal.schema_source.schema \
      --sam-schema .tmp/sam.schema.json \
      --cfn-schema schema_source/cloudformation.schema.json \
      --unified-schema .tmp/schema.json
    diff schema_source/sam.schema.json .tmp/sam.schema.json
    diff samtranslator/schema/schema.json .tmp/schema.json

Checklist

Examples?

N/A — no new sam init example template in this PR.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Passthrough EncryptionConfiguration to AWS::StepFunctions::StateMachine
for customer-managed KMS encryption.
@VanditGupta VanditGupta requested a review from a team as a code owner May 29, 2026 03:41
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.

Feature Request: Add EncryptionConfiguration for AWS::Serverless::StateMachine

1 participant