@beesolve/aws-accounts 1.0.5 → 1.0.6

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.
@@ -427,6 +427,31 @@ async function runRemoteInit(input) {
427
427
  writeStateCache(cachePath, response.state)
428
428
  ]);
429
429
  input.logger.log("State written to state.json and cache updated.");
430
+ const context = await readAwsContextFromFile(contextFilePath);
431
+ const graveyardOu = response.state.organization.organizationalUnits.find(
432
+ (ou) => ou.name === "Graveyard"
433
+ );
434
+ const updatedContext = {
435
+ ...context,
436
+ organization: {
437
+ managementAccountId: context.organization.managementAccountId,
438
+ rootId: response.state.organization.rootId,
439
+ graveyardOuId: graveyardOu?.id ?? context.organization.graveyardOuId
440
+ },
441
+ identityCenter: {
442
+ instanceArn: response.state.identityCenter.instanceArn,
443
+ identityStoreId: response.state.identityCenter.identityStoreId
444
+ }
445
+ };
446
+ const ordered = {
447
+ version: updatedContext.version,
448
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
449
+ organization: updatedContext.organization,
450
+ identityCenter: updatedContext.identityCenter,
451
+ deployment: updatedContext.deployment
452
+ };
453
+ await writeFile(contextFilePath, `${JSON.stringify(ordered, null, 2)}
454
+ `, "utf8");
430
455
  const configWriteResult = await writeAwsConfigFromState({
431
456
  statePath,
432
457
  contextPath: contextFilePath,
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beesolve/aws-accounts",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "AWS Organizations and IAM Identity Center management CLI",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {