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

Creating types sequentially takes a long time #524

Open
dbaynard opened this issue Jul 24, 2023 · 3 comments
Open

Creating types sequentially takes a long time #524

dbaynard opened this issue Jul 24, 2023 · 3 comments

Comments

@dbaynard
Copy link

do {
await sleep(3000);
registrationStatus = await cfn.describeTypeRegistration({ RegistrationToken: response.RegistrationToken }).promise();
} while (registrationStatus.ProgressStatus === 'IN_PROGRESS');

Is there a way to execute this for multiple types in parallel, so the total wait time is roughly a minute, the time it appears to take for the type to register, as opposed to n minutes for n types — this feels unnecessarily painful when setting up new accounts, in an existing organization (if it only happened when setting up the org then I'd be ok with it, though it would not be ideal)?

Naively, I might expect that rewriting the plugin to handle multiple types would then work… but I don't know whether there are AWS limits. If there is no such limit, would such a change — or an equivalent — be welcome? (I'd add a new plugin, to avoid breaking changes.)

@OlafConijn
Copy link
Member

What typically is done to run type-registration in parallel is to increase the MaxConcurrentTasks (see here.)

this will ensure the types gets registered to different accounts & regions in parallel.
if you have a lot of different types, you can set the MaxConcurrentTasks on the Type: include-task that imports the type registrations.

hope that helps

@dbaynard
Copy link
Author

dbaynard commented Sep 20, 2023

Thanks — I have MaxConcurrentTasks set to 100 as in your example, but I'm hitting the issue for a single account/region.

I don't have it on for the Type: include block, so I'll do that.

 Types:
   Type: include
+  MaxConcurrentTasks: 100
   DependsOn: OrganizationBuild
   Path: ./templates/005-types/_tasks.yml

Where would be the best place to document this (so I can close the issue — assuming it does in fact work)?

@OlafConijn
Copy link
Member

for documentation on this attribute I would refer to the documentation on the include-task. It already mentions the attribute. If you would have expected it somewhere else: feel free to add it!

also happy to close the issue as-is. thanks

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

2 participants