Skip to content

Support custom logicalId separate from name #124

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

Merged
merged 1 commit into from
Jul 9, 2018
Merged

Support custom logicalId separate from name #124

merged 1 commit into from
Jul 9, 2018

Conversation

dougmoscrop
Copy link
Contributor

I think it would be better to just use the key as the logical id, but this is more backwards-compatible.

This allows specifying an id that is different than the name. This makes it more deterministic for purposes of Ref, etc.

stepFunctions:
  stateMachines:
    foo:
      id: MyStateMachine # this only needs to be unique within the template
      name: myStateMachine-${opt:stage} # this has to be unique across stages, etc.

In fact, where key means the stateMachines key for a given state machine, I think making the name default to "{service}-{key}-{stage}" and the logicalId to {Key}StepFunctionStateMachine is a very sensible default.

@horike37
Copy link
Collaborator

Hi, @dougmoscrop thank you for implementing such as the awesome enhancement 🎉
Just tested this PR and looks great to see working as expected 👍
I would love to add this to the next release!

Just one more thing, could you document the explanation of id statement to README?

@horike37 horike37 added this to the 1.5 milestone Jun 25, 2018
@dougmoscrop
Copy link
Contributor Author

Will do!

@dougmoscrop
Copy link
Contributor Author

I updated the README and rebased on the latest changes.

@dougmoscrop
Copy link
Contributor Author

@horike37 sorry for the delay, fixed the lint issues too. should be good to go.

@horike37
Copy link
Collaborator

horike37 commented Jul 9, 2018

@dougmoscrop
Thanks!

@horike37 horike37 merged commit 6415b35 into serverless-operations:master Jul 9, 2018
ss-betseqnzr pushed a commit to BetSEQNZR/serverless-step-functions that referenced this pull request Sep 8, 2023
Support custom logicalId separate from name
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.

2 participants