aws-deployment-framework
aws-deployment-framework copied to clipboard
[Bug]: adf-account-management StateMachine fails if first 30 characters of account name are similar.
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
When you create multiple accounts in a single file the StateMachine fails to start cause stepfunctions states that it has already been started:
[ERROR] ExecutionAlreadyExists: An error occurred (ExecutionAlreadyExists) when calling the StartExecution operation: Execution Already Exists: 'arn:aws:states:us-east-1:xxxxxxxxxxx:execution:adf-account-management:LongClientName___Business_Names__-29a4174a-4ce7-4597-bc58-89fda1121172-96ac41b3da60' Traceback (most recent call last): File "/var/task/process_account_files.py", line 206, in lambda_handler start_executions( File "/var/task/process_account_files.py", line 179, in start_executions sfn_client.start_execution( File "/var/task/botocore/client.py", line 565, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/task/aws_xray_sdk/ext/botocore/patch.py", line 38, in _xray_traced_botocore return xray_recorder.record_subsegment( File "/var/task/aws_xray_sdk/core/recorder.py", line 456, in record_subsegment return_value = wrapped(*args, **kwargs) File "/var/task/botocore/client.py", line 1021, in _make_api_call raise error_class(parsed_response, operation_name)
So in case the accounts follow a naming standard like: LongClientName - BusinessName - Development/Production etc
The 30 selected first letters + id from process_account_files.py sends the exact same ID for both accounts into step functions.
Expected Behavior
Should run for each account in the account file, with zero regard to the naming being similar.
Current Behavior
ERROR] ExecutionAlreadyExists: An error occurred (ExecutionAlreadyExists) when calling the StartExecution operation: Execution Already Exists: 'arn:aws:states:us-east-1:xxxxxxxxxxx:execution:adf-account-management:LongClientName___Business_Names__-29a4174a-4ce7-4597-bc58-89fda1121172-96ac41b3da60'
The execution of the file stops - it will not try to run the state machines for accounts below the first failure either.
Steps To Reproduce
Add two new accounts into the account file, with first characters being the same.
Possible Solution
Add a short random string in front of the account name, instead of behind in step function trigger.
Additional Information/Context
No response
ADF Version
4.0.0
Contributing a fix?
- [ ] Yes, I am working on a fix to resolve this issue