low-cost-ecs 0.0.21 → 0.0.23

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 CHANGED
@@ -43,17 +43,6 @@ new LowCostECS(scope: Construct, id: string, props: LowCostECSProps)
43
43
  | **Name** | **Description** |
44
44
  | --- | --- |
45
45
  | <code><a href="#low-cost-ecs.LowCostECS.toString">toString</a></code> | Returns a string representation of this construct. |
46
- | <code><a href="#low-cost-ecs.LowCostECS.addDependency">addDependency</a></code> | Add a dependency between this stack and another stack. |
47
- | <code><a href="#low-cost-ecs.LowCostECS.addTransform">addTransform</a></code> | Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template. |
48
- | <code><a href="#low-cost-ecs.LowCostECS.exportValue">exportValue</a></code> | Create a CloudFormation Export for a value. |
49
- | <code><a href="#low-cost-ecs.LowCostECS.formatArn">formatArn</a></code> | Creates an ARN from components. |
50
- | <code><a href="#low-cost-ecs.LowCostECS.getLogicalId">getLogicalId</a></code> | Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource. |
51
- | <code><a href="#low-cost-ecs.LowCostECS.regionalFact">regionalFact</a></code> | Look up a fact value for the given fact for the region of this stack. |
52
- | <code><a href="#low-cost-ecs.LowCostECS.renameLogicalId">renameLogicalId</a></code> | Rename a generated logical identities. |
53
- | <code><a href="#low-cost-ecs.LowCostECS.reportMissingContextKey">reportMissingContextKey</a></code> | Indicate that a context key was expected. |
54
- | <code><a href="#low-cost-ecs.LowCostECS.resolve">resolve</a></code> | Resolve a tokenized value in the context of the current stack. |
55
- | <code><a href="#low-cost-ecs.LowCostECS.splitArn">splitArn</a></code> | Splits the provided ARN into its components. |
56
- | <code><a href="#low-cost-ecs.LowCostECS.toJsonString">toJsonString</a></code> | Convert an object, potentially containing tokens, to a JSON string. |
57
46
 
58
47
  ---
59
48
 
@@ -65,321 +54,11 @@ public toString(): string
65
54
 
66
55
  Returns a string representation of this construct.
67
56
 
