Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add the property UseAliasAsEventTarget to AWS::Serverless::StateMachine and make associated events use the state machine alias as a target. #3627

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

scorbiere
Copy link
Contributor

@scorbiere scorbiere commented Jul 22, 2024

Issue #3624

Description of changes

This change add a property UseAliasAsEventTarget to AWS::Serverless::StateMachine and make associated events use the state machine alias as a target.

Description of how you validated changes

Used the following template as input:

Transform:
  - AWS::LanguageExtensions
  - AWS::Serverless-2016-10-31
Resources:
  ExampleFunction:
    Type: AWS::Serverless::Function
    Properties:
      AutoPublishAlias: live
      Runtime: provided.al2023
      Handler: bootstrap
      CodeUri: s3://aws-sam-cli-managed-default-samclisourcebucket-example/example-fn
      Events:
        LambdaExample:
          Type: EventBridgeRule
          Properties:
            Pattern:
              source: [ aws.tag ]
  ExampleMachine:
    Type: AWS::Serverless::StateMachine
    Properties:
      AutoPublishAlias: live
      UseAliasAsEventTarget: true
      Events:
        MachineExample:
          Type: EventBridgeRule
          Properties:
            Pattern:
              source: [aws.tag]
      DefinitionUri:
        Bucket: aws-sam-cli-managed-default-samclisourcebucket-example
        Key: example-asl

With the folowing variations:

  • Without the property UseAliasAsEventTarget --> same output as before this change.
  • With the property UseAliasAsEventTarget set to false --> same output as before this change.
  • With the property UseAliasAsEventTarget set to true --> output template is new ussing the alias as the event target and also used in the generated permission for the action states:StartExecution.

Checklist

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

…ne and make associated events use the state machine alias as a target.
@scorbiere scorbiere requested a review from a team as a code owner July 22, 2024 23:40
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an integration test and test dependability?

@scorbiere scorbiere changed the title Add the property UseAliasAsEventTarget to AWS::Serverless::StateMachine and make associated events use the state machine alias as a target. fix: Add the property UseAliasAsEventTarget to AWS::Serverless::StateMachine and make associated events use the state machine alias as a target. Aug 10, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scorbiere scorbiere merged commit 249dc32 into aws:develop Aug 12, 2024
7 checks passed
@scorbiere scorbiere deleted the fix_event_target_statemachine_alias branch August 12, 2024 20:28
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