@kensio/yulin 1.20.12 → 1.20.13
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/dist/service/acm/command/delete-certificate/delete-certificate-authorizer.js +1 -0
- package/dist/service/acm/command/describe-certificate/describe-certificate-authorizer.js +1 -0
- package/dist/service/acm/command/list-certificates/list-certificates-authorizer.js +1 -0
- package/dist/service/acm/command/request-certificate/request-certificate-authorizer.js +1 -0
- package/dist/service/apigateway/serve/auth/sim-rest-api-authorizer-policy.js +3 -0
- package/dist/service/apigatewayv2/serve/auth/sim-http-api-authorizer-policy.js +3 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +3 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.js +5 -0
- package/dist/service/aws/factory/sim-aws-service-factory.d.ts +9 -0
- package/dist/service/aws/factory/sim-aws-service-factory.js +10 -0
- package/dist/service/aws/sim-aws.d.ts +18 -0
- package/dist/service/aws/sim-aws.js +19 -0
- package/dist/service/cloudformation/resource/cfn/organizations/sim-organizations-cfn-value-adapter.d.ts +6 -0
- package/dist/service/cloudformation/resource/cfn/organizations/sim-organizations-cfn-value-adapter.js +23 -0
- package/dist/service/cloudformation/resource/cfn/organizations/sim-organizations-cfn.d.ts +66 -0
- package/dist/service/cloudformation/resource/cfn/organizations/sim-organizations-cfn.js +136 -0
- package/dist/service/cloudformation/resource/cfn/sim-cfn-service-value-adapters.js +2 -0
- package/dist/service/cloudformation/resource/resolve/service/sim-cfn-service-factories.js +7 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution-authorizer.js +1 -0
- package/dist/service/cloudfront/command/create-function/create-function-authorizer.js +1 -0
- package/dist/service/cloudfront/command/delete-distribution/delete-distribution-authorizer.js +1 -0
- package/dist/service/cloudfront/command/delete-function/delete-function-authorizer.js +1 -0
- package/dist/service/cloudfront/command/get-distribution/get-distribution-authorizer.js +1 -0
- package/dist/service/cloudfront/command/update-distribution/update-distribution-authorizer.js +1 -0
- package/dist/service/cloudfront/edge/sim-cf-edge-association-auth-z.js +1 -0
- package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +1 -0
- package/dist/service/cloudwatch/command/authorize/sim-cloudwatch-decide.js +1 -0
- package/dist/service/cognito/command/authorize/sim-cognito-authorizer.js +1 -0
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.js +1 -0
- package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +1 -0
- package/dist/service/glue/command/authorize/sim-glue-authorize-resources.js +1 -0
- package/dist/service/iam/authorize/allow/sim-iam-policy-evaluation.d.ts +45 -0
- package/dist/service/iam/authorize/allow/sim-iam-policy-evaluation.js +59 -0
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +15 -4
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +15 -4
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context.d.ts +31 -1
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context.factory.js +1 -0
- package/dist/service/iam/authorize/context/sim-iam-auth-z-scp-source-builder.d.ts +46 -0
- package/dist/service/iam/authorize/context/sim-iam-auth-z-scp-source-builder.js +71 -0
- package/dist/service/iam/authorize/scp/sim-iam-scp-gate.d.ts +96 -0
- package/dist/service/iam/authorize/scp/sim-iam-scp-gate.js +148 -0
- package/dist/service/iam/authorize/scp/sim-iam-scp-resolver.d.ts +53 -0
- package/dist/service/iam/authorize/scp/sim-iam-scp-resolver.js +1 -0
- package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +8 -0
- package/dist/service/iam/authorize/sim-iam-account-auth-z.js +1 -0
- package/dist/service/iam/authorize/sim-iam-action-authorizer.js +1 -0
- package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +2 -0
- package/dist/service/iam/authorize/sim-iam-authorizer.js +1 -0
- package/dist/service/iam/authorize/sim-iam-decision-value.d.ts +13 -0
- package/dist/service/iam/authorize/sim-iam-decision-value.js +12 -0
- package/dist/service/iam/authorize/sim-iam-decision.d.ts +33 -16
- package/dist/service/iam/authorize/sim-iam-decision.js +64 -49
- package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +8 -0
- package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.js +1 -0
- package/dist/service/iam/error/sim-iam.error.d.ts +8 -0
- package/dist/service/iam/error/sim-iam.error.js +2 -1
- package/dist/service/iam/sim-iam-account-parts.d.ts +9 -0
- package/dist/service/iam/sim-iam-account-parts.js +1 -0
- package/dist/service/kinesis/command/authorize/sim-kinesis-authorizer.js +1 -0
- package/dist/service/kms/command/authorize/sim-kms-authorizer.js +2 -0
- package/dist/service/lambda/command/create-function/create-function-authorizer.js +1 -0
- package/dist/service/lambda/command/delete-function/delete-function-authorizer.js +1 -0
- package/dist/service/lambda/command/event-invoke-config/event-invoke-config-authorizer.js +1 -0
- package/dist/service/lambda/command/function-url/function-url-authorizer.js +1 -0
- package/dist/service/lambda/command/get-function/get-function-authorizer.js +1 -0
- package/dist/service/lambda/command/invoke/invoke-authorizer.js +1 -0
- package/dist/service/lambda/command/list-functions/list-functions-authorizer.js +1 -0
- package/dist/service/lambda/command/update-function-code/update-function-code-authorizer.js +1 -0
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +1 -0
- package/dist/service/lambda/command/version/version-authorizer.js +1 -0
- package/dist/service/logs/command/authorize/sim-logs-authorizer.js +1 -0
- package/dist/service/organizations/cfn/sim-cfn-organization-creator.d.ts +19 -0
- package/dist/service/organizations/cfn/sim-cfn-organization-creator.js +25 -0
- package/dist/service/organizations/cfn/sim-cfn-organizational-unit-creator.d.ts +16 -0
- package/dist/service/organizations/cfn/sim-cfn-organizational-unit-creator.js +21 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-account-creator.d.ts +20 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-account-creator.js +34 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-policy-creator.d.ts +21 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-policy-creator.js +40 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-policy-input.d.ts +20 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-policy-input.js +33 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-properties.d.ts +36 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-properties.js +78 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-record.d.ts +40 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-record.js +54 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-remover.d.ts +17 -0
- package/dist/service/organizations/cfn/sim-cfn-organizations-remover.js +40 -0
- package/dist/service/organizations/cfn/sim-organizations-cfn-resource-factory.d.ts +24 -0
- package/dist/service/organizations/cfn/sim-organizations-cfn-resource-factory.js +50 -0
- package/dist/service/organizations/index.d.ts +6 -0
- package/dist/service/organizations/index.js +6 -0
- package/dist/service/organizations/policy/sim-organizations-effective-policies.d.ts +43 -0
- package/dist/service/organizations/policy/sim-organizations-effective-policies.js +58 -0
- package/dist/service/organizations/policy/sim-organizations-scp-store.d.ts +61 -0
- package/dist/service/organizations/policy/sim-organizations-scp-store.js +103 -0
- package/dist/service/organizations/sim-organizations-structure.d.ts +94 -0
- package/dist/service/organizations/sim-organizations-structure.js +140 -0
- package/dist/service/organizations/sim-organizations.d.ts +95 -0
- package/dist/service/organizations/sim-organizations.js +99 -0
- package/dist/service/organizations/tree/sim-organizations-node.d.ts +57 -0
- package/dist/service/organizations/tree/sim-organizations-node.js +58 -0
- package/dist/service/organizations/tree/sim-organizations-tree.d.ts +91 -0
- package/dist/service/organizations/tree/sim-organizations-tree.js +154 -0
- package/dist/service/route53/command/change-resource-record-sets/change-resource-record-sets-authorizer.js +1 -0
- package/dist/service/route53/command/create-hosted-zone/create-hosted-zone-authorizer.js +1 -0
- package/dist/service/route53/command/delete-hosted-zone/delete-hosted-zone-authorizer.js +1 -0
- package/dist/service/route53/command/dnssec/sim-route53-dnssec-authorizer.js +1 -0
- package/dist/service/route53/command/get-hosted-zone/get-hosted-zone-authorizer.js +1 -0
- package/dist/service/route53/command/list-hosted-zones-by-name/list-hosted-zones-by-name-authorizer.js +1 -0
- package/dist/service/route53/command/list-resource-record-sets/list-resource-record-sets-authorizer.js +1 -0
- package/dist/service/s3/command/create-bucket/create-bucket.handler.js +1 -0
- package/dist/service/s3/command/delete-bucket/delete-bucket-authorizer.js +1 -0
- package/dist/service/s3/command/delete-bucket-policy/delete-bucket-policy-authorizer.js +1 -0
- package/dist/service/s3/command/delete-object/delete-object-authorizer.js +1 -0
- package/dist/service/s3/command/get-bucket-policy/get-bucket-policy-authorizer.js +1 -0
- package/dist/service/s3/command/get-object/get-object-authorizer.js +1 -0
- package/dist/service/s3/command/head-bucket/head-bucket-authorizer.js +1 -0
- package/dist/service/s3/command/lifecycle/sim-s3-lifecycle-authorizer.js +1 -0
- package/dist/service/s3/command/list-buckets/list-buckets-authorizer.js +1 -0
- package/dist/service/s3/command/list-objects/list-objects-authorizer.js +1 -0
- package/dist/service/s3/command/multipart/sim-s3-multipart-authorizer.js +1 -0
- package/dist/service/s3/command/notification/sim-s3-notification-authorizer.js +1 -0
- package/dist/service/s3/command/public-access-block/sim-s3-public-access-block-authorizer.js +1 -0
- package/dist/service/s3/command/put-bucket-policy/put-bucket-policy-authorizer.js +1 -0
- package/dist/service/s3/command/put-bucket-website/put-bucket-website-authorizer.js +1 -0
- package/dist/service/s3/command/put-object/put-object-authorizer.js +1 -0
- package/dist/service/secretsmanager/command/authorize/sim-secrets-manager-authorizer.js +1 -0
- package/dist/service/ses/command/authorize/sim-ses-authorizer.js +1 -0
- package/dist/service/sqs/command/authorize/sim-sqs-authorizer.js +1 -0
- package/dist/service/ssm/command/authorize/sim-ssm-authorizer.js +1 -0
- package/dist/service/wafv2/command/authorize/sim-wafv2-authorizer.js +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SimCfnOrganization } from "./sim-cfn-organizations-record.js";
|
|
2
|
+
import { SimCfnOrganizationsProperties } from "./sim-cfn-organizations-properties.js";
|
|
3
|
+
/**
|
|
4
|
+
* Records the organization an `AWS::Organizations::Organization` declares.
|
|
5
|
+
*
|
|
6
|
+
* A SimAws already has one organization, so this brings nothing into being.
|
|
7
|
+
* The Resource earns its place by answering `RootId`, which is what the rest
|
|
8
|
+
* of a template hangs off.
|
|
9
|
+
*/
|
|
10
|
+
export class SimCfnOrganizationCreator {
|
|
11
|
+
#simAws;
|
|
12
|
+
constructor(simAws) {
|
|
13
|
+
this.#simAws = simAws;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Record the organization a template declares.
|
|
17
|
+
*/
|
|
18
|
+
create(resource, properties) {
|
|
19
|
+
const values = new SimCfnOrganizationsProperties(resource, "AWS::Organizations::Organization");
|
|
20
|
+
const featureSet = properties["FeatureSet"];
|
|
21
|
+
values.ignore(featureSet, "FeatureSet", "Simulated Organizations evaluates service control policies whatever " +
|
|
22
|
+
"the feature set says");
|
|
23
|
+
return new SimCfnOrganization(this.#simAws.organizations().root().id, values.optionalString(featureSet) ?? "ALL", this.#simAws.defaultAccountId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SimAws } from "../../aws/sim-aws.js";
|
|
2
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
3
|
+
import type { SimCfnTemplateValueRecord } from "../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
4
|
+
import type { SimOrganizationsOrganizationalUnit } from "../tree/sim-organizations-node.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates organizational units from
|
|
7
|
+
* `AWS::Organizations::OrganizationalUnit` Resources.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SimCfnOrganizationalUnitCreator {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(simAws: SimAws);
|
|
12
|
+
/**
|
|
13
|
+
* Create a unit under the node its `ParentId` names.
|
|
14
|
+
*/
|
|
15
|
+
create(resource: SimCfnResource, properties: SimCfnTemplateValueRecord): SimOrganizationsOrganizationalUnit;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SimCfnOrganizationsProperties } from "./sim-cfn-organizations-properties.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates organizational units from
|
|
4
|
+
* `AWS::Organizations::OrganizationalUnit` Resources.
|
|
5
|
+
*/
|
|
6
|
+
export class SimCfnOrganizationalUnitCreator {
|
|
7
|
+
#simAws;
|
|
8
|
+
constructor(simAws) {
|
|
9
|
+
this.#simAws = simAws;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Create a unit under the node its `ParentId` names.
|
|
13
|
+
*/
|
|
14
|
+
create(resource, properties) {
|
|
15
|
+
const values = new SimCfnOrganizationsProperties(resource, "AWS::Organizations::OrganizationalUnit");
|
|
16
|
+
values.ignore(properties["Tags"], "Tags", "Simulated Organizations reads no unit tags");
|
|
17
|
+
return this.#simAws
|
|
18
|
+
.organizations()
|
|
19
|
+
.createOrganizationalUnit(values.requiredString(properties["Name"], "Name"), values.requiredString(properties["ParentId"], "ParentId"));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SimAws } from "../../aws/sim-aws.js";
|
|
2
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
3
|
+
import type { SimCfnTemplateValueRecord } from "../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
4
|
+
import { SimCfnOrganizationsAccount } from "./sim-cfn-organizations-record.js";
|
|
5
|
+
/**
|
|
6
|
+
* Puts Accounts in the organization from `AWS::Organizations::Account`
|
|
7
|
+
* Resources.
|
|
8
|
+
*
|
|
9
|
+
* AWS creates a new account here and gives it an id nobody chose, so this does
|
|
10
|
+
* the same. A template reads that id back with `Ref` or with
|
|
11
|
+
* `Fn::GetAtt AccountId`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SimCfnOrganizationsAccountCreator {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(simAws: SimAws);
|
|
16
|
+
/**
|
|
17
|
+
* Create an Account under the first node its `ParentIds` names.
|
|
18
|
+
*/
|
|
19
|
+
create(resource: SimCfnResource, properties: SimCfnTemplateValueRecord): SimCfnOrganizationsAccount;
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { makeSimAwsAccountId } from "../../aws/sim-aws-account.js";
|
|
2
|
+
import { SimCfnOrganizationsAccount } from "./sim-cfn-organizations-record.js";
|
|
3
|
+
import { SimCfnOrganizationsProperties } from "./sim-cfn-organizations-properties.js";
|
|
4
|
+
/**
|
|
5
|
+
* Puts Accounts in the organization from `AWS::Organizations::Account`
|
|
6
|
+
* Resources.
|
|
7
|
+
*
|
|
8
|
+
* AWS creates a new account here and gives it an id nobody chose, so this does
|
|
9
|
+
* the same. A template reads that id back with `Ref` or with
|
|
10
|
+
* `Fn::GetAtt AccountId`.
|
|
11
|
+
*/
|
|
12
|
+
export class SimCfnOrganizationsAccountCreator {
|
|
13
|
+
#simAws;
|
|
14
|
+
constructor(simAws) {
|
|
15
|
+
this.#simAws = simAws;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an Account under the first node its `ParentIds` names.
|
|
19
|
+
*/
|
|
20
|
+
create(resource, properties) {
|
|
21
|
+
const values = new SimCfnOrganizationsProperties(resource, "AWS::Organizations::Account");
|
|
22
|
+
values.ignore(properties["Tags"], "Tags", "Simulated Organizations reads no Account tags");
|
|
23
|
+
values.ignore(properties["RoleName"], "RoleName", "Simulated Organizations creates no cross-account access Role");
|
|
24
|
+
// Everything the Resource needs is read before the organization changes.
|
|
25
|
+
// A property that fails after the Account was placed would leave it in the
|
|
26
|
+
// organization with no record for a teardown to take it out again.
|
|
27
|
+
const accountName = values.requiredString(properties["AccountName"], "AccountName");
|
|
28
|
+
const email = values.requiredString(properties["Email"], "Email");
|
|
29
|
+
const parentId = values.stringList(properties["ParentIds"])[0];
|
|
30
|
+
const accountId = makeSimAwsAccountId();
|
|
31
|
+
this.#simAws.organizations().moveAccount(accountId, parentId);
|
|
32
|
+
return new SimCfnOrganizationsAccount(accountId, accountName, email, this.#simAws.now());
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SimAws } from "../../aws/sim-aws.js";
|
|
2
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
3
|
+
import type { SimCfnTemplateValueRecord } from "../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
4
|
+
import { SimCfnOrganizationsPolicy } from "./sim-cfn-organizations-record.js";
|
|
5
|
+
/**
|
|
6
|
+
* Attaches service control policies from `AWS::Organizations::Policy`
|
|
7
|
+
* Resources to the nodes they target.
|
|
8
|
+
*
|
|
9
|
+
* A policy of any other type is refused as an unsupported Resource, so the
|
|
10
|
+
* Stack records it and deploys on. Simulated Organizations evaluates service
|
|
11
|
+
* control policies and nothing else, and a tag policy stored here would look
|
|
12
|
+
* like one that does something.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SimCfnOrganizationsPolicyCreator {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(simAws: SimAws);
|
|
17
|
+
/**
|
|
18
|
+
* Attach a policy to every node its `TargetIds` names.
|
|
19
|
+
*/
|
|
20
|
+
create(resource: SimCfnResource, properties: SimCfnTemplateValueRecord): SimCfnOrganizationsPolicy;
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { makeSimOrganizationsPolicyId, } from "../tree/sim-organizations-node.js";
|
|
2
|
+
import { SimCfnOrganizationsPolicy } from "./sim-cfn-organizations-record.js";
|
|
3
|
+
import { SimCfnOrganizationsPolicyInput } from "./sim-cfn-organizations-policy-input.js";
|
|
4
|
+
/**
|
|
5
|
+
* Attaches service control policies from `AWS::Organizations::Policy`
|
|
6
|
+
* Resources to the nodes they target.
|
|
7
|
+
*
|
|
8
|
+
* A policy of any other type is refused as an unsupported Resource, so the
|
|
9
|
+
* Stack records it and deploys on. Simulated Organizations evaluates service
|
|
10
|
+
* control policies and nothing else, and a tag policy stored here would look
|
|
11
|
+
* like one that does something.
|
|
12
|
+
*/
|
|
13
|
+
export class SimCfnOrganizationsPolicyCreator {
|
|
14
|
+
#simAws;
|
|
15
|
+
constructor(simAws) {
|
|
16
|
+
this.#simAws = simAws;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Attach a policy to every node its `TargetIds` names.
|
|
20
|
+
*/
|
|
21
|
+
create(resource, properties) {
|
|
22
|
+
const input = new SimCfnOrganizationsPolicyInput(resource, properties);
|
|
23
|
+
const organizations = this.#simAws.organizations();
|
|
24
|
+
// Every target is resolved before any of them is attached to. Refusing one
|
|
25
|
+
// partway through would leave the earlier targets holding a policy no
|
|
26
|
+
// teardown knows about.
|
|
27
|
+
organizations.requireTargets(input.targetIds);
|
|
28
|
+
// An id of its own, rather than one derived from the logical id. Two
|
|
29
|
+
// Stacks can each declare a Policy called the same thing, and a shared id
|
|
30
|
+
// would let one Stack's teardown take the other's policy off.
|
|
31
|
+
const policyId = makeSimOrganizationsPolicyId();
|
|
32
|
+
for (const targetId of input.targetIds) {
|
|
33
|
+
organizations.attachServiceControlPolicy(targetId, input.document, {
|
|
34
|
+
policyName: input.name,
|
|
35
|
+
policyId,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return new SimCfnOrganizationsPolicy(policyId, input.name, input.policyType, input.targetIds);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
2
|
+
import type { SimCfnTemplateValueRecord } from "../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
3
|
+
import type { SimIamPolicyDocument } from "../../iam/policy/sim-iam-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* What an `AWS::Organizations::Policy` Resource asks for.
|
|
6
|
+
*
|
|
7
|
+
* Every property is read here before the creator changes anything, so a
|
|
8
|
+
* Resource that cannot be satisfied fails with the organization untouched.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimCfnOrganizationsPolicyInput {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly document: SimIamPolicyDocument;
|
|
13
|
+
readonly targetIds: readonly string[];
|
|
14
|
+
constructor(resource: SimCfnResource, properties: SimCfnTemplateValueRecord);
|
|
15
|
+
/**
|
|
16
|
+
* The policy type this Resource carries, which is the only one simulated
|
|
17
|
+
* Organizations evaluates.
|
|
18
|
+
*/
|
|
19
|
+
get policyType(): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SimCfnOrganizationsProperties } from "./sim-cfn-organizations-properties.js";
|
|
2
|
+
const SERVICE_CONTROL_POLICY = "SERVICE_CONTROL_POLICY";
|
|
3
|
+
/**
|
|
4
|
+
* What an `AWS::Organizations::Policy` Resource asks for.
|
|
5
|
+
*
|
|
6
|
+
* Every property is read here before the creator changes anything, so a
|
|
7
|
+
* Resource that cannot be satisfied fails with the organization untouched.
|
|
8
|
+
*/
|
|
9
|
+
export class SimCfnOrganizationsPolicyInput {
|
|
10
|
+
name;
|
|
11
|
+
document;
|
|
12
|
+
targetIds;
|
|
13
|
+
constructor(resource, properties) {
|
|
14
|
+
const values = new SimCfnOrganizationsProperties(resource, "AWS::Organizations::Policy");
|
|
15
|
+
const policyType = values.requiredString(properties["Type"], "Type");
|
|
16
|
+
if (policyType !== SERVICE_CONTROL_POLICY) {
|
|
17
|
+
throw new Error(`Unsupported sim Organizations CloudFormation Resource Policy of ` +
|
|
18
|
+
`type ${policyType}`);
|
|
19
|
+
}
|
|
20
|
+
values.ignore(properties["Tags"], "Tags", "Simulated Organizations reads no policy tags");
|
|
21
|
+
values.ignore(properties["Description"], "Description", "A policy description decides nothing");
|
|
22
|
+
this.name = values.requiredString(properties["Name"], "Name");
|
|
23
|
+
this.document = values.documentValue(properties["Content"], "Content");
|
|
24
|
+
this.targetIds = values.stringList(properties["TargetIds"]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The policy type this Resource carries, which is the only one simulated
|
|
28
|
+
* Organizations evaluates.
|
|
29
|
+
*/
|
|
30
|
+
get policyType() {
|
|
31
|
+
return SERVICE_CONTROL_POLICY;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
2
|
+
import type { SimCfnTemplateValue } from "../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reading the properties of an `AWS::Organizations::*` Resource.
|
|
5
|
+
*
|
|
6
|
+
* Each property is passed in by the caller under its own literal name, the way
|
|
7
|
+
* the other services read a template. A required one that is absent or of the
|
|
8
|
+
* wrong shape fails the Resource rather than quietly creating something else.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimCfnOrganizationsProperties {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(resource: SimCfnResource, resourceType: string);
|
|
13
|
+
/**
|
|
14
|
+
* A property that has to be a string for the Resource to mean anything.
|
|
15
|
+
*/
|
|
16
|
+
requiredString(value: SimCfnTemplateValue | undefined, name: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* A property that is a string where a template gives one.
|
|
19
|
+
*/
|
|
20
|
+
optionalString(value: SimCfnTemplateValue | undefined): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* A list-valued property, read as the strings in it.
|
|
23
|
+
*
|
|
24
|
+
* A template may give one value where a list is allowed, which
|
|
25
|
+
* CloudFormation accepts, so a bare string reads as a list of one.
|
|
26
|
+
*/
|
|
27
|
+
stringList(value: SimCfnTemplateValue | undefined): readonly string[];
|
|
28
|
+
/**
|
|
29
|
+
* A property holding an IAM policy document, given inline or as JSON text.
|
|
30
|
+
*/
|
|
31
|
+
documentValue(value: SimCfnTemplateValue | undefined, name: string): Readonly<Record<string, unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Record a property the simulation creates the Resource without acting on.
|
|
34
|
+
*/
|
|
35
|
+
ignore(value: SimCfnTemplateValue | undefined, name: string, reason: string): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading the properties of an `AWS::Organizations::*` Resource.
|
|
3
|
+
*
|
|
4
|
+
* Each property is passed in by the caller under its own literal name, the way
|
|
5
|
+
* the other services read a template. A required one that is absent or of the
|
|
6
|
+
* wrong shape fails the Resource rather than quietly creating something else.
|
|
7
|
+
*/
|
|
8
|
+
export class SimCfnOrganizationsProperties {
|
|
9
|
+
#resource;
|
|
10
|
+
#resourceType;
|
|
11
|
+
constructor(resource, resourceType) {
|
|
12
|
+
this.#resource = resource;
|
|
13
|
+
this.#resourceType = resourceType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A property that has to be a string for the Resource to mean anything.
|
|
17
|
+
*/
|
|
18
|
+
requiredString(value, name) {
|
|
19
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
20
|
+
throw new Error(`${this.#resourceType} ${this.#resource.logicalId} requires ${name}`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A property that is a string where a template gives one.
|
|
26
|
+
*/
|
|
27
|
+
optionalString(value) {
|
|
28
|
+
return typeof value === "string" ? value : undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A list-valued property, read as the strings in it.
|
|
32
|
+
*
|
|
33
|
+
* A template may give one value where a list is allowed, which
|
|
34
|
+
* CloudFormation accepts, so a bare string reads as a list of one.
|
|
35
|
+
*/
|
|
36
|
+
stringList(value) {
|
|
37
|
+
if (typeof value === "string") {
|
|
38
|
+
return [value];
|
|
39
|
+
}
|
|
40
|
+
if (!Array.isArray(value)) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
return value.filter((item) => typeof item === "string");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A property holding an IAM policy document, given inline or as JSON text.
|
|
47
|
+
*/
|
|
48
|
+
documentValue(value, name) {
|
|
49
|
+
const document = typeof value === "string" ? this.#parse(value, name) : value;
|
|
50
|
+
if (typeof document !== "object" ||
|
|
51
|
+
document === null ||
|
|
52
|
+
Array.isArray(document)) {
|
|
53
|
+
throw new Error(`${this.#resourceType} ${this.#resource.logicalId} requires ${name} ` +
|
|
54
|
+
`to be a policy document`);
|
|
55
|
+
}
|
|
56
|
+
return document;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Record a property the simulation creates the Resource without acting on.
|
|
60
|
+
*/
|
|
61
|
+
ignore(value, name, reason) {
|
|
62
|
+
if (value !== undefined) {
|
|
63
|
+
this.#resource.ignoreProperty(name, reason);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Read a document a template gave as JSON text.
|
|
68
|
+
*/
|
|
69
|
+
#parse(value, name) {
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(value);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
throw new Error(`${this.#resourceType} ${this.#resource.logicalId} ${name} is not ` +
|
|
75
|
+
`valid JSON`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SimAwsAccountId } from "../../aws/sim-aws-account.js";
|
|
2
|
+
import type { SimOrganizationsNodeId, SimOrganizationsRootId } from "../tree/sim-organizations-node.js";
|
|
3
|
+
/**
|
|
4
|
+
* What a template's `AWS::Organizations::Organization` produced.
|
|
5
|
+
*
|
|
6
|
+
* A simulated organization exists as soon as a SimAws does, so this records
|
|
7
|
+
* the one already there rather than making another. What the Resource is for
|
|
8
|
+
* is the values a template reads back off it, `RootId` above all, since that
|
|
9
|
+
* is how an organizational unit says where it hangs.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SimCfnOrganization {
|
|
12
|
+
readonly rootId: SimOrganizationsRootId;
|
|
13
|
+
readonly featureSet: string;
|
|
14
|
+
readonly managementAccountId: SimAwsAccountId;
|
|
15
|
+
constructor(rootId: SimOrganizationsRootId, featureSet: string, managementAccountId: SimAwsAccountId);
|
|
16
|
+
/**
|
|
17
|
+
* AWS gives an organization an `o-` id of its own, apart from its root's.
|
|
18
|
+
*/
|
|
19
|
+
get id(): string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* What a template's `AWS::Organizations::Account` produced.
|
|
23
|
+
*/
|
|
24
|
+
export declare class SimCfnOrganizationsAccount {
|
|
25
|
+
readonly accountId: SimAwsAccountId;
|
|
26
|
+
readonly accountName: string;
|
|
27
|
+
readonly email: string;
|
|
28
|
+
readonly joinedTimestamp: Date;
|
|
29
|
+
constructor(accountId: SimAwsAccountId, accountName: string, email: string, joinedTimestamp: Date);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What a template's `AWS::Organizations::Policy` produced.
|
|
33
|
+
*/
|
|
34
|
+
export declare class SimCfnOrganizationsPolicy {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly policyType: string;
|
|
38
|
+
readonly targetIds: readonly SimOrganizationsNodeId[];
|
|
39
|
+
constructor(id: string, name: string, policyType: string, targetIds: readonly SimOrganizationsNodeId[]);
|
|
40
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a template's `AWS::Organizations::Organization` produced.
|
|
3
|
+
*
|
|
4
|
+
* A simulated organization exists as soon as a SimAws does, so this records
|
|
5
|
+
* the one already there rather than making another. What the Resource is for
|
|
6
|
+
* is the values a template reads back off it, `RootId` above all, since that
|
|
7
|
+
* is how an organizational unit says where it hangs.
|
|
8
|
+
*/
|
|
9
|
+
export class SimCfnOrganization {
|
|
10
|
+
rootId;
|
|
11
|
+
featureSet;
|
|
12
|
+
managementAccountId;
|
|
13
|
+
constructor(rootId, featureSet, managementAccountId) {
|
|
14
|
+
this.rootId = rootId;
|
|
15
|
+
this.featureSet = featureSet;
|
|
16
|
+
this.managementAccountId = managementAccountId;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* AWS gives an organization an `o-` id of its own, apart from its root's.
|
|
20
|
+
*/
|
|
21
|
+
get id() {
|
|
22
|
+
return `o-${this.rootId.slice(2)}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What a template's `AWS::Organizations::Account` produced.
|
|
27
|
+
*/
|
|
28
|
+
export class SimCfnOrganizationsAccount {
|
|
29
|
+
accountId;
|
|
30
|
+
accountName;
|
|
31
|
+
email;
|
|
32
|
+
joinedTimestamp;
|
|
33
|
+
constructor(accountId, accountName, email, joinedTimestamp) {
|
|
34
|
+
this.accountId = accountId;
|
|
35
|
+
this.accountName = accountName;
|
|
36
|
+
this.email = email;
|
|
37
|
+
this.joinedTimestamp = joinedTimestamp;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* What a template's `AWS::Organizations::Policy` produced.
|
|
42
|
+
*/
|
|
43
|
+
export class SimCfnOrganizationsPolicy {
|
|
44
|
+
id;
|
|
45
|
+
name;
|
|
46
|
+
policyType;
|
|
47
|
+
targetIds;
|
|
48
|
+
constructor(id, name, policyType, targetIds) {
|
|
49
|
+
this.id = id;
|
|
50
|
+
this.name = name;
|
|
51
|
+
this.policyType = policyType;
|
|
52
|
+
this.targetIds = targetIds;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SimAws } from "../../aws/sim-aws.js";
|
|
2
|
+
import type { SimCfnResource } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
3
|
+
/**
|
|
4
|
+
* Takes back what an `AWS::Organizations::*` Resource did.
|
|
5
|
+
*
|
|
6
|
+
* A Stack tears down in reverse dependency order, so a policy comes off before
|
|
7
|
+
* the unit it was attached to goes, and a unit goes before the root it hung
|
|
8
|
+
* on. Each Resource here undoes its own step and nothing else.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimCfnOrganizationsRemover {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(simAws: SimAws);
|
|
13
|
+
/**
|
|
14
|
+
* Undo one Resource.
|
|
15
|
+
*/
|
|
16
|
+
remove(resourceTypeName: string, resource: SimCfnResource): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SimCfnOrganizationsAccount, SimCfnOrganizationsPolicy, } from "./sim-cfn-organizations-record.js";
|
|
2
|
+
import { SimOrganizationsOrganizationalUnit } from "../tree/sim-organizations-node.js";
|
|
3
|
+
/**
|
|
4
|
+
* Takes back what an `AWS::Organizations::*` Resource did.
|
|
5
|
+
*
|
|
6
|
+
* A Stack tears down in reverse dependency order, so a policy comes off before
|
|
7
|
+
* the unit it was attached to goes, and a unit goes before the root it hung
|
|
8
|
+
* on. Each Resource here undoes its own step and nothing else.
|
|
9
|
+
*/
|
|
10
|
+
export class SimCfnOrganizationsRemover {
|
|
11
|
+
#simAws;
|
|
12
|
+
constructor(simAws) {
|
|
13
|
+
this.#simAws = simAws;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Undo one Resource.
|
|
17
|
+
*/
|
|
18
|
+
remove(resourceTypeName, resource) {
|
|
19
|
+
const simResource = resource.simResource;
|
|
20
|
+
const organizations = this.#simAws.organizations();
|
|
21
|
+
if (simResource instanceof SimCfnOrganizationsPolicy) {
|
|
22
|
+
for (const targetId of simResource.targetIds) {
|
|
23
|
+
organizations.detachServiceControlPolicy(targetId, simResource.id);
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (simResource instanceof SimCfnOrganizationsAccount) {
|
|
28
|
+
organizations.removeAccount(simResource.accountId);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (simResource instanceof SimOrganizationsOrganizationalUnit) {
|
|
32
|
+
organizations.removeOrganizationalUnit(simResource);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (resourceTypeName !== "Organization") {
|
|
36
|
+
throw new Error(`Unsupported sim Organizations CloudFormation Resource ` +
|
|
37
|
+
`${resourceTypeName} deletion`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SimCfnServiceResourceFactory } from "../../cloudformation/resource/factory/sim-cfn-resource-factory.type.js";
|
|
2
|
+
import type { SimCfnResource, SimCloudFormationResourceCreateContext, SimCloudFormationResourceDeleteContext } from "../../cloudformation/resource/sim-cfn-resource.js";
|
|
3
|
+
/**
|
|
4
|
+
* CloudFormation Resource factory for simulated Organizations resources.
|
|
5
|
+
*
|
|
6
|
+
* An organization belongs to a whole SimAws rather than to the Account and
|
|
7
|
+
* Region scope a Stack deploys into, so this reads the organization off the
|
|
8
|
+
* creation context instead of being handed one. That leaves the factory with
|
|
9
|
+
* no state and lets one serve every scope.
|
|
10
|
+
*
|
|
11
|
+
* `AWS::Organizations::ResourcePolicy` is left out, along with every policy
|
|
12
|
+
* type but `SERVICE_CONTROL_POLICY`, and a template declaring either is
|
|
13
|
+
* recorded as a skipped Resource.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SimOrganizationsCfnResourceFactory implements SimCfnServiceResourceFactory {
|
|
16
|
+
/**
|
|
17
|
+
* Create a simulated Organizations resource from a CloudFormation Resource.
|
|
18
|
+
*/
|
|
19
|
+
create(resourceTypeName: string, resource: SimCfnResource, context: SimCloudFormationResourceCreateContext): Promise<object | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a simulated Organizations resource a Stack created.
|
|
22
|
+
*/
|
|
23
|
+
delete(resourceTypeName: string, resource: SimCfnResource, context: SimCloudFormationResourceDeleteContext): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SimCfnOrganizationCreator } from "./sim-cfn-organization-creator.js";
|
|
2
|
+
import { SimCfnOrganizationalUnitCreator } from "./sim-cfn-organizational-unit-creator.js";
|
|
3
|
+
import { SimCfnOrganizationsAccountCreator } from "./sim-cfn-organizations-account-creator.js";
|
|
4
|
+
import { SimCfnOrganizationsPolicyCreator } from "./sim-cfn-organizations-policy-creator.js";
|
|
5
|
+
import { SimCfnOrganizationsRemover } from "./sim-cfn-organizations-remover.js";
|
|
6
|
+
/**
|
|
7
|
+
* CloudFormation Resource factory for simulated Organizations resources.
|
|
8
|
+
*
|
|
9
|
+
* An organization belongs to a whole SimAws rather than to the Account and
|
|
10
|
+
* Region scope a Stack deploys into, so this reads the organization off the
|
|
11
|
+
* creation context instead of being handed one. That leaves the factory with
|
|
12
|
+
* no state and lets one serve every scope.
|
|
13
|
+
*
|
|
14
|
+
* `AWS::Organizations::ResourcePolicy` is left out, along with every policy
|
|
15
|
+
* type but `SERVICE_CONTROL_POLICY`, and a template declaring either is
|
|
16
|
+
* recorded as a skipped Resource.
|
|
17
|
+
*/
|
|
18
|
+
export class SimOrganizationsCfnResourceFactory {
|
|
19
|
+
/**
|
|
20
|
+
* Create a simulated Organizations resource from a CloudFormation Resource.
|
|
21
|
+
*/
|
|
22
|
+
create(resourceTypeName, resource, context) {
|
|
23
|
+
const properties = context.resolvedProperties ?? resource.properties;
|
|
24
|
+
const { simAws } = context;
|
|
25
|
+
switch (resourceTypeName) {
|
|
26
|
+
case "Organization": {
|
|
27
|
+
return Promise.resolve(new SimCfnOrganizationCreator(simAws).create(resource, properties));
|
|
28
|
+
}
|
|
29
|
+
case "OrganizationalUnit": {
|
|
30
|
+
return Promise.resolve(new SimCfnOrganizationalUnitCreator(simAws).create(resource, properties));
|
|
31
|
+
}
|
|
32
|
+
case "Account": {
|
|
33
|
+
return Promise.resolve(new SimCfnOrganizationsAccountCreator(simAws).create(resource, properties));
|
|
34
|
+
}
|
|
35
|
+
case "Policy": {
|
|
36
|
+
return Promise.resolve(new SimCfnOrganizationsPolicyCreator(simAws).create(resource, properties));
|
|
37
|
+
}
|
|
38
|
+
default: {
|
|
39
|
+
throw new Error(`Unsupported sim Organizations CloudFormation Resource ${resourceTypeName}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Remove a simulated Organizations resource a Stack created.
|
|
45
|
+
*/
|
|
46
|
+
delete(resourceTypeName, resource, context) {
|
|
47
|
+
new SimCfnOrganizationsRemover(context.simAws).remove(resourceTypeName, resource);
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SimOrganizations, type SimOrganizationsAttachOptions, } from "./sim-organizations.js";
|
|
2
|
+
export { SimOrganizationsStructure } from "./sim-organizations-structure.js";
|
|
3
|
+
export { SIM_ORGANIZATIONS_FULL_AWS_ACCESS, SimOrganizationsScpStore, } from "./policy/sim-organizations-scp-store.js";
|
|
4
|
+
export { SimOrganizationsEffectivePolicies } from "./policy/sim-organizations-effective-policies.js";
|
|
5
|
+
export { makeSimOrganizationsOrganizationalUnitId, makeSimOrganizationsRootId, SimOrganizationsOrganizationalUnit, type SimOrganizationsNodeId, type SimOrganizationsOrganizationalUnitId, SimOrganizationsRoot, type SimOrganizationsRootId, type SimOrganizationsTarget, } from "./tree/sim-organizations-node.js";
|
|
6
|
+
export { SimOrganizationsTree, SimOrganizationsUnknownNode, } from "./tree/sim-organizations-tree.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SimOrganizations, } from "./sim-organizations.js";
|
|
2
|
+
export { SimOrganizationsStructure } from "./sim-organizations-structure.js";
|
|
3
|
+
export { SIM_ORGANIZATIONS_FULL_AWS_ACCESS, SimOrganizationsScpStore, } from "./policy/sim-organizations-scp-store.js";
|
|
4
|
+
export { SimOrganizationsEffectivePolicies } from "./policy/sim-organizations-effective-policies.js";
|
|
5
|
+
export { makeSimOrganizationsOrganizationalUnitId, makeSimOrganizationsRootId, SimOrganizationsOrganizationalUnit, SimOrganizationsRoot, } from "./tree/sim-organizations-node.js";
|
|
6
|
+
export { SimOrganizationsTree, SimOrganizationsUnknownNode, } from "./tree/sim-organizations-tree.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SimAwsAccountId } from "../../aws/sim-aws-account.js";
|
|
2
|
+
import type { SimIamServiceControlPolicySet } from "../../iam/authorize/scp/sim-iam-scp-resolver.js";
|
|
3
|
+
import type { SimOrganizationsTree } from "../tree/sim-organizations-tree.js";
|
|
4
|
+
import type { SimOrganizationsScpStore } from "./sim-organizations-scp-store.js";
|
|
5
|
+
interface SimOrganizationsEffectivePoliciesProperties {
|
|
6
|
+
readonly tree: SimOrganizationsTree;
|
|
7
|
+
readonly scpStore: SimOrganizationsScpStore;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Works out which service control policies an Account is actually subject to.
|
|
11
|
+
*
|
|
12
|
+
* The tree says which nodes lie above an Account and the store says what hangs
|
|
13
|
+
* on each of them. Putting the two together is the whole of what sim IAM asks
|
|
14
|
+
* an organization, so it lives here rather than in the facade.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SimOrganizationsEffectivePolicies {
|
|
17
|
+
private readonly tree;
|
|
18
|
+
private readonly scpStore;
|
|
19
|
+
private managementAccountId?;
|
|
20
|
+
constructor(properties: SimOrganizationsEffectivePoliciesProperties);
|
|
21
|
+
/**
|
|
22
|
+
* Name the Account AWS exempts from every service control policy.
|
|
23
|
+
*/
|
|
24
|
+
setManagementAccount(accountId: SimAwsAccountId): void;
|
|
25
|
+
/**
|
|
26
|
+
* The policies in force for an Account, level by level, root first.
|
|
27
|
+
*/
|
|
28
|
+
setFor(accountId: SimAwsAccountId): SimIamServiceControlPolicySet;
|
|
29
|
+
/**
|
|
30
|
+
* The nodes filtering an Account's requests.
|
|
31
|
+
*
|
|
32
|
+
* An Account placed in the organization is filtered by the path down to it.
|
|
33
|
+
* An Account only ever named by having a policy attached to it is filtered
|
|
34
|
+
* by that policy alone, which is what attaching to an Account meant before
|
|
35
|
+
* the organization had a shape.
|
|
36
|
+
*/
|
|
37
|
+
private pathFor;
|
|
38
|
+
/**
|
|
39
|
+
* What one node contributes to an Account's decision.
|
|
40
|
+
*/
|
|
41
|
+
private levelAt;
|
|
42
|
+
}
|
|
43
|
+
export {};
|