UNPKG

8.88 kBTypeScriptView Raw
1import { Duration } from '@aws-cdk/core';
2/**
3 * Declaration of a Life cycle rule
4 */
5export interface LifecycleRule {
6 /**
7 * A unique identifier for this rule. The value cannot be more than 255 characters.
8 */
9 readonly id?: string;
10 /**
11 * Whether this rule is enabled.
12 *
13 * @default true
14 */
15 readonly enabled?: boolean;
16 /**
17 * Specifies a lifecycle rule that aborts incomplete multipart uploads to an Amazon S3 bucket.
18 *
19 * The AbortIncompleteMultipartUpload property type creates a lifecycle
20 * rule that aborts incomplete multipart uploads to an Amazon S3 bucket.
21 * When Amazon S3 aborts a multipart upload, it deletes all parts
22 * associated with the multipart upload.
23 *
24 * @default - Incomplete uploads are never aborted
25 */
26 readonly abortIncompleteMultipartUploadAfter?: Duration;
27 /**
28 * Indicates when objects are deleted from Amazon S3 and Amazon Glacier.
29 *
30 * The date value must be in ISO 8601 format. The time is always midnight UTC.
31 *
32 * If you specify an expiration and transition time, you must use the same
33 * time unit for both properties (either in days or by date). The
34 * expiration time must also be later than the transition time.
35 *
36 * @default - No expiration date
37 */
38 readonly expirationDate?: Date;
39 /**
40 * Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon Glacier.
41 *
42 * If you specify an expiration and transition time, you must use the same
43 * time unit for both properties (either in days or by date). The
44 * expiration time must also be later than the transition time.
45 *
46 * @default - No expiration timeout
47 */
48 readonly expiration?: Duration;
49 /**
50 * Time between when a new version of the object is uploaded to the bucket and when old versions of the object expire.
51 *
52 * For buckets with versioning enabled (or suspended), specifies the time,
53 * in days, between when a new version of the object is uploaded to the
54 * bucket and when old versions of the object expire. When object versions
55 * expire, Amazon S3 permanently deletes them. If you specify a transition
56 * and expiration time, the expiration time must be later than the
57 * transition time.
58 *
59 * @default - No noncurrent version expiration
60 */
61 readonly noncurrentVersionExpiration?: Duration;
62 /**
63 * Indicates a maximum number of noncurrent versions to retain.
64 *
65 * If there are this many more noncurrent versions,
66 * Amazon S3 permanently deletes them.
67 *
68 * @default - No noncurrent versions to retain
69 */
70 readonly noncurrentVersionsToRetain?: number;
71 /**
72 * One or more transition rules that specify when non-current objects transition to a specified storage class.
73 *
74 * Only for for buckets with versioning enabled (or suspended).
75 *
76 * If you specify a transition and expiration time, the expiration time
77 * must be later than the transition time.
78 */
79 readonly noncurrentVersionTransitions?: NoncurrentVersionTransition[];
80 /**
81 * One or more transition rules that specify when an object transitions to a specified storage class.
82 *
83 * If you specify an expiration and transition time, you must use the same
84 * time unit for both properties (either in days or by date). The
85 * expiration time must also be later than the transition time.
86 *
87 * @default - No transition rules
88 */
89 readonly transitions?: Transition[];
90 /**
91 * Object key prefix that identifies one or more objects to which this rule applies.
92 *
93 * @default - Rule applies to all objects
94 */
95 readonly prefix?: string;
96 /**
97 * The TagFilter property type specifies tags to use to identify a subset of objects for an Amazon S3 bucket.
98 *
99 * @default - Rule applies to all objects
100 */
101 readonly tagFilters?: {
102 [tag: string]: any;
103 };
104 /**
105 * Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.
106 * If set to true, the delete marker will be expired.
107 *
108 * @default false
109 */
110 readonly expiredObjectDeleteMarker?: boolean;
111 /**
112 * Specifies the maximum object size in bytes for this rule to apply to.
113 *
114 * @default - No rule
115 */
116 readonly objectSizeLessThan?: number;
117 /** Specifies the minimum object size in bytes for this rule to apply to.
118 *
119 * @default - No rule
120 */
121 readonly objectSizeGreaterThan?: number;
122}
123/**
124 * Describes when an object transitions to a specified storage class.
125 */
126export interface Transition {
127 /**
128 * The storage class to which you want the object to transition.
129 */
130 readonly storageClass: StorageClass;
131 /**
132 * Indicates when objects are transitioned to the specified storage class.
133 *
134 * The date value must be in ISO 8601 format. The time is always midnight UTC.
135 *
136 * @default - No transition date.
137 */
138 readonly transitionDate?: Date;
139 /**
140 * Indicates the number of days after creation when objects are transitioned to the specified storage class.
141 *
142 * @default - No transition count.
143 */
144 readonly transitionAfter?: Duration;
145}
146/**
147 * Describes when noncurrent versions transition to a specified storage class.
148 */
149export interface NoncurrentVersionTransition {
150 /**
151 * The storage class to which you want the object to transition.
152 */
153 readonly storageClass: StorageClass;
154 /**
155 * Indicates the number of days after creation when objects are transitioned to the specified storage class.
156 *
157 * @default - No transition count.
158 */
159 readonly transitionAfter: Duration;
160 /**
161 * Indicates the number of noncurrent version objects to be retained. Can be up to 100 noncurrent versions retained.
162 *
163 * @default - No noncurrent version retained.
164 */
165 readonly noncurrentVersionsToRetain?: number;
166}
167/**
168 * Storage class to move an object to
169 */
170export declare class StorageClass {
171 readonly value: string;
172 /**
173 * Storage class for data that is accessed less frequently, but requires rapid
174 * access when needed.
175 *
176 * Has lower availability than Standard storage.
177 */
178 static readonly INFREQUENT_ACCESS: StorageClass;
179 /**
180 * Infrequent Access that's only stored in one availability zone.
181 *
182 * Has lower availability than standard InfrequentAccess.
183 */
184 static readonly ONE_ZONE_INFREQUENT_ACCESS: StorageClass;
185 /**
186 * Storage class for long-term archival that can take between minutes and
187 * hours to access.
188 *
189 * Use for archives where portions of the data might need to be retrieved in
190 * minutes. Data stored in the GLACIER storage class has a minimum storage
191 * duration period of 90 days and can be accessed in as little as 1-5 minutes
192 * using expedited retrieval. If you delete an object before the 90-day
193 * minimum, you are charged for 90 days.
194 */
195 static readonly GLACIER: StorageClass;
196 /**
197 * Storage class for long-term archival that can be accessed in a few milliseconds.
198 *
199 * It is ideal for data that is accessed once or twice per quarter, and
200 * that requires immediate access. Data stored in the GLACIER_IR storage class
201 * has a minimum storage duration period of 90 days and can be accessed in
202 * as milliseconds. If you delete an object before the 90-day minimum,
203 * you are charged for 90 days.
204 */
205 static readonly GLACIER_INSTANT_RETRIEVAL: StorageClass;
206 /**
207 * Use for archiving data that rarely needs to be accessed. Data stored in the
208 * DEEP_ARCHIVE storage class has a minimum storage duration period of 180
209 * days and a default retrieval time of 12 hours. If you delete an object
210 * before the 180-day minimum, you are charged for 180 days. For pricing
211 * information, see Amazon S3 Pricing.
212 */
213 static readonly DEEP_ARCHIVE: StorageClass;
214 /**
215 * The INTELLIGENT_TIERING storage class is designed to optimize storage costs
216 * by automatically moving data to the most cost-effective storage access
217 * tier, without performance impact or operational overhead.
218 * INTELLIGENT_TIERING delivers automatic cost savings by moving data on a
219 * granular object level between two access tiers, a frequent access tier and
220 * a lower-cost infrequent access tier, when access patterns change. The
221 * INTELLIGENT_TIERING storage class is ideal if you want to optimize storage
222 * costs automatically for long-lived data when access patterns are unknown or
223 * unpredictable.
224 */
225 static readonly INTELLIGENT_TIERING: StorageClass;
226 constructor(value: string);
227 toString(): string;
228}