1 | import * as cdk from '@aws-cdk/core';
|
2 | import { PolicyStatement } from './policy-statement';
|
3 |
|
4 |
|
5 |
|
6 | export interface PolicyDocumentProps {
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 | readonly assignSids?: boolean;
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 | readonly statements?: PolicyStatement[];
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | readonly minimize?: boolean;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 | export declare class PolicyDocument implements cdk.IResolvable {
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | static fromJson(obj: any): PolicyDocument;
|
47 | readonly creationStack: string[];
|
48 | private readonly statements;
|
49 | private readonly autoAssignSids;
|
50 | private readonly minimize?;
|
51 | constructor(props?: PolicyDocumentProps);
|
52 | resolve(context: cdk.IResolveContext): any;
|
53 | /**
|
54 | * Whether the policy document contains any statements.
|
55 | */
|
56 | get isEmpty(): boolean;
|
57 | /**
|
58 | * The number of statements already added to this policy.
|
59 | * Can be used, for example, to generate unique "sid"s within the policy.
|
60 | */
|
61 | get statementCount(): number;
|
62 | /**
|
63 | * Adds a statement to the policy document.
|
64 | *
|
65 | * @param statement the statement to add.
|
66 | */
|
67 | addStatements(...statement: PolicyStatement[]): void;
|
68 | /**
|
69 | * Encode the policy document as a string
|
70 | */
|
71 | toString(): string;
|
72 | /**
|
73 | * JSON-ify the document
|
74 | *
|
75 | * Used when JSON.stringify() is called
|
76 | */
|
77 | toJSON(): any;
|
78 | /**
|
79 | * Validate that all policy statements in the policy document satisfies the
|
80 | * requirements for any policy.
|
81 | *
|
82 | * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json
|
83 | */
|
84 | validateForAnyPolicy(): string[];
|
85 | /**
|
86 | * Validate that all policy statements in the policy document satisfies the
|
87 | * requirements for a resource-based policy.
|
88 | *
|
89 | * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json
|
90 | */
|
91 | validateForResourcePolicy(): string[];
|
92 | /**
|
93 | * Validate that all policy statements in the policy document satisfies the
|
94 | * requirements for an identity-based policy.
|
95 | *
|
96 | * @see https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json
|
97 | */
|
98 | validateForIdentityPolicy(): string[];
|
99 | private render;
|
100 | }
|