68
- ##### `addDependency` <a name="addDependency" id="low-cost-ecs.LowCostECS.addDependency"></a>
69
-
70
- ```typescript
71
- public addDependency(target: Stack, reason?: string): void
72
- ```
73
-
74
- Add a dependency between this stack and another stack.
75
-
76
- This can be used to define dependencies between any two stacks within an
77
- app, and also supports nested stacks.
78
-
79
- ###### `target`<sup>Required</sup> <a name="target" id="low-cost-ecs.LowCostECS.addDependency.parameter.target"></a>
80
-
81
- - *Type:* aws-cdk-lib.Stack
82
-
83
- ---
84
-
85
- ###### `reason`<sup>Optional</sup> <a name="reason" id="low-cost-ecs.LowCostECS.addDependency.parameter.reason"></a>
86
-
87
- - *Type:* string
88
-
89
- ---
90
-
91
- ##### `addTransform` <a name="addTransform" id="low-cost-ecs.LowCostECS.addTransform"></a>
92
-
93
- ```typescript
94
- public addTransform(transform: string): void
95
- ```
96
-
97
- Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
98
-
99
- Duplicate values are removed when stack is synthesized.
100
-
101
- > [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html)
102
-
103
- *Example*
104
-
105
- ```typescript
106
- declare const stack: Stack;
107
-
108
- stack.addTransform('AWS::Serverless-2016-10-31')
109
- ```
110
-
111
-
112
- ###### `transform`<sup>Required</sup> <a name="transform" id="low-cost-ecs.LowCostECS.addTransform.parameter.transform"></a>
113
-
114
- - *Type:* string
115
-
116
- The transform to add.
117
-
118
- ---
119
-
120
- ##### `exportValue` <a name="exportValue" id="low-cost-ecs.LowCostECS.exportValue"></a>
121
-
122
- ```typescript
123
- public exportValue(exportedValue: any, options?: ExportValueOptions): string
124
- ```
125
-
126
- Create a CloudFormation Export for a value.
127
-
128
- Returns a string representing the corresponding `Fn.importValue()`
129
- expression for this Export. You can control the name for the export by
130
- passing the `name` option.
131
-
132
- If you don't supply a value for `name`, the value you're exporting must be
133
- a Resource attribute (for example: `bucket.bucketName`) and it will be
134
- given the same name as the automatic cross-stack reference that would be created
135
- if you used the attribute in another Stack.
136
-
137
- One of the uses for this method is to *remove* the relationship between
138
- two Stacks established by automatic cross-stack references. It will
139
- temporarily ensure that the CloudFormation Export still exists while you
140
- remove the reference from the consuming stack. After that, you can remove
141
- the resource and the manual export.
142
-
143
- ## Example
144
-
145
- Here is how the process works. Let's say there are two stacks,
146
- `producerStack` and `consumerStack`, and `producerStack` has a bucket
147
- called `bucket`, which is referenced by `consumerStack` (perhaps because
148
- an AWS Lambda Function writes into it, or something like that).
149
-
150
- It is not safe to remove `producerStack.bucket` because as the bucket is being
151
- deleted, `consumerStack` might still be using it.
152
-
153
- Instead, the process takes two deployments:
154
-
155
- ### Deployment 1: break the relationship
156
-
157
- - Make sure `consumerStack` no longer references `bucket.bucketName` (maybe the consumer
158
- stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
159
- remove the Lambda Function altogether).
160
- - In the `ProducerStack` class, call `this.exportValue(this.bucket.bucketName)`. This
161
- will make sure the CloudFormation Export continues to exist while the relationship
162
- between the two stacks is being broken.
163
- - Deploy (this will effectively only change the `consumerStack`, but it's safe to deploy both).
164
-
165
- ### Deployment 2: remove the bucket resource
166
-
167
- - You are now free to remove the `bucket` resource from `producerStack`.
168
- - Don't forget to remove the `exportValue()` call as well.
169
- - Deploy again (this time only the `producerStack` will be changed -- the bucket will be deleted).
170
-
171
- ###### `exportedValue`<sup>Required</sup> <a name="exportedValue" id="low-cost-ecs.LowCostECS.exportValue.parameter.exportedValue"></a>
172
-
173
- - *Type:* any
174
-
175
- ---
176
-
177
- ###### `options`<sup>Optional</sup> <a name="options" id="low-cost-ecs.LowCostECS.exportValue.parameter.options"></a>
178
-
179
- - *Type:* aws-cdk-lib.ExportValueOptions
180
-
181
- ---
182
-
183
- ##### `formatArn` <a name="formatArn" id="low-cost-ecs.LowCostECS.formatArn"></a>
184
-
185
- ```typescript
186
- public formatArn(components: ArnComponents): string
187
- ```
188
-
189
- Creates an ARN from components.
190
-
191
- If `partition`, `region` or `account` are not specified, the stack's
192
- partition, region and account will be used.
193
-
194
- If any component is the empty string, an empty string will be inserted
195
- into the generated ARN at the location that component corresponds to.
196
-
197
- The ARN will be formatted as follows:
198
-
199
- arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}
200
-
201
- The required ARN pieces that are omitted will be taken from the stack that
202
- the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope
203
- can be 'undefined'.
204
-
205
- ###### `components`<sup>Required</sup> <a name="components" id="low-cost-ecs.LowCostECS.formatArn.parameter.components"></a>
206
-
207
- - *Type:* aws-cdk-lib.ArnComponents
208
-
209
- ---
210
-
211
- ##### `getLogicalId` <a name="getLogicalId" id="low-cost-ecs.LowCostECS.getLogicalId"></a>
212
-
213
- ```typescript
214
- public getLogicalId(element: CfnElement): string
215
- ```
216
-
217
- Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
218
-
219
- This method is called when a `CfnElement` is created and used to render the
220
- initial logical identity of resources. Logical ID renames are applied at
221
- this stage.
222
-
223
- This method uses the protected method `allocateLogicalId` to render the
224
- logical ID for an element. To modify the naming scheme, extend the `Stack`
225
- class and override this method.
226
-
227
- ###### `element`<sup>Required</sup> <a name="element" id="low-cost-ecs.LowCostECS.getLogicalId.parameter.element"></a>
228
-
229
- - *Type:* aws-cdk-lib.CfnElement
230
-
231
- The CloudFormation element for which a logical identity is needed.
232
-
233
- ---
234
-
235
- ##### `regionalFact` <a name="regionalFact" id="low-cost-ecs.LowCostECS.regionalFact"></a>
236
-
237
- ```typescript
238
- public regionalFact(factName: string, defaultValue?: string): string
239
- ```
240
-
241
- Look up a fact value for the given fact for the region of this stack.
242
-
243
- Will return a definite value only if the region of the current stack is resolved.
244
- If not, a lookup map will be added to the stack and the lookup will be done at
245
- CDK deployment time.
246
-
247
- What regions will be included in the lookup map is controlled by the
248
- `@aws-cdk/core:target-partitions` context value: it must be set to a list
249
- of partitions, and only regions from the given partitions will be included.
250
- If no such context key is set, all regions will be included.
251
-
252
- This function is intended to be used by construct library authors. Application
253
- builders can rely on the abstractions offered by construct libraries and do
254
- not have to worry about regional facts.
255
-
256
- If `defaultValue` is not given, it is an error if the fact is unknown for
257
- the given region.
258
-
259
- ###### `factName`<sup>Required</sup> <a name="factName" id="low-cost-ecs.LowCostECS.regionalFact.parameter.factName"></a>
260
-
261
- - *Type:* string
262
-
263
- ---
264
-
265
- ###### `defaultValue`<sup>Optional</sup> <a name="defaultValue" id="low-cost-ecs.LowCostECS.regionalFact.parameter.defaultValue"></a>
266
-
267
- - *Type:* string
268
-
269
- ---
270
-
271
- ##### `renameLogicalId` <a name="renameLogicalId" id="low-cost-ecs.LowCostECS.renameLogicalId"></a>
272
-
273
- ```typescript
274
- public renameLogicalId(oldId: string, newId: string): void
275
- ```
276
-
277
- Rename a generated logical identities.
278
-
279
- To modify the naming scheme strategy, extend the `Stack` class and
280
- override the `allocateLogicalId` method.
281
-
282
- ###### `oldId`<sup>Required</sup> <a name="oldId" id="low-cost-ecs.LowCostECS.renameLogicalId.parameter.oldId"></a>
283
-
284
- - *Type:* string
285
-
286
- ---
287
-
288
- ###### `newId`<sup>Required</sup> <a name="newId" id="low-cost-ecs.LowCostECS.renameLogicalId.parameter.newId"></a>
289
-
290
- - *Type:* string
291
-
292
- ---
293
-
294
- ##### `reportMissingContextKey` <a name="reportMissingContextKey" id="low-cost-ecs.LowCostECS.reportMissingContextKey"></a>
295
-
296
- ```typescript
297
- public reportMissingContextKey(report: MissingContext): void
298
- ```
299
-
300
- Indicate that a context key was expected.
301
-
302
- Contains instructions which will be emitted into the cloud assembly on how
303
- the key should be supplied.
304
-
305
- ###### `report`<sup>Required</sup> <a name="report" id="low-cost-ecs.LowCostECS.reportMissingContextKey.parameter.report"></a>
306
-
307
- - *Type:* aws-cdk-lib.cloud_assembly_schema.MissingContext
308
-
309
- The set of parameters needed to obtain the context.
310
-
311
- ---
312
-
313
- ##### `resolve` <a name="resolve" id="low-cost-ecs.LowCostECS.resolve"></a>
314
-
315
- ```typescript
316
- public resolve(obj: any): any
317
- ```
318
-
319
- Resolve a tokenized value in the context of the current stack.
320
-
321
- ###### `obj`<sup>Required</sup> <a name="obj" id="low-cost-ecs.LowCostECS.resolve.parameter.obj"></a>
322
-
323
- - *Type:* any
324
-
325
- ---
326
-
327
- ##### `splitArn` <a name="splitArn" id="low-cost-ecs.LowCostECS.splitArn"></a>
328
-
329
- ```typescript
330
- public splitArn(arn: string, arnFormat: ArnFormat): ArnComponents
331
- ```
332
-
333
- Splits the provided ARN into its components.
334
-
335
- Works both if 'arn' is a string like 'arn:aws:s3:::bucket',
336
- and a Token representing a dynamic CloudFormation expression
337
- (in which case the returned components will also be dynamic CloudFormation expressions,
338
- encoded as Tokens).
339
-
340
- ###### `arn`<sup>Required</sup> <a name="arn" id="low-cost-ecs.LowCostECS.splitArn.parameter.arn"></a>
341
-
342
- - *Type:* string
343
-
344
- the ARN to split into its components.
345
-
346
- ---
347
-
348
- ###### `arnFormat`<sup>Required</sup> <a name="arnFormat" id="low-cost-ecs.LowCostECS.splitArn.parameter.arnFormat"></a>
349
-
350
- - *Type:* aws-cdk-lib.ArnFormat
351
-
352
- the expected format of 'arn' - depends on what format the service 'arn' represents uses.
353
-
354
- ---
355
-
356
- ##### `toJsonString` <a name="toJsonString" id="low-cost-ecs.LowCostECS.toJsonString"></a>
357
-
358
- ```typescript
359
- public toJsonString(obj: any, space?: number): string
360
- ```
361
-
362
- Convert an object, potentially containing tokens, to a JSON string.
363
-
364
- ###### `obj`<sup>Required</sup> <a name="obj" id="low-cost-ecs.LowCostECS.toJsonString.parameter.obj"></a>
365
-
366
- - *Type:* any
367
-
368
- ---
369
-
370
- ###### `space`<sup>Optional</sup> <a name="space" id="low-cost-ecs.LowCostECS.toJsonString.parameter.space"></a>
371
-
372
- - *Type:* number
373
-
374
- ---
375
-
376
57
  #### Static Functions <a name="Static Functions" id="Static Functions"></a>
