ec2-instance-running-scheduler 0.1.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/API.md ADDED
@@ -0,0 +1,1687 @@
1
+ # API Reference <a name="API Reference" id="api-reference"></a>
2
+
3
+ ## Constructs <a name="Constructs" id="Constructs"></a>
4
+
5
+ ### EC2InstanceRunningScheduler <a name="EC2InstanceRunningScheduler" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler"></a>
6
+
7
+ Provisions EventBridge Scheduler rules and a Durable Execution Lambda that start/stop tagged EC2 instances.
8
+
9
+ Each schedule invokes the function with `Params` (`TagKey`, `TagValues`, `Mode`). The function uses
10
+ the Resource Groups Tagging API and EC2 APIs; Slack notifications use the secret named in {@link Secrets.slackSecretName}.
11
+
12
+ #### Initializers <a name="Initializers" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer"></a>
13
+
14
+ ```typescript
15
+ import { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler'
16
+
17
+ new EC2InstanceRunningScheduler(scope: Construct, id: string, props: EC2InstanceRunningSchedulerProps)
18
+ ```
19
+
20
+ | **Name** | **Type** | **Description** |
21
+ | --- | --- | --- |
22
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
23
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.id">id</a></code> | <code>string</code> | - Construct id. |
24
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a></code> | - Target tags, optional cron overrides, Slack secret name, and schedule enable flag. |
25
+
26
+ ---
27
+
28
+ ##### `scope`<sup>Required</sup> <a name="scope" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.scope"></a>
29
+
30
+ - *Type:* constructs.Construct
31
+
32
+ Parent construct.
33
+
34
+ ---
35
+
36
+ ##### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.id"></a>
37
+
38
+ - *Type:* string
39
+
40
+ Construct id.
41
+
42
+ ---
43
+
44
+ ##### `props`<sup>Required</sup> <a name="props" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.Initializer.parameter.props"></a>
45
+
46
+ - *Type:* <a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps">EC2InstanceRunningSchedulerProps</a>
47
+
48
+ Target tags, optional cron overrides, Slack secret name, and schedule enable flag.
49
+
50
+ ---
51
+
52
+ #### Methods <a name="Methods" id="Methods"></a>
53
+
54
+ | **Name** | **Description** |
55
+ | --- | --- |
56
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.toString">toString</a></code> | Returns a string representation of this construct. |
57
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.with">with</a></code> | Applies one or more mixins to this construct. |
58
+
59
+ ---
60
+
61
+ ##### `toString` <a name="toString" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.toString"></a>
62
+
63
+ ```typescript
64
+ public toString(): string
65
+ ```
66
+
67
+ Returns a string representation of this construct.
68
+
69
+ ##### `with` <a name="with" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.with"></a>
70
+
71
+ ```typescript
72
+ public with(mixins: ...IMixin[]): IConstruct
73
+ ```
74
+
75
+ Applies one or more mixins to this construct.
76
+
77
+ Mixins are applied in order. The list of constructs is captured at the
78
+ start of the call, so constructs added by a mixin will not be visited.
79
+ Use multiple `with()` calls if subsequent mixins should apply to added
80
+ constructs.
81
+
82
+ ###### `mixins`<sup>Required</sup> <a name="mixins" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.with.parameter.mixins"></a>
83
+
84
+ - *Type:* ...constructs.IMixin[]
85
+
86
+ The mixins to apply.
87
+
88
+ ---
89
+
90
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
91
+
92
+ | **Name** | **Description** |
93
+ | --- | --- |
94
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
95
+
96
+ ---
97
+
98
+ ##### `isConstruct` <a name="isConstruct" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.isConstruct"></a>
99
+
100
+ ```typescript
101
+ import { EC2InstanceRunningScheduler } from 'ec2-instance-running-scheduler'
102
+
103
+ EC2InstanceRunningScheduler.isConstruct(x: any)
104
+ ```
105
+
106
+ Checks if `x` is a construct.
107
+
108
+ Use this method instead of `instanceof` to properly detect `Construct`
109
+ instances, even when the construct library is symlinked.
110
+
111
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
112
+ disk are seen as independent, completely different libraries. As a
113
+ consequence, the class `Construct` in each copy of the `constructs` library
114
+ is seen as a different class, and an instance of one class will not test as
115
+ `instanceof` the other class. `npm install` will not create installations
116
+ like this, but users may manually symlink construct libraries together or
117
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
118
+ library can be accidentally installed, and `instanceof` will behave
119
+ unpredictably. It is safest to avoid using `instanceof`, and using
120
+ this type-testing method instead.
121
+
122
+ ###### `x`<sup>Required</sup> <a name="x" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.isConstruct.parameter.x"></a>
123
+
124
+ - *Type:* any
125
+
126
+ Any object.
127
+
128
+ ---
129
+
130
+ #### Properties <a name="Properties" id="Properties"></a>
131
+
132
+ | **Name** | **Type** | **Description** |
133
+ | --- | --- | --- |
134
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduler.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
135
+
136
+ ---
137
+
138
+ ##### `node`<sup>Required</sup> <a name="node" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduler.property.node"></a>
139
+
140
+ ```typescript
141
+ public readonly node: Node;
142
+ ```
143
+
144
+ - *Type:* constructs.Node
145
+
146
+ The tree node.
147
+
148
+ ---
149
+
150
+
151
+ ### EC2InstanceRunningScheduleStack <a name="EC2InstanceRunningScheduleStack" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack"></a>
152
+
153
+ CDK Stack that deploys the EC2 instance running scheduler (EventBridge Scheduler + Durable Lambda).
154
+
155
+ #### Initializers <a name="Initializers" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer"></a>
156
+
157
+ ```typescript
158
+ import { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler'
159
+
160
+ new EC2InstanceRunningScheduleStack(scope: Construct, id: string, props: EC2InstanceRunningScheduleStackProps)
161
+ ```
162
+
163
+ | **Name** | **Type** | **Description** |
164
+ | --- | --- | --- |
165
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | - Parent construct. |
166
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.id">id</a></code> | <code>string</code> | - Stack id. |
167
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.props">props</a></code> | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps">EC2InstanceRunningScheduleStackProps</a></code> | - Stack props (target resource, schedules, secrets). |
168
+
169
+ ---
170
+
171
+ ##### `scope`<sup>Required</sup> <a name="scope" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.scope"></a>
172
+
173
+ - *Type:* constructs.Construct
174
+
175
+ Parent construct.
176
+
177
+ ---
178
+
179
+ ##### `id`<sup>Required</sup> <a name="id" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.id"></a>
180
+
181
+ - *Type:* string
182
+
183
+ Stack id.
184
+
185
+ ---
186
+
187
+ ##### `props`<sup>Required</sup> <a name="props" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.Initializer.parameter.props"></a>
188
+
189
+ - *Type:* <a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps">EC2InstanceRunningScheduleStackProps</a>
190
+
191
+ Stack props (target resource, schedules, secrets).
192
+
193
+ ---
194
+
195
+ #### Methods <a name="Methods" id="Methods"></a>
196
+
197
+ | **Name** | **Description** |
198
+ | --- | --- |
199
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toString">toString</a></code> | Returns a string representation of this construct. |
200
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.with">with</a></code> | Applies one or more mixins to this construct. |
201
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addDependency">addDependency</a></code> | Add a dependency between this stack and another stack. |
202
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addMetadata">addMetadata</a></code> | Adds an arbitrary key-value pair, with information you want to record about the stack. |
203
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addStackTag">addStackTag</a></code> | Configure a stack tag. |
204
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addTransform">addTransform</a></code> | Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template. |
205
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportStringListValue">exportStringListValue</a></code> | Create a CloudFormation Export for a string list value. |
206
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportValue">exportValue</a></code> | Create a CloudFormation Export for a string value. |
207
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.formatArn">formatArn</a></code> | Creates an ARN from components. |
208
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.getLogicalId">getLogicalId</a></code> | Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource. |
209
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.regionalFact">regionalFact</a></code> | Look up a fact value for the given fact for the region of this stack. |
210
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.removeStackTag">removeStackTag</a></code> | Remove a stack tag. |
211
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.renameLogicalId">renameLogicalId</a></code> | Rename a generated logical identities. |
212
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.reportMissingContextKey">reportMissingContextKey</a></code> | Indicate that a context key was expected. |
213
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.resolve">resolve</a></code> | Resolve a tokenized value in the context of the current stack. |
214
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.splitArn">splitArn</a></code> | Splits the provided ARN into its components. |
215
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toJsonString">toJsonString</a></code> | Convert an object, potentially containing tokens, to a JSON string. |
216
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toYamlString">toYamlString</a></code> | Convert an object, potentially containing tokens, to a YAML string. |
217
+
218
+ ---
219
+
220
+ ##### `toString` <a name="toString" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toString"></a>
221
+
222
+ ```typescript
223
+ public toString(): string
224
+ ```
225
+
226
+ Returns a string representation of this construct.
227
+
228
+ ##### `with` <a name="with" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.with"></a>
229
+
230
+ ```typescript
231
+ public with(mixins: ...IMixin[]): IConstruct
232
+ ```
233
+
234
+ Applies one or more mixins to this construct.
235
+
236
+ Mixins are applied in order. The list of constructs is captured at the
237
+ start of the call, so constructs added by a mixin will not be visited.
238
+ Use multiple `with()` calls if subsequent mixins should apply to added
239
+ constructs.
240
+
241
+ ###### `mixins`<sup>Required</sup> <a name="mixins" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.with.parameter.mixins"></a>
242
+
243
+ - *Type:* ...constructs.IMixin[]
244
+
245
+ The mixins to apply.
246
+
247
+ ---
248
+
249
+ ##### `addDependency` <a name="addDependency" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addDependency"></a>
250
+
251
+ ```typescript
252
+ public addDependency(target: Stack, reason?: string): void
253
+ ```
254
+
255
+ Add a dependency between this stack and another stack.
256
+
257
+ This can be used to define dependencies between any two stacks within an
258
+ app, and also supports nested stacks.
259
+
260
+ ###### `target`<sup>Required</sup> <a name="target" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addDependency.parameter.target"></a>
261
+
262
+ - *Type:* aws-cdk-lib.Stack
263
+
264
+ ---
265
+
266
+ ###### `reason`<sup>Optional</sup> <a name="reason" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addDependency.parameter.reason"></a>
267
+
268
+ - *Type:* string
269
+
270
+ ---
271
+
272
+ ##### `addMetadata` <a name="addMetadata" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addMetadata"></a>
273
+
274
+ ```typescript
275
+ public addMetadata(key: string, value: any): void
276
+ ```
277
+
278
+ Adds an arbitrary key-value pair, with information you want to record about the stack.
279
+
280
+ These get translated to the Metadata section of the generated template.
281
+
282
+ > [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html)
283
+
284
+ ###### `key`<sup>Required</sup> <a name="key" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addMetadata.parameter.key"></a>
285
+
286
+ - *Type:* string
287
+
288
+ ---
289
+
290
+ ###### `value`<sup>Required</sup> <a name="value" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addMetadata.parameter.value"></a>
291
+
292
+ - *Type:* any
293
+
294
+ ---
295
+
296
+ ##### `addStackTag` <a name="addStackTag" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addStackTag"></a>
297
+
298
+ ```typescript
299
+ public addStackTag(tagName: string, tagValue: string): void
300
+ ```
301
+
302
+ Configure a stack tag.
303
+
304
+ At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
305
+
306
+ ###### `tagName`<sup>Required</sup> <a name="tagName" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addStackTag.parameter.tagName"></a>
307
+
308
+ - *Type:* string
309
+
310
+ ---
311
+
312
+ ###### `tagValue`<sup>Required</sup> <a name="tagValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addStackTag.parameter.tagValue"></a>
313
+
314
+ - *Type:* string
315
+
316
+ ---
317
+
318
+ ##### `addTransform` <a name="addTransform" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addTransform"></a>
319
+
320
+ ```typescript
321
+ public addTransform(transform: string): void
322
+ ```
323
+
324
+ Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
325
+
326
+ Duplicate values are removed when stack is synthesized.
327
+
328
+ > [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html)
329
+
330
+ *Example*
331
+
332
+ ```typescript
333
+ declare const stack: Stack;
334
+
335
+ stack.addTransform('AWS::Serverless-2016-10-31')
336
+ ```
337
+
338
+
339
+ ###### `transform`<sup>Required</sup> <a name="transform" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.addTransform.parameter.transform"></a>
340
+
341
+ - *Type:* string
342
+
343
+ The transform to add.
344
+
345
+ ---
346
+
347
+ ##### `exportStringListValue` <a name="exportStringListValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportStringListValue"></a>
348
+
349
+ ```typescript
350
+ public exportStringListValue(exportedValue: any, options?: ExportValueOptions): string[]
351
+ ```
352
+
353
+ Create a CloudFormation Export for a string list value.
354
+
355
+ Returns a string list representing the corresponding `Fn.importValue()`
356
+ expression for this Export. The export expression is automatically wrapped with an
357
+ `Fn::Join` and the import value with an `Fn::Split`, since CloudFormation can only
358
+ export strings. You can control the name for the export by passing the `name` option.
359
+
360
+ If you don't supply a value for `name`, the value you're exporting must be
361
+ a Resource attribute (for example: `bucket.bucketName`) and it will be
362
+ given the same name as the automatic cross-stack reference that would be created
363
+ if you used the attribute in another Stack.
364
+
365
+ One of the uses for this method is to *remove* the relationship between
366
+ two Stacks established by automatic cross-stack references. It will
367
+ temporarily ensure that the CloudFormation Export still exists while you
368
+ remove the reference from the consuming stack. After that, you can remove
369
+ the resource and the manual export.
370
+
371
+ See `exportValue` for an example of this process.
372
+
373
+ ###### `exportedValue`<sup>Required</sup> <a name="exportedValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportStringListValue.parameter.exportedValue"></a>
374
+
375
+ - *Type:* any
376
+
377
+ ---
378
+
379
+ ###### `options`<sup>Optional</sup> <a name="options" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportStringListValue.parameter.options"></a>
380
+
381
+ - *Type:* aws-cdk-lib.ExportValueOptions
382
+
383
+ ---
384
+
385
+ ##### `exportValue` <a name="exportValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportValue"></a>
386
+
387
+ ```typescript
388
+ public exportValue(exportedValue: any, options?: ExportValueOptions): string
389
+ ```
390
+
391
+ Create a CloudFormation Export for a string value.
392
+
393
+ Returns a string representing the corresponding `Fn.importValue()`
394
+ expression for this Export. You can control the name for the export by
395
+ passing the `name` option.
396
+
397
+ If you don't supply a value for `name`, the value you're exporting must be
398
+ a Resource attribute (for example: `bucket.bucketName`) and it will be
399
+ given the same name as the automatic cross-stack reference that would be created
400
+ if you used the attribute in another Stack.
401
+
402
+ One of the uses for this method is to *remove* the relationship between
403
+ two Stacks established by automatic cross-stack references. It will
404
+ temporarily ensure that the CloudFormation Export still exists while you
405
+ remove the reference from the consuming stack. After that, you can remove
406
+ the resource and the manual export.
407
+
408
+ Here is how the process works. Let's say there are two stacks,
409
+ `producerStack` and `consumerStack`, and `producerStack` has a bucket
410
+ called `bucket`, which is referenced by `consumerStack` (perhaps because
411
+ an AWS Lambda Function writes into it, or something like that).
412
+
413
+ It is not safe to remove `producerStack.bucket` because as the bucket is being
414
+ deleted, `consumerStack` might still be using it.
415
+
416
+ Instead, the process takes two deployments:
417
+
418
+ **Deployment 1: break the relationship**:
419
+
420
+ - Make sure `consumerStack` no longer references `bucket.bucketName` (maybe the consumer
421
+ stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
422
+ remove the Lambda Function altogether).
423
+ - In the `ProducerStack` class, call `this.exportValue(this.bucket.bucketName)`. This
424
+ will make sure the CloudFormation Export continues to exist while the relationship
425
+ between the two stacks is being broken.
426
+ - Deploy (this will effectively only change the `consumerStack`, but it's safe to deploy both).
427
+
428
+ **Deployment 2: remove the bucket resource**:
429
+
430
+ - You are now free to remove the `bucket` resource from `producerStack`.
431
+ - Don't forget to remove the `exportValue()` call as well.
432
+ - Deploy again (this time only the `producerStack` will be changed -- the bucket will be deleted).
433
+
434
+ ###### `exportedValue`<sup>Required</sup> <a name="exportedValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportValue.parameter.exportedValue"></a>
435
+
436
+ - *Type:* any
437
+
438
+ ---
439
+
440
+ ###### `options`<sup>Optional</sup> <a name="options" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.exportValue.parameter.options"></a>
441
+
442
+ - *Type:* aws-cdk-lib.ExportValueOptions
443
+
444
+ ---
445
+
446
+ ##### `formatArn` <a name="formatArn" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.formatArn"></a>
447
+
448
+ ```typescript
449
+ public formatArn(components: ArnComponents): string
450
+ ```
451
+
452
+ Creates an ARN from components.
453
+
454
+ If `partition`, `region` or `account` are not specified, the stack's
455
+ partition, region and account will be used.
456
+
457
+ If any component is the empty string, an empty string will be inserted
458
+ into the generated ARN at the location that component corresponds to.
459
+
460
+ The ARN will be formatted as follows:
461
+
462
+ arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}
463
+
464
+ The required ARN pieces that are omitted will be taken from the stack that
465
+ the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope
466
+ can be 'undefined'.
467
+
468
+ ###### `components`<sup>Required</sup> <a name="components" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.formatArn.parameter.components"></a>
469
+
470
+ - *Type:* aws-cdk-lib.ArnComponents
471
+
472
+ ---
473
+
474
+ ##### `getLogicalId` <a name="getLogicalId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.getLogicalId"></a>
475
+
476
+ ```typescript
477
+ public getLogicalId(element: CfnElement): string
478
+ ```
479
+
480
+ Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
481
+
482
+ This method is called when a `CfnElement` is created and used to render the
483
+ initial logical identity of resources. Logical ID renames are applied at
484
+ this stage.
485
+
486
+ This method uses the protected method `allocateLogicalId` to render the
487
+ logical ID for an element. To modify the naming scheme, extend the `Stack`
488
+ class and override this method.
489
+
490
+ ###### `element`<sup>Required</sup> <a name="element" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.getLogicalId.parameter.element"></a>
491
+
492
+ - *Type:* aws-cdk-lib.CfnElement
493
+
494
+ The CloudFormation element for which a logical identity is needed.
495
+
496
+ ---
497
+
498
+ ##### `regionalFact` <a name="regionalFact" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.regionalFact"></a>
499
+
500
+ ```typescript
501
+ public regionalFact(factName: string, defaultValue?: string): string
502
+ ```
503
+
504
+ Look up a fact value for the given fact for the region of this stack.
505
+
506
+ Will return a definite value only if the region of the current stack is resolved.
507
+ If not, a lookup map will be added to the stack and the lookup will be done at
508
+ CDK deployment time.
509
+
510
+ What regions will be included in the lookup map is controlled by the
511
+ `@aws-cdk/core:target-partitions` context value: it must be set to a list
512
+ of partitions, and only regions from the given partitions will be included.
513
+ If no such context key is set, all regions will be included.
514
+
515
+ This function is intended to be used by construct library authors. Application
516
+ builders can rely on the abstractions offered by construct libraries and do
517
+ not have to worry about regional facts.
518
+
519
+ If `defaultValue` is not given, it is an error if the fact is unknown for
520
+ the given region.
521
+
522
+ ###### `factName`<sup>Required</sup> <a name="factName" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.regionalFact.parameter.factName"></a>
523
+
524
+ - *Type:* string
525
+
526
+ ---
527
+
528
+ ###### `defaultValue`<sup>Optional</sup> <a name="defaultValue" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.regionalFact.parameter.defaultValue"></a>
529
+
530
+ - *Type:* string
531
+
532
+ ---
533
+
534
+ ##### `removeStackTag` <a name="removeStackTag" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.removeStackTag"></a>
535
+
536
+ ```typescript
537
+ public removeStackTag(tagName: string): void
538
+ ```
539
+
540
+ Remove a stack tag.
541
+
542
+ At deploy time, CloudFormation will automatically apply all stack tags to all resources in the stack.
543
+
544
+ ###### `tagName`<sup>Required</sup> <a name="tagName" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.removeStackTag.parameter.tagName"></a>
545
+
546
+ - *Type:* string
547
+
548
+ ---
549
+
550
+ ##### `renameLogicalId` <a name="renameLogicalId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.renameLogicalId"></a>
551
+
552
+ ```typescript
553
+ public renameLogicalId(oldId: string, newId: string): void
554
+ ```
555
+
556
+ Rename a generated logical identities.
557
+
558
+ To modify the naming scheme strategy, extend the `Stack` class and
559
+ override the `allocateLogicalId` method.
560
+
561
+ ###### `oldId`<sup>Required</sup> <a name="oldId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.renameLogicalId.parameter.oldId"></a>
562
+
563
+ - *Type:* string
564
+
565
+ ---
566
+
567
+ ###### `newId`<sup>Required</sup> <a name="newId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.renameLogicalId.parameter.newId"></a>
568
+
569
+ - *Type:* string
570
+
571
+ ---
572
+
573
+ ##### `reportMissingContextKey` <a name="reportMissingContextKey" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.reportMissingContextKey"></a>
574
+
575
+ ```typescript
576
+ public reportMissingContextKey(report: MissingContext): void
577
+ ```
578
+
579
+ Indicate that a context key was expected.
580
+
581
+ Contains instructions which will be emitted into the cloud assembly on how
582
+ the key should be supplied.
583
+
584
+ ###### `report`<sup>Required</sup> <a name="report" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.reportMissingContextKey.parameter.report"></a>
585
+
586
+ - *Type:* aws-cdk-lib.cloud_assembly_schema.MissingContext
587
+
588
+ The set of parameters needed to obtain the context.
589
+
590
+ ---
591
+
592
+ ##### `resolve` <a name="resolve" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.resolve"></a>
593
+
594
+ ```typescript
595
+ public resolve(obj: any): any
596
+ ```
597
+
598
+ Resolve a tokenized value in the context of the current stack.
599
+
600
+ ###### `obj`<sup>Required</sup> <a name="obj" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.resolve.parameter.obj"></a>
601
+
602
+ - *Type:* any
603
+
604
+ ---
605
+
606
+ ##### `splitArn` <a name="splitArn" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.splitArn"></a>
607
+
608
+ ```typescript
609
+ public splitArn(arn: string, arnFormat: ArnFormat): ArnComponents
610
+ ```
611
+
612
+ Splits the provided ARN into its components.
613
+
614
+ Works both if 'arn' is a string like 'arn:aws:s3:::bucket',
615
+ and a Token representing a dynamic CloudFormation expression
616
+ (in which case the returned components will also be dynamic CloudFormation expressions,
617
+ encoded as Tokens).
618
+
619
+ ###### `arn`<sup>Required</sup> <a name="arn" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.splitArn.parameter.arn"></a>
620
+
621
+ - *Type:* string
622
+
623
+ the ARN to split into its components.
624
+
625
+ ---
626
+
627
+ ###### `arnFormat`<sup>Required</sup> <a name="arnFormat" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.splitArn.parameter.arnFormat"></a>
628
+
629
+ - *Type:* aws-cdk-lib.ArnFormat
630
+
631
+ the expected format of 'arn' - depends on what format the service 'arn' represents uses.
632
+
633
+ ---
634
+
635
+ ##### `toJsonString` <a name="toJsonString" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toJsonString"></a>
636
+
637
+ ```typescript
638
+ public toJsonString(obj: any, space?: number): string
639
+ ```
640
+
641
+ Convert an object, potentially containing tokens, to a JSON string.
642
+
643
+ ###### `obj`<sup>Required</sup> <a name="obj" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toJsonString.parameter.obj"></a>
644
+
645
+ - *Type:* any
646
+
647
+ ---
648
+
649
+ ###### `space`<sup>Optional</sup> <a name="space" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toJsonString.parameter.space"></a>
650
+
651
+ - *Type:* number
652
+
653
+ ---
654
+
655
+ ##### `toYamlString` <a name="toYamlString" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toYamlString"></a>
656
+
657
+ ```typescript
658
+ public toYamlString(obj: any): string
659
+ ```
660
+
661
+ Convert an object, potentially containing tokens, to a YAML string.
662
+
663
+ ###### `obj`<sup>Required</sup> <a name="obj" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.toYamlString.parameter.obj"></a>
664
+
665
+ - *Type:* any
666
+
667
+ ---
668
+
669
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
670
+
671
+ | **Name** | **Description** |
672
+ | --- | --- |
673
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
674
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isStack">isStack</a></code> | Return whether the given object is a Stack. |
675
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.of">of</a></code> | Looks up the first stack scope in which `construct` is defined. |
676
+
677
+ ---
678
+
679
+ ##### `isConstruct` <a name="isConstruct" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isConstruct"></a>
680
+
681
+ ```typescript
682
+ import { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler'
683
+
684
+ EC2InstanceRunningScheduleStack.isConstruct(x: any)
685
+ ```
686
+
687
+ Checks if `x` is a construct.
688
+
689
+ Use this method instead of `instanceof` to properly detect `Construct`
690
+ instances, even when the construct library is symlinked.
691
+
692
+ Explanation: in JavaScript, multiple copies of the `constructs` library on
693
+ disk are seen as independent, completely different libraries. As a
694
+ consequence, the class `Construct` in each copy of the `constructs` library
695
+ is seen as a different class, and an instance of one class will not test as
696
+ `instanceof` the other class. `npm install` will not create installations
697
+ like this, but users may manually symlink construct libraries together or
698
+ use a monorepo tool: in those cases, multiple copies of the `constructs`
699
+ library can be accidentally installed, and `instanceof` will behave
700
+ unpredictably. It is safest to avoid using `instanceof`, and using
701
+ this type-testing method instead.
702
+
703
+ ###### `x`<sup>Required</sup> <a name="x" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isConstruct.parameter.x"></a>
704
+
705
+ - *Type:* any
706
+
707
+ Any object.
708
+
709
+ ---
710
+
711
+ ##### `isStack` <a name="isStack" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isStack"></a>
712
+
713
+ ```typescript
714
+ import { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler'
715
+
716
+ EC2InstanceRunningScheduleStack.isStack(x: any)
717
+ ```
718
+
719
+ Return whether the given object is a Stack.
720
+
721
+ We do attribute detection since we can't reliably use 'instanceof'.
722
+
723
+ ###### `x`<sup>Required</sup> <a name="x" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.isStack.parameter.x"></a>
724
+
725
+ - *Type:* any
726
+
727
+ ---
728
+
729
+ ##### `of` <a name="of" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.of"></a>
730
+
731
+ ```typescript
732
+ import { EC2InstanceRunningScheduleStack } from 'ec2-instance-running-scheduler'
733
+
734
+ EC2InstanceRunningScheduleStack.of(construct: IConstruct)
735
+ ```
736
+
737
+ Looks up the first stack scope in which `construct` is defined.
738
+
739
+ Fails if there is no stack up the tree.
740
+
741
+ ###### `construct`<sup>Required</sup> <a name="construct" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.of.parameter.construct"></a>
742
+
743
+ - *Type:* constructs.IConstruct
744
+
745
+ The construct to start the search from.
746
+
747
+ ---
748
+
749
+ #### Properties <a name="Properties" id="Properties"></a>
750
+
751
+ | **Name** | **Type** | **Description** |
752
+ | --- | --- | --- |
753
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
754
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.account">account</a></code> | <code>string</code> | The AWS account into which this stack will be deployed. |
755
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.artifactId">artifactId</a></code> | <code>string</code> | The ID of the cloud assembly artifact for this stack. |
756
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.availabilityZones">availabilityZones</a></code> | <code>string[]</code> | Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack. |
757
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.bundlingRequired">bundlingRequired</a></code> | <code>boolean</code> | Indicates whether the stack requires bundling or not. |
758
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.dependencies">dependencies</a></code> | <code>aws-cdk-lib.Stack[]</code> | Return the stacks this stack depends on. |
759
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.environment">environment</a></code> | <code>string</code> | The environment coordinates in which this stack is deployed. |
760
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nested">nested</a></code> | <code>boolean</code> | Indicates if this is a nested stack, in which case `parentStack` will include a reference to it's parent. |
761
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.notificationArns">notificationArns</a></code> | <code>string[]</code> | Returns the list of notification Amazon Resource Names (ARNs) for the current stack. |
762
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.partition">partition</a></code> | <code>string</code> | The partition in which this stack is defined. |
763
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.region">region</a></code> | <code>string</code> | The AWS region into which this stack will be deployed (e.g. `us-west-2`). |
764
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.stackId">stackId</a></code> | <code>string</code> | The ID of the stack. |
765
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.stackName">stackName</a></code> | <code>string</code> | The concrete CloudFormation physical stack name. |
766
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.synthesizer">synthesizer</a></code> | <code>aws-cdk-lib.IStackSynthesizer</code> | Synthesis method for this stack. |
767
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.tags">tags</a></code> | <code>aws-cdk-lib.TagManager</code> | Tags to be applied to the stack. |
768
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.templateFile">templateFile</a></code> | <code>string</code> | The name of the CloudFormation template file emitted to the output directory during synthesis. |
769
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.templateOptions">templateOptions</a></code> | <code>aws-cdk-lib.ITemplateOptions</code> | Options for CloudFormation template (like version, transform, description). |
770
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.urlSuffix">urlSuffix</a></code> | <code>string</code> | The Amazon domain suffix for the region in which this stack is defined. |
771
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nestedStackParent">nestedStackParent</a></code> | <code>aws-cdk-lib.Stack</code> | If this is a nested stack, returns it's parent stack. |
772
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nestedStackResource">nestedStackResource</a></code> | <code>aws-cdk-lib.CfnResource</code> | If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource. |
773
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.terminationProtection">terminationProtection</a></code> | <code>boolean</code> | Whether termination protection is enabled for this stack. |
774
+
775
+ ---
776
+
777
+ ##### `node`<sup>Required</sup> <a name="node" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.node"></a>
778
+
779
+ ```typescript
780
+ public readonly node: Node;
781
+ ```
782
+
783
+ - *Type:* constructs.Node
784
+
785
+ The tree node.
786
+
787
+ ---
788
+
789
+ ##### `account`<sup>Required</sup> <a name="account" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.account"></a>
790
+
791
+ ```typescript
792
+ public readonly account: string;
793
+ ```
794
+
795
+ - *Type:* string
796
+
797
+ The AWS account into which this stack will be deployed.
798
+
799
+ This value is resolved according to the following rules:
800
+
801
+ 1. The value provided to `env.account` when the stack is defined. This can
802
+ either be a concrete account (e.g. `585695031111`) or the
803
+ `Aws.ACCOUNT_ID` token.
804
+ 3. `Aws.ACCOUNT_ID`, which represents the CloudFormation intrinsic reference
805
+ `{ "Ref": "AWS::AccountId" }` encoded as a string token.
806
+
807
+ Preferably, you should use the return value as an opaque string and not
808
+ attempt to parse it to implement your logic. If you do, you must first
809
+ check that it is a concrete value an not an unresolved token. If this
810
+ value is an unresolved token (`Token.isUnresolved(stack.account)` returns
811
+ `true`), this implies that the user wishes that this stack will synthesize
812
+ into an **account-agnostic template**. In this case, your code should either
813
+ fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
814
+ implement some other account-agnostic behavior.
815
+
816
+ ---
817
+
818
+ ##### `artifactId`<sup>Required</sup> <a name="artifactId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.artifactId"></a>
819
+
820
+ ```typescript
821
+ public readonly artifactId: string;
822
+ ```
823
+
824
+ - *Type:* string
825
+
826
+ The ID of the cloud assembly artifact for this stack.
827
+
828
+ ---
829
+
830
+ ##### `availabilityZones`<sup>Required</sup> <a name="availabilityZones" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.availabilityZones"></a>
831
+
832
+ ```typescript
833
+ public readonly availabilityZones: string[];
834
+ ```
835
+
836
+ - *Type:* string[]
837
+
838
+ Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
839
+
840
+ If the stack is environment-agnostic (either account and/or region are
841
+ tokens), this property will return an array with 2 tokens that will resolve
842
+ at deploy-time to the first two availability zones returned from CloudFormation's
843
+ `Fn::GetAZs` intrinsic function.
844
+
845
+ If they are not available in the context, returns a set of dummy values and
846
+ reports them as missing, and let the CLI resolve them by calling EC2
847
+ `DescribeAvailabilityZones` on the target environment.
848
+
849
+ To specify a different strategy for selecting availability zones override this method.
850
+
851
+ ---
852
+
853
+ ##### `bundlingRequired`<sup>Required</sup> <a name="bundlingRequired" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.bundlingRequired"></a>
854
+
855
+ ```typescript
856
+ public readonly bundlingRequired: boolean;
857
+ ```
858
+
859
+ - *Type:* boolean
860
+
861
+ Indicates whether the stack requires bundling or not.
862
+
863
+ ---
864
+
865
+ ##### `dependencies`<sup>Required</sup> <a name="dependencies" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.dependencies"></a>
866
+
867
+ ```typescript
868
+ public readonly dependencies: Stack[];
869
+ ```
870
+
871
+ - *Type:* aws-cdk-lib.Stack[]
872
+
873
+ Return the stacks this stack depends on.
874
+
875
+ ---
876
+
877
+ ##### `environment`<sup>Required</sup> <a name="environment" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.environment"></a>
878
+
879
+ ```typescript
880
+ public readonly environment: string;
881
+ ```
882
+
883
+ - *Type:* string
884
+
885
+ The environment coordinates in which this stack is deployed.
886
+
887
+ In the form
888
+ `aws://account/region`. Use `stack.account` and `stack.region` to obtain
889
+ the specific values, no need to parse.
890
+
891
+ You can use this value to determine if two stacks are targeting the same
892
+ environment.
893
+
894
+ If either `stack.account` or `stack.region` are not concrete values (e.g.
895
+ `Aws.ACCOUNT_ID` or `Aws.REGION`) the special strings `unknown-account` and/or
896
+ `unknown-region` will be used respectively to indicate this stack is
897
+ region/account-agnostic.
898
+
899
+ ---
900
+
901
+ ##### `nested`<sup>Required</sup> <a name="nested" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nested"></a>
902
+
903
+ ```typescript
904
+ public readonly nested: boolean;
905
+ ```
906
+
907
+ - *Type:* boolean
908
+
909
+ Indicates if this is a nested stack, in which case `parentStack` will include a reference to it's parent.
910
+
911
+ ---
912
+
913
+ ##### `notificationArns`<sup>Required</sup> <a name="notificationArns" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.notificationArns"></a>
914
+
915
+ ```typescript
916
+ public readonly notificationArns: string[];
917
+ ```
918
+
919
+ - *Type:* string[]
920
+
921
+ Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
922
+
923
+ ---
924
+
925
+ ##### `partition`<sup>Required</sup> <a name="partition" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.partition"></a>
926
+
927
+ ```typescript
928
+ public readonly partition: string;
929
+ ```
930
+
931
+ - *Type:* string
932
+
933
+ The partition in which this stack is defined.
934
+
935
+ ---
936
+
937
+ ##### `region`<sup>Required</sup> <a name="region" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.region"></a>
938
+
939
+ ```typescript
940
+ public readonly region: string;
941
+ ```
942
+
943
+ - *Type:* string
944
+
945
+ The AWS region into which this stack will be deployed (e.g. `us-west-2`).
946
+
947
+ This value is resolved according to the following rules:
948
+
949
+ 1. The value provided to `env.region` when the stack is defined. This can
950
+ either be a concrete region (e.g. `us-west-2`) or the `Aws.REGION`
951
+ token.
952
+ 3. `Aws.REGION`, which is represents the CloudFormation intrinsic reference
953
+ `{ "Ref": "AWS::Region" }` encoded as a string token.
954
+
955
+ Preferably, you should use the return value as an opaque string and not
956
+ attempt to parse it to implement your logic. If you do, you must first
957
+ check that it is a concrete value an not an unresolved token. If this
958
+ value is an unresolved token (`Token.isUnresolved(stack.region)` returns
959
+ `true`), this implies that the user wishes that this stack will synthesize
960
+ into a **region-agnostic template**. In this case, your code should either
961
+ fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
962
+ implement some other region-agnostic behavior.
963
+
964
+ ---
965
+
966
+ ##### `stackId`<sup>Required</sup> <a name="stackId" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.stackId"></a>
967
+
968
+ ```typescript
969
+ public readonly stackId: string;
970
+ ```
971
+
972
+ - *Type:* string
973
+
974
+ The ID of the stack.
975
+
976
+ ---
977
+
978
+ *Example*
979
+
980
+ ```typescript
981
+ // After resolving, looks like
982
+ 'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
983
+ ```
984
+
985
+
986
+ ##### `stackName`<sup>Required</sup> <a name="stackName" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.stackName"></a>
987
+
988
+ ```typescript
989
+ public readonly stackName: string;
990
+ ```
991
+
992
+ - *Type:* string
993
+
994
+ The concrete CloudFormation physical stack name.
995
+
996
+ This is either the name defined explicitly in the `stackName` prop or
997
+ allocated based on the stack's location in the construct tree. Stacks that
998
+ are directly defined under the app use their construct `id` as their stack
999
+ name. Stacks that are defined deeper within the tree will use a hashed naming
1000
+ scheme based on the construct path to ensure uniqueness.
1001
+
1002
+ If you wish to obtain the deploy-time AWS::StackName intrinsic,
1003
+ you can use `Aws.STACK_NAME` directly.
1004
+
1005
+ ---
1006
+
1007
+ ##### `synthesizer`<sup>Required</sup> <a name="synthesizer" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.synthesizer"></a>
1008
+
1009
+ ```typescript
1010
+ public readonly synthesizer: IStackSynthesizer;
1011
+ ```
1012
+
1013
+ - *Type:* aws-cdk-lib.IStackSynthesizer
1014
+
1015
+ Synthesis method for this stack.
1016
+
1017
+ ---
1018
+
1019
+ ##### `tags`<sup>Required</sup> <a name="tags" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.tags"></a>
1020
+
1021
+ ```typescript
1022
+ public readonly tags: TagManager;
1023
+ ```
1024
+
1025
+ - *Type:* aws-cdk-lib.TagManager
1026
+
1027
+ Tags to be applied to the stack.
1028
+
1029
+ ---
1030
+
1031
+ ##### `templateFile`<sup>Required</sup> <a name="templateFile" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.templateFile"></a>
1032
+
1033
+ ```typescript
1034
+ public readonly templateFile: string;
1035
+ ```
1036
+
1037
+ - *Type:* string
1038
+
1039
+ The name of the CloudFormation template file emitted to the output directory during synthesis.
1040
+
1041
+ Example value: `MyStack.template.json`
1042
+
1043
+ ---
1044
+
1045
+ ##### `templateOptions`<sup>Required</sup> <a name="templateOptions" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.templateOptions"></a>
1046
+
1047
+ ```typescript
1048
+ public readonly templateOptions: ITemplateOptions;
1049
+ ```
1050
+
1051
+ - *Type:* aws-cdk-lib.ITemplateOptions
1052
+
1053
+ Options for CloudFormation template (like version, transform, description).
1054
+
1055
+ ---
1056
+
1057
+ ##### `urlSuffix`<sup>Required</sup> <a name="urlSuffix" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.urlSuffix"></a>
1058
+
1059
+ ```typescript
1060
+ public readonly urlSuffix: string;
1061
+ ```
1062
+
1063
+ - *Type:* string
1064
+
1065
+ The Amazon domain suffix for the region in which this stack is defined.
1066
+
1067
+ ---
1068
+
1069
+ ##### `nestedStackParent`<sup>Optional</sup> <a name="nestedStackParent" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nestedStackParent"></a>
1070
+
1071
+ ```typescript
1072
+ public readonly nestedStackParent: Stack;
1073
+ ```
1074
+
1075
+ - *Type:* aws-cdk-lib.Stack
1076
+
1077
+ If this is a nested stack, returns it's parent stack.
1078
+
1079
+ ---
1080
+
1081
+ ##### `nestedStackResource`<sup>Optional</sup> <a name="nestedStackResource" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.nestedStackResource"></a>
1082
+
1083
+ ```typescript
1084
+ public readonly nestedStackResource: CfnResource;
1085
+ ```
1086
+
1087
+ - *Type:* aws-cdk-lib.CfnResource
1088
+
1089
+ If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource.
1090
+
1091
+ `undefined` for top-level (non-nested) stacks.
1092
+
1093
+ ---
1094
+
1095
+ ##### `terminationProtection`<sup>Required</sup> <a name="terminationProtection" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStack.property.terminationProtection"></a>
1096
+
1097
+ ```typescript
1098
+ public readonly terminationProtection: boolean;
1099
+ ```
1100
+
1101
+ - *Type:* boolean
1102
+
1103
+ Whether termination protection is enabled for this stack.
1104
+
1105
+ ---
1106
+
1107
+
1108
+ ## Structs <a name="Structs" id="Structs"></a>
1109
+
1110
+ ### EC2InstanceRunningSchedulerProps <a name="EC2InstanceRunningSchedulerProps" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps"></a>
1111
+
1112
+ Properties for creating an EC2 instance running scheduler.
1113
+
1114
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.Initializer"></a>
1115
+
1116
+ ```typescript
1117
+ import { EC2InstanceRunningSchedulerProps } from 'ec2-instance-running-scheduler'
1118
+
1119
+ const eC2InstanceRunningSchedulerProps: EC2InstanceRunningSchedulerProps = { ... }
1120
+ ```
1121
+
1122
+ #### Properties <a name="Properties" id="Properties"></a>
1123
+
1124
+ | **Name** | **Type** | **Description** |
1125
+ | --- | --- | --- |
1126
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.secrets">secrets</a></code> | <code><a href="#ec2-instance-running-scheduler.Secrets">Secrets</a></code> | Secrets (e.g. Slack) used for notifications. |
1127
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.targetResource">targetResource</a></code> | <code><a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a></code> | Tag-based targeting for EC2 instances to start/stop. |
1128
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.enableScheduling">enableScheduling</a></code> | <code>boolean</code> | Whether EventBridge Scheduler rules are enabled. |
1129
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.startSchedule">startSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for starting instances. |
1130
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.stopSchedule">stopSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for stopping instances. |
1131
+
1132
+ ---
1133
+
1134
+ ##### `secrets`<sup>Required</sup> <a name="secrets" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.secrets"></a>
1135
+
1136
+ ```typescript
1137
+ public readonly secrets: Secrets;
1138
+ ```
1139
+
1140
+ - *Type:* <a href="#ec2-instance-running-scheduler.Secrets">Secrets</a>
1141
+
1142
+ Secrets (e.g. Slack) used for notifications.
1143
+
1144
+ ---
1145
+
1146
+ ##### `targetResource`<sup>Required</sup> <a name="targetResource" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.targetResource"></a>
1147
+
1148
+ ```typescript
1149
+ public readonly targetResource: TargetResource;
1150
+ ```
1151
+
1152
+ - *Type:* <a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a>
1153
+
1154
+ Tag-based targeting for EC2 instances to start/stop.
1155
+
1156
+ ---
1157
+
1158
+ ##### `enableScheduling`<sup>Optional</sup> <a name="enableScheduling" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.enableScheduling"></a>
1159
+
1160
+ ```typescript
1161
+ public readonly enableScheduling: boolean;
1162
+ ```
1163
+
1164
+ - *Type:* boolean
1165
+
1166
+ Whether EventBridge Scheduler rules are enabled.
1167
+
1168
+ Defaults to true if omitted.
1169
+
1170
+ ---
1171
+
1172
+ ##### `startSchedule`<sup>Optional</sup> <a name="startSchedule" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.startSchedule"></a>
1173
+
1174
+ ```typescript
1175
+ public readonly startSchedule: Schedule;
1176
+ ```
1177
+
1178
+ - *Type:* <a href="#ec2-instance-running-scheduler.Schedule">Schedule</a>
1179
+
1180
+ Cron schedule for starting instances.
1181
+
1182
+ ---
1183
+
1184
+ ##### `stopSchedule`<sup>Optional</sup> <a name="stopSchedule" id="ec2-instance-running-scheduler.EC2InstanceRunningSchedulerProps.property.stopSchedule"></a>
1185
+
1186
+ ```typescript
1187
+ public readonly stopSchedule: Schedule;
1188
+ ```
1189
+
1190
+ - *Type:* <a href="#ec2-instance-running-scheduler.Schedule">Schedule</a>
1191
+
1192
+ Cron schedule for stopping instances.
1193
+
1194
+ ---
1195
+
1196
+ ### EC2InstanceRunningScheduleStackProps <a name="EC2InstanceRunningScheduleStackProps" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps"></a>
1197
+
1198
+ Props for the EC2 instance running schedule CDK stack.
1199
+
1200
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.Initializer"></a>
1201
+
1202
+ ```typescript
1203
+ import { EC2InstanceRunningScheduleStackProps } from 'ec2-instance-running-scheduler'
1204
+
1205
+ const eC2InstanceRunningScheduleStackProps: EC2InstanceRunningScheduleStackProps = { ... }
1206
+ ```
1207
+
1208
+ #### Properties <a name="Properties" id="Properties"></a>
1209
+
1210
+ | **Name** | **Type** | **Description** |
1211
+ | --- | --- | --- |
1212
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.analyticsReporting">analyticsReporting</a></code> | <code>boolean</code> | Include runtime versioning information in this Stack. |
1213
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.crossRegionReferences">crossRegionReferences</a></code> | <code>boolean</code> | Enable this flag to allow native cross region stack references. |
1214
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.description">description</a></code> | <code>string</code> | A description of the stack. |
1215
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.env">env</a></code> | <code>aws-cdk-lib.Environment</code> | The AWS environment (account/region) where this stack will be deployed. |
1216
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.notificationArns">notificationArns</a></code> | <code>string[]</code> | SNS Topic ARNs that will receive stack events. |
1217
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.permissionsBoundary">permissionsBoundary</a></code> | <code>aws-cdk-lib.PermissionsBoundary</code> | Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. |
1218
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.propertyInjectors">propertyInjectors</a></code> | <code>aws-cdk-lib.IPropertyInjector[]</code> | A list of IPropertyInjector attached to this Stack. |
1219
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.stackName">stackName</a></code> | <code>string</code> | Name to deploy the stack with. |
1220
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.suppressTemplateIndentation">suppressTemplateIndentation</a></code> | <code>boolean</code> | Enable this flag to suppress indentation in generated CloudFormation templates. |
1221
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.synthesizer">synthesizer</a></code> | <code>aws-cdk-lib.IStackSynthesizer</code> | Synthesis method to use while deploying this stack. |
1222
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.tags">tags</a></code> | <code>{[ key: string ]: string}</code> | Tags that will be applied to the Stack. |
1223
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.terminationProtection">terminationProtection</a></code> | <code>boolean</code> | Whether to enable termination protection for this stack. |
1224
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.secrets">secrets</a></code> | <code><a href="#ec2-instance-running-scheduler.Secrets">Secrets</a></code> | Secrets (e.g. Slack) for the scheduler. |
1225
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.targetResource">targetResource</a></code> | <code><a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a></code> | Tag-based target resource for EC2 instances to start/stop. |
1226
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.enableScheduling">enableScheduling</a></code> | <code>boolean</code> | Whether scheduling is enabled. |
1227
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.startSchedule">startSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for starting instances. |
1228
+ | <code><a href="#ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.stopSchedule">stopSchedule</a></code> | <code><a href="#ec2-instance-running-scheduler.Schedule">Schedule</a></code> | Cron schedule for stopping instances. |
1229
+
1230
+ ---
1231
+
1232
+ ##### `analyticsReporting`<sup>Optional</sup> <a name="analyticsReporting" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.analyticsReporting"></a>
1233
+
1234
+ ```typescript
1235
+ public readonly analyticsReporting: boolean;
1236
+ ```
1237
+
1238
+ - *Type:* boolean
1239
+ - *Default:* `analyticsReporting` setting of containing `App`, or value of 'aws:cdk:version-reporting' context key
1240
+
1241
+ Include runtime versioning information in this Stack.
1242
+
1243
+ ---
1244
+
1245
+ ##### `crossRegionReferences`<sup>Optional</sup> <a name="crossRegionReferences" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.crossRegionReferences"></a>
1246
+
1247
+ ```typescript
1248
+ public readonly crossRegionReferences: boolean;
1249
+ ```
1250
+
1251
+ - *Type:* boolean
1252
+ - *Default:* false
1253
+
1254
+ Enable this flag to allow native cross region stack references.
1255
+
1256
+ Enabling this will create a CloudFormation custom resource
1257
+ in both the producing stack and consuming stack in order to perform the export/import
1258
+
1259
+ This feature is currently experimental
1260
+
1261
+ ---
1262
+
1263
+ ##### `description`<sup>Optional</sup> <a name="description" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.description"></a>
1264
+
1265
+ ```typescript
1266
+ public readonly description: string;
1267
+ ```
1268
+
1269
+ - *Type:* string
1270
+ - *Default:* No description.
1271
+
1272
+ A description of the stack.
1273
+
1274
+ ---
1275
+
1276
+ ##### `env`<sup>Optional</sup> <a name="env" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.env"></a>
1277
+
1278
+ ```typescript
1279
+ public readonly env: Environment;
1280
+ ```
1281
+
1282
+ - *Type:* aws-cdk-lib.Environment
1283
+ - *Default:* The environment of the containing `Stage` if available, otherwise create the stack will be environment-agnostic.
1284
+
1285
+ The AWS environment (account/region) where this stack will be deployed.
1286
+
1287
+ Set the `region`/`account` fields of `env` to either a concrete value to
1288
+ select the indicated environment (recommended for production stacks), or to
1289
+ the values of environment variables
1290
+ `CDK_DEFAULT_REGION`/`CDK_DEFAULT_ACCOUNT` to let the target environment
1291
+ depend on the AWS credentials/configuration that the CDK CLI is executed
1292
+ under (recommended for development stacks).
1293
+
1294
+ If the `Stack` is instantiated inside a `Stage`, any undefined
1295
+ `region`/`account` fields from `env` will default to the same field on the
1296
+ encompassing `Stage`, if configured there.
1297
+
1298
+ If either `region` or `account` are not set nor inherited from `Stage`, the
1299
+ Stack will be considered "*environment-agnostic*"". Environment-agnostic
1300
+ stacks can be deployed to any environment but may not be able to take
1301
+ advantage of all features of the CDK. For example, they will not be able to
1302
+ use environmental context lookups such as `ec2.Vpc.fromLookup` and will not
1303
+ automatically translate Service Principals to the right format based on the
1304
+ environment's AWS partition, and other such enhancements.
1305
+
1306
+ ---
1307
+
1308
+ *Example*
1309
+
1310
+ ```typescript
1311
+ // Use a concrete account and region to deploy this stack to:
1312
+ // `.account` and `.region` will simply return these values.
1313
+ new Stack(app, 'Stack1', {
1314
+ env: {
1315
+ account: '123456789012',
1316
+ region: 'us-east-1'
1317
+ },
1318
+ });
1319
+
1320
+ // Use the CLI's current credentials to determine the target environment:
1321
+ // `.account` and `.region` will reflect the account+region the CLI
1322
+ // is configured to use (based on the user CLI credentials)
1323
+ new Stack(app, 'Stack2', {
1324
+ env: {
1325
+ account: process.env.CDK_DEFAULT_ACCOUNT,
1326
+ region: process.env.CDK_DEFAULT_REGION
1327
+ },
1328
+ });
1329
+
1330
+ // Define multiple stacks stage associated with an environment
1331
+ const myStage = new Stage(app, 'MyStage', {
1332
+ env: {
1333
+ account: '123456789012',
1334
+ region: 'us-east-1'
1335
+ }
1336
+ });
1337
+
1338
+ // both of these stacks will use the stage's account/region:
1339
+ // `.account` and `.region` will resolve to the concrete values as above
1340
+ new MyStack(myStage, 'Stack1');
1341
+ new YourStack(myStage, 'Stack2');
1342
+
1343
+ // Define an environment-agnostic stack:
1344
+ // `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
1345
+ // which will only resolve to actual values by CloudFormation during deployment.
1346
+ new MyStack(app, 'Stack1');
1347
+ ```
1348
+
1349
+
1350
+ ##### `notificationArns`<sup>Optional</sup> <a name="notificationArns" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.notificationArns"></a>
1351
+
1352
+ ```typescript
1353
+ public readonly notificationArns: string[];
1354
+ ```
1355
+
1356
+ - *Type:* string[]
1357
+ - *Default:* no notification arns.
1358
+
1359
+ SNS Topic ARNs that will receive stack events.
1360
+
1361
+ ---
1362
+
1363
+ ##### `permissionsBoundary`<sup>Optional</sup> <a name="permissionsBoundary" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.permissionsBoundary"></a>
1364
+
1365
+ ```typescript
1366
+ public readonly permissionsBoundary: PermissionsBoundary;
1367
+ ```
1368
+
1369
+ - *Type:* aws-cdk-lib.PermissionsBoundary
1370
+ - *Default:* no permissions boundary is applied
1371
+
1372
+ Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.
1373
+
1374
+ ---
1375
+
1376
+ ##### `propertyInjectors`<sup>Optional</sup> <a name="propertyInjectors" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.propertyInjectors"></a>
1377
+
1378
+ ```typescript
1379
+ public readonly propertyInjectors: IPropertyInjector[];
1380
+ ```
1381
+
1382
+ - *Type:* aws-cdk-lib.IPropertyInjector[]
1383
+ - *Default:* no PropertyInjectors
1384
+
1385
+ A list of IPropertyInjector attached to this Stack.
1386
+
1387
+ ---
1388
+
1389
+ ##### `stackName`<sup>Optional</sup> <a name="stackName" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.stackName"></a>
1390
+
1391
+ ```typescript
1392
+ public readonly stackName: string;
1393
+ ```
1394
+
1395
+ - *Type:* string
1396
+ - *Default:* Derived from construct path.
1397
+
1398
+ Name to deploy the stack with.
1399
+
1400
+ ---
1401
+
1402
+ ##### `suppressTemplateIndentation`<sup>Optional</sup> <a name="suppressTemplateIndentation" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.suppressTemplateIndentation"></a>
1403
+
1404
+ ```typescript
1405
+ public readonly suppressTemplateIndentation: boolean;
1406
+ ```
1407
+
1408
+ - *Type:* boolean
1409
+ - *Default:* the value of `@aws-cdk/core:suppressTemplateIndentation`, or `false` if that is not set.
1410
+
1411
+ Enable this flag to suppress indentation in generated CloudFormation templates.
1412
+
1413
+ If not specified, the value of the `@aws-cdk/core:suppressTemplateIndentation`
1414
+ context key will be used. If that is not specified, then the
1415
+ default value `false` will be used.
1416
+
1417
+ ---
1418
+
1419
+ ##### `synthesizer`<sup>Optional</sup> <a name="synthesizer" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.synthesizer"></a>
1420
+
1421
+ ```typescript
1422
+ public readonly synthesizer: IStackSynthesizer;
1423
+ ```
1424
+
1425
+ - *Type:* aws-cdk-lib.IStackSynthesizer
1426
+ - *Default:* The synthesizer specified on `App`, or `DefaultStackSynthesizer` otherwise.
1427
+
1428
+ Synthesis method to use while deploying this stack.
1429
+
1430
+ The Stack Synthesizer controls aspects of synthesis and deployment,
1431
+ like how assets are referenced and what IAM roles to use. For more
1432
+ information, see the README of the main CDK package.
1433
+
1434
+ If not specified, the `defaultStackSynthesizer` from `App` will be used.
1435
+ If that is not specified, `DefaultStackSynthesizer` is used if
1436
+ `@aws-cdk/core:newStyleStackSynthesis` is set to `true` or the CDK major
1437
+ version is v2. In CDK v1 `LegacyStackSynthesizer` is the default if no
1438
+ other synthesizer is specified.
1439
+
1440
+ ---
1441
+
1442
+ ##### `tags`<sup>Optional</sup> <a name="tags" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.tags"></a>
1443
+
1444
+ ```typescript
1445
+ public readonly tags: {[ key: string ]: string};
1446
+ ```
1447
+
1448
+ - *Type:* {[ key: string ]: string}
1449
+ - *Default:* {}
1450
+
1451
+ Tags that will be applied to the Stack.
1452
+
1453
+ These tags are applied to the CloudFormation Stack itself. They will not
1454
+ appear in the CloudFormation template.
1455
+
1456
+ However, at deployment time, CloudFormation will apply these tags to all
1457
+ resources in the stack that support tagging. You will not be able to exempt
1458
+ resources from tagging (using the `excludeResourceTypes` property of
1459
+ `Tags.of(...).add()`) for tags applied in this way.
1460
+
1461
+ ---
1462
+
1463
+ ##### `terminationProtection`<sup>Optional</sup> <a name="terminationProtection" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.terminationProtection"></a>
1464
+
1465
+ ```typescript
1466
+ public readonly terminationProtection: boolean;
1467
+ ```
1468
+
1469
+ - *Type:* boolean
1470
+ - *Default:* false
1471
+
1472
+ Whether to enable termination protection for this stack.
1473
+
1474
+ ---
1475
+
1476
+ ##### `secrets`<sup>Required</sup> <a name="secrets" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.secrets"></a>
1477
+
1478
+ ```typescript
1479
+ public readonly secrets: Secrets;
1480
+ ```
1481
+
1482
+ - *Type:* <a href="#ec2-instance-running-scheduler.Secrets">Secrets</a>
1483
+
1484
+ Secrets (e.g. Slack) for the scheduler.
1485
+
1486
+ ---
1487
+
1488
+ ##### `targetResource`<sup>Required</sup> <a name="targetResource" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.targetResource"></a>
1489
+
1490
+ ```typescript
1491
+ public readonly targetResource: TargetResource;
1492
+ ```
1493
+
1494
+ - *Type:* <a href="#ec2-instance-running-scheduler.TargetResource">TargetResource</a>
1495
+
1496
+ Tag-based target resource for EC2 instances to start/stop.
1497
+
1498
+ ---
1499
+
1500
+ ##### `enableScheduling`<sup>Optional</sup> <a name="enableScheduling" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.enableScheduling"></a>
1501
+
1502
+ ```typescript
1503
+ public readonly enableScheduling: boolean;
1504
+ ```
1505
+
1506
+ - *Type:* boolean
1507
+
1508
+ Whether scheduling is enabled.
1509
+
1510
+ Defaults to true if omitted.
1511
+
1512
+ ---
1513
+
1514
+ ##### `startSchedule`<sup>Optional</sup> <a name="startSchedule" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.startSchedule"></a>
1515
+
1516
+ ```typescript
1517
+ public readonly startSchedule: Schedule;
1518
+ ```
1519
+
1520
+ - *Type:* <a href="#ec2-instance-running-scheduler.Schedule">Schedule</a>
1521
+
1522
+ Cron schedule for starting instances.
1523
+
1524
+ ---
1525
+
1526
+ ##### `stopSchedule`<sup>Optional</sup> <a name="stopSchedule" id="ec2-instance-running-scheduler.EC2InstanceRunningScheduleStackProps.property.stopSchedule"></a>
1527
+
1528
+ ```typescript
1529
+ public readonly stopSchedule: Schedule;
1530
+ ```
1531
+
1532
+ - *Type:* <a href="#ec2-instance-running-scheduler.Schedule">Schedule</a>
1533
+
1534
+ Cron schedule for stopping instances.
1535
+
1536
+ ---
1537
+
1538
+ ### Schedule <a name="Schedule" id="ec2-instance-running-scheduler.Schedule"></a>
1539
+
1540
+ Cron-style schedule configuration for start/stop actions.
1541
+
1542
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.Schedule.Initializer"></a>
1543
+
1544
+ ```typescript
1545
+ import { Schedule } from 'ec2-instance-running-scheduler'
1546
+
1547
+ const schedule: Schedule = { ... }
1548
+ ```
1549
+
1550
+ #### Properties <a name="Properties" id="Properties"></a>
1551
+
1552
+ | **Name** | **Type** | **Description** |
1553
+ | --- | --- | --- |
1554
+ | <code><a href="#ec2-instance-running-scheduler.Schedule.property.timezone">timezone</a></code> | <code>aws-cdk-lib.TimeZone</code> | Time zone for the schedule (e.g. ETC_UTC). |
1555
+ | <code><a href="#ec2-instance-running-scheduler.Schedule.property.hour">hour</a></code> | <code>string</code> | Cron hour (0–23). |
1556
+ | <code><a href="#ec2-instance-running-scheduler.Schedule.property.minute">minute</a></code> | <code>string</code> | Cron minute (0–59). |
1557
+ | <code><a href="#ec2-instance-running-scheduler.Schedule.property.week">week</a></code> | <code>string</code> | Cron day of week (e.g. MON-FRI). |
1558
+
1559
+ ---
1560
+
1561
+ ##### `timezone`<sup>Required</sup> <a name="timezone" id="ec2-instance-running-scheduler.Schedule.property.timezone"></a>
1562
+
1563
+ ```typescript
1564
+ public readonly timezone: TimeZone;
1565
+ ```
1566
+
1567
+ - *Type:* aws-cdk-lib.TimeZone
1568
+
1569
+ Time zone for the schedule (e.g. ETC_UTC).
1570
+
1571
+ ---
1572
+
1573
+ ##### `hour`<sup>Optional</sup> <a name="hour" id="ec2-instance-running-scheduler.Schedule.property.hour"></a>
1574
+
1575
+ ```typescript
1576
+ public readonly hour: string;
1577
+ ```
1578
+
1579
+ - *Type:* string
1580
+
1581
+ Cron hour (0–23).
1582
+
1583
+ ---
1584
+
1585
+ ##### `minute`<sup>Optional</sup> <a name="minute" id="ec2-instance-running-scheduler.Schedule.property.minute"></a>
1586
+
1587
+ ```typescript
1588
+ public readonly minute: string;
1589
+ ```
1590
+
1591
+ - *Type:* string
1592
+
1593
+ Cron minute (0–59).
1594
+
1595
+ ---
1596
+
1597
+ ##### `week`<sup>Optional</sup> <a name="week" id="ec2-instance-running-scheduler.Schedule.property.week"></a>
1598
+
1599
+ ```typescript
1600
+ public readonly week: string;
1601
+ ```
1602
+
1603
+ - *Type:* string
1604
+
1605
+ Cron day of week (e.g. MON-FRI).
1606
+
1607
+ ---
1608
+
1609
+ ### Secrets <a name="Secrets" id="ec2-instance-running-scheduler.Secrets"></a>
1610
+
1611
+ Secret identifiers required by the scheduler (e.g. Slack).
1612
+
1613
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.Secrets.Initializer"></a>
1614
+
1615
+ ```typescript
1616
+ import { Secrets } from 'ec2-instance-running-scheduler'
1617
+
1618
+ const secrets: Secrets = { ... }
1619
+ ```
1620
+
1621
+ #### Properties <a name="Properties" id="Properties"></a>
1622
+
1623
+ | **Name** | **Type** | **Description** |
1624
+ | --- | --- | --- |
1625
+ | <code><a href="#ec2-instance-running-scheduler.Secrets.property.slackSecretName">slackSecretName</a></code> | <code>string</code> | Name of the Secrets Manager secret containing Slack token and channel. |
1626
+
1627
+ ---
1628
+
1629
+ ##### `slackSecretName`<sup>Required</sup> <a name="slackSecretName" id="ec2-instance-running-scheduler.Secrets.property.slackSecretName"></a>
1630
+
1631
+ ```typescript
1632
+ public readonly slackSecretName: string;
1633
+ ```
1634
+
1635
+ - *Type:* string
1636
+
1637
+ Name of the Secrets Manager secret containing Slack token and channel.
1638
+
1639
+ ---
1640
+
1641
+ ### TargetResource <a name="TargetResource" id="ec2-instance-running-scheduler.TargetResource"></a>
1642
+
1643
+ Defines which EC2 instances are targeted by tag key and values.
1644
+
1645
+ #### Initializer <a name="Initializer" id="ec2-instance-running-scheduler.TargetResource.Initializer"></a>
1646
+
1647
+ ```typescript
1648
+ import { TargetResource } from 'ec2-instance-running-scheduler'
1649
+
1650
+ const targetResource: TargetResource = { ... }
1651
+ ```
1652
+
1653
+ #### Properties <a name="Properties" id="Properties"></a>
1654
+
1655
+ | **Name** | **Type** | **Description** |
1656
+ | --- | --- | --- |
1657
+ | <code><a href="#ec2-instance-running-scheduler.TargetResource.property.tagKey">tagKey</a></code> | <code>string</code> | Tag key used to select instances (e.g. Schedule). |
1658
+ | <code><a href="#ec2-instance-running-scheduler.TargetResource.property.tagValues">tagValues</a></code> | <code>string[]</code> | Tag values that match instances to include. |
1659
+
1660
+ ---
1661
+
1662
+ ##### `tagKey`<sup>Required</sup> <a name="tagKey" id="ec2-instance-running-scheduler.TargetResource.property.tagKey"></a>
1663
+
1664
+ ```typescript
1665
+ public readonly tagKey: string;
1666
+ ```
1667
+
1668
+ - *Type:* string
1669
+
1670
+ Tag key used to select instances (e.g. Schedule).
1671
+
1672
+ ---
1673
+
1674
+ ##### `tagValues`<sup>Required</sup> <a name="tagValues" id="ec2-instance-running-scheduler.TargetResource.property.tagValues"></a>
1675
+
1676
+ ```typescript
1677
+ public readonly tagValues: string[];
1678
+ ```
1679
+
1680
+ - *Type:* string[]
1681
+
1682
+ Tag values that match instances to include.
1683
+
1684
+ ---
1685
+
1686
+
1687
+