@mapbox/cloudfriend 9.1.1-0 → 9.1.1-2
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/.nyc_output/{8d7825ff-d255-4e4a-ace8-09ece4986dd0.json → 01080346-d53d-4f4f-afd6-1bc7176afdb7.json} +1 -1
- package/.nyc_output/{a47652f0-6d32-4764-bfc0-35090b7c546a.json → 8abf5805-988a-4531-a74d-ac3f5fec191f.json} +1 -1
- package/.nyc_output/processinfo/{8d7825ff-d255-4e4a-ace8-09ece4986dd0.json → 01080346-d53d-4f4f-afd6-1bc7176afdb7.json} +1 -1
- package/.nyc_output/processinfo/{a47652f0-6d32-4764-bfc0-35090b7c546a.json → 8abf5805-988a-4531-a74d-ac3f5fec191f.json} +1 -1
- package/.nyc_output/processinfo/index.json +1 -1
- package/changelog.md +4 -0
- package/lib/shortcuts/api.md +2 -2
- package/lib/shortcuts/glue-iceberg-table.js +7 -47
- package/lib/shortcuts/lambda.js +4 -2
- package/package.json +1 -1
- package/test/fixtures/shortcuts/event-lambda-custom-eventbus.json +2 -1
- package/test/fixtures/shortcuts/event-lambda-defaults.json +2 -1
- package/test/fixtures/shortcuts/event-lambda-full.json +2 -1
- package/test/fixtures/shortcuts/hookshot-github-compatible-legacy-node-runtimes.json +3 -1
- package/test/fixtures/shortcuts/hookshot-github-secret-ref.json +3 -1
- package/test/fixtures/shortcuts/hookshot-github-secret-string.json +3 -1
- package/test/fixtures/shortcuts/hookshot-github.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-access-log-format.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-alarms.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-compatible-legacy-node-runtimes.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-enhanced-logging.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-full-blown-logging.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough-logging.json +3 -1
- package/test/fixtures/shortcuts/hookshot-passthrough.json +3 -1
- package/test/fixtures/shortcuts/lambda-defaults.json +2 -1
- package/test/fixtures/shortcuts/lambda-docker.json +2 -1
- package/test/fixtures/shortcuts/lambda-full.json +2 -1
- package/test/fixtures/shortcuts/lambda-provided-role.json +2 -1
- package/test/fixtures/shortcuts/lambda-zipfile.json +2 -1
- package/test/fixtures/shortcuts/log-subscription-lambda-defaults.json +2 -1
- package/test/fixtures/shortcuts/log-subscription-lambda-no-defaults.json +2 -1
- package/test/fixtures/shortcuts/queue-lambda-zero.json +2 -1
- package/test/fixtures/shortcuts/queue-lambda.json +2 -1
- package/test/fixtures/shortcuts/scheduled-lambda-defaults.json +2 -1
- package/test/fixtures/shortcuts/scheduled-lambda-full.json +2 -1
- package/test/fixtures/shortcuts/stream-lambda-defaults.json +2 -1
- package/test/fixtures/shortcuts/stream-lambda-no-defaults.json +2 -1
- package/test/shortcuts.test.js +94 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"uuid":"
|
|
1
|
+
{"uuid":"01080346-d53d-4f4f-afd6-1bc7176afdb7","parent":null,"pid":75452,"argv":["/opt/homebrew/Cellar/node/23.11.0/bin/node","/Users/marierajan/projects/cloudfriend/node_modules/.bin/tape","test/bin.test.js","test/index.test.js","test/shortcuts.test.js"],"execArgv":[],"cwd":"/Users/marierajan/projects/cloudfriend","time":1769550164760,"ppid":75444,"root":"c776b9ed-5f03-4f1a-9701-aaff10d7a8b5","coverageFilename":"/Users/marierajan/projects/cloudfriend/.nyc_output/01080346-d53d-4f4f-afd6-1bc7176afdb7.json","files":["/Users/marierajan/projects/cloudfriend/index.js","/Users/marierajan/projects/cloudfriend/lib/intrinsic.js","/Users/marierajan/projects/cloudfriend/lib/conditions.js","/Users/marierajan/projects/cloudfriend/lib/rules.js","/Users/marierajan/projects/cloudfriend/lib/pseudo.js","/Users/marierajan/projects/cloudfriend/lib/build.js","/Users/marierajan/projects/cloudfriend/lib/validate.js","/Users/marierajan/projects/cloudfriend/lib/merge.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/index.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/service-role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/scheduled-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/event-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/stream-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/cross-account-role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/s3-kinesis-firehose.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/kinesis-firehose-base.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-database.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-json-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-orc-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-parquet-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-iceberg-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-presto-view.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-spark-view.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/hookshot.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/log-subscription-lambda.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"uuid":"
|
|
1
|
+
{"uuid":"8abf5805-988a-4531-a74d-ac3f5fec191f","parent":"01080346-d53d-4f4f-afd6-1bc7176afdb7","pid":75453,"argv":["/opt/homebrew/Cellar/node/23.11.0/bin/node","/Users/marierajan/projects/cloudfriend/bin/build-template.js","/Users/marierajan/projects/cloudfriend/test/fixtures/sync-args.js","--this","that","-r","cn-north-1"],"execArgv":[],"cwd":"/Users/marierajan/projects/cloudfriend","time":1769550165077,"ppid":75452,"root":"c776b9ed-5f03-4f1a-9701-aaff10d7a8b5","coverageFilename":"/Users/marierajan/projects/cloudfriend/.nyc_output/8abf5805-988a-4531-a74d-ac3f5fec191f.json","files":["/Users/marierajan/projects/cloudfriend/bin/build-template.js","/Users/marierajan/projects/cloudfriend/index.js","/Users/marierajan/projects/cloudfriend/lib/intrinsic.js","/Users/marierajan/projects/cloudfriend/lib/conditions.js","/Users/marierajan/projects/cloudfriend/lib/rules.js","/Users/marierajan/projects/cloudfriend/lib/pseudo.js","/Users/marierajan/projects/cloudfriend/lib/build.js","/Users/marierajan/projects/cloudfriend/lib/validate.js","/Users/marierajan/projects/cloudfriend/lib/merge.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/index.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/service-role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/scheduled-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/event-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/stream-lambda.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/cross-account-role.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/s3-kinesis-firehose.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/kinesis-firehose-base.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-database.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-json-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-orc-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-parquet-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-iceberg-table.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-presto-view.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-spark-view.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/hookshot.js","/Users/marierajan/projects/cloudfriend/lib/shortcuts/log-subscription-lambda.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"processes":{"
|
|
1
|
+
{"processes":{"01080346-d53d-4f4f-afd6-1bc7176afdb7":{"parent":null,"children":["8abf5805-988a-4531-a74d-ac3f5fec191f"]},"8abf5805-988a-4531-a74d-ac3f5fec191f":{"parent":"01080346-d53d-4f4f-afd6-1bc7176afdb7","children":[]}},"files":{"/Users/marierajan/projects/cloudfriend/index.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/intrinsic.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/conditions.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/rules.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/pseudo.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/build.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/validate.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/merge.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/index.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/service-role.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/role.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/scheduled-lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/event-lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue-lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/stream-lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/cross-account-role.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/queue.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/s3-kinesis-firehose.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/kinesis-firehose-base.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-database.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-table.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-json-table.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-orc-table.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-parquet-table.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-iceberg-table.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-presto-view.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/glue-spark-view.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/hookshot.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/lib/shortcuts/log-subscription-lambda.js":["01080346-d53d-4f4f-afd6-1bc7176afdb7","8abf5805-988a-4531-a74d-ac3f5fec191f"],"/Users/marierajan/projects/cloudfriend/bin/build-template.js":["8abf5805-988a-4531-a74d-ac3f5fec191f"]},"externalIds":{}}
|
package/changelog.md
CHANGED
package/lib/shortcuts/api.md
CHANGED
|
@@ -222,8 +222,7 @@ Create a Glue table backed by Apache Iceberg format on S3.
|
|
|
222
222
|
| options.Name | <code>String</code> | | The name of the table. |
|
|
223
223
|
| options.DatabaseName | <code>String</code> | | The name of the database the table resides in. |
|
|
224
224
|
| options.Location | <code>String</code> | | The physical location of the table (S3 URI). Required. |
|
|
225
|
-
|
|
|
226
|
-
| [options.Schema] | <code>Object</code> | | Full Iceberg schema definition with Type: "struct" and Fields array. Either Columns or Schema must be provided. See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-icebergtableinput.html). |
|
|
225
|
+
| options.Schema | <code>Object</code> | | Full Iceberg schema definition with Type: "struct" and Fields array. Each field must have Id (integer), Name (string), Type (string or object for complex types), and Required (boolean). See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-icebergtableinput.html). |
|
|
227
226
|
| [options.PartitionSpec] | <code>Object</code> | | Iceberg partition specification. See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-partitionspec.html). |
|
|
228
227
|
| [options.WriteOrder] | <code>Object</code> | | Iceberg write order specification. See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-writeorder.html). |
|
|
229
228
|
| [options.CatalogId] | <code>String</code> | <code>AccountId</code> | The AWS account ID for the account in which to create the table. |
|
|
@@ -464,6 +463,7 @@ Log Group, a Role, an Alarm on function errors, and the Lambda Function itself.
|
|
|
464
463
|
| [options.ExtendedStatistic] | <code>String</code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-extendedstatistic)] |
|
|
465
464
|
| [options.OKActions] | <code>Array.<String></code> | | See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-okactions). |
|
|
466
465
|
| [options.LogRetentionInDays] | <code>Number</code> | <code>14</code> | How long to retain CloudWatch logs for this Lambda function. See [AWS Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) for allowed values. |
|
|
466
|
+
| [options.LogPolicyDeletionPolicy] | <code>String</code> | <code>'Delete'</code> | DeletionPolicy on the IAM Policy resource used to access Logs. See [AWS Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-attribute-deletionpolicy.html) for allowed values. |
|
|
467
467
|
|
|
468
468
|
**Example**
|
|
469
469
|
```js
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
* @param {String} options.Name - The name of the table.
|
|
9
9
|
* @param {String} options.DatabaseName - The name of the database the table resides in.
|
|
10
10
|
* @param {String} options.Location - The physical location of the table (S3 URI). Required.
|
|
11
|
-
* @param {
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* Either Columns or Schema must be provided. See [AWS
|
|
11
|
+
* @param {Object} options.Schema - Full Iceberg schema definition with Type: "struct" and Fields array.
|
|
12
|
+
* Each field must have Id (integer), Name (string), Type (string or object for complex types), and Required (boolean).
|
|
13
|
+
* See [AWS
|
|
15
14
|
* documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-icebergtableinput.html).
|
|
16
15
|
* @param {Object} [options.PartitionSpec] - Iceberg partition specification. See [AWS
|
|
17
16
|
* documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-partitionspec.html).
|
|
@@ -30,8 +29,6 @@
|
|
|
30
29
|
* @param {String} [options.OrphanFileDeletionRoleArn=undefined] - The ARN of the IAM role for the orphan file deletion optimizer. Required if EnableOrphanFileDeletion is true.
|
|
31
30
|
* @param {Number} [options.OrphanFileRetentionPeriodInDays=3] - The number of days to retain orphan files before deleting them.
|
|
32
31
|
* @param {String} [options.OrphanFileDeletionLocation=undefined] - The S3 location to scan for orphan files.
|
|
33
|
-
* @param {String} [options.Condition=undefined] - CloudFormation condition name.
|
|
34
|
-
* @param {String} [options.DependsOn=undefined] - CloudFormation resource dependency.
|
|
35
32
|
*/
|
|
36
33
|
class GlueIcebergTable {
|
|
37
34
|
constructor(options) {
|
|
@@ -41,7 +38,6 @@ class GlueIcebergTable {
|
|
|
41
38
|
Name,
|
|
42
39
|
DatabaseName,
|
|
43
40
|
Location,
|
|
44
|
-
Columns,
|
|
45
41
|
Schema,
|
|
46
42
|
PartitionSpec,
|
|
47
43
|
WriteOrder,
|
|
@@ -57,18 +53,13 @@ class GlueIcebergTable {
|
|
|
57
53
|
EnableOrphanFileDeletion = false,
|
|
58
54
|
OrphanFileDeletionRoleArn,
|
|
59
55
|
OrphanFileRetentionPeriodInDays = 3,
|
|
60
|
-
OrphanFileDeletionLocation
|
|
61
|
-
Condition,
|
|
62
|
-
DependsOn
|
|
56
|
+
OrphanFileDeletionLocation
|
|
63
57
|
} = options;
|
|
64
58
|
|
|
65
59
|
// Validate required fields
|
|
66
|
-
const required = [LogicalName, Name, DatabaseName, Location];
|
|
60
|
+
const required = [LogicalName, Name, DatabaseName, Location, Schema];
|
|
67
61
|
if (required.some((variable) => !variable))
|
|
68
|
-
throw new Error('You must provide a LogicalName, Name, DatabaseName, and
|
|
69
|
-
|
|
70
|
-
if (!Columns && !Schema)
|
|
71
|
-
throw new Error('You must provide either Columns or Schema');
|
|
62
|
+
throw new Error('You must provide a LogicalName, Name, DatabaseName, Location, and Schema');
|
|
72
63
|
|
|
73
64
|
if (EnableOptimizer && !OptimizerRoleArn)
|
|
74
65
|
throw new Error('You must provide an OptimizerRoleArn when EnableOptimizer is true');
|
|
@@ -79,26 +70,10 @@ class GlueIcebergTable {
|
|
|
79
70
|
if (EnableOrphanFileDeletion && !OrphanFileDeletionRoleArn)
|
|
80
71
|
throw new Error('You must provide an OrphanFileDeletionRoleArn when EnableOrphanFileDeletion is true');
|
|
81
72
|
|
|
82
|
-
// Convert simple Columns format to Iceberg Schema format if needed
|
|
83
|
-
let icebergSchema = Schema;
|
|
84
|
-
if (!Schema && Columns) {
|
|
85
|
-
icebergSchema = {
|
|
86
|
-
Type: 'struct',
|
|
87
|
-
Fields: Columns.map((col, index) => ({
|
|
88
|
-
Name: col.Name,
|
|
89
|
-
Type: col.Type,
|
|
90
|
-
Id: index + 1,
|
|
91
|
-
Required: col.Required !== undefined ? col.Required : true
|
|
92
|
-
}))
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
73
|
// Build the Iceberg table resource (no TableInput!)
|
|
97
74
|
this.Resources = {
|
|
98
75
|
[LogicalName]: {
|
|
99
76
|
Type: 'AWS::Glue::Table',
|
|
100
|
-
Condition,
|
|
101
|
-
DependsOn,
|
|
102
77
|
Properties: {
|
|
103
78
|
CatalogId,
|
|
104
79
|
DatabaseName,
|
|
@@ -109,7 +84,7 @@ class GlueIcebergTable {
|
|
|
109
84
|
Version: IcebergVersion,
|
|
110
85
|
IcebergTableInput: {
|
|
111
86
|
Location,
|
|
112
|
-
Schema
|
|
87
|
+
Schema
|
|
113
88
|
}
|
|
114
89
|
}
|
|
115
90
|
}
|
|
@@ -151,11 +126,6 @@ class GlueIcebergTable {
|
|
|
151
126
|
}
|
|
152
127
|
}
|
|
153
128
|
};
|
|
154
|
-
|
|
155
|
-
// Apply Condition to optimizer if specified on the table
|
|
156
|
-
if (Condition) {
|
|
157
|
-
this.Resources[optimizerLogicalName].Condition = Condition;
|
|
158
|
-
}
|
|
159
129
|
}
|
|
160
130
|
|
|
161
131
|
// Optionally add TableOptimizer for compaction
|
|
@@ -179,11 +149,6 @@ class GlueIcebergTable {
|
|
|
179
149
|
}
|
|
180
150
|
}
|
|
181
151
|
};
|
|
182
|
-
|
|
183
|
-
// Apply Condition to compaction optimizer if specified on the table
|
|
184
|
-
if (Condition) {
|
|
185
|
-
this.Resources[compactionLogicalName].Condition = Condition;
|
|
186
|
-
}
|
|
187
152
|
}
|
|
188
153
|
|
|
189
154
|
// Optionally add TableOptimizer for orphan file deletion
|
|
@@ -215,11 +180,6 @@ class GlueIcebergTable {
|
|
|
215
180
|
}
|
|
216
181
|
}
|
|
217
182
|
};
|
|
218
|
-
|
|
219
|
-
// Apply Condition to orphan file deletion optimizer if specified on the table
|
|
220
|
-
if (Condition) {
|
|
221
|
-
this.Resources[orphanLogicalName].Condition = Condition;
|
|
222
|
-
}
|
|
223
183
|
}
|
|
224
184
|
}
|
|
225
185
|
}
|
package/lib/shortcuts/lambda.js
CHANGED
|
@@ -48,7 +48,7 @@ const ServiceRole = require('./service-role');
|
|
|
48
48
|
* @param {String} [options.ExtendedStatistic=undefined] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-extendedstatistic)]
|
|
49
49
|
* @param {Array<String>} [options.OKActions=undefined] - See [AWS documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html#cfn-cloudwatch-alarms-okactions).
|
|
50
50
|
* @param {Number} [options.LogRetentionInDays=14] - How long to retain CloudWatch logs for this Lambda function. See [AWS Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) for allowed values.
|
|
51
|
-
*
|
|
51
|
+
* @param {String} [options.LogPolicyDeletionPolicy='Delete'] - DeletionPolicy on the IAM Policy resource used to access Logs. See [AWS Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-attribute-deletionpolicy.html) for allowed values.
|
|
52
52
|
* @example
|
|
53
53
|
* const cf = require('@mapbox/cloudfriend');
|
|
54
54
|
*
|
|
@@ -108,7 +108,8 @@ class Lambda {
|
|
|
108
108
|
EvaluateLowSampleCountPercentile,
|
|
109
109
|
ExtendedStatistic,
|
|
110
110
|
OKActions,
|
|
111
|
-
LogRetentionInDays = 14
|
|
111
|
+
LogRetentionInDays = 14,
|
|
112
|
+
LogPolicyDeletionPolicy = 'Delete'
|
|
112
113
|
} = options;
|
|
113
114
|
|
|
114
115
|
if (options.EvaluationPeriods < Math.ceil(Timeout / Period))
|
|
@@ -202,6 +203,7 @@ class Lambda {
|
|
|
202
203
|
Type: 'AWS::IAM::Policy',
|
|
203
204
|
Condition,
|
|
204
205
|
DependsOn: (RoleArn) ? undefined : `${LogicalName}Role`,
|
|
206
|
+
DeletionPolicy: LogPolicyDeletionPolicy,
|
|
205
207
|
Properties: {
|
|
206
208
|
PolicyName: `${LogicalName}-lambda-log-access`,
|
|
207
209
|
Roles: [roleName],
|
package/package.json
CHANGED
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"MyLambdaLogPolicy": {
|
|
87
87
|
"Type": "AWS::IAM::Policy",
|
|
88
88
|
"DependsOn": "MyLambdaRole",
|
|
89
|
+
"DeletionPolicy": "Delete",
|
|
89
90
|
"Properties": {
|
|
90
91
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
91
92
|
"Roles": [
|
|
@@ -197,4 +198,4 @@
|
|
|
197
198
|
}
|
|
198
199
|
},
|
|
199
200
|
"Outputs": {}
|
|
200
|
-
}
|
|
201
|
+
}
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"MyLambdaLogPolicy": {
|
|
87
87
|
"Type": "AWS::IAM::Policy",
|
|
88
88
|
"DependsOn": "MyLambdaRole",
|
|
89
|
+
"DeletionPolicy": "Delete",
|
|
89
90
|
"Properties": {
|
|
90
91
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
91
92
|
"Roles": [
|
|
@@ -196,4 +197,4 @@
|
|
|
196
197
|
}
|
|
197
198
|
},
|
|
198
199
|
"Outputs": {}
|
|
199
|
-
}
|
|
200
|
+
}
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"MyLambdaLogPolicy": {
|
|
87
87
|
"Type": "AWS::IAM::Policy",
|
|
88
88
|
"DependsOn": "MyLambdaRole",
|
|
89
|
+
"DeletionPolicy": "Delete",
|
|
89
90
|
"Properties": {
|
|
90
91
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
91
92
|
"Roles": [
|
|
@@ -196,4 +197,4 @@
|
|
|
196
197
|
}
|
|
197
198
|
},
|
|
198
199
|
"Outputs": {}
|
|
199
|
-
}
|
|
200
|
+
}
|
|
@@ -224,6 +224,7 @@
|
|
|
224
224
|
"PassFunctionLogPolicy": {
|
|
225
225
|
"Type": "AWS::IAM::Policy",
|
|
226
226
|
"DependsOn": "PassFunctionRole",
|
|
227
|
+
"DeletionPolicy": "Delete",
|
|
227
228
|
"Properties": {
|
|
228
229
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
229
230
|
"Roles": [
|
|
@@ -365,6 +366,7 @@
|
|
|
365
366
|
"DestinationLogPolicy": {
|
|
366
367
|
"Type": "AWS::IAM::Policy",
|
|
367
368
|
"DependsOn": "DestinationRole",
|
|
369
|
+
"DeletionPolicy": "Delete",
|
|
368
370
|
"Properties": {
|
|
369
371
|
"PolicyName": "Destination-lambda-log-access",
|
|
370
372
|
"Roles": [
|
|
@@ -420,4 +422,4 @@
|
|
|
420
422
|
"Value": "abc123"
|
|
421
423
|
}
|
|
422
424
|
}
|
|
423
|
-
}
|
|
425
|
+
}
|
|
@@ -230,6 +230,7 @@
|
|
|
230
230
|
"PassFunctionLogPolicy": {
|
|
231
231
|
"Type": "AWS::IAM::Policy",
|
|
232
232
|
"DependsOn": "PassFunctionRole",
|
|
233
|
+
"DeletionPolicy": "Delete",
|
|
233
234
|
"Properties": {
|
|
234
235
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
235
236
|
"Roles": [
|
|
@@ -371,6 +372,7 @@
|
|
|
371
372
|
"DestinationLogPolicy": {
|
|
372
373
|
"Type": "AWS::IAM::Policy",
|
|
373
374
|
"DependsOn": "DestinationRole",
|
|
375
|
+
"DeletionPolicy": "Delete",
|
|
374
376
|
"Properties": {
|
|
375
377
|
"PolicyName": "Destination-lambda-log-access",
|
|
376
378
|
"Roles": [
|
|
@@ -428,4 +430,4 @@
|
|
|
428
430
|
}
|
|
429
431
|
}
|
|
430
432
|
}
|
|
431
|
-
}
|
|
433
|
+
}
|
|
@@ -224,6 +224,7 @@
|
|
|
224
224
|
"PassFunctionLogPolicy": {
|
|
225
225
|
"Type": "AWS::IAM::Policy",
|
|
226
226
|
"DependsOn": "PassFunctionRole",
|
|
227
|
+
"DeletionPolicy": "Delete",
|
|
227
228
|
"Properties": {
|
|
228
229
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
229
230
|
"Roles": [
|
|
@@ -365,6 +366,7 @@
|
|
|
365
366
|
"DestinationLogPolicy": {
|
|
366
367
|
"Type": "AWS::IAM::Policy",
|
|
367
368
|
"DependsOn": "DestinationRole",
|
|
369
|
+
"DeletionPolicy": "Delete",
|
|
368
370
|
"Properties": {
|
|
369
371
|
"PolicyName": "Destination-lambda-log-access",
|
|
370
372
|
"Roles": [
|
|
@@ -420,4 +422,4 @@
|
|
|
420
422
|
"Value": "abc123"
|
|
421
423
|
}
|
|
422
424
|
}
|
|
423
|
-
}
|
|
425
|
+
}
|
|
@@ -232,6 +232,7 @@
|
|
|
232
232
|
"PassFunctionLogPolicy": {
|
|
233
233
|
"Type": "AWS::IAM::Policy",
|
|
234
234
|
"DependsOn": "PassFunctionRole",
|
|
235
|
+
"DeletionPolicy": "Delete",
|
|
235
236
|
"Properties": {
|
|
236
237
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
237
238
|
"Roles": [
|
|
@@ -373,6 +374,7 @@
|
|
|
373
374
|
"DestinationLogPolicy": {
|
|
374
375
|
"Type": "AWS::IAM::Policy",
|
|
375
376
|
"DependsOn": "DestinationRole",
|
|
377
|
+
"DeletionPolicy": "Delete",
|
|
376
378
|
"Properties": {
|
|
377
379
|
"PolicyName": "Destination-lambda-log-access",
|
|
378
380
|
"Roles": [
|
|
@@ -430,4 +432,4 @@
|
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
}
|
|
433
|
-
}
|
|
435
|
+
}
|
|
@@ -228,6 +228,7 @@
|
|
|
228
228
|
"PassFunctionLogPolicy": {
|
|
229
229
|
"Type": "AWS::IAM::Policy",
|
|
230
230
|
"DependsOn": "PassFunctionRole",
|
|
231
|
+
"DeletionPolicy": "Delete",
|
|
231
232
|
"Properties": {
|
|
232
233
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
233
234
|
"Roles": [
|
|
@@ -369,6 +370,7 @@
|
|
|
369
370
|
"DestinationLogPolicy": {
|
|
370
371
|
"Type": "AWS::IAM::Policy",
|
|
371
372
|
"DependsOn": "DestinationRole",
|
|
373
|
+
"DeletionPolicy": "Delete",
|
|
372
374
|
"Properties": {
|
|
373
375
|
"PolicyName": "Destination-lambda-log-access",
|
|
374
376
|
"Roles": [
|
|
@@ -426,4 +428,4 @@
|
|
|
426
428
|
}
|
|
427
429
|
}
|
|
428
430
|
}
|
|
429
|
-
}
|
|
431
|
+
}
|
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"PassFunctionLogPolicy": {
|
|
213
213
|
"Type": "AWS::IAM::Policy",
|
|
214
214
|
"DependsOn": "PassFunctionRole",
|
|
215
|
+
"DeletionPolicy": "Delete",
|
|
215
216
|
"Properties": {
|
|
216
217
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
217
218
|
"Roles": [
|
|
@@ -353,6 +354,7 @@
|
|
|
353
354
|
"DestinationLogPolicy": {
|
|
354
355
|
"Type": "AWS::IAM::Policy",
|
|
355
356
|
"DependsOn": "DestinationRole",
|
|
357
|
+
"DeletionPolicy": "Delete",
|
|
356
358
|
"Properties": {
|
|
357
359
|
"PolicyName": "Destination-lambda-log-access",
|
|
358
360
|
"Roles": [
|
|
@@ -410,4 +412,4 @@
|
|
|
410
412
|
}
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
|
-
}
|
|
415
|
+
}
|
|
@@ -210,6 +210,7 @@
|
|
|
210
210
|
"PassFunctionLogPolicy": {
|
|
211
211
|
"Type": "AWS::IAM::Policy",
|
|
212
212
|
"DependsOn": "PassFunctionRole",
|
|
213
|
+
"DeletionPolicy": "Delete",
|
|
213
214
|
"Properties": {
|
|
214
215
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
215
216
|
"Roles": [
|
|
@@ -351,6 +352,7 @@
|
|
|
351
352
|
"DestinationLogPolicy": {
|
|
352
353
|
"Type": "AWS::IAM::Policy",
|
|
353
354
|
"DependsOn": "DestinationRole",
|
|
355
|
+
"DeletionPolicy": "Delete",
|
|
354
356
|
"Properties": {
|
|
355
357
|
"PolicyName": "Destination-lambda-log-access",
|
|
356
358
|
"Roles": [
|
|
@@ -408,4 +410,4 @@
|
|
|
408
410
|
}
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
|
-
}
|
|
413
|
+
}
|
|
@@ -210,6 +210,7 @@
|
|
|
210
210
|
"PassFunctionLogPolicy": {
|
|
211
211
|
"Type": "AWS::IAM::Policy",
|
|
212
212
|
"DependsOn": "PassFunctionRole",
|
|
213
|
+
"DeletionPolicy": "Delete",
|
|
213
214
|
"Properties": {
|
|
214
215
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
215
216
|
"Roles": [
|
|
@@ -351,6 +352,7 @@
|
|
|
351
352
|
"DestinationLogPolicy": {
|
|
352
353
|
"Type": "AWS::IAM::Policy",
|
|
353
354
|
"DependsOn": "DestinationRole",
|
|
355
|
+
"DeletionPolicy": "Delete",
|
|
354
356
|
"Properties": {
|
|
355
357
|
"PolicyName": "Destination-lambda-log-access",
|
|
356
358
|
"Roles": [
|
|
@@ -408,4 +410,4 @@
|
|
|
408
410
|
}
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
|
-
}
|
|
413
|
+
}
|
|
@@ -210,6 +210,7 @@
|
|
|
210
210
|
"PassFunctionLogPolicy": {
|
|
211
211
|
"Type": "AWS::IAM::Policy",
|
|
212
212
|
"DependsOn": "PassFunctionRole",
|
|
213
|
+
"DeletionPolicy": "Delete",
|
|
213
214
|
"Properties": {
|
|
214
215
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
215
216
|
"Roles": [
|
|
@@ -351,6 +352,7 @@
|
|
|
351
352
|
"DestinationLogPolicy": {
|
|
352
353
|
"Type": "AWS::IAM::Policy",
|
|
353
354
|
"DependsOn": "DestinationRole",
|
|
355
|
+
"DeletionPolicy": "Delete",
|
|
354
356
|
"Properties": {
|
|
355
357
|
"PolicyName": "Destination-lambda-log-access",
|
|
356
358
|
"Roles": [
|
|
@@ -408,4 +410,4 @@
|
|
|
408
410
|
}
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
|
-
}
|
|
413
|
+
}
|
|
@@ -210,6 +210,7 @@
|
|
|
210
210
|
"PassFunctionLogPolicy": {
|
|
211
211
|
"Type": "AWS::IAM::Policy",
|
|
212
212
|
"DependsOn": "PassFunctionRole",
|
|
213
|
+
"DeletionPolicy": "Delete",
|
|
213
214
|
"Properties": {
|
|
214
215
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
215
216
|
"Roles": [
|
|
@@ -351,6 +352,7 @@
|
|
|
351
352
|
"DestinationLogPolicy": {
|
|
352
353
|
"Type": "AWS::IAM::Policy",
|
|
353
354
|
"DependsOn": "DestinationRole",
|
|
355
|
+
"DeletionPolicy": "Delete",
|
|
354
356
|
"Properties": {
|
|
355
357
|
"PolicyName": "Destination-lambda-log-access",
|
|
356
358
|
"Roles": [
|
|
@@ -408,4 +410,4 @@
|
|
|
408
410
|
}
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
|
-
}
|
|
413
|
+
}
|
|
@@ -210,6 +210,7 @@
|
|
|
210
210
|
"PassFunctionLogPolicy": {
|
|
211
211
|
"Type": "AWS::IAM::Policy",
|
|
212
212
|
"DependsOn": "PassFunctionRole",
|
|
213
|
+
"DeletionPolicy": "Delete",
|
|
213
214
|
"Properties": {
|
|
214
215
|
"PolicyName": "PassFunction-lambda-log-access",
|
|
215
216
|
"Roles": [
|
|
@@ -351,6 +352,7 @@
|
|
|
351
352
|
"DestinationLogPolicy": {
|
|
352
353
|
"Type": "AWS::IAM::Policy",
|
|
353
354
|
"DependsOn": "DestinationRole",
|
|
355
|
+
"DeletionPolicy": "Delete",
|
|
354
356
|
"Properties": {
|
|
355
357
|
"PolicyName": "Destination-lambda-log-access",
|
|
356
358
|
"Roles": [
|
|
@@ -408,4 +410,4 @@
|
|
|
408
410
|
}
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
|
-
}
|
|
413
|
+
}
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"MyLambdaLogPolicy": {
|
|
87
87
|
"Type": "AWS::IAM::Policy",
|
|
88
88
|
"DependsOn": "MyLambdaRole",
|
|
89
|
+
"DeletionPolicy": "Delete",
|
|
89
90
|
"Properties": {
|
|
90
91
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
91
92
|
"Roles": [
|
|
@@ -130,4 +131,4 @@
|
|
|
130
131
|
}
|
|
131
132
|
},
|
|
132
133
|
"Outputs": {}
|
|
133
|
-
}
|
|
134
|
+
}
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"MyLambdaLogPolicy": {
|
|
85
85
|
"Type": "AWS::IAM::Policy",
|
|
86
86
|
"DependsOn": "MyLambdaRole",
|
|
87
|
+
"DeletionPolicy": "Delete",
|
|
87
88
|
"Properties": {
|
|
88
89
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
89
90
|
"Roles": [
|
|
@@ -128,4 +129,4 @@
|
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
"Outputs": {}
|
|
131
|
-
}
|
|
132
|
+
}
|
|
@@ -120,6 +120,7 @@
|
|
|
120
120
|
"Type": "AWS::IAM::Policy",
|
|
121
121
|
"Condition": "Always",
|
|
122
122
|
"DependsOn": "MyLambdaRole",
|
|
123
|
+
"DeletionPolicy": "Delete",
|
|
123
124
|
"Properties": {
|
|
124
125
|
"PolicyName": "MyLambda-lambda-log-access",
|
|
125
126
|
"Roles": [
|
|
@@ -180,4 +181,4 @@
|
|
|
180
181
|
}
|
|
181
182
|
},
|
|
182
183
|
"Outputs": {}
|
|
183
|
-
}
|
|
184
|
+
}
|