377
58
 
378
59
  | **Name** | **Description** |
379
60
  | --- | --- |
380
61
  | <code><a href="#low-cost-ecs.LowCostECS.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
381
- | <code><a href="#low-cost-ecs.LowCostECS.isStack">isStack</a></code> | Return whether the given object is a Stack. |
382
- | <code><a href="#low-cost-ecs.LowCostECS.of">of</a></code> | Looks up the first stack scope in which `construct` is defined. |
383
62
 
384
63
  ---
385
64
 
@@ -401,73 +80,17 @@ Any object.
401
80
 
402
81
  ---
403
82
 
404
- ##### `isStack` <a name="isStack" id="low-cost-ecs.LowCostECS.isStack"></a>
405
-
406
- ```typescript
407
- import { LowCostECS } from 'low-cost-ecs'
408
-
409
- LowCostECS.isStack(x: any)
410
- ```
411
-
412
- Return whether the given object is a Stack.
413
-
414
- We do attribute detection since we can't reliably use 'instanceof'.
415
-
416
- ###### `x`<sup>Required</sup> <a name="x" id="low-cost-ecs.LowCostECS.isStack.parameter.x"></a>
417
-
418
- - *Type:* any
419
-
420
- ---
421
-
422
- ##### `of` <a name="of" id="low-cost-ecs.LowCostECS.of"></a>
423
-
424
- ```typescript
425
- import { LowCostECS } from 'low-cost-ecs'
426
-
427
- LowCostECS.of(construct: IConstruct)
428
- ```
429
-
430
- Looks up the first stack scope in which `construct` is defined.
431
-
432
- Fails if there is no stack up the tree.
433
-
434
- ###### `construct`<sup>Required</sup> <a name="construct" id="low-cost-ecs.LowCostECS.of.parameter.construct"></a>
435
-
436
- - *Type:* constructs.IConstruct
437
-
438
- The construct to start the search from.
439
-
440
- ---
441
-
442
83
  #### Properties <a name="Properties" id="Properties"></a>
443
84
 
444
85
  | **Name** | **Type** | **Description** |
445
86
  | --- | --- | --- |
446
87
  | <code><a href="#low-cost-ecs.LowCostECS.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
447
- | <code><a href="#low-cost-ecs.LowCostECS.property.account">account</a></code> | <code>string</code> | The AWS account into which this stack will be deployed. |
448
- | <code><a href="#low-cost-ecs.LowCostECS.property.artifactId">artifactId</a></code> | <code>string</code> | The ID of the cloud assembly artifact for this stack. |
449
- | <code><a href="#low-cost-ecs.LowCostECS.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. |
450
- | <code><a href="#low-cost-ecs.LowCostECS.property.bundlingRequired">bundlingRequired</a></code> | <code>boolean</code> | Indicates whether the stack requires bundling or not. |
451
- | <code><a href="#low-cost-ecs.LowCostECS.property.dependencies">dependencies</a></code> | <code>aws-cdk-lib.Stack[]</code> | Return the stacks this stack depends on. |
452
- | <code><a href="#low-cost-ecs.LowCostECS.property.environment">environment</a></code> | <code>string</code> | The environment coordinates in which this stack is deployed. |
453
- | <code><a href="#low-cost-ecs.LowCostECS.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. |
454
- | <code><a href="#low-cost-ecs.LowCostECS.property.notificationArns">notificationArns</a></code> | <code>string[]</code> | Returns the list of notification Amazon Resource Names (ARNs) for the current stack. |
455
- | <code><a href="#low-cost-ecs.LowCostECS.property.partition">partition</a></code> | <code>string</code> | The partition in which this stack is defined. |
456
- | <code><a href="#low-cost-ecs.LowCostECS.property.region">region</a></code> | <code>string</code> | The AWS region into which this stack will be deployed (e.g. `us-west-2`). |
457
- | <code><a href="#low-cost-ecs.LowCostECS.property.stackId">stackId</a></code> | <code>string</code> | The ID of the stack. |
458
- | <code><a href="#low-cost-ecs.LowCostECS.property.stackName">stackName</a></code> | <code>string</code> | The concrete CloudFormation physical stack name. |
459
- | <code><a href="#low-cost-ecs.LowCostECS.property.synthesizer">synthesizer</a></code> | <code>aws-cdk-lib.IStackSynthesizer</code> | Synthesis method for this stack. |
460
- | <code><a href="#low-cost-ecs.LowCostECS.property.tags">tags</a></code> | <code>aws-cdk-lib.TagManager</code> | Tags to be applied to the stack. |
461
- | <code><a href="#low-cost-ecs.LowCostECS.property.templateFile">templateFile</a></code> | <code>string</code> | The name of the CloudFormation template file emitted to the output directory during synthesis. |
462
- | <code><a href="#low-cost-ecs.LowCostECS.property.templateOptions">templateOptions</a></code> | <code>aws-cdk-lib.ITemplateOptions</code> | Options for CloudFormation template (like version, transform, description). |
463
- | <code><a href="#low-cost-ecs.LowCostECS.property.urlSuffix">urlSuffix</a></code> | <code>string</code> | The Amazon domain suffix for the region in which this stack is defined. |
464
- | <code><a href="#low-cost-ecs.LowCostECS.property.nestedStackParent">nestedStackParent</a></code> | <code>aws-cdk-lib.Stack</code> | If this is a nested stack, returns it's parent stack. |
465
- | <code><a href="#low-cost-ecs.LowCostECS.property.nestedStackResource">nestedStackResource</a></code> | <code>aws-cdk-lib.CfnResource</code> | If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource. |
466
- | <code><a href="#low-cost-ecs.LowCostECS.property.terminationProtection">terminationProtection</a></code> | <code>boolean</code> | Whether termination protection is enabled for this stack. |
467
88
  | <code><a href="#low-cost-ecs.LowCostECS.property.certFileSystem">certFileSystem</a></code> | <code>aws-cdk-lib.aws_efs.FileSystem</code> | *No description.* |
468
89
  | <code><a href="#low-cost-ecs.LowCostECS.property.cluster">cluster</a></code> | <code>aws-cdk-lib.aws_ecs.Cluster</code> | *No description.* |
469
90
  | <code><a href="#low-cost-ecs.LowCostECS.property.hostAutoScalingGroup">hostAutoScalingGroup</a></code> | <code>aws-cdk-lib.aws_autoscaling.AutoScalingGroup</code> | *No description.* |
91
+ | <code><a href="#low-cost-ecs.LowCostECS.property.serverTaskDefinition">serverTaskDefinition</a></code> | <code>aws-cdk-lib.aws_ecs.Ec2TaskDefinition</code> | *No description.* |
470
92
  | <code><a href="#low-cost-ecs.LowCostECS.property.service">service</a></code> | <code>aws-cdk-lib.aws_ecs.Ec2Service</code> | *No description.* |
93
+ | <code><a href="#low-cost-ecs.LowCostECS.property.topic">topic</a></code> | <code>aws-cdk-lib.aws_sns.Topic</code> | *No description.* |
471
94
  | <code><a href="#low-cost-ecs.LowCostECS.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | *No description.* |
472
95
 
473
96
  ---
@@ -484,361 +107,63 @@ The tree node.
484
107
 
485
108
  ---
486
109
 
