@propulsionworks/cloudformation 0.0.1
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 +3 -0
- package/exports/main/intrinsics.ts +632 -0
- package/exports/main/json.ts +6 -0
- package/exports/main/parameters.ts +132 -0
- package/exports/main/policy.ts +388 -0
- package/exports/main/template.ts +1027 -0
- package/exports/main.ts +5 -0
- package/out/exports/main/intrinsics.d.ts +522 -0
- package/out/exports/main/intrinsics.d.ts.map +1 -0
- package/out/exports/main/intrinsics.js +20 -0
- package/out/exports/main/intrinsics.js.map +1 -0
- package/out/exports/main/json.d.ts +5 -0
- package/out/exports/main/json.d.ts.map +1 -0
- package/out/exports/main/json.js +2 -0
- package/out/exports/main/json.js.map +1 -0
- package/out/exports/main/parameters.d.ts +89 -0
- package/out/exports/main/parameters.d.ts.map +1 -0
- package/out/exports/main/parameters.js +2 -0
- package/out/exports/main/parameters.js.map +1 -0
- package/out/exports/main/policy.d.ts +309 -0
- package/out/exports/main/policy.d.ts.map +1 -0
- package/out/exports/main/policy.js +2 -0
- package/out/exports/main/policy.js.map +1 -0
- package/out/exports/main/template.d.ts +904 -0
- package/out/exports/main/template.d.ts.map +1 -0
- package/out/exports/main/template.js +13 -0
- package/out/exports/main/template.js.map +1 -0
- package/out/exports/main.d.ts +6 -0
- package/out/exports/main.d.ts.map +1 -0
- package/out/exports/main.js +6 -0
- package/out/exports/main.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value for {@link ParameterDefinition.Type} that cause the parameter to
|
|
3
|
+
* resolve to an array value.
|
|
4
|
+
*/
|
|
5
|
+
export type ParameterListType<T extends string> = `List<${T}>`;
|
|
6
|
+
/**
|
|
7
|
+
* Get the element type of a list type.
|
|
8
|
+
*/
|
|
9
|
+
export type ParameterElementOfListType<T> = T extends ParameterListType<infer Element> ? Element : never;
|
|
10
|
+
/**
|
|
11
|
+
* Values for {@link ParameterDefinition.Type} that can also be used with
|
|
12
|
+
* `List<...>`.
|
|
13
|
+
*/
|
|
14
|
+
export type AwsParameterTypesSupportingList = "AWS::EC2::AvailabilityZone::Name" | "AWS::EC2::Image::Id" | "AWS::EC2::Instance::Id" | "AWS::EC2::SecurityGroup::GroupName" | "AWS::EC2::SecurityGroup::Id" | "AWS::EC2::Subnet::Id" | "AWS::EC2::Volume::Id" | "AWS::EC2::VPC::Id" | "AWS::Route53::HostedZone::Id";
|
|
15
|
+
/**
|
|
16
|
+
* CloudFormation provides a set of parameter types that help catch invalid
|
|
17
|
+
* values when creating or updating a stack. When you use these parameter types,
|
|
18
|
+
* anyone who uses your template must specify valid values from the AWS account
|
|
19
|
+
* and Region they're creating the stack in.
|
|
20
|
+
*
|
|
21
|
+
* If they use the AWS Management Console, CloudFormation provides a
|
|
22
|
+
* prepopulated list of existing values from their account and Region. This way,
|
|
23
|
+
* the user doesn't have to remember and correctly type a specific name or ID.
|
|
24
|
+
* Instead, they just select values from a drop-down list. In some cases, they
|
|
25
|
+
* can even search for values by ID, name, or Name tag value.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-supplied-parameter-types.html#aws-specific-parameter-types-supported}
|
|
28
|
+
*/
|
|
29
|
+
export type AwsScalarParameterType = "AWS::EC2::AvailabilityZone::Name" | "AWS::EC2::Image::Id" | "AWS::EC2::Instance::Id" | "AWS::EC2::KeyPair::KeyName" | "AWS::EC2::SecurityGroup::GroupName" | "AWS::EC2::SecurityGroup::Id" | "AWS::EC2::Subnet::Id" | "AWS::EC2::Volume::Id" | "AWS::EC2::VPC::Id" | "AWS::Route53::HostedZone::Id";
|
|
30
|
+
/**
|
|
31
|
+
* CloudFormation provides a set of parameter types that help catch invalid
|
|
32
|
+
* values when creating or updating a stack. When you use these parameter types,
|
|
33
|
+
* anyone who uses your template must specify valid values from the AWS account
|
|
34
|
+
* and Region they're creating the stack in.
|
|
35
|
+
*
|
|
36
|
+
* If they use the AWS Management Console, CloudFormation provides a
|
|
37
|
+
* prepopulated list of existing values from their account and Region. This way,
|
|
38
|
+
* the user doesn't have to remember and correctly type a specific name or ID.
|
|
39
|
+
* Instead, they just select values from a drop-down list. In some cases, they
|
|
40
|
+
* can even search for values by ID, name, or Name tag value.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-supplied-parameter-types.html#aws-specific-parameter-types-supported}
|
|
43
|
+
*/
|
|
44
|
+
export type AwsParameterType = AwsScalarParameterType | ParameterListType<AwsParameterTypesSupportingList>;
|
|
45
|
+
/**
|
|
46
|
+
* A value for {@link ParameterDefinition.Type} that means the parameter value
|
|
47
|
+
* will be loaded from SSM Parameter Store, using the provided parameter value
|
|
48
|
+
* as the SSM Parameter Store key.
|
|
49
|
+
*/
|
|
50
|
+
export type SsmParameterValueType<T extends string> = `AWS::SSM::Parameter::Value<${T}>`;
|
|
51
|
+
/**
|
|
52
|
+
* CloudFormation also provides parameter types that correspond to existing
|
|
53
|
+
* parameters in Systems Manager Parameter Store. When you use these parameter
|
|
54
|
+
* types, anyone who uses your template must specify a Parameter Store key as
|
|
55
|
+
* the value of the Systems Manager parameter type, and CloudFormation then
|
|
56
|
+
* retrieves the latest value from Parameter Store to use in their stack. This
|
|
57
|
+
* can be useful when you need to frequently update applications with new
|
|
58
|
+
* property values, such as new Amazon Machine Image (AMI) IDs.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-supplied-parameter-types.html#systems-manager-parameter-types-supported}
|
|
61
|
+
*/
|
|
62
|
+
export type SsmParameterType = "AWS::SSM::Parameter::Name" | SsmParameterValueType<"String"> | SsmParameterValueType<ParameterListType<"String">> | SsmParameterValueType<"CommaDelimitedList"> | SsmParameterValueType<AwsParameterType>;
|
|
63
|
+
/**
|
|
64
|
+
* All values for {@link ParameterDefinition.Type} that will cause the parameter
|
|
65
|
+
* to resolve to an array value.
|
|
66
|
+
*/
|
|
67
|
+
export type ParameterStringArrayType = "CommaDelimitedList" | ParameterListType<"String"> | ParameterListType<AwsParameterTypesSupportingList>;
|
|
68
|
+
/**
|
|
69
|
+
* Map of CloudFormation parameter type values to TypeScript types.
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html}
|
|
72
|
+
*/
|
|
73
|
+
export type ParameterTypeMap = {
|
|
74
|
+
String: string;
|
|
75
|
+
Number: number;
|
|
76
|
+
"List<Number>": number[];
|
|
77
|
+
CommaDelimitedList: string[];
|
|
78
|
+
} & {
|
|
79
|
+
[T in AwsParameterType | SsmParameterType]: T extends ParameterStringArrayType | SsmParameterValueType<ParameterStringArrayType> ? string[] : string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Allowed values for the Type field in a Parameter definition.
|
|
83
|
+
*
|
|
84
|
+
* To convert to a TypeScript type, see {@link ParameterTypeMap}.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html}
|
|
87
|
+
*/
|
|
88
|
+
export type ParameterType = keyof ParameterTypeMap;
|
|
89
|
+
//# sourceMappingURL=parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../exports/main/parameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,0BAA0B,CAAC,CAAC,IACtC,CAAC,SAAS,iBAAiB,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GACvC,kCAAkC,GACl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AEF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../exports/main/parameters.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import type { WithIntrinsics } from "./intrinsics.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The `Version` policy element specifies the language syntax rules that are
|
|
4
|
+
* to be used to process a policy. To use all of the available policy
|
|
5
|
+
* features, include a `Version` element with a value of `"2012-10-17"`.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_version.html}
|
|
8
|
+
*/
|
|
9
|
+
export type PolicyVersion = "2008-10-17" | "2012-10-17";
|
|
10
|
+
/**
|
|
11
|
+
* You manage access in AWS by creating policies and attaching them to IAM
|
|
12
|
+
* identities (users, groups of users, or roles) or AWS resources. A policy is
|
|
13
|
+
* an object in AWS that, when associated with an identity or resource, defines
|
|
14
|
+
* their permissions. AWS evaluates these policies when an IAM principal (user
|
|
15
|
+
* or role) makes a request. Permissions in the policies determine whether the
|
|
16
|
+
* request is allowed or denied. Most policies are stored in AWS as JSON
|
|
17
|
+
* documents. AWS supports six types of policies: identity-based policies,
|
|
18
|
+
* resource-based policies, permissions boundaries, Organizations SCPs, ACLs,
|
|
19
|
+
* and session policies.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html}
|
|
22
|
+
*/
|
|
23
|
+
export type PolicyDocument = {
|
|
24
|
+
/**
|
|
25
|
+
* The `Version` policy element specifies the language syntax rules that are
|
|
26
|
+
* to be used to process a policy. To use all of the available policy
|
|
27
|
+
* features, include a `Version` element with a value of `"2012-10-17"`.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_version.html}
|
|
30
|
+
*/
|
|
31
|
+
Version?: PolicyVersion | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The `Statement` element is the main element for a policy. This element is
|
|
34
|
+
* required. The Statement element can contain a single statement or an array
|
|
35
|
+
* of individual statements. Each individual statement block must be enclosed
|
|
36
|
+
* in curly braces `{ }`. For multiple statements, the array must be enclosed
|
|
37
|
+
* in square brackets `[ ]`.
|
|
38
|
+
*
|
|
39
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_statement.html}
|
|
40
|
+
*/
|
|
41
|
+
Statement: PolicyStatement[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The `Statement` element is the main element for a policy. This element is
|
|
45
|
+
* required. The Statement element can contain a single statement or an array
|
|
46
|
+
* of individual statements. Each individual statement block must be enclosed
|
|
47
|
+
* in curly braces `{ }`. For multiple statements, the array must be enclosed
|
|
48
|
+
* in square brackets `[ ]`.
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_statement.html}
|
|
51
|
+
*/
|
|
52
|
+
export type PolicyStatement = {
|
|
53
|
+
/**
|
|
54
|
+
* The `Action` element describes the specific action or actions that will be
|
|
55
|
+
* allowed or denied. Statements must include either an `Action` or
|
|
56
|
+
* `NotAction` element. Each AWS service has its own set of actions that
|
|
57
|
+
* describe tasks that you can perform with that service.
|
|
58
|
+
*
|
|
59
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_action.html}
|
|
60
|
+
*/
|
|
61
|
+
Action: string | string[];
|
|
62
|
+
/**
|
|
63
|
+
* The Condition element (or Condition block) lets you specify conditions for
|
|
64
|
+
* when a policy is in effect. The Condition element is optional. In the
|
|
65
|
+
* Condition element, you build expressions in which you use condition
|
|
66
|
+
* operators (equal, less than, etc.) to match the condition keys and values
|
|
67
|
+
* in the policy against keys and values in the request context.
|
|
68
|
+
*
|
|
69
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html}
|
|
70
|
+
*/
|
|
71
|
+
Condition?: PolicyCondition;
|
|
72
|
+
/**
|
|
73
|
+
* The `Effect` element is required and specifies whether the statement
|
|
74
|
+
* results in an allow or an explicit deny. Valid values for `Effect` are
|
|
75
|
+
* `Allow` and `Deny`. By default, access to resources is denied. To allow
|
|
76
|
+
* access to a resource, you must set the `Effect` element to `Allow`. To override
|
|
77
|
+
* an allow (for example, to override an allow that is otherwise in force),
|
|
78
|
+
* you set the `Effect` element to `Deny`.
|
|
79
|
+
*
|
|
80
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_effect.html}
|
|
81
|
+
*/
|
|
82
|
+
Effect?: PolicyEffect | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* `NotAction` is an advanced policy element that explicitly matches
|
|
85
|
+
* everything except the specified list of actions. Using `NotAction` can
|
|
86
|
+
* result in a shorter policy by listing only a few actions that should not
|
|
87
|
+
* match, rather than including a long list of actions that will match. When
|
|
88
|
+
* using `NotAction`, you should keep in mind that actions specified in this
|
|
89
|
+
* element are the only actions in that are limited. This, in turn, means that
|
|
90
|
+
* all of the applicable actions or services that are not listed are allowed
|
|
91
|
+
* if you use the `Allow` effect. In addition, such unlisted actions or
|
|
92
|
+
* services are denied if you use the `Deny` effect. When you use `NotAction`
|
|
93
|
+
* with the `Resource` element, you provide scope for the policy. This is how
|
|
94
|
+
* AWS determines which actions or services are applicable. For more
|
|
95
|
+
* information, see the following example policy.
|
|
96
|
+
*
|
|
97
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notaction.html}
|
|
98
|
+
*/
|
|
99
|
+
NotAction?: string | string[] | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Use the `NotPrincipal` element to specify the IAM user, federated user, IAM
|
|
102
|
+
* role, AWS account, AWS service, or other principal that is not allowed or
|
|
103
|
+
* denied access to a resource. The `NotPrincipal` element enables you to
|
|
104
|
+
* specify an exception to a list of principals. Use this element to deny
|
|
105
|
+
* access to all principals except the one named in the `NotPrincipal`
|
|
106
|
+
* element.
|
|
107
|
+
*
|
|
108
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notprincipal.html}
|
|
109
|
+
*/
|
|
110
|
+
NotPrincipal?: PolicyPrincipal | string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* `NotResource` is an advanced policy element that explicitly matches every
|
|
113
|
+
* resource except those specified. Using `NotResource` can result in a
|
|
114
|
+
* shorter policy by listing only a few resources that should not match,
|
|
115
|
+
* rather than including a long list of resources that will match. This is
|
|
116
|
+
* particularly useful for policies that apply within a single AWS service.
|
|
117
|
+
*
|
|
118
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notresource.html}
|
|
119
|
+
*/
|
|
120
|
+
NotResource?: string | string[] | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Use the `Principal` element in a resource-based JSON policy to specify the
|
|
123
|
+
* principal that is allowed or denied access to a resource.
|
|
124
|
+
*
|
|
125
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html}
|
|
126
|
+
*/
|
|
127
|
+
Principal?: PolicyPrincipal | string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The `Resource` element specifies the object or objects that the statement
|
|
130
|
+
* covers. Statements must include either a `Resource` or a `NotResource`
|
|
131
|
+
* element. You specify a resource using an ARN.
|
|
132
|
+
*
|
|
133
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_resource.html}
|
|
134
|
+
*/
|
|
135
|
+
Resource?: string | string[] | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* You can provide an optional identifier, `Sid` (statement ID) for the policy
|
|
138
|
+
* statement. You can assign a `Sid` value to each statement in a statement
|
|
139
|
+
* array. In services that let you specify an ID element, such as SQS and SNS,
|
|
140
|
+
* the `Sid` value is just a sub-ID of the policy document ID. In IAM, the
|
|
141
|
+
* `Sid` value must be unique within a JSON policy.
|
|
142
|
+
*
|
|
143
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html}
|
|
144
|
+
*/
|
|
145
|
+
Sid?: string | undefined;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* By default, access to resources is denied. To allow access to a resource, you
|
|
149
|
+
* must set the `Effect` element to `Allow`. To override an allow (for example,
|
|
150
|
+
* to override an allow that is otherwise in force), you set the `Effect`
|
|
151
|
+
* element to `Deny`.
|
|
152
|
+
*
|
|
153
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_effect.html}
|
|
154
|
+
*/
|
|
155
|
+
export type PolicyEffect = "Allow" | "Deny";
|
|
156
|
+
/**
|
|
157
|
+
* You can specify AWS account identifiers in the Principal element of a
|
|
158
|
+
* resource-based policy or in condition keys that support principals. This
|
|
159
|
+
* delegates authority to the account. When you allow access to a different
|
|
160
|
+
* account, an administrator in that account must then grant access to an
|
|
161
|
+
* identity (IAM user or role) in that account. When you specify an AWS account,
|
|
162
|
+
* you can use the account ARN (arn:aws:iam::account-ID:root), or a shortened
|
|
163
|
+
* form that consists of the "AWS" prefix followed by the account ID.
|
|
164
|
+
*
|
|
165
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-accounts}
|
|
166
|
+
*/
|
|
167
|
+
export type AwsPrincipal = {
|
|
168
|
+
AWS: string | string[];
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* An alpha-numeric identifier, that is an obfuscated form of the AWS account
|
|
172
|
+
* ID. You can use this ID to identify an AWS account when granting
|
|
173
|
+
* cross-account access to buckets and objects using Amazon S3. You can retrieve
|
|
174
|
+
* the canonical user ID for your AWS account as either the root user or an IAM
|
|
175
|
+
* user.
|
|
176
|
+
*
|
|
177
|
+
* @see {@link https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId}
|
|
178
|
+
*/
|
|
179
|
+
export type CanonicalUserPrincipal = {
|
|
180
|
+
CanonicalUser: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* A web identity session principal is a session principal that results from
|
|
184
|
+
* using the AWS STS `AssumeRoleWithWebIdentity` operation. You can use an
|
|
185
|
+
* external web identity provider (IdP) to sign in, and then assume an IAM role
|
|
186
|
+
* using this operation. This leverages identity federation and issues a role
|
|
187
|
+
* session.
|
|
188
|
+
*
|
|
189
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-federated-web-identity}
|
|
190
|
+
*/
|
|
191
|
+
export type FederatedPrincipal = {
|
|
192
|
+
Federated: string;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* You can specify AWS services in the `Principal` element of a resource-based
|
|
196
|
+
* policy or in condition keys that support principals. A service principal is
|
|
197
|
+
* an identifier for a service.
|
|
198
|
+
*
|
|
199
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services}
|
|
200
|
+
*/
|
|
201
|
+
export type ServicePrincipal = {
|
|
202
|
+
Service: string | string[];
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Use the `Principal` element in a resource-based JSON policy to specify the
|
|
206
|
+
* principal that is allowed or denied access to a resource.
|
|
207
|
+
*
|
|
208
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html}
|
|
209
|
+
*/
|
|
210
|
+
export type PolicyPrincipal = AwsPrincipal | CanonicalUserPrincipal | FederatedPrincipal | ServicePrincipal;
|
|
211
|
+
/**
|
|
212
|
+
* String condition operators let you construct Condition elements that restrict
|
|
213
|
+
* access based on comparing a key to a string value.
|
|
214
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String}
|
|
215
|
+
*/
|
|
216
|
+
type StringConditionOperator = "StringEquals" | "StringNotEquals" | "StringEqualsIgnoreCase" | "StringNotEqualsIgnoreCase" | "StringLike" | "StringNotLike";
|
|
217
|
+
/**
|
|
218
|
+
* Numeric condition operators let you construct Condition elements that
|
|
219
|
+
* restrict access based on comparing a key to an integer or decimal value.
|
|
220
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_Numeric}
|
|
221
|
+
*/
|
|
222
|
+
type NumericConditionOperator = "NumericEquals" | "NumericNotEquals" | "NumericLessThan" | "NumericLessThanEquals" | "NumericGreaterThan" | "NumericGreaterThanEquals";
|
|
223
|
+
/**
|
|
224
|
+
* Date condition operators let you construct Condition elements that restrict
|
|
225
|
+
* access based on comparing a key to a date/time value. You use these condition
|
|
226
|
+
* operators with `aws:CurrentTime` key or `aws:EpochTime` key. You must specify
|
|
227
|
+
* date/time values with one of the W3C implementations of the ISO 8601 date
|
|
228
|
+
* formats or in epoch (UNIX) time.
|
|
229
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_Date}
|
|
230
|
+
*/
|
|
231
|
+
type DateConditionOperator = "DateEquals" | "DateNotEquals" | "DateLessThan" | "DateLessThanEquals" | "DateGreaterThan" | "DateGreaterThanEquals";
|
|
232
|
+
/**
|
|
233
|
+
* Boolean conditions let you construct Condition elements that restrict access
|
|
234
|
+
* based on comparing a key to "true" or "false."
|
|
235
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_Boolean}
|
|
236
|
+
*/
|
|
237
|
+
type BooleanConditionOperator = "Bool";
|
|
238
|
+
/**
|
|
239
|
+
* The BinaryEquals condition operator let you construct Condition elements that
|
|
240
|
+
* test key values that are in binary format. It compares the value of the
|
|
241
|
+
* specified key byte for byte against a base-64 encoded representation of the
|
|
242
|
+
* binary value in the policy.
|
|
243
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_BinaryEquals}
|
|
244
|
+
*/
|
|
245
|
+
type BinaryConditionOperator = "BinaryEquals";
|
|
246
|
+
/**
|
|
247
|
+
* IP address condition operators let you construct Condition elements that
|
|
248
|
+
* restrict access based on comparing a key to an IPv4 or IPv6 address or range
|
|
249
|
+
* of IP addresses. You use these with the aws:SourceIp key. The value must be
|
|
250
|
+
* in the standard CIDR format (for example, 203.0.113.0/24 or
|
|
251
|
+
* 2001:DB8:1234:5678::/64). If you specify an IP address without the associated
|
|
252
|
+
* routing prefix, IAM uses the default prefix value of /32.
|
|
253
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_IPAddress}
|
|
254
|
+
*/
|
|
255
|
+
type IpAddressConditionOperator = "IpAddress" | "NotIpAddress";
|
|
256
|
+
/**
|
|
257
|
+
* Amazon Resource Name (ARN) condition operators let you construct Condition
|
|
258
|
+
* elements that restrict access based on comparing a key to an ARN. The ARN is
|
|
259
|
+
* considered a string.
|
|
260
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN}
|
|
261
|
+
*/
|
|
262
|
+
type ArnConditionOperator = "ArnEquals" | "ArnLike" | "ArnNotEquals" | "ArnNotLike";
|
|
263
|
+
type UnqualifiedConditionOperator = StringConditionOperator | NumericConditionOperator | DateConditionOperator | BooleanConditionOperator | BinaryConditionOperator | IpAddressConditionOperator | ArnConditionOperator | "Null";
|
|
264
|
+
/**
|
|
265
|
+
* To compare your condition context key against a request context key with
|
|
266
|
+
* multiple values, you must use the ForAllValues or ForAnyValue set operators.
|
|
267
|
+
* These set operators are used to compare two sets of values, such as the set
|
|
268
|
+
* of tags in a request and the set of tags in a policy condition.
|
|
269
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-single-vs-multi-valued-context-keys.html#reference_policies_condition-multi-valued-context-keys}
|
|
270
|
+
*/
|
|
271
|
+
type SetConditionOperator<Operator extends UnqualifiedConditionOperator = UnqualifiedConditionOperator> = `ForAllValues:${Operator}` | `ForAnyValue:${Operator}`;
|
|
272
|
+
/**
|
|
273
|
+
* You can add IfExists to the end of any condition operator name except the
|
|
274
|
+
* `Null` condition—for example, `StringLikeIfExists`. You do this to say "If
|
|
275
|
+
* the condition key is present in the context of the request, process the key
|
|
276
|
+
* as specified in the policy. If the key is not present, evaluate the condition
|
|
277
|
+
* element as true." Other condition elements in the statement can still result
|
|
278
|
+
* in a nonmatch, but not a missing key when checked with `...IfExists`. If you
|
|
279
|
+
* are using an `"Effect": "Deny"` element with a negated condition operator
|
|
280
|
+
* like `StringNotEqualsIfExists`, the request is still denied even if the
|
|
281
|
+
* condition key is not present.
|
|
282
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_IfExists}
|
|
283
|
+
*/
|
|
284
|
+
type IfExistsOperator<Operator extends Exclude<UnqualifiedConditionOperator, "Null"> = Exclude<UnqualifiedConditionOperator, "Null">> = `${Operator}IfExists`;
|
|
285
|
+
/**
|
|
286
|
+
* An operator for a policy condition.
|
|
287
|
+
*/
|
|
288
|
+
export type PolicyConditionOperator = UnqualifiedConditionOperator | SetConditionOperator | IfExistsOperator;
|
|
289
|
+
/**
|
|
290
|
+
* The comparison key and value for a policy condition.
|
|
291
|
+
*/
|
|
292
|
+
export type PolicyConditionValue<Key extends string = string> = Record<Key, string | string[]>;
|
|
293
|
+
/**
|
|
294
|
+
* The Condition element (or Condition block) lets you specify conditions for
|
|
295
|
+
* when a policy is in effect. The Condition element is optional. In the
|
|
296
|
+
* Condition element, you build expressions in which you use condition
|
|
297
|
+
* operators (equal, less than, etc.) to match the condition keys and values
|
|
298
|
+
* in the policy against keys and values in the request context.
|
|
299
|
+
*
|
|
300
|
+
* @see {@link https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html}
|
|
301
|
+
*/
|
|
302
|
+
export type PolicyCondition = Partial<Record<PolicyConditionOperator, PolicyConditionValue>>;
|
|
303
|
+
/**
|
|
304
|
+
* Like {@link PolicyDocument} but accepts intrinsic functions, for use within
|
|
305
|
+
* a resource definition.
|
|
306
|
+
*/
|
|
307
|
+
export type TemplatePolicyDocument = WithIntrinsics<PolicyDocument>;
|
|
308
|
+
export {};
|
|
309
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../exports/main/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAEpC;;;;;;;;OAQG;IACH,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAElC;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAE1C;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;IAEpD;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAE5C;;;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