@cloud-copilot/iam-collect 0.1.15 → 0.1.17
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.
- package/README.md +13 -9
- package/dist/cjs/persistence/AwsIamStore.d.ts +99 -0
- package/dist/cjs/persistence/AwsIamStore.d.ts.map +1 -1
- package/dist/cjs/persistence/file/FileSystemAwsIamStore.d.ts +43 -1
- package/dist/cjs/persistence/file/FileSystemAwsIamStore.d.ts.map +1 -1
- package/dist/cjs/persistence/file/FileSystemAwsIamStore.js +122 -28
- package/dist/cjs/persistence/file/FileSystemAwsIamStore.js.map +1 -1
- package/dist/cjs/persistence/util.d.ts +1 -1
- package/dist/cjs/persistence/util.d.ts.map +1 -1
- package/dist/cjs/persistence/util.js +9 -3
- package/dist/cjs/persistence/util.js.map +1 -1
- package/dist/cjs/services.d.ts +1 -1
- package/dist/cjs/services.d.ts.map +1 -1
- package/dist/cjs/services.js +1 -1
- package/dist/cjs/services.js.map +1 -1
- package/dist/cjs/syncs/organizations/organizations.d.ts +49 -0
- package/dist/cjs/syncs/organizations/organizations.d.ts.map +1 -0
- package/dist/cjs/syncs/organizations/organizations.js +347 -0
- package/dist/cjs/syncs/organizations/organizations.js.map +1 -0
- package/dist/cjs/syncs/syncMap.d.ts.map +1 -1
- package/dist/cjs/syncs/syncMap.js +8 -1
- package/dist/cjs/syncs/syncMap.js.map +1 -1
- package/dist/esm/persistence/AwsIamStore.d.ts +99 -0
- package/dist/esm/persistence/AwsIamStore.d.ts.map +1 -1
- package/dist/esm/persistence/file/FileSystemAwsIamStore.d.ts +43 -1
- package/dist/esm/persistence/file/FileSystemAwsIamStore.d.ts.map +1 -1
- package/dist/esm/persistence/file/FileSystemAwsIamStore.js +122 -28
- package/dist/esm/persistence/file/FileSystemAwsIamStore.js.map +1 -1
- package/dist/esm/persistence/util.d.ts +1 -1
- package/dist/esm/persistence/util.d.ts.map +1 -1
- package/dist/esm/persistence/util.js +9 -3
- package/dist/esm/persistence/util.js.map +1 -1
- package/dist/esm/services.d.ts +1 -1
- package/dist/esm/services.d.ts.map +1 -1
- package/dist/esm/services.js +1 -1
- package/dist/esm/services.js.map +1 -1
- package/dist/esm/syncs/organizations/organizations.d.ts +49 -0
- package/dist/esm/syncs/organizations/organizations.d.ts.map +1 -0
- package/dist/esm/syncs/organizations/organizations.js +339 -0
- package/dist/esm/syncs/organizations/organizations.js.map +1 -0
- package/dist/esm/syncs/syncMap.d.ts.map +1 -1
- package/dist/esm/syncs/syncMap.js +8 -1
- package/dist/esm/syncs/syncMap.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -46,12 +46,16 @@ This will download the IAM data from the current account to the `./iam-data` dir
|
|
|
46
46
|
|
|
47
47
|
# Supported Services and Data Downloaded
|
|
48
48
|
|
|
49
|
-
| Service
|
|
50
|
-
|
|
|
51
|
-
| iam
|
|
52
|
-
| iam
|
|
53
|
-
| iam
|
|
54
|
-
| iam
|
|
55
|
-
| kms
|
|
56
|
-
| lambda
|
|
57
|
-
| s3
|
|
49
|
+
| Service | Resource Type | Data Downloaded |
|
|
50
|
+
| ------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| iam | Users | name, path, id, groups, tags, inline policies, managed policies, permission boundary |
|
|
52
|
+
| iam | Groups | name, path, id, inline policies, managed policies |
|
|
53
|
+
| iam | Roles | name, path, id, trust policy, inline policies, managed policies, instance profiles, tags, permission boundary |
|
|
54
|
+
| iam | Customer and AWS Managed Policies | name, path, id, default version, default version doc, tags |
|
|
55
|
+
| kms | Keys | id, policy, tags |
|
|
56
|
+
| lambda | Functions | name, role, tags, policy |
|
|
57
|
+
| s3 | Buckets | name, region, tags, policy, block public access configuration, default encryption |
|
|
58
|
+
| organizations | Organizations | id, arn, root account id, enabled policy types, org structure |
|
|
59
|
+
| organizations | Organizational Units | id, arn, parent ou, enabled SCPs, enabled RCPs, tags |
|
|
60
|
+
| organizations | Accounts | id, arn, parent ou, enabled SCPs, enabled RCPs, tags |
|
|
61
|
+
| organizations | SCPs, RCPs | id, arn, name, description, tags, policy |
|
|
@@ -25,6 +25,7 @@ export interface ResourceTypeParts {
|
|
|
25
25
|
*/
|
|
26
26
|
resourceType?: string;
|
|
27
27
|
}
|
|
28
|
+
export type OrganizationPolicyType = 'scps' | 'rcps';
|
|
28
29
|
/**
|
|
29
30
|
* An interface for persisting AWS resource metadata.
|
|
30
31
|
* Implementations can be backed by S3 or the local file system.
|
|
@@ -91,5 +92,103 @@ export interface AwsIamStore {
|
|
|
91
92
|
* @param desiredResources - The list of resource arns that should exist.
|
|
92
93
|
*/
|
|
93
94
|
syncResourceList(accountId: string, options: ResourceTypeParts, desiredResources: string[]): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Save metadata for an AWS Organization
|
|
97
|
+
*
|
|
98
|
+
* @param organizationId - The AWS organization ID.
|
|
99
|
+
* @param metadataType - The type of metadata to save (e.g., "metadata").
|
|
100
|
+
* @param data - The metadata content to save an an object.
|
|
101
|
+
*/
|
|
102
|
+
saveOrganizationMetadata(organizationId: string, metadataType: string, data: any): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete metadata for an AWS Organization
|
|
105
|
+
*
|
|
106
|
+
* @param organizationId - The AWS organization ID.
|
|
107
|
+
* @param metadataType - The type of metadata to delete (e.g., "metadata").
|
|
108
|
+
*/
|
|
109
|
+
deleteOrganizationMetadata(organizationId: string, metadataType: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* List the Organizational Units (OUs) that have been saved for a given organization.
|
|
112
|
+
*
|
|
113
|
+
* @param organizationId - The AWS organization ID.
|
|
114
|
+
*/
|
|
115
|
+
listOrganizationalUnits(organizationId: string): Promise<string[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Save metadata for an Organizational Unit (OU) within an AWS Organization.
|
|
118
|
+
*
|
|
119
|
+
* @param organizationId - The AWS organization ID.
|
|
120
|
+
* @param ouId - The AWS ID of the Organizational Unit.
|
|
121
|
+
* @param metadataType - The type of metadata to save (e.g., "metadata").
|
|
122
|
+
* @param data - The metadata content to save as an object.
|
|
123
|
+
*/
|
|
124
|
+
saveOrganizationalUnitMetadata(organizationId: string, ouId: string, metadataType: string, data: any): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Delete metadata for an Organizational Unit (OU) within an AWS Organization.
|
|
127
|
+
*
|
|
128
|
+
* @param organizationId - The AWS organization ID.
|
|
129
|
+
* @param ouId - The AWS ID of the Organizational Unit.
|
|
130
|
+
* @param metadataType - The type of metadata to delete (e.g., "metadata").
|
|
131
|
+
*/
|
|
132
|
+
deleteOrganizationalUnitMetadata(organizationId: string, ouId: string, metadataType: string): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Get metadata for an Organizational Unit (OU) within an AWS Organization.
|
|
135
|
+
*
|
|
136
|
+
* @param organizationId - The AWS organization ID.
|
|
137
|
+
* @param ouId - The AWS ID of the Organizational Unit.
|
|
138
|
+
* @param metadataType - The type of metadata to retrieve (e.g., "metadata").
|
|
139
|
+
* @param defaultValue - The default value to return if the metadata is not found.
|
|
140
|
+
*/
|
|
141
|
+
getOrganizationalUnitMetadata<T, D extends T>(organizationId: string, ouId: string, metadataType: string, defaultValue?: D): Promise<D extends undefined ? T | undefined : T>;
|
|
142
|
+
/**
|
|
143
|
+
* Delete an Organizational Unit (OU) from an AWS Organization.
|
|
144
|
+
*
|
|
145
|
+
* @param organizationId - The AWS organization ID.
|
|
146
|
+
* @param ouId - The AWS ID of the Organizational Unit.
|
|
147
|
+
*/
|
|
148
|
+
deleteOrganizationalUnit(organizationId: string, ouId: string): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Delete metadata for an Organization Policy.
|
|
151
|
+
*
|
|
152
|
+
* @param organizationId the AWS organization ID
|
|
153
|
+
* @param policyType the type of policy (e.g., "scps", "rcps")
|
|
154
|
+
* @param policyId the ID of the policy to delete metadata for
|
|
155
|
+
* @param metadataType the type of metadata to delete (e.g., "metadata")
|
|
156
|
+
*/
|
|
157
|
+
deleteOrganizationPolicyMetadata(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
* @param organizationId the AWS organization ID
|
|
161
|
+
* @param policyType the type of policy (e.g., "scps", "rcps")
|
|
162
|
+
* @param policyId the ID of the policy to save metadata for
|
|
163
|
+
* @param metadataType the type of metadata to save (e.g., "metadata")
|
|
164
|
+
* @param data the content to save
|
|
165
|
+
*/
|
|
166
|
+
saveOrganizationPolicyMetadata(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string, data: any): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Get metadata for an Organization Policy.
|
|
169
|
+
*
|
|
170
|
+
* @param organizationId the AWS organization ID
|
|
171
|
+
* @param policyType the type of policy (e.g., "scps", "rcps")
|
|
172
|
+
* @param policyId the ID of the policy to retrieve metadata for
|
|
173
|
+
* @param metadataType the type of metadata to retrieve (e.g., "metadata")
|
|
174
|
+
* @param defaultValue the default value to return if the metadata is not found
|
|
175
|
+
*/
|
|
176
|
+
getOrganizationPolicyMetadata<T, D extends T>(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string, defaultValue?: D): Promise<D extends undefined ? T | undefined : T>;
|
|
177
|
+
/**
|
|
178
|
+
* Delete an Organization Policy.
|
|
179
|
+
*
|
|
180
|
+
* @param organizationId the AWS organization ID
|
|
181
|
+
* @param policyType the type of policy (e.g., "scps", "rcps")
|
|
182
|
+
* @param policyId the ID of the policy to delete
|
|
183
|
+
*/
|
|
184
|
+
deleteOrganizationPolicy(organizationId: string, policyType: OrganizationPolicyType, policyId: string): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* List the Organization Policies for a given organization and type
|
|
187
|
+
*
|
|
188
|
+
* @param organizationId the AWS organization ID
|
|
189
|
+
* @param policyType the type of policy (e.g., "scps", "rcps")
|
|
190
|
+
* @returns An array of policy IDs
|
|
191
|
+
*/
|
|
192
|
+
listOrganizationPolicies(organizationId: string, policyType: OrganizationPolicyType): Promise<string[]>;
|
|
94
193
|
}
|
|
95
194
|
//# sourceMappingURL=AwsIamStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AwsIamStore.d.ts","sourceRoot":"","sources":["../../../src/persistence/AwsIamStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GAAG,GAAG,GACjB,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB;;;;;;OAMG;IACH,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAEvE;;;;;;;OAOG;IACH,mBAAmB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAChC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,CAAC,GACf,OAAO,CAAC,CAAC,SAAS,SAAS,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAA;IAEnD;;;;;;OAMG;IACH,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OA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Ac,EAAE,MAAM,EACtB,UAAU,EAAE,sBAAsB,EAClC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB;;;;;;OAMG;IACH,wBAAwB,CACtB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CACrB"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { AwsIamStore, ResourceTypeParts } from '../AwsIamStore.js';
|
|
1
|
+
import { AwsIamStore, OrganizationPolicyType, ResourceTypeParts } from '../AwsIamStore.js';
|
|
2
2
|
import { FileSystemAdapter } from './FileSystemAdapter.js';
|
|
3
3
|
export declare class FileSystemAwsIamStore implements AwsIamStore {
|
|
4
4
|
private readonly baseFolder;
|
|
5
5
|
private readonly partition;
|
|
6
6
|
private fsAdapter;
|
|
7
7
|
constructor(baseFolder: string, partition: string, fsAdapter?: FileSystemAdapter);
|
|
8
|
+
private organizationPath;
|
|
9
|
+
private organizationMetadataPath;
|
|
10
|
+
private organizationalUnitsPath;
|
|
11
|
+
private organizationalUnitPath;
|
|
12
|
+
private organizationPoliciesPath;
|
|
13
|
+
private organizationPolicyPath;
|
|
14
|
+
private organizationPolicyMetadataPath;
|
|
15
|
+
private organizationalUnitMetadataPath;
|
|
8
16
|
private accountPath;
|
|
9
17
|
private buildResourcePath;
|
|
10
18
|
private buildMetadataPath;
|
|
@@ -15,5 +23,39 @@ export declare class FileSystemAwsIamStore implements AwsIamStore {
|
|
|
15
23
|
deleteResource(accountId: string, arn: string): Promise<void>;
|
|
16
24
|
listResources(accountId: string, options: ResourceTypeParts): Promise<string[]>;
|
|
17
25
|
syncResourceList(accountId: string, options: ResourceTypeParts, desiredResources: string[]): Promise<void>;
|
|
26
|
+
saveOrganizationMetadata(organizationId: string, metadataType: string, data: any): Promise<void>;
|
|
27
|
+
deleteOrganizationMetadata(organizationId: string, metadataType: string): Promise<void>;
|
|
28
|
+
listOrganizationalUnits(organizationId: string): Promise<string[]>;
|
|
29
|
+
deleteOrganizationalUnitMetadata(organizationId: string, ouId: string, metadataType: string): Promise<void>;
|
|
30
|
+
saveOrganizationalUnitMetadata(organizationId: string, ouId: string, metadataType: string, data: any): Promise<void>;
|
|
31
|
+
getOrganizationalUnitMetadata<T, D extends T>(organizationId: string, ouId: string, metadataType: string, defaultValue?: D): Promise<D extends undefined ? T | undefined : T>;
|
|
32
|
+
deleteOrganizationalUnit(organizationId: string, ouId: string): Promise<void>;
|
|
33
|
+
deleteOrganizationPolicyMetadata(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string): Promise<void>;
|
|
34
|
+
saveOrganizationPolicyMetadata(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string, data: any): Promise<void>;
|
|
35
|
+
getOrganizationPolicyMetadata<T, D extends T>(organizationId: string, policyType: OrganizationPolicyType, policyId: string, metadataType: string, defaultValue?: D): Promise<D extends undefined ? T | undefined : T>;
|
|
36
|
+
deleteOrganizationPolicy(organizationId: string, policyType: OrganizationPolicyType, policyId: string): Promise<void>;
|
|
37
|
+
listOrganizationPolicies(organizationId: string, policyType: OrganizationPolicyType): Promise<string[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Checks if a given content value is empty.
|
|
40
|
+
*
|
|
41
|
+
* @param content The content to check.
|
|
42
|
+
* @returns true if the content is empty, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
private isEmptyContent;
|
|
45
|
+
/**
|
|
46
|
+
* Read the content of a file or return a default value if the file does not exist.
|
|
47
|
+
*
|
|
48
|
+
* @param filePath the path to the file
|
|
49
|
+
* @param defaultValue the default value to return if the file does not exist
|
|
50
|
+
* @returns the content of the file or the default value
|
|
51
|
+
*/
|
|
52
|
+
private contentOrDefault;
|
|
53
|
+
/**
|
|
54
|
+
* Either saves the provided data to a file or deletes the file if the data is empty.
|
|
55
|
+
*
|
|
56
|
+
* @param filePath the path to the file
|
|
57
|
+
* @param data the data to save in the file
|
|
58
|
+
*/
|
|
59
|
+
private saveOrDeleteFile;
|
|
18
60
|
}
|
|
19
61
|
//# sourceMappingURL=FileSystemAwsIamStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystemAwsIamStore.d.ts","sourceRoot":"","sources":["../../../../src/persistence/file/FileSystemAwsIamStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"FileSystemAwsIamStore.d.ts","sourceRoot":"","sources":["../../../../src/persistence/file/FileSystemAwsIamStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,qBAAa,qBAAsB,YAAW,WAAW;IAIrD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJ5B,OAAO,CAAC,SAAS,CAAmB;gBAGjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EAClC,SAAS,CAAC,EAAE,iBAAiB;IAM/B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,wBAAwB;IAOhC,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,8BAA8B;IAYtC,OAAO,CAAC,8BAA8B;IAWtC,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;IAKnB,oBAAoB,CACxB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GAAG,GAAG,GACjB,OAAO,CAAC,IAAI,CAAC;IAKV,oBA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B;;;;;;OAMG;YACW,gBAAgB;IAW9B;;;;;OAKG;YACW,gBAAgB;CAY/B"}
|
|
@@ -11,10 +11,33 @@ class FileSystemAwsIamStore {
|
|
|
11
11
|
constructor(baseFolder, partition, fsAdapter) {
|
|
12
12
|
this.baseFolder = baseFolder;
|
|
13
13
|
this.partition = partition;
|
|
14
|
-
console.log(`Initializing FileSystemAwsIamStore with baseFolder: ${baseFolder}, partition: ${partition}`);
|
|
15
14
|
this.baseFolder = (0, path_1.join)(baseFolder, 'aws', partition);
|
|
16
15
|
this.fsAdapter = fsAdapter || new FileSystemAdapter_js_1.FileSystemAdapter();
|
|
17
16
|
}
|
|
17
|
+
organizationPath(organizationId) {
|
|
18
|
+
return (0, path_1.join)(this.baseFolder, 'organizations', organizationId).toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
organizationMetadataPath(organizationId, metadataType) {
|
|
21
|
+
return (0, path_1.join)(this.organizationPath(organizationId), `${metadataType}.json`).toLowerCase();
|
|
22
|
+
}
|
|
23
|
+
organizationalUnitsPath(organizationId) {
|
|
24
|
+
return (0, path_1.join)(this.organizationPath(organizationId), 'ous').toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
organizationalUnitPath(organizationId, ouId) {
|
|
27
|
+
return (0, path_1.join)(this.organizationalUnitsPath(organizationId), ouId).toLowerCase();
|
|
28
|
+
}
|
|
29
|
+
organizationPoliciesPath(organizationId, policyType) {
|
|
30
|
+
return (0, path_1.join)(this.organizationPath(organizationId), policyType).toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
organizationPolicyPath(organizationId, policyType, policyId) {
|
|
33
|
+
return (0, path_1.join)(this.organizationPoliciesPath(organizationId, policyType), policyId).toLowerCase();
|
|
34
|
+
}
|
|
35
|
+
organizationPolicyMetadataPath(organizationId, policyType, policyId, metadataType) {
|
|
36
|
+
return (0, path_1.join)(this.organizationPolicyPath(organizationId, policyType, policyId), `${metadataType}.json`).toLowerCase();
|
|
37
|
+
}
|
|
38
|
+
organizationalUnitMetadataPath(organizationId, ouId, metadataType) {
|
|
39
|
+
return (0, path_1.join)(this.organizationalUnitPath(organizationId, ouId), `${metadataType}.json`).toLowerCase();
|
|
40
|
+
}
|
|
18
41
|
accountPath(accountId) {
|
|
19
42
|
return (0, path_1.join)(this.baseFolder, 'accounts', accountId).toLowerCase();
|
|
20
43
|
}
|
|
@@ -26,29 +49,13 @@ class FileSystemAwsIamStore {
|
|
|
26
49
|
return (0, path_1.join)(prefix, `${metadataType}.json`).toLowerCase();
|
|
27
50
|
}
|
|
28
51
|
async saveResourceMetadata(accountId, arn, metadataType, data) {
|
|
29
|
-
if (typeof data === 'string') {
|
|
30
|
-
data = data.trim();
|
|
31
|
-
}
|
|
32
|
-
if (data === undefined ||
|
|
33
|
-
data === null ||
|
|
34
|
-
data === '' ||
|
|
35
|
-
data === '{}' ||
|
|
36
|
-
data === '[]' ||
|
|
37
|
-
(Array.isArray(data) && data.length === 0) ||
|
|
38
|
-
(typeof data === 'object' && Object.keys(data).length === 0)) {
|
|
39
|
-
await this.deleteResourceMetadata(accountId, arn, metadataType);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const content = typeof data === 'string' ? data : JSON.stringify(data, null, 2);
|
|
43
52
|
const filePath = this.buildMetadataPath(accountId, arn, metadataType);
|
|
44
|
-
await this.
|
|
53
|
+
await this.saveOrDeleteFile(filePath, data);
|
|
45
54
|
}
|
|
46
55
|
async listResourceMetadata(accountId, arn) {
|
|
47
56
|
// List all files in the resource directory to find metadata types
|
|
48
57
|
const dirPath = this.buildResourcePath(accountId, arn);
|
|
49
|
-
// console.log(dirPath)
|
|
50
58
|
const files = await this.fsAdapter.listDirectory(dirPath);
|
|
51
|
-
// console.log(files)
|
|
52
59
|
// Filter for files that match the pattern of *.json
|
|
53
60
|
const metadataTypes = files
|
|
54
61
|
.filter((file) => file.endsWith('.json'))
|
|
@@ -57,11 +64,7 @@ class FileSystemAwsIamStore {
|
|
|
57
64
|
}
|
|
58
65
|
async getResourceMetadata(accountId, arn, metadataType, defaultValue) {
|
|
59
66
|
const filePath = this.buildMetadataPath(accountId, arn, metadataType);
|
|
60
|
-
|
|
61
|
-
if (!contents) {
|
|
62
|
-
return defaultValue;
|
|
63
|
-
}
|
|
64
|
-
return JSON.parse(contents);
|
|
67
|
+
return this.contentOrDefault(filePath, defaultValue);
|
|
65
68
|
}
|
|
66
69
|
async deleteResourceMetadata(accountId, arn, metadataType) {
|
|
67
70
|
const filePath = this.buildMetadataPath(accountId, arn, metadataType);
|
|
@@ -72,25 +75,116 @@ class FileSystemAwsIamStore {
|
|
|
72
75
|
await this.fsAdapter.deleteDirectory(dirPath);
|
|
73
76
|
}
|
|
74
77
|
async listResources(accountId, options) {
|
|
75
|
-
const dirPath = (0, util_js_1.resourceTypePrefix)(this.accountPath(accountId), { ...options
|
|
78
|
+
const dirPath = (0, util_js_1.resourceTypePrefix)(this.accountPath(accountId), { ...options }, path_1.sep);
|
|
76
79
|
return await this.fsAdapter.listDirectory(dirPath);
|
|
77
80
|
}
|
|
78
81
|
async syncResourceList(accountId, options, desiredResources) {
|
|
79
|
-
const dirPath = (0, util_js_1.resourceTypePrefix)(this.accountPath(accountId), { ...options
|
|
82
|
+
const dirPath = (0, util_js_1.resourceTypePrefix)(this.accountPath(accountId), { ...options }, path_1.sep);
|
|
80
83
|
const existingSubDirs = (await this.fsAdapter.listDirectory(dirPath)).map((subDir) => (0, path_1.join)(dirPath, subDir));
|
|
81
84
|
const desiredDirs = new Set(desiredResources.map((desiredArn) => {
|
|
82
85
|
const resourceDir = this.buildResourcePath(accountId, desiredArn);
|
|
83
86
|
return resourceDir;
|
|
84
87
|
}));
|
|
85
|
-
// console.log(desiredDirs)
|
|
86
88
|
// Identify resources that exist in storage but not in desiredResources.
|
|
87
89
|
const resourcesToDelete = existingSubDirs.filter((s) => !desiredDirs.has(s));
|
|
88
90
|
for (const resource of resourcesToDelete) {
|
|
89
|
-
// const resourceDir = join(dirPath, resource)
|
|
90
|
-
// console.log('Deleting resource directory:', resource)
|
|
91
91
|
await this.fsAdapter.deleteDirectory(resource);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
async saveOrganizationMetadata(organizationId, metadataType, data) {
|
|
95
|
+
const filePath = this.organizationMetadataPath(organizationId, metadataType);
|
|
96
|
+
await this.saveOrDeleteFile(filePath, data);
|
|
97
|
+
}
|
|
98
|
+
async deleteOrganizationMetadata(organizationId, metadataType) {
|
|
99
|
+
const filePath = this.organizationMetadataPath(organizationId, metadataType);
|
|
100
|
+
await this.fsAdapter.deleteFile(filePath);
|
|
101
|
+
}
|
|
102
|
+
async listOrganizationalUnits(organizationId) {
|
|
103
|
+
const dirPath = this.organizationalUnitsPath(organizationId);
|
|
104
|
+
return await this.fsAdapter.listDirectory(dirPath);
|
|
105
|
+
}
|
|
106
|
+
async deleteOrganizationalUnitMetadata(organizationId, ouId, metadataType) {
|
|
107
|
+
const filePath = this.organizationalUnitMetadataPath(organizationId, ouId, metadataType);
|
|
108
|
+
await this.fsAdapter.deleteFile(filePath);
|
|
109
|
+
}
|
|
110
|
+
async saveOrganizationalUnitMetadata(organizationId, ouId, metadataType, data) {
|
|
111
|
+
const filePath = this.organizationalUnitMetadataPath(organizationId, ouId, metadataType);
|
|
112
|
+
await this.saveOrDeleteFile(filePath, data);
|
|
113
|
+
}
|
|
114
|
+
async getOrganizationalUnitMetadata(organizationId, ouId, metadataType, defaultValue) {
|
|
115
|
+
const filePath = this.organizationalUnitMetadataPath(organizationId, ouId, metadataType);
|
|
116
|
+
return this.contentOrDefault(filePath, defaultValue);
|
|
117
|
+
}
|
|
118
|
+
async deleteOrganizationalUnit(organizationId, ouId) {
|
|
119
|
+
const dirPath = this.organizationalUnitPath(organizationId, ouId);
|
|
120
|
+
await this.fsAdapter.deleteDirectory(dirPath);
|
|
121
|
+
}
|
|
122
|
+
async deleteOrganizationPolicyMetadata(organizationId, policyType, policyId, metadataType) {
|
|
123
|
+
const filePath = this.organizationPolicyMetadataPath(organizationId, policyType, policyId, metadataType);
|
|
124
|
+
await this.fsAdapter.deleteFile(filePath);
|
|
125
|
+
}
|
|
126
|
+
async saveOrganizationPolicyMetadata(organizationId, policyType, policyId, metadataType, data) {
|
|
127
|
+
const filePath = this.organizationPolicyMetadataPath(organizationId, policyType, policyId, metadataType);
|
|
128
|
+
await this.saveOrDeleteFile(filePath, data);
|
|
129
|
+
}
|
|
130
|
+
async getOrganizationPolicyMetadata(organizationId, policyType, policyId, metadataType, defaultValue) {
|
|
131
|
+
const filePath = this.organizationPolicyMetadataPath(organizationId, policyType, policyId, metadataType);
|
|
132
|
+
return this.contentOrDefault(filePath, defaultValue);
|
|
133
|
+
}
|
|
134
|
+
async deleteOrganizationPolicy(organizationId, policyType, policyId) {
|
|
135
|
+
const dirPath = this.organizationPolicyPath(organizationId, policyType, policyId);
|
|
136
|
+
await this.fsAdapter.deleteDirectory(dirPath);
|
|
137
|
+
}
|
|
138
|
+
async listOrganizationPolicies(organizationId, policyType) {
|
|
139
|
+
const dirPath = this.organizationPoliciesPath(organizationId, policyType);
|
|
140
|
+
return await this.fsAdapter.listDirectory(dirPath);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Checks if a given content value is empty.
|
|
144
|
+
*
|
|
145
|
+
* @param content The content to check.
|
|
146
|
+
* @returns true if the content is empty, false otherwise.
|
|
147
|
+
*/
|
|
148
|
+
isEmptyContent(content) {
|
|
149
|
+
return (content === undefined ||
|
|
150
|
+
content === null ||
|
|
151
|
+
content === '' ||
|
|
152
|
+
content === '{}' ||
|
|
153
|
+
content === '[]' ||
|
|
154
|
+
(Array.isArray(content) && content.length === 0) ||
|
|
155
|
+
(typeof content === 'object' && Object.keys(content).length === 0));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Read the content of a file or return a default value if the file does not exist.
|
|
159
|
+
*
|
|
160
|
+
* @param filePath the path to the file
|
|
161
|
+
* @param defaultValue the default value to return if the file does not exist
|
|
162
|
+
* @returns the content of the file or the default value
|
|
163
|
+
*/
|
|
164
|
+
async contentOrDefault(filePath, defaultValue) {
|
|
165
|
+
const contents = await this.fsAdapter.readFile(filePath);
|
|
166
|
+
if (!contents) {
|
|
167
|
+
return defaultValue;
|
|
168
|
+
}
|
|
169
|
+
return JSON.parse(contents);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Either saves the provided data to a file or deletes the file if the data is empty.
|
|
173
|
+
*
|
|
174
|
+
* @param filePath the path to the file
|
|
175
|
+
* @param data the data to save in the file
|
|
176
|
+
*/
|
|
177
|
+
async saveOrDeleteFile(filePath, data) {
|
|
178
|
+
if (typeof data === 'string') {
|
|
179
|
+
data = data.trim();
|
|
180
|
+
}
|
|
181
|
+
if (this.isEmptyContent(data)) {
|
|
182
|
+
await this.fsAdapter.deleteFile(filePath);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const content = typeof data === 'string' ? data : JSON.stringify(data, null, 2);
|
|
186
|
+
await this.fsAdapter.writeFile(filePath, content);
|
|
187
|
+
}
|
|
94
188
|
}
|
|
95
189
|
exports.FileSystemAwsIamStore = FileSystemAwsIamStore;
|
|
96
190
|
//# sourceMappingURL=FileSystemAwsIamStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystemAwsIamStore.js","sourceRoot":"","sources":["../../../../src/persistence/file/FileSystemAwsIamStore.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEhC,wCAA+D;AAC/D,iEAA0D;AAE1D,MAAa,qBAAqB;IAIb;IACA;IAJX,SAAS,CAAmB;IAEpC,YACmB,UAAkB,EAClB,SAAiB,EAClC,SAA6B;QAFZ,eAAU,GAAV,UAAU,CAAQ;QAClB,cAAS,GAAT,SAAS,CAAQ;QAGlC,
|
|
1
|
+
{"version":3,"file":"FileSystemAwsIamStore.js","sourceRoot":"","sources":["../../../../src/persistence/file/FileSystemAwsIamStore.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEhC,wCAA+D;AAC/D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AAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QACpB,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;YACzC,OAAM;QACR,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QAC/E,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;CACF;AAvUD,sDAuUC"}
|
|
@@ -18,7 +18,7 @@ export declare function resourcePrefix(startingPath: string, resourceArn: string
|
|
|
18
18
|
* @returns A string that represents the resource type prefix.
|
|
19
19
|
*/
|
|
20
20
|
export declare function resourceTypePrefix(startingPath: string, parts: {
|
|
21
|
-
partition
|
|
21
|
+
partition?: string;
|
|
22
22
|
account?: string;
|
|
23
23
|
service: string;
|
|
24
24
|
region?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/persistence/util.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/persistence/util.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAcR;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE;IACL,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,EACD,SAAS,EAAE,MAAM,GAChB,MAAM,CAYR;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKtF"}
|
|
@@ -18,10 +18,9 @@ function resourcePrefix(startingPath, resourceArn, separator) {
|
|
|
18
18
|
const parts = (0, arn_js_1.splitArnParts)(resourceArn);
|
|
19
19
|
return joinPathParts([
|
|
20
20
|
startingPath,
|
|
21
|
-
parts.partition,
|
|
22
21
|
parts.service,
|
|
23
22
|
parts.region,
|
|
24
|
-
parts.accountId,
|
|
23
|
+
parts.accountId === 'aws' ? parts.accountId : undefined,
|
|
25
24
|
parts.resourceType,
|
|
26
25
|
parts.resourcePath ? encodeURIComponent(parts.resourcePath.trim()) : undefined
|
|
27
26
|
], separator);
|
|
@@ -35,7 +34,14 @@ function resourcePrefix(startingPath, resourceArn, separator) {
|
|
|
35
34
|
* @returns A string that represents the resource type prefix.
|
|
36
35
|
*/
|
|
37
36
|
function resourceTypePrefix(startingPath, parts, separator) {
|
|
38
|
-
return joinPathParts([
|
|
37
|
+
return joinPathParts([
|
|
38
|
+
startingPath,
|
|
39
|
+
parts.partition,
|
|
40
|
+
parts.service,
|
|
41
|
+
parts.region,
|
|
42
|
+
parts.account === 'aws' ? parts.account : undefined,
|
|
43
|
+
parts.resourceType
|
|
44
|
+
], separator);
|
|
39
45
|
}
|
|
40
46
|
function joinPathParts(parts, separator) {
|
|
41
47
|
// Filter out undefined or empty strings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/persistence/util.ts"],"names":[],"mappings":";;AAYA,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/persistence/util.ts"],"names":[],"mappings":";;AAYA,wCAkBC;AAUD,gDAsBC;AAED,sCAKC;AArED,4CAA+C;AAE/C;;;;;;;;;GASG;AACH,SAAgB,cAAc,CAC5B,YAAoB,EACpB,WAAmB,EACnB,SAAiB;IAEjB,MAAM,KAAK,GAAG,IAAA,sBAAa,EAAC,WAAW,CAAC,CAAA;IAExC,OAAO,aAAa,CAClB;QACE,YAAY;QACZ,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,MAAM;QACZ,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACvD,KAAK,CAAC,YAAY;QAClB,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KAC/E,EACD,SAAS,CACV,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,YAAoB,EACpB,KAMC,EACD,SAAiB;IAEjB,OAAO,aAAa,CAClB;QACE,YAAY;QACZ,KAAK,CAAC,SAAS;QACf,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,MAAM;QACZ,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;QACnD,KAAK,CAAC,YAAY;KACnB,EACD,SAAS,CACV,CAAA;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,KAA6B,EAAE,SAAiB;IAC5E,wCAAwC;IACxC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACtF,sCAAsC;IACtC,OAAO,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AACtC,CAAC"}
|
package/dist/cjs/services.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,eAAe,GAAG,IAAI,CAAA;AAE1E,eAAO,MAAM,WAAW,EAAE,UAAU,EAAoD,CAAA"}
|
package/dist/cjs/services.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allServices = void 0;
|
|
4
|
-
exports.allServices = ['iam', 'kms', 'lambda', 's3'];
|
|
4
|
+
exports.allServices = ['iam', 'kms', 'lambda', 'organizations', 's3'];
|
|
5
5
|
//# sourceMappingURL=services.js.map
|
package/dist/cjs/services.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Account, Organization, OrganizationalUnit, OrganizationsClient, Root } from '@aws-sdk/client-organizations';
|
|
2
|
+
import { Sync } from '../sync.js';
|
|
3
|
+
export declare const OrganizationSync: Sync;
|
|
4
|
+
/**
|
|
5
|
+
* Get the details of an organization or an account.
|
|
6
|
+
*
|
|
7
|
+
* @param client The OrganizationsClient to use
|
|
8
|
+
* @returns the details of the organization the account belongs to or undefined if the account is not part of an organization or does not have permission.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOrganizationDetails(client: OrganizationsClient): Promise<Organization | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the root Organizational Unit for an organization
|
|
13
|
+
*
|
|
14
|
+
* @param client The OrganizationsClient to use
|
|
15
|
+
* @returns the root Organizational Unit for the organization if it exists
|
|
16
|
+
*/
|
|
17
|
+
export declare function getOrganizationRoot(client: OrganizationsClient): Promise<Root | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the tags for an Organizational Unit
|
|
20
|
+
*
|
|
21
|
+
* @param client The OrganizationsClient to use
|
|
22
|
+
* @param ouId The AWS id of the Organizational Unit to get the tags for
|
|
23
|
+
* @returns The tags for the Organizational Unit
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTagsForOu(client: OrganizationsClient, ouId: string): Promise<Record<string, string>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get the tags for an account
|
|
28
|
+
* @param client The OrganizationsClient to use
|
|
29
|
+
* @param accountId The AWS id of the account to get the tags for
|
|
30
|
+
* @returns The tags for the account
|
|
31
|
+
*/
|
|
32
|
+
export declare function getTagsForAccount(client: OrganizationsClient, accountId: string): Promise<Record<string, string>>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the organizational units for a parent organizational unit
|
|
35
|
+
*
|
|
36
|
+
* @param client The OrganizationsClient to use
|
|
37
|
+
* @param parentId The AWS id of the parent organizational unit
|
|
38
|
+
* @returns The organizational units directly under the parent
|
|
39
|
+
*/
|
|
40
|
+
export declare function getChildOrgUnits(client: OrganizationsClient, parentId: string): Promise<OrganizationalUnit[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the accounts for a parent organizational unit
|
|
43
|
+
*
|
|
44
|
+
* @param client The OrganizationsClient to use
|
|
45
|
+
* @param parentId The AWS id of the parent organizational unit
|
|
46
|
+
* @returns The accounts directly under the parent
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAccountsForParent(client: OrganizationsClient, parentId: string): Promise<Account[]>;
|
|
49
|
+
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../../../src/syncs/organizations/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAUP,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EAGnB,IAAI,EACL,MAAM,+BAA+B,CAAA;AAKtC,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAA;AA+B9C,eAAO,MAAM,gBAAgB,EAAE,IAmM9B,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAenC;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAchG;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEjC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEjC;AA4BD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAQ/B;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,EAAE,CAAC,CAYpB"}
|