487
- ##### `account`<sup>Required</sup> <a name="account" id="low-cost-ecs.LowCostECS.property.account"></a>
488
-
489
- ```typescript
490
- public readonly account: string;
491
- ```
492
-
493
- - *Type:* string
494
-
495
- The AWS account into which this stack will be deployed.
496
-
497
- This value is resolved according to the following rules:
498
-
499
- 1. The value provided to `env.account` when the stack is defined. This can
500
- either be a concrete account (e.g. `585695031111`) or the
501
- `Aws.ACCOUNT_ID` token.
502
- 3. `Aws.ACCOUNT_ID`, which represents the CloudFormation intrinsic reference
503
- `{ "Ref": "AWS::AccountId" }` encoded as a string token.
504
-
505
- Preferably, you should use the return value as an opaque string and not
506
- attempt to parse it to implement your logic. If you do, you must first
507
- check that it is a concerete value an not an unresolved token. If this
508
- value is an unresolved token (`Token.isUnresolved(stack.account)` returns
509
- `true`), this implies that the user wishes that this stack will synthesize
510
- into a **account-agnostic template**. In this case, your code should either
511
- fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
512
- implement some other region-agnostic behavior.
513
-
514
- ---
515
-
516
- ##### `artifactId`<sup>Required</sup> <a name="artifactId" id="low-cost-ecs.LowCostECS.property.artifactId"></a>
517
-
518
- ```typescript
519
- public readonly artifactId: string;
520
- ```
521
-
522
- - *Type:* string
523
-
524
- The ID of the cloud assembly artifact for this stack.
525
-
526
- ---
527
-
528
- ##### `availabilityZones`<sup>Required</sup> <a name="availabilityZones" id="low-cost-ecs.LowCostECS.property.availabilityZones"></a>
529
-
530
- ```typescript
531
- public readonly availabilityZones: string[];
532
- ```
533
-
534
- - *Type:* string[]
535
-
536
- Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
537
-
538
- If the stack is environment-agnostic (either account and/or region are
539
- tokens), this property will return an array with 2 tokens that will resolve
540
- at deploy-time to the first two availability zones returned from CloudFormation's
541
- `Fn::GetAZs` intrinsic function.
542
-
543
- If they are not available in the context, returns a set of dummy values and
544
- reports them as missing, and let the CLI resolve them by calling EC2
545
- `DescribeAvailabilityZones` on the target environment.
546
-
547
- To specify a different strategy for selecting availability zones override this method.
548
-
549
- ---
550
-
551
- ##### `bundlingRequired`<sup>Required</sup> <a name="bundlingRequired" id="low-cost-ecs.LowCostECS.property.bundlingRequired"></a>
552
-
553
- ```typescript
554
- public readonly bundlingRequired: boolean;
555
- ```
556
-
557
- - *Type:* boolean
558
-
559
- Indicates whether the stack requires bundling or not.
560
-
561
- ---
562
-
563
- ##### `dependencies`<sup>Required</sup> <a name="dependencies" id="low-cost-ecs.LowCostECS.property.dependencies"></a>
564
-
565
- ```typescript
566
- public readonly dependencies: Stack[];
567
- ```
568
-
569
- - *Type:* aws-cdk-lib.Stack[]
570
-
571
- Return the stacks this stack depends on.
572
-
573
- ---
574
-
575
- ##### `environment`<sup>Required</sup> <a name="environment" id="low-cost-ecs.LowCostECS.property.environment"></a>
576
-
577
- ```typescript
578
- public readonly environment: string;
579
- ```
580
-
581
- - *Type:* string
582
-
583
- The environment coordinates in which this stack is deployed.
584
-
585
- In the form
586
- `aws://account/region`. Use `stack.account` and `stack.region` to obtain
587
- the specific values, no need to parse.
588
-
589
- You can use this value to determine if two stacks are targeting the same
590
- environment.
591
-
592
- If either `stack.account` or `stack.region` are not concrete values (e.g.
593
- `Aws.ACCOUNT_ID` or `Aws.REGION`) the special strings `unknown-account` and/or
594
- `unknown-region` will be used respectively to indicate this stack is
595
- region/account-agnostic.
596
-
597
- ---
598
-
599
- ##### `nested`<sup>Required</sup> <a name="nested" id="low-cost-ecs.LowCostECS.property.nested"></a>
600
-
601
- ```typescript
602
- public readonly nested: boolean;
603
- ```
604
-
605
- - *Type:* boolean
606
-
607
- Indicates if this is a nested stack, in which case `parentStack` will include a reference to it's parent.
608
-
609
- ---
610
-
611
- ##### `notificationArns`<sup>Required</sup> <a name="notificationArns" id="low-cost-ecs.LowCostECS.property.notificationArns"></a>
612
-
613
- ```typescript
614
- public readonly notificationArns: string[];
615
- ```
616
-
617
- - *Type:* string[]
618
-
619
- Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
620
-
621
- ---
622
-
623
- ##### `partition`<sup>Required</sup> <a name="partition" id="low-cost-ecs.LowCostECS.property.partition"></a>
624
-
625
- ```typescript
626
- public readonly partition: string;
627
- ```
628
-
629
- - *Type:* string
630
-
631
- The partition in which this stack is defined.
632
-
633
- ---
634
-
635
- ##### `region`<sup>Required</sup> <a name="region" id="low-cost-ecs.LowCostECS.property.region"></a>
636
-
637
- ```typescript
638
- public readonly region: string;
639
- ```
640
-
641
- - *Type:* string
642
-
643
- The AWS region into which this stack will be deployed (e.g. `us-west-2`).
644
-
645
- This value is resolved according to the following rules:
646
-
647
- 1. The value provided to `env.region` when the stack is defined. This can
648
- either be a concerete region (e.g. `us-west-2`) or the `Aws.REGION`
649
- token.
650
- 3. `Aws.REGION`, which is represents the CloudFormation intrinsic reference
651
- `{ "Ref": "AWS::Region" }` encoded as a string token.
652
-
653
- Preferably, you should use the return value as an opaque string and not
654
- attempt to parse it to implement your logic. If you do, you must first
655
- check that it is a concerete value an not an unresolved token. If this
656
- value is an unresolved token (`Token.isUnresolved(stack.region)` returns
657
- `true`), this implies that the user wishes that this stack will synthesize
658
- into a **region-agnostic template**. In this case, your code should either
659
- fail (throw an error, emit a synth error using `Annotations.of(construct).addError()`) or
660
- implement some other region-agnostic behavior.
661
-
662
- ---
663
-
664
- ##### `stackId`<sup>Required</sup> <a name="stackId" id="low-cost-ecs.LowCostECS.property.stackId"></a>
665
-
666
- ```typescript
667
- public readonly stackId: string;
668
- ```
669
-
670
- - *Type:* string
671
-
672
- The ID of the stack.
673
-
674
- ---
675
-
676
- *Example*
677
-
678
- ```typescript
679
- // After resolving, looks like
680
- 'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
681
- ```
682
-
683
-
684
- ##### `stackName`<sup>Required</sup> <a name="stackName" id="low-cost-ecs.LowCostECS.property.stackName"></a>
685
-
686
- ```typescript
687
- public readonly stackName: string;
688
- ```
689
-
690
- - *Type:* string
691
-
692
- The concrete CloudFormation physical stack name.
693
-
694
- This is either the name defined explicitly in the `stackName` prop or
695
- allocated based on the stack's location in the construct tree. Stacks that
696
- are directly defined under the app use their construct `id` as their stack
697
- name. Stacks that are defined deeper within the tree will use a hashed naming
698
- scheme based on the construct path to ensure uniqueness.
699
-
700
- If you wish to obtain the deploy-time AWS::StackName intrinsic,
701
- you can use `Aws.STACK_NAME` directly.
702
-
703
- ---
704
-
705
- ##### `synthesizer`<sup>Required</sup> <a name="synthesizer" id="low-cost-ecs.LowCostECS.property.synthesizer"></a>
706
-
707
- ```typescript
708
- public readonly synthesizer: IStackSynthesizer;
709
- ```
710
-
711
- - *Type:* aws-cdk-lib.IStackSynthesizer
712
-
713
- Synthesis method for this stack.
714
-
715
- ---
716
-
717
- ##### `tags`<sup>Required</sup> <a name="tags" id="low-cost-ecs.LowCostECS.property.tags"></a>
718
-
719
- ```typescript
720
- public readonly tags: TagManager;
721
- ```
722
-
723
- - *Type:* aws-cdk-lib.TagManager
724
-
725
- Tags to be applied to the stack.
726
-
727
- ---
728
-
729
- ##### `templateFile`<sup>Required</sup> <a name="templateFile" id="low-cost-ecs.LowCostECS.property.templateFile"></a>
730
-
731
- ```typescript
732
- public readonly templateFile: string;
733
- ```
734
-
735
- - *Type:* string
736
-
737
- The name of the CloudFormation template file emitted to the output directory during synthesis.
738
-
739
- Example value: `MyStack.template.json`
740
-
741
- ---
742
-
743
- ##### `templateOptions`<sup>Required</sup> <a name="templateOptions" id="low-cost-ecs.LowCostECS.property.templateOptions"></a>
744
-
745
- ```typescript
746
- public readonly templateOptions: ITemplateOptions;
747
- ```
748
-
749
- - *Type:* aws-cdk-lib.ITemplateOptions
750
-
751
- Options for CloudFormation template (like version, transform, description).
752
-
753
- ---
754
-
755
- ##### `urlSuffix`<sup>Required</sup> <a name="urlSuffix" id="low-cost-ecs.LowCostECS.property.urlSuffix"></a>
756
-
757
- ```typescript
758
- public readonly urlSuffix: string;
759
- ```
760
-
761
- - *Type:* string
762
-
763
- The Amazon domain suffix for the region in which this stack is defined.
764
-
765
- ---
766
-
767
- ##### `nestedStackParent`<sup>Optional</sup> <a name="nestedStackParent" id="low-cost-ecs.LowCostECS.property.nestedStackParent"></a>
768
-
769
- ```typescript
770
- public readonly nestedStackParent: Stack;
771
- ```
772
-
773
- - *Type:* aws-cdk-lib.Stack
774
-
775
- If this is a nested stack, returns it's parent stack.
776
-
777
- ---
778
-
779
- ##### `nestedStackResource`<sup>Optional</sup> <a name="nestedStackResource" id="low-cost-ecs.LowCostECS.property.nestedStackResource"></a>
110
+ ##### `certFileSystem`<sup>Required</sup> <a name="certFileSystem" id="low-cost-ecs.LowCostECS.property.certFileSystem"></a>
780
111
 
781
112
  ```typescript
782
- public readonly nestedStackResource: CfnResource;
113
+ public readonly certFileSystem: FileSystem;
783
114
  ```
784
115
 
785
- - *Type:* aws-cdk-lib.CfnResource
786
-
787
- If this is a nested stack, this represents its `AWS::CloudFormation::Stack` resource.
788
-
789
- `undefined` for top-level (non-nested) stacks.
116
+ - *Type:* aws-cdk-lib.aws_efs.FileSystem
790
117
 
791
118
  ---
792
119
 
793
- ##### `terminationProtection`<sup>Optional</sup> <a name="terminationProtection" id="low-cost-ecs.LowCostECS.property.terminationProtection"></a>
120
+ ##### `cluster`<sup>Required</sup> <a name="cluster" id="low-cost-ecs.LowCostECS.property.cluster"></a>
794
121
 
795
122
  ```typescript
796
- public readonly terminationProtection: boolean;
123
+ public readonly cluster: Cluster;
797
124
  ```
798
125
 
799
- - *Type:* boolean
800
-
801
- Whether termination protection is enabled for this stack.
126
+ - *Type:* aws-cdk-lib.aws_ecs.Cluster
802
127
 
803
128
  ---
804
129
 
805
- ##### `certFileSystem`<sup>Required</sup> <a name="certFileSystem" id="low-cost-ecs.LowCostECS.property.certFileSystem"></a>
130
+ ##### `hostAutoScalingGroup`<sup>Required</sup> <a name="hostAutoScalingGroup" id="low-cost-ecs.LowCostECS.property.hostAutoScalingGroup"></a>
806
131
 
807
132
  ```typescript
808
- public readonly certFileSystem: FileSystem;
133
+ public readonly hostAutoScalingGroup: AutoScalingGroup;
809
134
  ```
810
135
 
811
- - *Type:* aws-cdk-lib.aws_efs.FileSystem
136
+ - *Type:* aws-cdk-lib.aws_autoscaling.AutoScalingGroup
812
137
 
813
138
  ---
814
139
 
815
- ##### `cluster`<sup>Required</sup> <a name="cluster" id="low-cost-ecs.LowCostECS.property.cluster"></a>
140
+ ##### `serverTaskDefinition`<sup>Required</sup> <a name="serverTaskDefinition" id="low-cost-ecs.LowCostECS.property.serverTaskDefinition"></a>
816
141
 
817
142
  ```typescript
818
- public readonly cluster: Cluster;
143
+ public readonly serverTaskDefinition: Ec2TaskDefinition;
819
144
  ```
820
145
 
821
- - *Type:* aws-cdk-lib.aws_ecs.Cluster
146
+ - *Type:* aws-cdk-lib.aws_ecs.Ec2TaskDefinition
822
147
 
823
148
  ---
824
149
 
825
- ##### `hostAutoScalingGroup`<sup>Required</sup> <a name="hostAutoScalingGroup" id="low-cost-ecs.LowCostECS.property.hostAutoScalingGroup"></a>
150
+ ##### `service`<sup>Required</sup> <a name="service" id="low-cost-ecs.LowCostECS.property.service"></a>
826
151
 
827
152
  ```typescript
828
- public readonly hostAutoScalingGroup: AutoScalingGroup;
153
+ public readonly service: Ec2Service;
829
154
  ```
830
155
 
831
- - *Type:* aws-cdk-lib.aws_autoscaling.AutoScalingGroup
156
+ - *Type:* aws-cdk-lib.aws_ecs.Ec2Service
832
157
 
833
158
  ---
834
159
 
835
- ##### `service`<sup>Required</sup> <a name="service" id="low-cost-ecs.LowCostECS.property.service"></a>
160
+ ##### `topic`<sup>Required</sup> <a name="topic" id="low-cost-ecs.LowCostECS.property.topic"></a>
836
161
 
837
162
  ```typescript
838
- public readonly service: Ec2Service;
163
+ public readonly topic: Topic;
839
164
  ```
840
165
 
841
- - *Type:* aws-cdk-lib.aws_ecs.Ec2Service
166
+ - *Type:* aws-cdk-lib.aws_sns.Topic
842
167
 
843
168
  ---
844
169
 
@@ -869,13 +194,6 @@ const lowCostECSProps: LowCostECSProps = { ... }
869
194
 
870
195
  | **Name** | **Type** | **Description** |
871
196
  | --- | --- | --- |
872
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.analyticsReporting">analyticsReporting</a></code> | <code>boolean</code> | Include runtime versioning information in this Stack. |
873
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.description">description</a></code> | <code>string</code> | A description of the stack. |
874
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.env">env</a></code> | <code>aws-cdk-lib.Environment</code> | The AWS environment (account/region) where this stack will be deployed. |
875
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.stackName">stackName</a></code> | <code>string</code> | Name to deploy the stack with. |
876
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.synthesizer">synthesizer</a></code> | <code>aws-cdk-lib.IStackSynthesizer</code> | Synthesis method to use while deploying this stack. |
877
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.tags">tags</a></code> | <code>{[ key: string ]: string}</code> | Stack tags that will be applied to all the taggable resources and the stack itself. |
878
- | <code><a href="#low-cost-ecs.LowCostECSProps.property.terminationProtection">terminationProtection</a></code> | <code>boolean</code> | Whether to enable termination protection for this stack. |
879
197
  | <code><a href="#low-cost-ecs.LowCostECSProps.property.email">email</a></code> | <code>string</code> | Email for expiration emails to register to your let's encrypt account. |
880
198
  | <code><a href="#low-cost-ecs.LowCostECSProps.property.hostedZoneDomain">hostedZoneDomain</a></code> | <code>string</code> | Domain name of the hosted zone. |
881
199
  | <code><a href="#low-cost-ecs.LowCostECSProps.property.awsCliDockerTag">awsCliDockerTag</a></code> | <code>string</code> | Docker image tag of amazon/aws-cli. |
@@ -893,158 +211,6 @@ const lowCostECSProps: LowCostECSProps = { ... }
893
211
 
894
212
  ---
895
213
 
