Skip to content

Allow reference against specific version of function #240

@theburningmonk

Description

@theburningmonk

This is a Feature Proposal

Description

To make it easy to implement blue-green deployments for step functions (hence ensuring that running executions are not affected by deployments), we can add a configuration option to reference the current version of functions.

e.g.

stepFunctions:
  stateMachines:
    myStateMachine:
      name: blah
      useExactVersion: true # default to false for backward compatibility
      definition:
        StartAt: Hello
        States:
          Hello:
            Type: Task
            Resource:
              Fn::GetAtt: [hello, Arn] # we'll replace this
            End: true

When useExactVersion is true, we can swap out the function ARN with the ARN of the version to be deployed.

We'll also need to adjust the IAM roles that are generated to allow InvokeFunction permission on all versions (e.g. arn:aws:lambda:us-east-1:123456789012:function:hello:*) as well. Otherwise, after a deploy, the existing executions would lose the ability to invoke the previous version of the functions.

More info on how I managed to do this with alias instead of versions: https://theburningmonk.com/2019/08/how-to-do-blue-green-deployment-for-step-functions/

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