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

StackSetTarget - Improvement - Prevent empty account ID arrays from being passed down to the CfnStackSet #384

Open
Obirah opened this issue Mar 12, 2024 · 0 comments

Comments

@Obirah
Copy link

Obirah commented Mar 12, 2024

When using StackSetTarget.fromOrganizationalUnits(...) and passing additionalAccounts it is possible to pass an empty array which makes sense because of the types that are necessary for that parameter (i.e. string[] | undefined).

However, the underlying CfnStackSet will cause a validation error when trying to deploy it, because it does not allow the Accounts array in the deployment target section to be empty:

The validation error: [#/StackInstancesGroup/0/DeploymentTargets/Accounts: expected minimum item count: 1, found: 0]

I'd suggest to add a check for an empty account ID array (maybe here) which will transform every empty account ID array into undefined.

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

No branches or pull requests

1 participant