896
- ##### `analyticsReporting`<sup>Optional</sup> <a name="analyticsReporting" id="low-cost-ecs.LowCostECSProps.property.analyticsReporting"></a>
897
-
898
- ```typescript
899
- public readonly analyticsReporting: boolean;
900
- ```
901
-
902
- - *Type:* boolean
903
- - *Default:* `analyticsReporting` setting of containing `App`, or value of 'aws:cdk:version-reporting' context key
904
-
905
- Include runtime versioning information in this Stack.
906
-
907
- ---
908
-
909
- ##### `description`<sup>Optional</sup> <a name="description" id="low-cost-ecs.LowCostECSProps.property.description"></a>
910
-
911
- ```typescript
912
- public readonly description: string;
913
- ```
914
-
915
- - *Type:* string
916
- - *Default:* No description.
917
-
918
- A description of the stack.
919
-
920
- ---
921
-
922
- ##### `env`<sup>Optional</sup> <a name="env" id="low-cost-ecs.LowCostECSProps.property.env"></a>
923
-
924
- ```typescript
925
- public readonly env: Environment;
926
- ```
927
-
928
- - *Type:* aws-cdk-lib.Environment
929
- - *Default:* The environment of the containing `Stage` if available, otherwise create the stack will be environment-agnostic.
930
-
931
- The AWS environment (account/region) where this stack will be deployed.
932
-
933
- Set the `region`/`account` fields of `env` to either a concrete value to
934
- select the indicated environment (recommended for production stacks), or to
935
- the values of environment variables
936
- `CDK_DEFAULT_REGION`/`CDK_DEFAULT_ACCOUNT` to let the target environment
937
- depend on the AWS credentials/configuration that the CDK CLI is executed
938
- under (recommended for development stacks).
939
-
940
- If the `Stack` is instantiated inside a `Stage`, any undefined
941
- `region`/`account` fields from `env` will default to the same field on the
942
- encompassing `Stage`, if configured there.
943
-
944
- If either `region` or `account` are not set nor inherited from `Stage`, the
945
- Stack will be considered "*environment-agnostic*"". Environment-agnostic
946
- stacks can be deployed to any environment but may not be able to take
947
- advantage of all features of the CDK. For example, they will not be able to
948
- use environmental context lookups such as `ec2.Vpc.fromLookup` and will not
949
- automatically translate Service Principals to the right format based on the
950
- environment's AWS partition, and other such enhancements.
951
-
952
- ---
953
-
954
- *Example*
955
-
956
- ```typescript
957
- // Use a concrete account and region to deploy this stack to:
958
- // `.account` and `.region` will simply return these values.
959
- new Stack(app, 'Stack1', {
960
- env: {
961
- account: '123456789012',
962
- region: 'us-east-1'
963
- },
964
- });
965
-
966
- // Use the CLI's current credentials to determine the target environment:
967
- // `.account` and `.region` will reflect the account+region the CLI
968
- // is configured to use (based on the user CLI credentials)
969
- new Stack(app, 'Stack2', {
970
- env: {
971
- account: process.env.CDK_DEFAULT_ACCOUNT,
972
- region: process.env.CDK_DEFAULT_REGION
973
- },
974
- });
975
-
976
- // Define multiple stacks stage associated with an environment
977
- const myStage = new Stage(app, 'MyStage', {
978
- env: {
979
- account: '123456789012',
980
- region: 'us-east-1'
981
- }
982
- });
983
-
984
- // both of these stacks will use the stage's account/region:
985
- // `.account` and `.region` will resolve to the concrete values as above
986
- new MyStack(myStage, 'Stack1');
987
- new YourStack(myStage, 'Stack2');
988
-
989
- // Define an environment-agnostic stack:
990
- // `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
991
- // which will only resolve to actual values by CloudFormation during deployment.
992
- new MyStack(app, 'Stack1');
993
- ```
994
-
995
-
996
- ##### `stackName`<sup>Optional</sup> <a name="stackName" id="low-cost-ecs.LowCostECSProps.property.stackName"></a>
997
-
998
- ```typescript
999
- public readonly stackName: string;
1000
- ```
1001
-
1002
- - *Type:* string
1003
- - *Default:* Derived from construct path.
1004
-
1005
- Name to deploy the stack with.
1006
-
1007
- ---
1008
-
1009
- ##### `synthesizer`<sup>Optional</sup> <a name="synthesizer" id="low-cost-ecs.LowCostECSProps.property.synthesizer"></a>
1010
-
1011
- ```typescript
1012
- public readonly synthesizer: IStackSynthesizer;
1013
- ```
1014
-
1015
- - *Type:* aws-cdk-lib.IStackSynthesizer
1016
- - *Default:* `DefaultStackSynthesizer` if the `@aws-cdk/core:newStyleStackSynthesis` feature flag is set, `LegacyStackSynthesizer` otherwise.
1017
-
1018
- Synthesis method to use while deploying this stack.
1019
-
1020
- ---
1021
-
1022
- ##### `tags`<sup>Optional</sup> <a name="tags" id="low-cost-ecs.LowCostECSProps.property.tags"></a>
1023
-
1024
- ```typescript
1025
- public readonly tags: {[ key: string ]: string};
1026
- ```
1027
-
1028
- - *Type:* {[ key: string ]: string}
1029
- - *Default:* {}
1030
-
1031
- Stack tags that will be applied to all the taggable resources and the stack itself.
1032
-
1033
- ---
1034
-
1035
- ##### `terminationProtection`<sup>Optional</sup> <a name="terminationProtection" id="low-cost-ecs.LowCostECSProps.property.terminationProtection"></a>
1036
-
1037
- ```typescript
1038
- public readonly terminationProtection: boolean;
1039
- ```
1040
-
1041
- - *Type:* boolean
1042
- - *Default:* false
1043
-
1044
- Whether to enable termination protection for this stack.
1045
-
1046
- ---
1047
-
1048
214
  ##### `email`<sup>Required</sup> <a name="email" id="low-cost-ecs.LowCostECSProps.property.email"></a>
1049
215
 
1050
216
  ```typescript
@@ -1216,10 +382,12 @@ public readonly serverTaskDefinition: LowCostECSTaskDefinitionOptions;
1216
382
  ```
1217
383
 
1218
384
  - *Type:* <a href="#low-cost-ecs.LowCostECSTaskDefinitionOptions">LowCostECSTaskDefinitionOptions</a>
1219
- - *Default:* Nginx server task definition defined in createSampleTaskDefinition()
385
+ - *Default:* Nginx server task definition defined in sampleTaskDefinition()
1220
386
 
1221
387
  Task definition for the server ecs task.
1222
388
 
389
+ > [sampleTaskDefinition](sampleTaskDefinition)
390
+
1223
391
  ---
1224
392
 
1225
393
  ##### `vpc`<sup>Optional</sup> <a name="vpc" id="low-cost-ecs.LowCostECSProps.property.vpc"></a>