@beesolve/aws-accounts 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,11 @@ async function runRemoteBootstrap(input) {
116
116
  resolvedRegion,
117
117
  logger: input.logger
118
118
  });
119
- const context = await readAwsContextFromFile(contextFilePath);
119
+ let context = null;
120
+ try {
121
+ context = await readAwsContextFromFile(contextFilePath);
122
+ } catch {
123
+ }
120
124
  const deployment = {
121
125
  profile: input.profile ?? "",
122
126
  region: resolvedRegion,
@@ -124,8 +128,11 @@ async function runRemoteBootstrap(input) {
124
128
  stateBucketName: bucketName,
125
129
  stateCacheTtlSeconds: 300
126
130
  };
127
- const updatedContext = {
128
- ...context,
131
+ const updatedContext = context != null ? { ...context, deployment } : {
132
+ version: "1",
133
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
134
+ organization: { managementAccountId: accountId, rootId: "pending", graveyardOuId: "pending" },
135
+ identityCenter: { instanceArn: "pending", identityStoreId: "pending" },
129
136
  deployment
130
137
  };
131
138
  const ordered = {
@@ -138,7 +145,7 @@ async function runRemoteBootstrap(input) {
138
145
  await writeFile(contextFilePath, `${JSON.stringify(ordered, null, 2)}
139
146
  `, "utf8");
140
147
  const instanceArn = updatedContext.identityCenter?.instanceArn;
141
- if (instanceArn != null && instanceArn !== "") {
148
+ if (instanceArn != null && instanceArn !== "" && instanceArn !== "pending") {
142
149
  await ensureOrganizationManagementPermissionSet({
143
150
  ssoAdminClient: input.ssoAdminClient,
144
151
  instanceArn,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beesolve/aws-accounts",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "AWS Organizations and IAM Identity Center management CLI",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {