terraconstructs 0.0.23 → 0.0.24

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.
Files changed (266) hide show
  1. package/.jsii +61226 -46941
  2. package/go.mod +2 -1
  3. package/go.sum +2 -0
  4. package/lib/aws/arn.js +1 -1
  5. package/lib/aws/aws-construct.js +1 -1
  6. package/lib/aws/aws-stack.js +1 -1
  7. package/lib/aws/aws-tags.js +2 -2
  8. package/lib/aws/cloudwatch/actions/ec2.js +1 -1
  9. package/lib/aws/cloudwatch/actions/lambda.js +1 -1
  10. package/lib/aws/cloudwatch/alarm-base.js +1 -1
  11. package/lib/aws/cloudwatch/alarm-rule.js +1 -1
  12. package/lib/aws/cloudwatch/alarm-status-widget.js +1 -1
  13. package/lib/aws/cloudwatch/alarm.js +4 -5
  14. package/lib/aws/cloudwatch/composite-alarm.js +1 -1
  15. package/lib/aws/cloudwatch/dashboard.js +1 -1
  16. package/lib/aws/cloudwatch/data-protection-policy.js +5 -5
  17. package/lib/aws/cloudwatch/graph.js +8 -8
  18. package/lib/aws/cloudwatch/layout.js +3 -3
  19. package/lib/aws/cloudwatch/log-destinations/kinesis.js +1 -1
  20. package/lib/aws/cloudwatch/log-destinations/lambda.js +1 -1
  21. package/lib/aws/cloudwatch/log-group.js +3 -3
  22. package/lib/aws/cloudwatch/log-query.js +1 -1
  23. package/lib/aws/cloudwatch/log-stream.js +1 -1
  24. package/lib/aws/cloudwatch/metric-filter.js +1 -1
  25. package/lib/aws/cloudwatch/metric.js +4 -4
  26. package/lib/aws/cloudwatch/pattern.js +3 -3
  27. package/lib/aws/cloudwatch/policy.js +1 -1
  28. package/lib/aws/cloudwatch/private/metric-util.js +1 -2
  29. package/lib/aws/cloudwatch/query-definition.js +2 -2
  30. package/lib/aws/cloudwatch/stats.js +1 -1
  31. package/lib/aws/cloudwatch/subscription-filter.js +1 -1
  32. package/lib/aws/cloudwatch/text.js +1 -1
  33. package/lib/aws/cloudwatch/variable.js +3 -3
  34. package/lib/aws/cloudwatch/widget.js +1 -1
  35. package/lib/aws/compute/activity.js +1 -1
  36. package/lib/aws/compute/alb/application-listener-action.js +1 -1
  37. package/lib/aws/compute/alb/application-listener-certificate.js +1 -1
  38. package/lib/aws/compute/alb/application-listener-rule.js +1 -1
  39. package/lib/aws/compute/alb/application-listener.js +2 -4
  40. package/lib/aws/compute/alb/application-load-balancer.js +2 -4
  41. package/lib/aws/compute/alb/application-target-group.js +1 -1
  42. package/lib/aws/compute/alb/conditions.js +1 -1
  43. package/lib/aws/compute/alb/trust-store-revocation.js +1 -1
  44. package/lib/aws/compute/alb/trust-store.js +1 -1
  45. package/lib/aws/compute/architecture.js +1 -1
  46. package/lib/aws/compute/aspects/require-imdsv2-aspect.js +2 -2
  47. package/lib/aws/compute/autoscaling-common/index.d.ts +3 -0
  48. package/lib/aws/compute/autoscaling-common/index.js +21 -0
  49. package/lib/aws/compute/autoscaling-common/interval-utils.d.ts +21 -0
  50. package/lib/aws/compute/autoscaling-common/interval-utils.js +213 -0
  51. package/lib/aws/compute/autoscaling-common/test-utils.d.ts +21 -0
  52. package/lib/aws/compute/autoscaling-common/test-utils.js +94 -0
  53. package/lib/aws/compute/autoscaling-common/types.d.ts +34 -0
  54. package/lib/aws/compute/autoscaling-common/types.js +3 -0
  55. package/lib/aws/compute/base-scalable-attribute.d.ts +74 -0
  56. package/lib/aws/compute/base-scalable-attribute.js +58 -0
  57. package/lib/aws/compute/bastion-host.js +1 -1
  58. package/lib/aws/compute/chain.js +1 -1
  59. package/lib/aws/compute/client-vpn-authorization-rule.js +1 -1
  60. package/lib/aws/compute/client-vpn-endpoint.js +2 -2
  61. package/lib/aws/compute/client-vpn-route.js +2 -2
  62. package/lib/aws/compute/condition.js +1 -1
  63. package/lib/aws/compute/connections.js +1 -1
  64. package/lib/aws/compute/ec2-util.js +1 -4
  65. package/lib/aws/compute/event-invoke-config.js +1 -1
  66. package/lib/aws/compute/event-source-filter.js +2 -2
  67. package/lib/aws/compute/event-source-mapping.js +3 -3
  68. package/lib/aws/compute/event-sources/s3-onfailure-destination.js +1 -1
  69. package/lib/aws/compute/event-sources/s3.js +1 -1
  70. package/lib/aws/compute/event-sources/sqs-dlq.js +1 -1
  71. package/lib/aws/compute/event-sources/sqs.js +1 -1
  72. package/lib/aws/compute/fields.js +4 -4
  73. package/lib/aws/compute/function-alias.js +1 -1
  74. package/lib/aws/compute/function-base.js +7 -8
  75. package/lib/aws/compute/function-destinations/event-bridge.js +3 -3
  76. package/lib/aws/compute/function-destinations/function.js +1 -1
  77. package/lib/aws/compute/function-destinations/sqs.js +1 -1
  78. package/lib/aws/compute/function-nodejs.js +1 -1
  79. package/lib/aws/compute/function-url.js +1 -1
  80. package/lib/aws/compute/function.js +1 -1
  81. package/lib/aws/compute/index.d.ts +7 -0
  82. package/lib/aws/compute/index.js +11 -2
  83. package/lib/aws/compute/instance-types.js +1 -1
  84. package/lib/aws/compute/instance.js +1 -1
  85. package/lib/aws/compute/ip-addresses.js +2 -2
  86. package/lib/aws/compute/ipam.js +1 -1
  87. package/lib/aws/compute/key-pair.js +1 -1
  88. package/lib/aws/compute/launch-template.js +2 -2
  89. package/lib/aws/compute/lb-shared/base-listener.js +1 -1
  90. package/lib/aws/compute/lb-shared/base-load-balancer.js +2 -2
  91. package/lib/aws/compute/lb-shared/base-target-group.js +1 -1
  92. package/lib/aws/compute/lb-shared/listener-certificate.js +1 -1
  93. package/lib/aws/compute/lb-shared/load-balancer-targets.js +2 -2
  94. package/lib/aws/compute/lb-shared/util.js +1 -2
  95. package/lib/aws/compute/lb-targets/alb-target.js +3 -3
  96. package/lib/aws/compute/lb-targets/instance-target.js +2 -2
  97. package/lib/aws/compute/lb-targets/ip-target.js +1 -1
  98. package/lib/aws/compute/lb-targets/lambda-target.js +1 -1
  99. package/lib/aws/compute/load-balancer.js +3 -3
  100. package/lib/aws/compute/machine-image/amazon-linux-2022.js +2 -2
  101. package/lib/aws/compute/machine-image/amazon-linux-2023.js +2 -2
  102. package/lib/aws/compute/machine-image/amazon-linux2.js +2 -2
  103. package/lib/aws/compute/machine-image/common.js +1 -1
  104. package/lib/aws/compute/machine-image/machine-image.js +8 -8
  105. package/lib/aws/compute/machine-image/utils.js +6 -6
  106. package/lib/aws/compute/nat.js +5 -5
  107. package/lib/aws/compute/network-acl-types.js +2 -2
  108. package/lib/aws/compute/network-acl.js +3 -3
  109. package/lib/aws/compute/nlb/network-listener-action.js +1 -1
  110. package/lib/aws/compute/nlb/network-listener.js +2 -3
  111. package/lib/aws/compute/nlb/network-load-balancer.js +1 -1
  112. package/lib/aws/compute/nlb/network-target-group.js +1 -1
  113. package/lib/aws/compute/peer.js +1 -1
  114. package/lib/aws/compute/placement-group.js +1 -1
  115. package/lib/aws/compute/port.js +1 -1
  116. package/lib/aws/compute/prefix-list.js +1 -1
  117. package/lib/aws/compute/private/context-stub.js +2 -2
  118. package/lib/aws/compute/route.js +11 -11
  119. package/lib/aws/compute/scalable-target.d.ts +197 -0
  120. package/lib/aws/compute/scalable-target.js +168 -0
  121. package/lib/aws/compute/schedule.d.ts +81 -0
  122. package/lib/aws/compute/schedule.js +145 -0
  123. package/lib/aws/compute/security-group.js +4 -4
  124. package/lib/aws/compute/state-graph.js +1 -1
  125. package/lib/aws/compute/state-machine-fragment.js +1 -1
  126. package/lib/aws/compute/state-machine.js +4 -4
  127. package/lib/aws/compute/states/choice.js +1 -1
  128. package/lib/aws/compute/states/custom-state.js +1 -1
  129. package/lib/aws/compute/states/distributed-map/item-batcher.js +1 -1
  130. package/lib/aws/compute/states/distributed-map/item-reader.js +7 -7
  131. package/lib/aws/compute/states/distributed-map/result-writer.js +1 -1
  132. package/lib/aws/compute/states/distributed-map.js +4 -4
  133. package/lib/aws/compute/states/fail.js +1 -1
  134. package/lib/aws/compute/states/map-base.js +1 -1
  135. package/lib/aws/compute/states/map.js +1 -1
  136. package/lib/aws/compute/states/parallel.js +1 -1
  137. package/lib/aws/compute/states/pass.js +2 -2
  138. package/lib/aws/compute/states/state.js +1 -1
  139. package/lib/aws/compute/states/succeed.js +1 -1
  140. package/lib/aws/compute/states/task-base.js +2 -2
  141. package/lib/aws/compute/states/task.js +1 -1
  142. package/lib/aws/compute/states/wait.js +2 -2
  143. package/lib/aws/compute/step-scaling-action.d.ts +148 -0
  144. package/lib/aws/compute/step-scaling-action.js +109 -0
  145. package/lib/aws/compute/step-scaling-policy.d.ts +132 -0
  146. package/lib/aws/compute/step-scaling-policy.js +153 -0
  147. package/lib/aws/compute/subnet-v2.js +2 -2
  148. package/lib/aws/compute/subnet.js +1 -1
  149. package/lib/aws/compute/target-tracking-scaling-policy.d.ts +262 -0
  150. package/lib/aws/compute/target-tracking-scaling-policy.js +234 -0
  151. package/lib/aws/compute/task-credentials.js +1 -1
  152. package/lib/aws/compute/task-input.js +1 -1
  153. package/lib/aws/compute/tasks/aws-sdk/call-aws-service.js +1 -1
  154. package/lib/aws/compute/tasks/eventbridge/put-events.js +1 -1
  155. package/lib/aws/compute/tasks/http/invoke.js +1 -1
  156. package/lib/aws/compute/tasks/lambda/invoke.js +1 -1
  157. package/lib/aws/compute/tasks/sqs/send-message.js +1 -1
  158. package/lib/aws/compute/tasks/stepfunctions/invoke-activity.js +1 -1
  159. package/lib/aws/compute/tasks/stepfunctions/start-execution.js +1 -1
  160. package/lib/aws/compute/types.js +1 -1
  161. package/lib/aws/compute/user-data.js +3 -3
  162. package/lib/aws/compute/volume.js +2 -2
  163. package/lib/aws/compute/vpc-endpoint-service.js +1 -1
  164. package/lib/aws/compute/vpc-endpoint.js +6 -6
  165. package/lib/aws/compute/vpc-flow-logs.js +4 -4
  166. package/lib/aws/compute/vpc-v2-base.js +1 -1
  167. package/lib/aws/compute/vpc-v2.js +2 -2
  168. package/lib/aws/compute/vpc.d.ts +1 -1
  169. package/lib/aws/compute/vpc.js +10 -16
  170. package/lib/aws/compute/vpn.js +4 -7
  171. package/lib/aws/compute/windows-versions.js +1 -2
  172. package/lib/aws/edge/certificate.js +1 -1
  173. package/lib/aws/edge/distribution.js +4 -5
  174. package/lib/aws/edge/dns-alias-record-targets.js +3 -3
  175. package/lib/aws/edge/dns-record.js +13 -13
  176. package/lib/aws/edge/dns-zone.js +1 -1
  177. package/lib/aws/edge/function.js +2 -2
  178. package/lib/aws/edge/key-value-store.js +4 -4
  179. package/lib/aws/edge/origin.js +3 -3
  180. package/lib/aws/edge/response-headers-policy.js +1 -1
  181. package/lib/aws/encryption/alias.js +1 -1
  182. package/lib/aws/encryption/key.js +1 -1
  183. package/lib/aws/encryption/via-service-principal.js +1 -1
  184. package/lib/aws/iam/grant.js +3 -4
  185. package/lib/aws/iam/group.js +1 -1
  186. package/lib/aws/iam/instance-profile.js +1 -1
  187. package/lib/aws/iam/managed-policy.js +1 -1
  188. package/lib/aws/iam/oidc-provider.js +3 -3
  189. package/lib/aws/iam/policy-document.js +1 -1
  190. package/lib/aws/iam/policy-statement.js +1 -1
  191. package/lib/aws/iam/policy.js +1 -1
  192. package/lib/aws/iam/principals.js +20 -20
  193. package/lib/aws/iam/role.js +1 -1
  194. package/lib/aws/iam/saml-provider.js +2 -2
  195. package/lib/aws/iam/unknown-principal.js +1 -1
  196. package/lib/aws/iam/user.js +1 -1
  197. package/lib/aws/network/simple-ipv4-vpc.js +1 -1
  198. package/lib/aws/network/subnet-group.js +3 -3
  199. package/lib/aws/network/subnet.js +4 -4
  200. package/lib/aws/notify/archive.js +1 -1
  201. package/lib/aws/notify/connection.js +7 -7
  202. package/lib/aws/notify/event-bus.js +3 -3
  203. package/lib/aws/notify/event-pattern.js +1 -1
  204. package/lib/aws/notify/input.js +2 -2
  205. package/lib/aws/notify/kinesis-stream.js +1 -1
  206. package/lib/aws/notify/notification-rule.js +1 -1
  207. package/lib/aws/notify/policy.js +1 -1
  208. package/lib/aws/notify/queue-policy.js +1 -1
  209. package/lib/aws/notify/queue.js +1 -1
  210. package/lib/aws/notify/resource-policy.js +1 -1
  211. package/lib/aws/notify/rule.js +1 -1
  212. package/lib/aws/notify/schedule.js +1 -1
  213. package/lib/aws/notify/subscription-filter.js +1 -1
  214. package/lib/aws/notify/subscription.js +4 -4
  215. package/lib/aws/notify/subscriptions/email.js +1 -1
  216. package/lib/aws/notify/subscriptions/lambda.js +1 -1
  217. package/lib/aws/notify/subscriptions/sms.js +1 -1
  218. package/lib/aws/notify/subscriptions/sqs.js +1 -1
  219. package/lib/aws/notify/subscriptions/url.js +1 -1
  220. package/lib/aws/notify/targets/event-bus.js +1 -1
  221. package/lib/aws/notify/targets/function.js +1 -1
  222. package/lib/aws/notify/targets/log-group.js +2 -2
  223. package/lib/aws/notify/targets/sqs.js +3 -3
  224. package/lib/aws/notify/targets/state-machine.js +1 -1
  225. package/lib/aws/notify/targets/util.js +2 -2
  226. package/lib/aws/notify/topic-base.js +1 -1
  227. package/lib/aws/notify/topic.js +1 -1
  228. package/lib/aws/storage/billing.d.ts +62 -0
  229. package/lib/aws/storage/billing.js +49 -0
  230. package/lib/aws/storage/bucket-notifications.js +1 -1
  231. package/lib/aws/storage/bucket-policy.js +1 -1
  232. package/lib/aws/storage/bucket-source.js +3 -3
  233. package/lib/aws/storage/bucket.js +2 -2
  234. package/lib/aws/storage/capacity.d.ts +96 -0
  235. package/lib/aws/storage/capacity.js +103 -0
  236. package/lib/aws/storage/dynamodb-canned-metrics.generated.d.ts +493 -0
  237. package/lib/aws/storage/dynamodb-canned-metrics.generated.js +263 -0
  238. package/lib/aws/storage/dynamodb-perms.d.ts +8 -0
  239. package/lib/aws/storage/dynamodb-perms.js +45 -0
  240. package/lib/aws/storage/encryption.d.ts +54 -0
  241. package/lib/aws/storage/encryption.js +116 -0
  242. package/lib/aws/storage/index.d.ts +6 -0
  243. package/lib/aws/storage/index.js +10 -1
  244. package/lib/aws/storage/notification-targets/function.js +1 -1
  245. package/lib/aws/storage/notification-targets/queue.js +1 -1
  246. package/lib/aws/storage/origin-access-identity.js +1 -1
  247. package/lib/aws/storage/parameter.js +2 -2
  248. package/lib/aws/storage/scalable-attribute-api.d.ts +36 -0
  249. package/lib/aws/storage/scalable-attribute-api.js +3 -0
  250. package/lib/aws/storage/scalable-table-attribute.d.ts +32 -0
  251. package/lib/aws/storage/scalable-table-attribute.js +48 -0
  252. package/lib/aws/storage/shared.d.ts +419 -0
  253. package/lib/aws/storage/shared.js +161 -0
  254. package/lib/aws/storage/table.d.ts +536 -0
  255. package/lib/aws/storage/table.js +1054 -0
  256. package/lib/construct-base.js +2 -2
  257. package/lib/duration.js +1 -1
  258. package/lib/expiration.js +1 -1
  259. package/lib/index.d.ts +1 -0
  260. package/lib/index.js +2 -1
  261. package/lib/size.js +1 -1
  262. package/lib/stack-base.js +1 -1
  263. package/lib/terra-func.js +1 -1
  264. package/lib/time-zone.d.ts +724 -0
  265. package/lib/time-zone.js +737 -0
  266. package/package.json +2 -1
@@ -0,0 +1,536 @@
1
+ import { dynamodbTable } from "@cdktf/provider-aws";
2
+ import { Construct } from "constructs";
3
+ import * as storage from ".";
4
+ import { AwsConstructBase, AwsConstructProps } from "..";
5
+ import { EnableScalingProps, IScalableTableAttribute } from "./scalable-attribute-api";
6
+ import { OperationsMetricOptions, SystemErrorsForOperationsMetricOptions, Attribute, BillingMode, ITable, SecondaryIndexProps, TableClass, LocalSecondaryIndexProps, TableEncryption, StreamViewType, PointInTimeRecoverySpecification } from "./shared";
7
+ import * as cloudwatch from "../cloudwatch";
8
+ import * as kms from "../encryption";
9
+ import * as iam from "../iam";
10
+ import * as kinesis from "../notify";
11
+ /**
12
+ * Represents the table schema attributes.
13
+ */
14
+ export interface SchemaOptions {
15
+ /**
16
+ * Partition key attribute definition.
17
+ */
18
+ readonly partitionKey: Attribute;
19
+ /**
20
+ * Sort key attribute definition.
21
+ *
22
+ * @default no sort key
23
+ */
24
+ readonly sortKey?: Attribute;
25
+ }
26
+ /**
27
+ * Type of compression to use for imported data.
28
+ */
29
+ export declare enum InputCompressionType {
30
+ /**
31
+ * GZIP compression.
32
+ */
33
+ GZIP = "GZIP",
34
+ /**
35
+ * ZSTD compression.
36
+ */
37
+ ZSTD = "ZSTD",
38
+ /**
39
+ * No compression.
40
+ */
41
+ NONE = "NONE"
42
+ }
43
+ /**
44
+ * The options for imported source files in CSV format.
45
+ */
46
+ export interface CsvOptions {
47
+ /**
48
+ * The delimiter used for separating items in the CSV file being imported.
49
+ *
50
+ * Valid delimiters are as follows:
51
+ * - comma (`,`)
52
+ * - tab (`\t`)
53
+ * - colon (`:`)
54
+ * - semicolon (`;`)
55
+ * - pipe (`|`)
56
+ * - space (` `)
57
+ *
58
+ * @default - use comma as a delimiter.
59
+ */
60
+ readonly delimiter?: string;
61
+ /**
62
+ * List of the headers used to specify a common header for all source CSV files being imported.
63
+ *
64
+ * **NOTE**: If this field is specified then the first line of each CSV file is treated as data instead of the header.
65
+ * If this field is not specified the the first line of each CSV file is treated as the header.
66
+ *
67
+ * @default - the first line of the CSV file is treated as the header
68
+ */
69
+ readonly headerList?: string[];
70
+ }
71
+ /**
72
+ * The format of the source data.
73
+ */
74
+ export declare abstract class InputFormat {
75
+ /**
76
+ * DynamoDB JSON format.
77
+ */
78
+ static dynamoDBJson(): InputFormat;
79
+ /**
80
+ * Amazon Ion format.
81
+ */
82
+ static ion(): InputFormat;
83
+ /**
84
+ * CSV format.
85
+ */
86
+ static csv(options?: CsvOptions): InputFormat;
87
+ private static validCsvDelimiters;
88
+ private static readableValidCsvDelimiters;
89
+ /**
90
+ * @internal
91
+ */
92
+ abstract _render(): Pick<dynamodbTable.DynamodbTableImportTable, "inputFormat" | "inputFormatOptions">;
93
+ }
94
+ /**
95
+ * Properties for importing data from the S3.
96
+ */
97
+ export interface ImportSourceSpecification {
98
+ /**
99
+ * The compression type of the imported data.
100
+ *
101
+ * @default InputCompressionType.NONE
102
+ */
103
+ readonly compressionType?: InputCompressionType;
104
+ /**
105
+ * The format of the imported data.
106
+ */
107
+ readonly inputFormat: InputFormat;
108
+ /**
109
+ * The S3 bucket that is being imported from.
110
+ */
111
+ readonly bucket: storage.IBucket;
112
+ /**
113
+ * The account number of the S3 bucket that is being imported from.
114
+ *
115
+ * @default - no value
116
+ */
117
+ readonly bucketOwner?: string;
118
+ /**
119
+ * The key prefix shared by all S3 Objects that are being imported.
120
+ *
121
+ * @default - no value
122
+ */
123
+ readonly keyPrefix?: string;
124
+ }
125
+ /**
126
+ * The precision associated with the DynamoDB write timestamps that will be replicated to Kinesis.
127
+ * The default setting for record timestamp precision is microseconds. You can change this setting at any time.
128
+ * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html#aws-properties-dynamodb-table-kinesisstreamspecification-properties
129
+ */
130
+ export declare enum ApproximateCreationDateTimePrecision {
131
+ /**
132
+ * Millisecond precision
133
+ */
134
+ MILLISECOND = "MILLISECOND",
135
+ /**
136
+ * Microsecond precision
137
+ */
138
+ MICROSECOND = "MICROSECOND"
139
+ }
140
+ export interface DynamodbTableReplica {
141
+ /** (Optional) ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key, `alias/aws/dynamodb`. **Note:** This attribute will _not_ be populated with the ARN of _default_ keys. */
142
+ readonly encryptionKey?: kms.IKey;
143
+ /** (Optional) Whether to enable Point In Time Recovery for the replica. Default is `false`. */
144
+ readonly pointInTimeRecovery?: boolean;
145
+ /** (Optional) Whether to propagate the global table's tags to a replica. Default is `false`. Changes to tags only move in one direction: from global (source) to replica. In other words, tag drift on a replica will not trigger an update. Tag or replica changes on the global table, whether from drift or configuration changes, are propagated to replicas. Changing from `true` to `false` on a subsequent `apply` means replica tags are left as they were, unmanaged, not deleted. */
146
+ readonly propagateTags?: boolean;
147
+ /** (Required) Region name of the replica. */
148
+ readonly regionName: string;
149
+ }
150
+ /**
151
+ * Properties of a DynamoDB Table
152
+ *
153
+ * Use `TableProps` for all table properties
154
+ */
155
+ export interface TableOptions extends SchemaOptions {
156
+ /**
157
+ * The read capacity for the table. Careful if you add Global Secondary Indexes, as
158
+ * those will share the table's provisioned throughput.
159
+ *
160
+ * Can only be provided if billingMode is Provisioned.
161
+ *
162
+ * @default 5
163
+ */
164
+ readonly readCapacity?: number;
165
+ /**
166
+ * The write capacity for the table. Careful if you add Global Secondary Indexes, as
167
+ * those will share the table's provisioned throughput.
168
+ *
169
+ * Can only be provided if billingMode is Provisioned.
170
+ *
171
+ * @default 5
172
+ */
173
+ readonly writeCapacity?: number;
174
+ /**
175
+ * The maximum read request units for the table. Careful if you add Global Secondary Indexes, as
176
+ * those will share the table's maximum on-demand throughput.
177
+ *
178
+ * Can only be provided if billingMode is PAY_PER_REQUEST.
179
+ *
180
+ * @default - on-demand throughput is disabled
181
+ */
182
+ readonly maxReadRequestUnits?: number;
183
+ /**
184
+ * The write request units for the table. Careful if you add Global Secondary Indexes, as
185
+ * those will share the table's maximum on-demand throughput.
186
+ *
187
+ * Can only be provided if billingMode is PAY_PER_REQUEST.
188
+ *
189
+ * @default - on-demand throughput is disabled
190
+ */
191
+ readonly maxWriteRequestUnits?: number;
192
+ /**
193
+ * Specify how you are charged for read and write throughput and how you manage capacity.
194
+ *
195
+ * @default PROVISIONED if `replicationRegions` is not specified, PAY_PER_REQUEST otherwise
196
+ */
197
+ readonly billingMode?: BillingMode;
198
+ /**
199
+ * Whether point-in-time recovery is enabled.
200
+ * @deprecated use `pointInTimeRecoverySpecification` instead
201
+ * @default false - point in time recovery is not enabled.
202
+ */
203
+ readonly pointInTimeRecovery?: boolean;
204
+ /**
205
+ * Whether point-in-time recovery is enabled.
206
+ *
207
+ * @default - point in time recovery is not enabled.
208
+ */
209
+ readonly pointInTimeRecoverySpecification?: PointInTimeRecoverySpecification;
210
+ /**
211
+ * Whether server-side encryption with an AWS managed customer master key is enabled.
212
+ *
213
+ * This property cannot be set if `encryption` and/or `encryptionKey` is set.
214
+ *
215
+ * @default - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
216
+ *
217
+ * @deprecated This property is deprecated. In order to obtain the same behavior as
218
+ * enabling this, set the `encryption` property to `TableEncryption.AWS_MANAGED` instead.
219
+ */
220
+ readonly serverSideEncryption?: boolean;
221
+ /**
222
+ * Specify the table class.
223
+ * @default STANDARD
224
+ */
225
+ readonly tableClass?: TableClass;
226
+ /**
227
+ * Whether server-side encryption with an AWS managed customer master key is enabled.
228
+ *
229
+ * This property cannot be set if `serverSideEncryption` is set.
230
+ *
231
+ * @default - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
232
+ */
233
+ readonly encryption?: TableEncryption;
234
+ /**
235
+ * External KMS key to use for table encryption.
236
+ *
237
+ * This property can only be set if `encryption` is set to `TableEncryption.CUSTOMER_MANAGED`.
238
+ *
239
+ * @default - If `encryption` is set to `TableEncryption.CUSTOMER_MANAGED` and this
240
+ * property is undefined, a new KMS key will be created and associated with this table.
241
+ * If `encryption` and this property are both undefined, then the table is encrypted with
242
+ * an encryption key managed by DynamoDB, and you are not charged any fee for using it.
243
+ */
244
+ readonly encryptionKey?: kms.IKey;
245
+ /**
246
+ * The name of TTL attribute.
247
+ * @default - TTL is disabled
248
+ */
249
+ readonly timeToLiveAttribute?: string;
250
+ /**
251
+ * When an item in the table is modified, StreamViewType determines what information
252
+ * is written to the stream for this table.
253
+ *
254
+ * @default - streams are disabled unless `replicationRegions` is specified
255
+ */
256
+ readonly stream?: StreamViewType;
257
+ /**
258
+ * Regions where replica tables will be created
259
+ *
260
+ * @deprecated use replicaSpecification instead
261
+ * @default - no replica tables are created
262
+ */
263
+ readonly replicationRegions?: string[];
264
+ /**
265
+ * The specification for replica tables.
266
+ */
267
+ readonly replicaSpecification?: DynamodbTableReplica[];
268
+ /**
269
+ * Whether CloudWatch contributor insights is enabled.
270
+ *
271
+ * @default false
272
+ */
273
+ readonly contributorInsightsEnabled?: boolean;
274
+ /**
275
+ * Enables deletion protection for the table.
276
+ *
277
+ * @default false
278
+ */
279
+ readonly deletionProtection?: boolean;
280
+ /**
281
+ * The properties of data being imported from the S3 bucket source to the table.
282
+ *
283
+ * @default - no data import from the S3 bucket
284
+ */
285
+ readonly importSource?: ImportSourceSpecification;
286
+ /**
287
+ * Resource policy to assign to table.
288
+ * Note: `aws_dynamodb_table` does not directly support a resource policy property.
289
+ * This policy would need to be managed and applied separately, e.g., via `aws_iam_policy` attached to principals.
290
+ * @default - No resource policy statement
291
+ */
292
+ readonly resourcePolicy?: iam.PolicyDocument;
293
+ }
294
+ /**
295
+ * Properties for a DynamoDB Table
296
+ */
297
+ export interface TableProps extends TableOptions, AwsConstructProps {
298
+ /**
299
+ * Enforces a particular physical table name.
300
+ * @default <generated>
301
+ */
302
+ readonly tableName?: string;
303
+ /**
304
+ * Kinesis Data Stream to capture item-level changes for the table.
305
+ *
306
+ * @default - no Kinesis Data Stream
307
+ */
308
+ readonly kinesisStream?: kinesis.IStream;
309
+ /**
310
+ * Kinesis Data Stream approximate creation timestamp precision
311
+ *
312
+ * @default ApproximateCreationDateTimePrecision.MICROSECOND
313
+ */
314
+ readonly kinesisPrecisionTimestamp?: ApproximateCreationDateTimePrecision;
315
+ }
316
+ /**
317
+ * Properties for a global secondary index
318
+ */
319
+ export interface GlobalSecondaryIndexProps extends SecondaryIndexProps, SchemaOptions {
320
+ /**
321
+ * The read capacity for the global secondary index.
322
+ *
323
+ * Can only be provided if table billingMode is Provisioned or undefined.
324
+ *
325
+ * @default 5
326
+ */
327
+ readonly readCapacity?: number;
328
+ /**
329
+ * The write capacity for the global secondary index.
330
+ *
331
+ * Can only be provided if table billingMode is Provisioned or undefined.
332
+ *
333
+ * @default 5
334
+ */
335
+ readonly writeCapacity?: number;
336
+ /**
337
+ * The maximum read request units for the global secondary index.
338
+ *
339
+ * Can only be provided if table billingMode is PAY_PER_REQUEST.
340
+ *
341
+ * @default - on-demand throughput is disabled
342
+ */
343
+ readonly maxReadRequestUnits?: number;
344
+ /**
345
+ * The maximum write request units for the global secondary index.
346
+ *
347
+ * Can only be provided if table billingMode is PAY_PER_REQUEST.
348
+ *
349
+ * @default - on-demand throughput is disabled
350
+ */
351
+ readonly maxWriteRequestUnits?: number;
352
+ /**
353
+ * Whether CloudWatch contributor insights is enabled for the specified global secondary index.
354
+ *
355
+ * @default false
356
+ */
357
+ readonly contributorInsightsEnabled?: boolean;
358
+ }
359
+ /**
360
+ * Reference to a dynamodb table.
361
+ */
362
+ export interface TableAttributes {
363
+ /**
364
+ * The ARN of the dynamodb table.
365
+ * One of this, or `tableName`, is required.
366
+ *
367
+ * @default - no table arn
368
+ */
369
+ readonly tableArn?: string;
370
+ /**
371
+ * The table name of the dynamodb table.
372
+ * One of this, or `tableArn`, is required.
373
+ *
374
+ * @default - no table name
375
+ */
376
+ readonly tableName?: string;
377
+ /**
378
+ * The ARN of the table's stream.
379
+ *
380
+ * @default - no table stream
381
+ */
382
+ readonly tableStreamArn?: string;
383
+ /**
384
+ * KMS encryption key, if this table uses a customer-managed encryption key.
385
+ *
386
+ * @default - no key
387
+ */
388
+ readonly encryptionKey?: kms.IKey;
389
+ /**
390
+ * The name of the global indexes set for this Table.
391
+ * Note that you need to set either this property,
392
+ * or `localIndexes`,
393
+ * if you want methods like grantReadData()
394
+ * to grant permissions for indexes as well as the table itself.
395
+ *
396
+ * @default - no global indexes
397
+ */
398
+ readonly globalIndexes?: string[];
399
+ /**
400
+ * The name of the local indexes set for this Table.
401
+ * Note that you need to set either this property,
402
+ * or `globalIndexes`,
403
+ * if you want methods like grantReadData()
404
+ * to grant permissions for indexes as well as the table itself.
405
+ *
406
+ * @default - no local indexes
407
+ */
408
+ readonly localIndexes?: string[];
409
+ /**
410
+ * If set to true, grant methods always grant permissions for all indexes.
411
+ * If false is provided, grant methods grant the permissions
412
+ * only when `globalIndexes` or `localIndexes` is specified.
413
+ *
414
+ * @default - false
415
+ */
416
+ readonly grantIndexPermissions?: boolean;
417
+ }
418
+ export declare abstract class TableBase extends AwsConstructBase implements ITable, iam.IAwsConstructWithPolicy {
419
+ abstract readonly tableArn: string;
420
+ abstract readonly tableName: string;
421
+ abstract readonly tableStreamArn?: string;
422
+ abstract readonly encryptionKey?: kms.IKey;
423
+ abstract resourcePolicy?: iam.PolicyDocument;
424
+ protected readonly regionalArns: string[];
425
+ get outputs(): Record<string, any>;
426
+ grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
427
+ grantStream(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
428
+ grantReadData(grantee: iam.IGrantable): iam.Grant;
429
+ grantTableListStreams(grantee: iam.IGrantable): iam.Grant;
430
+ grantStreamRead(grantee: iam.IGrantable): iam.Grant;
431
+ grantWriteData(grantee: iam.IGrantable): iam.Grant;
432
+ grantReadWriteData(grantee: iam.IGrantable): iam.Grant;
433
+ grantFullAccess(grantee: iam.IGrantable): iam.Grant;
434
+ addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult;
435
+ metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
436
+ metricConsumedReadCapacityUnits(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
437
+ metricConsumedWriteCapacityUnits(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
438
+ /** @deprecated use `metricSystemErrorsForOperations`. */
439
+ metricSystemErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
440
+ metricUserErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
441
+ metricConditionalCheckFailedRequests(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
442
+ /** @deprecated Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead. */
443
+ metricThrottledRequests(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
444
+ metricSuccessfulRequestLatency(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
445
+ metricThrottledRequestsForOperation(operation: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
446
+ metricThrottledRequestsForOperations(props?: OperationsMetricOptions): cloudwatch.IMetric;
447
+ metricSystemErrorsForOperations(props?: SystemErrorsForOperationsMetricOptions): cloudwatch.IMetric;
448
+ private sumMetricsForOperations;
449
+ private createMetricsForOperations;
450
+ protected abstract get hasIndex(): boolean;
451
+ private combinedGrant;
452
+ private cannedMetric;
453
+ }
454
+ /**
455
+ * Provides a DynamoDB table.
456
+ */
457
+ export declare class Table extends TableBase {
458
+ /**
459
+ * Permits an IAM Principal to list all DynamoDB Streams.
460
+ * @deprecated Use `#grantTableListStreams` for more granular permission
461
+ * @param grantee The principal (no-op if undefined)
462
+ */
463
+ static grantListStreams(grantee: iam.IGrantable): iam.Grant;
464
+ /**
465
+ * Creates a Table construct that represents an external table via table name.
466
+ *
467
+ * @param scope The parent creating construct (usually `this`).
468
+ * @param id The construct's name.
469
+ * @param tableName The table's name.
470
+ */
471
+ static fromTableName(scope: Construct, id: string, tableName: string): ITable;
472
+ /**
473
+ * Creates a Table construct that represents an external table via table arn.
474
+ *
475
+ * @param scope The parent creating construct (usually `this`).
476
+ * @param id The construct's name.
477
+ * @param tableArn The table's ARN.
478
+ */
479
+ static fromTableArn(scope: Construct, id: string, tableArn: string): ITable;
480
+ /**
481
+ * Creates a Table construct that represents an external table.
482
+ *
483
+ * @param scope The parent creating construct (usually `this`).
484
+ * @param id The construct's name.
485
+ * @param attrs A `TableAttributes` object.
486
+ */
487
+ static fromTableAttributes(scope: Construct, id: string, attrs: TableAttributes): ITable;
488
+ readonly encryptionKey?: kms.IKey;
489
+ /**
490
+ * Resource policy to assign to DynamoDB Table.
491
+ * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-resourcepolicy.html
492
+ * @default - No resource policy statements are added to the created table.
493
+ */
494
+ resourcePolicy?: iam.PolicyDocument;
495
+ readonly tableArn: string;
496
+ readonly tableName: string;
497
+ readonly tableStreamArn: string | undefined;
498
+ private readonly attributeDefinitionsInternal;
499
+ private readonly globalSecondaryIndexesInternal;
500
+ private readonly localSecondaryIndexesInternal;
501
+ private readonly secondaryIndexSchemas;
502
+ private readonly nonKeyAttributes;
503
+ private readonly tablePartitionKey;
504
+ private readonly tableSortKey?;
505
+ private readonly billingMode;
506
+ private readonly tableScaling;
507
+ private readonly indexScaling;
508
+ private readonly _resource;
509
+ private readonly _replicas;
510
+ constructor(scope: Construct, id: string, props: TableProps);
511
+ addGlobalSecondaryIndex(props: GlobalSecondaryIndexProps): void;
512
+ addLocalSecondaryIndex(props: LocalSecondaryIndexProps): void;
513
+ autoScaleReadCapacity(props: EnableScalingProps): IScalableTableAttribute;
514
+ autoScaleWriteCapacity(props: EnableScalingProps): IScalableTableAttribute;
515
+ autoScaleGlobalSecondaryIndexReadCapacity(indexName: string, props: EnableScalingProps): IScalableTableAttribute;
516
+ autoScaleGlobalSecondaryIndexWriteCapacity(indexName: string, props: EnableScalingProps): IScalableTableAttribute;
517
+ schema(indexName?: string): SchemaOptions;
518
+ private validateTable;
519
+ private validateProvisioning;
520
+ private validateProvisioningGSI;
521
+ private validateIndexName;
522
+ private validateNonKeyAttributes;
523
+ private renderPointInTimeRecovery;
524
+ private buildIndexProjection;
525
+ private addKey;
526
+ private registerAttribute;
527
+ /**
528
+ * Creates replica tables
529
+ *
530
+ * @param regions regions where to create tables
531
+ */
532
+ private renderReplicas;
533
+ protected get hasIndex(): boolean;
534
+ private parseEncryption;
535
+ private renderImportSourceSpecification;
536
+ }