Closed TonySherman closed 5 months ago
Just drafting a PR to see what you think of the implementation. Have not addressed the Terraform changes yet.
I am not real familiar with Terraform but it looks like we could actually have a similar functionality by giving the statemachine a name_prefix instead of name
If that's the case, I think we just need to update this line
Thanks @TonySherman, this looks great 🚀
@ldcorentin any chance you can share your feedback on the Terraform side of things? 😄
@TonySherman I have added MaxLength
to make sure the 44 chars limit is applied.
I would also play with AllowedPattern
to make sure that we avoid restricted characters.
As for the documentation (here):
A name must not contain:
- white space
- brackets < > { } [ ]
- wildcard characters ? *
- special characters " # % \ ^ | ~ ` $ & , ; : /
- control characters (U+0000-001F, U+007F-009F)
@TonySherman I have added
MaxLength
to make sure the 44 chars limit is applied.I would also play with
AllowedPattern
to make sure that we avoid restricted characters.As for the documentation (here):
A name must not contain: - white space - brackets < > { } [ ] - wildcard characters ? * - special characters " # % \ ^ | ~ ` $ & , ; : / - control characters (U+0000-001F, U+007F-009F)
I think the regex pattern I added should meet those requirements by limiting to alphanumeric characters.
@TonySherman I've done a few minor things:
-
and _
as wellname_prefix
instead of name
- I think this is a more useful solution that allows you to deploy the same stack to the same account twice without naming conflicts (there might be other conflicts though!)It if all makes sense to you, I'll be happy to merge this PR :)
(don't worry about the failing integration test, it's an auth error on my side)
Also, I've realized we only have 43 characters for the prefix (not 44), since we're using one for the -
delimiter :)
Good catch on the character count and the characters I missed! 😂
Those changes all look great to me! Really nice working with you on this!
This will address #220, allowing customized prefixes for the StateMachine name.
It is defaulted to the original name
powerTuningStateMachine
but the appended id will be slightly longer.Current default:
powerTuningStateMachine-8WZnCEWFsLBW
This PR changes the default to:
powerTuningStateMachine-7c304ce0-a4ff-11ee-89b2-0ea1c2170c63
and allows the customized prefix:
myCustomPrefix-7c304ce0-a4ff-11ee-89b2-0ea1c2170c63