perf(apigateway): read the account singleton once per provider#6912
Draft
jasonrowsell wants to merge 3 commits into
Draft
perf(apigateway): read the account singleton once per provider#6912jasonrowsell wants to merge 3 commits into
jasonrowsell wants to merge 3 commits into
Conversation
Since terraform-provider-aws v6, destroying aws_api_gateway_account resets cloudwatchRoleArn to null. The setup resource only exists in the program while the account has no role configured, so the cycle was: bootstrap sets the ARN, the next deploy drops the setup resource and the destroy resets the ARN, and the deploy after that bootstraps again with a fresh orphan role. Retaining the resource on delete keeps the account settings and converges after the first deploy.
a2dfb4a to
611315b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #6911 — the first two commits are that PR; review just the last one.
Every
ApiGatewayV1/ApiGatewayWebSocketregisters its own Read of the API Gateway account, and Pulumi re-reads each from AWS on everyup,diff, andrefresh. The account is a per-provider singleton, so on an app with 35 gateways that's 40 identical AWS calls per deploy. Deduplicating them cut a no-changepulumi upfrom 35s to 22s on our largest app.This memoizes the read per provider (
lazy+ Map, same pattern asuseProvider):dependsOnordering for stages/log groups unchanged.providers(plural) or inheritance → unchanged: the read stays on the default provider, as today.APIGatewayAccountSetupkeeps its name, role singleton unchanged.Added
platform/test/components/apigateway-account.test.tscovering read identity per provider and URN uniqueness across providers. It deliberately skips theimport "../../src/global.d.ts"line — that file runtime-imports@types/node, which breaks vitest collection in the suites that include it.