From 6a45a0845b4cb49e5c20179b76fa0712b1d71a29 Mon Sep 17 00:00:00 2001 From: Olaf Conijn Date: Sat, 13 Dec 2025 13:41:57 +0100 Subject: [PATCH 1/2] chore: improved backoff --- package.json | 2 +- src/aws-provider/aws-organization-writer.ts | 4 ++-- src/plugin/impl/rp-build-task-plugin.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b32bc509..a6354211 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aws-organization-formation", - "version": "1.0.17-beta.2", + "version": "1.0.18", "description": "Infrastructure as code solution for AWS Organizations", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/aws-provider/aws-organization-writer.ts b/src/aws-provider/aws-organization-writer.ts index 362e7f1e..33fe0c79 100644 --- a/src/aws-provider/aws-organization-writer.ts +++ b/src/aws-provider/aws-organization-writer.ts @@ -336,10 +336,10 @@ export class AwsOrganizationWriter { try { await this.updateAccount(resource, accountId); } catch (err) { - if ((err.name === 'AccessDenied' || err.name === 'InvalidClientTokenId') && retryCountAccessDenied < 3) { + if ((err.name === 'AccessDenied' || err.name === 'InvalidClientTokenId' || err.name === 'RegionDisabledException') && retryCountAccessDenied < 3) { shouldRetry = true; retryCountAccessDenied = retryCountAccessDenied + 1; - await sleep(3000); + await sleep(6000); continue; } throw err; diff --git a/src/plugin/impl/rp-build-task-plugin.ts b/src/plugin/impl/rp-build-task-plugin.ts index 5b6a4496..14f83555 100644 --- a/src/plugin/impl/rp-build-task-plugin.ts +++ b/src/plugin/impl/rp-build-task-plugin.ts @@ -202,12 +202,12 @@ const retryTypeRegistrationWrapper = async (type: string, fn: () => Promise await fn(); } catch (err) { const message = err.message as string; - if (message && -1 !== message.indexOf('Deployment is currently in DEPLOY_STAGE of status FAILED')) { + if (message && -1 !== message.indexOf('Rate exceeded on Registry APIs')) { if (retryCount >= 20) { throw err; } - ConsoleUtil.LogInfo(`Type registration ${type} is in DEPLOY_STAGE of status FAILED. waiting.... `); + ConsoleUtil.LogInfo(`Type registration ${type} Rate exceeded on Registry APIs. waiting.... `); retryCount += 1; await sleep(1000 * (26 + (4 * Math.random()))); retryTypeRegistration = true; From 00ef1ebf7e1d64928bc75c315a249c467151443a Mon Sep 17 00:00:00 2001 From: Olaf Conijn Date: Sat, 13 Dec 2025 13:44:29 +0100 Subject: [PATCH 2/2] chore: improved backoff --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e4b0091..7f545e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to aws organization formation will be documented in this fil **BREAKING CHANGES**: - v1.0.0: execution role under which org-formation is ran requires the ec2:describeRegions permission + +**version: 1.0.18** +- fix: improved backoff for account creation and type registration + **version: 1.0.16** - fix: access denied issue when running init-pipeline passing --build-account-id as an argument