eoapi-cdk 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/.jsii +594 -26
  2. package/lib/bastion-host/index.js +1 -1
  3. package/lib/database/PgBouncer.js +2 -2
  4. package/lib/database/index.d.ts +1 -0
  5. package/lib/database/index.js +5 -5
  6. package/lib/database/pgbouncer-setup.sh +6 -2
  7. package/lib/index.d.ts +2 -0
  8. package/lib/index.js +3 -1
  9. package/lib/ingestor-api/index.js +1 -1
  10. package/lib/stac-api/index.js +1 -1
  11. package/lib/stac-browser/index.js +1 -1
  12. package/lib/stac-item-loader/index.d.ts +322 -0
  13. package/lib/stac-item-loader/index.js +251 -0
  14. package/lib/stac-item-loader/runtime/Dockerfile +18 -0
  15. package/lib/stac-item-loader/runtime/pyproject.toml +17 -0
  16. package/lib/stac-item-loader/runtime/src/stac_item_loader/handler.py +241 -0
  17. package/lib/stactools-item-generator/index.d.ts +243 -0
  18. package/lib/stactools-item-generator/index.js +204 -0
  19. package/lib/stactools-item-generator/runtime/Dockerfile +20 -0
  20. package/lib/stactools-item-generator/runtime/pyproject.toml +16 -0
  21. package/lib/stactools-item-generator/runtime/src/stactools_item_generator/__init__.py +2 -0
  22. package/lib/stactools-item-generator/runtime/src/stactools_item_generator/handler.py +176 -0
  23. package/lib/stactools-item-generator/runtime/src/stactools_item_generator/item.py +77 -0
  24. package/lib/tipg-api/index.js +1 -1
  25. package/lib/titiler-pgstac-api/index.js +1 -1
  26. package/package.json +1 -1
  27. package/pyproject.toml +45 -0
  28. package/uv.lock +1065 -0
  29. package/.devcontainer/devcontainer.json +0 -4
  30. package/.github/pull_request_template.md +0 -4
  31. package/.github/workflows/build.yaml +0 -73
  32. package/.github/workflows/build_and_release.yaml +0 -13
  33. package/.github/workflows/conventional-pr.yaml +0 -26
  34. package/.github/workflows/deploy.yaml +0 -84
  35. package/.github/workflows/distribute.yaml +0 -46
  36. package/.github/workflows/docs.yaml +0 -26
  37. package/.github/workflows/lint.yaml +0 -26
  38. package/.github/workflows/tox.yaml +0 -26
  39. package/.nvmrc +0 -1
  40. package/.pre-commit-config.yaml +0 -23
  41. package/CHANGELOG.md +0 -464
  42. package/diagrams/bastion_diagram.excalidraw +0 -1416
  43. package/diagrams/bastion_diagram.png +0 -0
  44. package/diagrams/ingestor_diagram.excalidraw +0 -2274
  45. package/diagrams/ingestor_diagram.png +0 -0
  46. package/integration_tests/cdk/README.md +0 -55
  47. package/integration_tests/cdk/app.py +0 -186
  48. package/integration_tests/cdk/cdk.json +0 -32
  49. package/integration_tests/cdk/config.py +0 -52
  50. package/integration_tests/cdk/package-lock.json +0 -42
  51. package/integration_tests/cdk/package.json +0 -7
  52. package/integration_tests/cdk/requirements.txt +0 -7
  53. package/lib/database/lambda/package-lock.json +0 -1324
  54. package/lib/ingestor-api/runtime/tests/conftest.py +0 -270
  55. package/lib/ingestor-api/runtime/tests/test_collection.py +0 -87
  56. package/lib/ingestor-api/runtime/tests/test_collection_endpoint.py +0 -41
  57. package/lib/ingestor-api/runtime/tests/test_ingestor.py +0 -60
  58. package/lib/ingestor-api/runtime/tests/test_registration.py +0 -207
  59. package/lib/ingestor-api/runtime/tests/test_utils.py +0 -35
  60. package/lib/ingestor-api/runtime/tests/test_validators.py +0 -164
  61. package/ruff.toml +0 -23
  62. package/tox.ini +0 -16
  63. package/tsconfig.tsbuildinfo +0 -1
  64. /package/lib/{ingestor-api/runtime/tests → stac-item-loader/runtime/src/stac_item_loader}/__init__.py +0 -0
package/.jsii CHANGED
@@ -4170,7 +4170,7 @@
4170
4170
  "kind": "interface",
4171
4171
  "locationInModule": {
4172
4172
  "filename": "lib/database/index.ts",
4173
- "line": 292
4173
+ "line": 295
4174
4174
  },
4175
4175
  "name": "DatabaseParameters",
4176
4176
  "properties": [
@@ -4183,7 +4183,7 @@
4183
4183
  "immutable": true,
4184
4184
  "locationInModule": {
4185
4185
  "filename": "lib/database/index.ts",
4186
- "line": 308
4186
+ "line": 311
4187
4187
  },
4188
4188
  "name": "effectiveCacheSize",
4189
4189
  "type": {
@@ -4199,7 +4199,7 @@
4199
4199
  "immutable": true,
4200
4200
  "locationInModule": {
4201
4201
  "filename": "lib/database/index.ts",
4202
- "line": 318
4202
+ "line": 321
4203
4203
  },
4204
4204
  "name": "maintenanceWorkMem",
4205
4205
  "type": {
@@ -4215,7 +4215,7 @@
4215
4215
  "immutable": true,
4216
4216
  "locationInModule": {
4217
4217
  "filename": "lib/database/index.ts",
4218
- "line": 296
4218
+ "line": 299
4219
4219
  },
4220
4220
  "name": "maxConnections",
4221
4221
  "type": {
@@ -4231,7 +4231,7 @@
4231
4231
  "immutable": true,
4232
4232
  "locationInModule": {
4233
4233
  "filename": "lib/database/index.ts",
4234
- "line": 323
4234
+ "line": 326
4235
4235
  },
4236
4236
  "name": "maxLocksPerTransaction",
4237
4237
  "type": {
@@ -4247,7 +4247,7 @@
4247
4247
  "immutable": true,
4248
4248
  "locationInModule": {
4249
4249
  "filename": "lib/database/index.ts",
4250
- "line": 338
4250
+ "line": 341
4251
4251
  },
4252
4252
  "name": "randomPageCost",
4253
4253
  "type": {
@@ -4263,7 +4263,7 @@
4263
4263
  "immutable": true,
4264
4264
  "locationInModule": {
4265
4265
  "filename": "lib/database/index.ts",
4266
- "line": 333
4266
+ "line": 336
4267
4267
  },
4268
4268
  "name": "seqPageCost",
4269
4269
  "type": {
@@ -4280,7 +4280,7 @@
4280
4280
  "immutable": true,
4281
4281
  "locationInModule": {
4282
4282
  "filename": "lib/database/index.ts",
4283
- "line": 303
4283
+ "line": 306
4284
4284
  },
4285
4285
  "name": "sharedBuffers",
4286
4286
  "type": {
@@ -4296,7 +4296,7 @@
4296
4296
  "immutable": true,
4297
4297
  "locationInModule": {
4298
4298
  "filename": "lib/database/index.ts",
4299
- "line": 328
4299
+ "line": 331
4300
4300
  },
4301
4301
  "name": "tempBuffers",
4302
4302
  "type": {
@@ -4312,7 +4312,7 @@
4312
4312
  "immutable": true,
4313
4313
  "locationInModule": {
4314
4314
  "filename": "lib/database/index.ts",
4315
- "line": 313
4315
+ "line": 316
4316
4316
  },
4317
4317
  "name": "workMem",
4318
4318
  "type": {
@@ -4582,7 +4582,7 @@
4582
4582
  },
4583
4583
  "locationInModule": {
4584
4584
  "filename": "lib/database/index.ts",
4585
- "line": 43
4585
+ "line": 44
4586
4586
  },
4587
4587
  "parameters": [
4588
4588
  {
@@ -4617,7 +4617,7 @@
4617
4617
  },
4618
4618
  "locationInModule": {
4619
4619
  "filename": "lib/database/index.ts",
4620
- "line": 191
4620
+ "line": 194
4621
4621
  },
4622
4622
  "name": "getParameters",
4623
4623
  "parameters": [
@@ -4656,7 +4656,7 @@
4656
4656
  "immutable": true,
4657
4657
  "locationInModule": {
4658
4658
  "filename": "lib/database/index.ts",
4659
- "line": 39
4659
+ "line": 40
4660
4660
  },
4661
4661
  "name": "connectionTarget",
4662
4662
  "type": {
@@ -4679,7 +4679,21 @@
4679
4679
  "immutable": true,
4680
4680
  "locationInModule": {
4681
4681
  "filename": "lib/database/index.ts",
4682
- "line": 41
4682
+ "line": 39
4683
+ },
4684
+ "name": "pgstacVersion",
4685
+ "type": {
4686
+ "primitive": "string"
4687
+ }
4688
+ },
4689
+ {
4690
+ "docs": {
4691
+ "stability": "experimental"
4692
+ },
4693
+ "immutable": true,
4694
+ "locationInModule": {
4695
+ "filename": "lib/database/index.ts",
4696
+ "line": 42
4683
4697
  },
4684
4698
  "name": "secretBootstrapper",
4685
4699
  "optional": true,
@@ -4694,7 +4708,7 @@
4694
4708
  "immutable": true,
4695
4709
  "locationInModule": {
4696
4710
  "filename": "lib/database/index.ts",
4697
- "line": 40
4711
+ "line": 41
4698
4712
  },
4699
4713
  "name": "securityGroup",
4700
4714
  "optional": true,
@@ -4744,7 +4758,7 @@
4744
4758
  "kind": "interface",
4745
4759
  "locationInModule": {
4746
4760
  "filename": "lib/database/index.ts",
4747
- "line": 231
4761
+ "line": 234
4748
4762
  },
4749
4763
  "name": "PgStacDatabaseProps",
4750
4764
  "properties": [
@@ -4758,7 +4772,7 @@
4758
4772
  "immutable": true,
4759
4773
  "locationInModule": {
4760
4774
  "filename": "lib/database/index.ts",
4761
- "line": 265
4775
+ "line": 268
4762
4776
  },
4763
4777
  "name": "addPgbouncer",
4764
4778
  "optional": true,
@@ -4776,7 +4790,7 @@
4776
4790
  "immutable": true,
4777
4791
  "locationInModule": {
4778
4792
  "filename": "lib/database/index.ts",
4779
- "line": 289
4793
+ "line": 292
4780
4794
  },
4781
4795
  "name": "bootstrapperLambdaFunctionOptions",
4782
4796
  "optional": true,
@@ -4794,7 +4808,7 @@
4794
4808
  "immutable": true,
4795
4809
  "locationInModule": {
4796
4810
  "filename": "lib/database/index.ts",
4797
- "line": 280
4811
+ "line": 283
4798
4812
  },
4799
4813
  "name": "customResourceProperties",
4800
4814
  "optional": true,
@@ -4817,7 +4831,7 @@
4817
4831
  "immutable": true,
4818
4832
  "locationInModule": {
4819
4833
  "filename": "lib/database/index.ts",
4820
- "line": 272
4834
+ "line": 275
4821
4835
  },
4822
4836
  "name": "pgbouncerInstanceProps",
4823
4837
  "optional": true,
@@ -4835,7 +4849,7 @@
4835
4849
  "immutable": true,
4836
4850
  "locationInModule": {
4837
4851
  "filename": "lib/database/index.ts",
4838
- "line": 237
4852
+ "line": 240
4839
4853
  },
4840
4854
  "name": "pgstacDbName",
4841
4855
  "optional": true,
@@ -4853,7 +4867,7 @@
4853
4867
  "immutable": true,
4854
4868
  "locationInModule": {
4855
4869
  "filename": "lib/database/index.ts",
4856
- "line": 258
4870
+ "line": 261
4857
4871
  },
4858
4872
  "name": "pgstacUsername",
4859
4873
  "optional": true,
@@ -4871,7 +4885,7 @@
4871
4885
  "immutable": true,
4872
4886
  "locationInModule": {
4873
4887
  "filename": "lib/database/index.ts",
4874
- "line": 244
4888
+ "line": 247
4875
4889
  },
4876
4890
  "name": "pgstacVersion",
4877
4891
  "optional": true,
@@ -4889,7 +4903,7 @@
4889
4903
  "immutable": true,
4890
4904
  "locationInModule": {
4891
4905
  "filename": "lib/database/index.ts",
4892
- "line": 251
4906
+ "line": 254
4893
4907
  },
4894
4908
  "name": "secretsPrefix",
4895
4909
  "optional": true,
@@ -5444,6 +5458,560 @@
5444
5458
  ],
5445
5459
  "symbolId": "lib/ingestor-api/index:StacIngestorProps"
5446
5460
  },
5461
+ "eoapi-cdk.StacItemLoader": {
5462
+ "assembly": "eoapi-cdk",
5463
+ "base": "constructs.Construct",
5464
+ "docs": {
5465
+ "remarks": "The StacItemLoader creates a serverless, event-driven system for loading\nSTAC (SpatioTemporal Asset Catalog) items into a PostgreSQL database with\nthe pgstac extension. This construct supports multiple ingestion pathways\nfor flexible STAC item loading.\n\n## Architecture Overview\n\nThis construct creates the following AWS resources:\n- **SNS Topic**: Entry point for STAC items and S3 event notifications\n- **SQS Queue**: Buffers and batches messages before processing (60-second visibility timeout)\n- **Dead Letter Queue**: Captures failed loading attempts after 5 retries\n- **Lambda Function**: Python function that processes batches and inserts items into pgstac\n\n## Data Flow\n\nThe loader supports two primary data ingestion patterns:\n\n### Direct STAC Item Publishing\n1. STAC items (JSON) are published directly to the SNS topic in message bodies\n2. The SQS queue collects messages and batches them (up to {batchSize} items or 1 minute window)\n3. The Lambda function receives batches, validates items, and inserts into pgstac\n\n### S3 Event-Driven Loading\n1. An S3 bucket is configured to send notifications to the SNS topic when json files are created\n2. STAC items are uploaded to S3 buckets as JSON/GeoJSON files\n3. S3 event notifications are sent to the SNS topic when items are uploaded\n4. The Lambda function receives S3 events in the SQS message batch, fetches items from S3, and loads into pgstac\n\n## Batching Behavior\n\nThe SQS-to-Lambda integration uses intelligent batching to optimize performance:\n\n- **Batch Size**: Lambda waits to receive up to `batchSize` messages (default: 500)\n- **Batching Window**: If fewer than `batchSize` messages are available, Lambda\n triggers after `maxBatchingWindow` minutes (default: 1 minute)\n- **Trigger Condition**: Lambda executes when EITHER condition is met first\n- **Concurrency**: Limited to `maxConcurrency` concurrent executions to prevent database overload\n- **Partial Failures**: Uses `reportBatchItemFailures` to retry only failed items\n\nThis approach balances throughput (larger batches = fewer database connections)\nwith latency (time-based triggers prevent indefinite waiting).\n\n## Error Handling and Dead Letter Queue\n\nFailed messages are sent to the dead letter queue after 5 processing attempts.\n**Important**: This construct provides NO automated handling of dead letter queue\nmessages - monitoring, inspection, and reprocessing of failed items is the\nresponsibility of the implementing application.\n\nConsider implementing:\n- CloudWatch alarms on dead letter queue depth\n- Manual or automated reprocessing workflows\n- Logging and alerting for failed items\n- Regular cleanup of old dead letter messages (14-day retention)\n\n## Operational Characteristics\n\n- **Scalability**: Lambda scales automatically based on queue depth\n- **Reliability**: Dead letter queue captures failures for debugging\n- **Efficiency**: Batching optimizes database operations for high throughput\n- **Security**: Database credentials accessed via AWS Secrets Manager\n- **Observability**: CloudWatch logs retained for one week\n\n## Prerequisites\n\nBefore using this construct, ensure:\n- The pgstac database has collections loaded (items require existing collection IDs)\n- Database credentials are stored in AWS Secrets Manager\n- The pgstac extension is properly installed and configured\n\n## Usage Example\n\n```typescript\n// Create database first\nconst database = new PgStacDatabase(this, 'Database', {\n pgstacVersion: '0.9.5'\n});\n\n// Create item loader\nconst loader = new StacItemLoader(this, 'ItemLoader', {\n pgstacDb: database,\n batchSize: 1000, // Process up to 1000 items per batch\n maxBatchingWindowMinutes: 1, // Wait max 1 minute to fill batch\n lambdaTimeoutSeconds: 300 // Allow up to 300 seconds for database operations\n});\n\n// The topic ARN can be used by other services to publish items\nnew CfnOutput(this, 'LoaderTopicArn', {\n value: loader.topic.topicArn\n});\n```\n\n## Direct Item Publishing\n\nExternal services can publish STAC items directly to the topic:\n\n```bash\naws sns publish --topic-arn $ITEM_LOAD_TOPIC --message '{\n \"type\": \"Feature\",\n \"stac_version\": \"1.0.0\",\n \"id\": \"example-item\",\n \"properties\": {\"datetime\": \"2021-01-01T00:00:00Z\"},\n \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [...]},\n \"collection\": \"example-collection\"\n}'\n```\n\n## S3 Event Configuration\n\nTo enable S3 event-driven loading, configure S3 bucket notifications to send\nevents to the SNS topic when STAC items (.json or .geojson files) are uploaded:\n\n```typescript\n// Configure S3 bucket to send notifications to the loader topic\nbucket.addEventNotification(\n s3.EventType.OBJECT_CREATED,\n new s3n.SnsDestination(loader.topic),\n { suffix: '.json' }\n);\n\nbucket.addEventNotification(\n s3.EventType.OBJECT_CREATED,\n new s3n.SnsDestination(loader.topic),\n { suffix: '.geojson' }\n);\n```\n\nWhen STAC items are uploaded to the configured S3 bucket, the loader will:\n1. Receive S3 event notifications via SNS\n2. Fetch the STAC item JSON from S3\n3. Validate and load the item into the pgstac database\n\n## Monitoring and Troubleshooting\n\n- Monitor Lambda logs: `/aws/lambda/{FunctionName}`\n- **Dead Letter Queue**: Check for failed items - **no automated handling provided**\n- Use batch item failure reporting for partial batch processing\n- CloudWatch metrics available for queue depth and Lambda performance\n\n### Dead Letter Queue Management\n\nApplications must implement their own dead letter queue monitoring:\n\n```typescript\n// Example: CloudWatch alarm for dead letter queue depth\nnew cloudwatch.Alarm(this, 'DeadLetterAlarm', {\n metric: loader.deadLetterQueue.metricApproximateNumberOfVisibleMessages(),\n threshold: 1,\n evaluationPeriods: 1\n});\n\n// Example: Lambda to reprocess dead letter messages\nconst reprocessFunction = new lambda.Function(this, 'Reprocess', {\n // Implementation to fetch and republish failed messages\n});\n```",
5466
+ "stability": "experimental",
5467
+ "summary": "AWS CDK Construct for STAC Item Loading Infrastructure."
5468
+ },
5469
+ "fqn": "eoapi-cdk.StacItemLoader",
5470
+ "initializer": {
5471
+ "docs": {
5472
+ "stability": "experimental"
5473
+ },
5474
+ "locationInModule": {
5475
+ "filename": "lib/stac-item-loader/index.ts",
5476
+ "line": 342
5477
+ },
5478
+ "parameters": [
5479
+ {
5480
+ "name": "scope",
5481
+ "type": {
5482
+ "fqn": "constructs.Construct"
5483
+ }
5484
+ },
5485
+ {
5486
+ "name": "id",
5487
+ "type": {
5488
+ "primitive": "string"
5489
+ }
5490
+ },
5491
+ {
5492
+ "name": "props",
5493
+ "type": {
5494
+ "fqn": "eoapi-cdk.StacItemLoaderProps"
5495
+ }
5496
+ }
5497
+ ]
5498
+ },
5499
+ "kind": "class",
5500
+ "locationInModule": {
5501
+ "filename": "lib/stac-item-loader/index.ts",
5502
+ "line": 290
5503
+ },
5504
+ "name": "StacItemLoader",
5505
+ "properties": [
5506
+ {
5507
+ "docs": {
5508
+ "remarks": "Messages that fail processing after 5 attempts are sent here\nfor inspection and potential replay. Retains messages for 14 days\nto allow for debugging and manual intervention.\n\n**User Responsibility**: This construct provides NO automated monitoring,\nalerting, or reprocessing of dead letter queue messages. Applications\nusing this construct must implement their own:\n- Dead letter queue depth monitoring and alerting\n- Failed message inspection and debugging workflows\n- Manual or automated reprocessing mechanisms\n- Cleanup procedures for old failed messages",
5509
+ "stability": "experimental",
5510
+ "summary": "Dead letter queue for failed item loading attempts."
5511
+ },
5512
+ "immutable": true,
5513
+ "locationInModule": {
5514
+ "filename": "lib/stac-item-loader/index.ts",
5515
+ "line": 327
5516
+ },
5517
+ "name": "deadLetterQueue",
5518
+ "type": {
5519
+ "fqn": "aws-cdk-lib.aws_sqs.Queue"
5520
+ }
5521
+ },
5522
+ {
5523
+ "docs": {
5524
+ "remarks": "This Python function receives batches of messages from SQS and processes\nthem based on their type:\n- Direct STAC items: Validates and loads directly into pgstac\n- S3 events: Fetches STAC items from S3, validates, and loads into pgstac\n\nThe function connects to PostgreSQL using credentials from Secrets Manager\nand uses pypgstac for efficient database operations.",
5525
+ "stability": "experimental",
5526
+ "summary": "The Lambda function that loads STAC items into the pgstac database."
5527
+ },
5528
+ "immutable": true,
5529
+ "locationInModule": {
5530
+ "filename": "lib/stac-item-loader/index.ts",
5531
+ "line": 340
5532
+ },
5533
+ "name": "lambdaFunction",
5534
+ "type": {
5535
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
5536
+ }
5537
+ },
5538
+ {
5539
+ "docs": {
5540
+ "remarks": "This queue collects both direct STAC items from SNS and S3 event\nnotifications, batching them for efficient database operations.\nConfigured with a visibility timeout that accommodates Lambda\nprocessing time plus buffer.",
5541
+ "stability": "experimental",
5542
+ "summary": "The SQS queue that buffers messages before processing."
5543
+ },
5544
+ "immutable": true,
5545
+ "locationInModule": {
5546
+ "filename": "lib/stac-item-loader/index.ts",
5547
+ "line": 310
5548
+ },
5549
+ "name": "queue",
5550
+ "type": {
5551
+ "fqn": "aws-cdk-lib.aws_sqs.Queue"
5552
+ }
5553
+ },
5554
+ {
5555
+ "docs": {
5556
+ "remarks": "This topic serves as the entry point for two types of events:\n1. Direct STAC item JSON documents published by external services\n2. S3 event notifications when STAC items are uploaded to configured buckets\n\nThe topic fans out to the SQS queue for batched processing.",
5557
+ "stability": "experimental",
5558
+ "summary": "The SNS topic that receives STAC items and S3 event notifications for loading."
5559
+ },
5560
+ "immutable": true,
5561
+ "locationInModule": {
5562
+ "filename": "lib/stac-item-loader/index.ts",
5563
+ "line": 300
5564
+ },
5565
+ "name": "topic",
5566
+ "type": {
5567
+ "fqn": "aws-cdk-lib.aws_sns.Topic"
5568
+ }
5569
+ }
5570
+ ],
5571
+ "symbolId": "lib/stac-item-loader/index:StacItemLoader"
5572
+ },
5573
+ "eoapi-cdk.StacItemLoaderProps": {
5574
+ "assembly": "eoapi-cdk",
5575
+ "datatype": true,
5576
+ "docs": {
5577
+ "example": "const loader = new StacItemLoader(this, 'ItemLoader', {\n pgstacDb: database,\n batchSize: 1000,\n maxBatchingWindowMinutes: 1,\n lambdaTimeoutSeconds: 300\n});",
5578
+ "remarks": "The StacItemLoader is part of a two-phase serverless STAC ingestion pipeline\nthat loads STAC items into a pgstac database. This construct creates\nthe infrastructure for receiving STAC items from multiple sources:\n1. SNS messages containing STAC metadata (direct ingestion)\n2. S3 event notifications for STAC items uploaded to S3 buckets\n\nItems from both sources are batched and inserted into PostgreSQL with the pgstac extension.",
5579
+ "stability": "experimental",
5580
+ "summary": "Configuration properties for the StacItemLoader construct."
5581
+ },
5582
+ "fqn": "eoapi-cdk.StacItemLoaderProps",
5583
+ "kind": "interface",
5584
+ "locationInModule": {
5585
+ "filename": "lib/stac-item-loader/index.ts",
5586
+ "line": 34
5587
+ },
5588
+ "name": "StacItemLoaderProps",
5589
+ "properties": [
5590
+ {
5591
+ "abstract": true,
5592
+ "docs": {
5593
+ "remarks": "This database must have the pgstac extension installed and be properly\nconfigured with collections before items can be loaded. The loader will\nuse AWS Secrets Manager to securely access database credentials.",
5594
+ "stability": "experimental",
5595
+ "summary": "The PgSTAC database instance to load items into."
5596
+ },
5597
+ "immutable": true,
5598
+ "locationInModule": {
5599
+ "filename": "lib/stac-item-loader/index.ts",
5600
+ "line": 42
5601
+ },
5602
+ "name": "pgstacDb",
5603
+ "type": {
5604
+ "fqn": "eoapi-cdk.PgStacDatabase"
5605
+ }
5606
+ },
5607
+ {
5608
+ "abstract": true,
5609
+ "docs": {
5610
+ "default": "500",
5611
+ "remarks": "This determines the maximum number of STAC items that will be\nprocessed together in a single lambda invocation. Larger batch\nsizes improve database insertion efficiency but require more\nmemory and longer processing time.\n\n**Batching Behavior**: SQS will wait to accumulate up to this many\nmessages before triggering the Lambda, OR until the maxBatchingWindow\ntimeout is reached, whichever comes first. This creates an efficient\nbalance between throughput and latency.",
5612
+ "stability": "experimental",
5613
+ "summary": "SQS batch size for lambda event source."
5614
+ },
5615
+ "immutable": true,
5616
+ "locationInModule": {
5617
+ "filename": "lib/stac-item-loader/index.ts",
5618
+ "line": 92
5619
+ },
5620
+ "name": "batchSize",
5621
+ "optional": true,
5622
+ "type": {
5623
+ "primitive": "number"
5624
+ }
5625
+ },
5626
+ {
5627
+ "abstract": true,
5628
+ "docs": {
5629
+ "remarks": "These will be merged with the default environment variables including\nPGSTAC_SECRET_ARN. Use this for custom configuration or debugging flags.",
5630
+ "stability": "experimental",
5631
+ "summary": "Additional environment variables for the lambda function."
5632
+ },
5633
+ "immutable": true,
5634
+ "locationInModule": {
5635
+ "filename": "lib/stac-item-loader/index.ts",
5636
+ "line": 126
5637
+ },
5638
+ "name": "environment",
5639
+ "optional": true,
5640
+ "type": {
5641
+ "collection": {
5642
+ "elementtype": {
5643
+ "primitive": "string"
5644
+ },
5645
+ "kind": "map"
5646
+ }
5647
+ }
5648
+ },
5649
+ {
5650
+ "abstract": true,
5651
+ "docs": {
5652
+ "default": "lambda.Runtime.PYTHON_3_11",
5653
+ "remarks": "The function is implemented in Python and uses pypgstac for database\noperations. Ensure the runtime version is compatible with the pgstac\nversion specified in the database configuration.",
5654
+ "stability": "experimental",
5655
+ "summary": "The lambda runtime to use for the item loading function."
5656
+ },
5657
+ "immutable": true,
5658
+ "locationInModule": {
5659
+ "filename": "lib/stac-item-loader/index.ts",
5660
+ "line": 53
5661
+ },
5662
+ "name": "lambdaRuntime",
5663
+ "optional": true,
5664
+ "type": {
5665
+ "fqn": "aws-cdk-lib.aws_lambda.Runtime"
5666
+ }
5667
+ },
5668
+ {
5669
+ "abstract": true,
5670
+ "docs": {
5671
+ "default": "300",
5672
+ "remarks": "This should accommodate the time needed to process up to `batchSize`\nitems and perform database insertions. The SQS visibility timeout\nwill be set to this value plus 10 seconds.",
5673
+ "stability": "experimental",
5674
+ "summary": "The timeout for the item load lambda in seconds."
5675
+ },
5676
+ "immutable": true,
5677
+ "locationInModule": {
5678
+ "filename": "lib/stac-item-loader/index.ts",
5679
+ "line": 64
5680
+ },
5681
+ "name": "lambdaTimeoutSeconds",
5682
+ "optional": true,
5683
+ "type": {
5684
+ "primitive": "number"
5685
+ }
5686
+ },
5687
+ {
5688
+ "abstract": true,
5689
+ "docs": {
5690
+ "default": "1",
5691
+ "remarks": "Even if the batch size isn't reached, the lambda will be triggered\nafter this time period to ensure timely processing of items.\nThis prevents items from waiting indefinitely in low-volume scenarios.\n\n**Important**: This timeout works in conjunction with batchSize - SQS\nwill trigger the Lambda when EITHER the batch size is reached OR this\ntime window expires, ensuring items are processed in a timely manner\nregardless of volume.",
5692
+ "stability": "experimental",
5693
+ "summary": "Maximum batching window in minutes."
5694
+ },
5695
+ "immutable": true,
5696
+ "locationInModule": {
5697
+ "filename": "lib/stac-item-loader/index.ts",
5698
+ "line": 108
5699
+ },
5700
+ "name": "maxBatchingWindowMinutes",
5701
+ "optional": true,
5702
+ "type": {
5703
+ "primitive": "number"
5704
+ }
5705
+ },
5706
+ {
5707
+ "abstract": true,
5708
+ "docs": {
5709
+ "default": "2",
5710
+ "remarks": "This limit will be applied to the Lambda function and will control how\nmany concurrent batches will be released from the SQS queue.",
5711
+ "stability": "experimental",
5712
+ "summary": "Maximum concurrent executions for the StacItemLoader Lambda function."
5713
+ },
5714
+ "immutable": true,
5715
+ "locationInModule": {
5716
+ "filename": "lib/stac-item-loader/index.ts",
5717
+ "line": 118
5718
+ },
5719
+ "name": "maxConcurrency",
5720
+ "optional": true,
5721
+ "type": {
5722
+ "primitive": "number"
5723
+ }
5724
+ },
5725
+ {
5726
+ "abstract": true,
5727
+ "docs": {
5728
+ "default": "1024",
5729
+ "remarks": "Higher memory allocation may improve performance when processing\nlarge batches of STAC items, especially for memory-intensive\ndatabase operations.",
5730
+ "stability": "experimental",
5731
+ "summary": "Memory size for the lambda function in MB."
5732
+ },
5733
+ "immutable": true,
5734
+ "locationInModule": {
5735
+ "filename": "lib/stac-item-loader/index.ts",
5736
+ "line": 75
5737
+ },
5738
+ "name": "memorySize",
5739
+ "optional": true,
5740
+ "type": {
5741
+ "primitive": "number"
5742
+ }
5743
+ }
5744
+ ],
5745
+ "symbolId": "lib/stac-item-loader/index:StacItemLoaderProps"
5746
+ },
5747
+ "eoapi-cdk.StactoolsItemGenerator": {
5748
+ "assembly": "eoapi-cdk",
5749
+ "base": "constructs.Construct",
5750
+ "docs": {
5751
+ "remarks": "The StactoolsItemGenerator creates a serverless, event-driven system for generating\nSTAC (SpatioTemporal Asset Catalog) items from source data. This construct\nimplements the first phase of a two-stage ingestion pipeline that transforms\nraw geospatial data into standardized STAC metadata.\n\n## Architecture Overview\n\nThis construct creates the following AWS resources:\n- **SNS Topic**: Entry point for triggering item generation workflows\n- **SQS Queue**: Buffers generation requests (120-second visibility timeout)\n- **Dead Letter Queue**: Captures failed messages after 5 processing attempts\n- **Lambda Function**: Containerized function that generates STAC items using stactools\n\n## Data Flow\n\n1. External systems publish ItemRequest messages to the SNS topic with metadata about assets\n2. The SQS queue buffers these messages and triggers the Lambda function\n3. The Lambda function:\n - Uses `uvx` to install the required stactools package\n - Executes the `create-item` CLI command with provided arguments\n - Publishes generated STAC items to the ItemLoad topic\n4. Failed processing attempts are sent to the dead letter queue\n\n## Operational Characteristics\n\n- **Scalability**: Lambda scales automatically based on queue depth (up to maxConcurrency)\n- **Flexibility**: Supports any stactools package through dynamic installation\n- **Reliability**: Dead letter queue captures failed generation attempts\n- **Isolation**: Each generation task runs in a fresh container environment\n- **Observability**: CloudWatch logs retained for one week\n\n## Message Schema\n\nThe function expects messages matching the ItemRequest model:\n\n```json\n{\n \"package_name\": \"stactools-glad-global-forest-change\",\n \"group_name\": \"gladglobalforestchange\",\n \"create_item_args\": [\n \"https://example.com/data.tif\"\n ],\n \"collection_id\": \"glad-global-forest-change-1.11\"\n}\n```\n\n## Usage Example\n\n```typescript\n// Create item loader first (or get existing topic ARN)\nconst loader = new StacItemLoader(this, 'ItemLoader', {\n pgstacDb: database\n});\n\n// Create item generator that feeds the loader\nconst generator = new StactoolsItemGenerator(this, 'ItemGenerator', {\n itemLoadTopicArn: loader.topic.topicArn,\n lambdaTimeoutSeconds: 120, // Allow time for package installation\n maxConcurrency: 100, // Control parallel processing\n batchSize: 10 // Process 10 requests per invocation\n});\n\n// Grant permission to publish to the loader topic\nloader.topic.grantPublish(generator.lambdaFunction);\n```\n\n## Publishing Generation Requests\n\nSend messages to the generator topic to trigger item creation:\n\n```bash\naws sns publish --topic-arn $ITEM_GEN_TOPIC --message '{\n \"package_name\": \"stactools-glad-global-forest-change\",\n \"group_name\": \"gladglobalforestchange\",\n \"create_item_args\": [\n \"https://storage.googleapis.com/earthenginepartners-hansen/GFC-2023-v1.11/Hansen_GFC-2023-v1.11_gain_40N_080W.tif\"\n ],\n \"collection_id\": \"glad-global-forest-change-1.11\"\n}'\n```\n\n## Batch Processing Example\n\nFor processing many assets, you can loop through URLs:\n\n```bash\nwhile IFS= read -r url; do\n aws sns publish --topic-arn \"$ITEM_GEN_TOPIC\" --message \"{\n \\\"package_name\\\": \\\"stactools-glad-glclu2020\\\",\n \\\"group_name\\\": \\\"gladglclu2020\\\",\n \\\"create_item_args\\\": [\\\"$url\\\"]\n }\"\ndone < urls.txt\n```\n\n## Monitoring and Troubleshooting\n\n- Monitor Lambda logs: `/aws/lambda/{FunctionName}`\n- Check dead letter queue for failed generation attempts\n- Use CloudWatch metrics to track processing rates and errors\n- Failed items can be replayed from the dead letter queue\n\n## Supported Stactools Packages\n\nAny package available on PyPI that follows the stactools plugin pattern\ncan be used. Examples include:\n- `stactools-glad-global-forest-change`\n- `stactools-glad-glclu2020`\n- `stactools-landsat`\n- `stactools-sentinel2`",
5752
+ "see": "{@link https://stactools.readthedocs.io/} for stactools documentation",
5753
+ "stability": "experimental",
5754
+ "summary": "AWS CDK Construct for STAC Item Generation Infrastructure."
5755
+ },
5756
+ "fqn": "eoapi-cdk.StactoolsItemGenerator",
5757
+ "initializer": {
5758
+ "docs": {
5759
+ "stability": "experimental"
5760
+ },
5761
+ "locationInModule": {
5762
+ "filename": "lib/stactools-item-generator/index.ts",
5763
+ "line": 263
5764
+ },
5765
+ "parameters": [
5766
+ {
5767
+ "name": "scope",
5768
+ "type": {
5769
+ "fqn": "constructs.Construct"
5770
+ }
5771
+ },
5772
+ {
5773
+ "name": "id",
5774
+ "type": {
5775
+ "primitive": "string"
5776
+ }
5777
+ },
5778
+ {
5779
+ "name": "props",
5780
+ "type": {
5781
+ "fqn": "eoapi-cdk.StactoolsItemGeneratorProps"
5782
+ }
5783
+ }
5784
+ ]
5785
+ },
5786
+ "kind": "class",
5787
+ "locationInModule": {
5788
+ "filename": "lib/stactools-item-generator/index.ts",
5789
+ "line": 227
5790
+ },
5791
+ "name": "StactoolsItemGenerator",
5792
+ "properties": [
5793
+ {
5794
+ "docs": {
5795
+ "remarks": "Messages that fail processing after 5 attempts are sent here for\ninspection and potential replay. This helps with debugging stactools\npackage issues, network failures, or malformed requests.",
5796
+ "stability": "experimental",
5797
+ "summary": "Dead letter queue for failed item generation attempts."
5798
+ },
5799
+ "immutable": true,
5800
+ "locationInModule": {
5801
+ "filename": "lib/stactools-item-generator/index.ts",
5802
+ "line": 244
5803
+ },
5804
+ "name": "deadLetterQueue",
5805
+ "type": {
5806
+ "fqn": "aws-cdk-lib.aws_sqs.Queue"
5807
+ }
5808
+ },
5809
+ {
5810
+ "docs": {
5811
+ "remarks": "This Docker-based function dynamically installs stactools packages\nusing uvx, processes source data, and publishes generated STAC items\nto the configured ItemLoad SNS topic.",
5812
+ "stability": "experimental",
5813
+ "summary": "The containerized Lambda function that generates STAC items."
5814
+ },
5815
+ "immutable": true,
5816
+ "locationInModule": {
5817
+ "filename": "lib/stactools-item-generator/index.ts",
5818
+ "line": 261
5819
+ },
5820
+ "name": "lambdaFunction",
5821
+ "type": {
5822
+ "fqn": "aws-cdk-lib.aws_lambda.DockerImageFunction"
5823
+ }
5824
+ },
5825
+ {
5826
+ "docs": {
5827
+ "remarks": "This queue receives messages from the SNS topic containing ItemRequest\npayloads. It's configured with a visibility timeout that matches the\nLambda timeout plus buffer time to prevent duplicate processing.",
5828
+ "stability": "experimental",
5829
+ "summary": "The SQS queue that buffers item generation requests."
5830
+ },
5831
+ "immutable": true,
5832
+ "locationInModule": {
5833
+ "filename": "lib/stactools-item-generator/index.ts",
5834
+ "line": 235
5835
+ },
5836
+ "name": "queue",
5837
+ "type": {
5838
+ "fqn": "aws-cdk-lib.aws_sqs.Queue"
5839
+ }
5840
+ },
5841
+ {
5842
+ "docs": {
5843
+ "remarks": "External systems publish ItemRequest messages to this topic to trigger\nSTAC item generation. The topic fans out to the SQS queue for processing.",
5844
+ "stability": "experimental",
5845
+ "summary": "The SNS topic that receives item generation requests."
5846
+ },
5847
+ "immutable": true,
5848
+ "locationInModule": {
5849
+ "filename": "lib/stactools-item-generator/index.ts",
5850
+ "line": 252
5851
+ },
5852
+ "name": "topic",
5853
+ "type": {
5854
+ "fqn": "aws-cdk-lib.aws_sns.Topic"
5855
+ }
5856
+ }
5857
+ ],
5858
+ "symbolId": "lib/stactools-item-generator/index:StactoolsItemGenerator"
5859
+ },
5860
+ "eoapi-cdk.StactoolsItemGeneratorProps": {
5861
+ "assembly": "eoapi-cdk",
5862
+ "datatype": true,
5863
+ "docs": {
5864
+ "example": "const generator = new StactoolsItemGenerator(this, 'ItemGenerator', {\n itemLoadTopicArn: loader.topic.topicArn,\n lambdaTimeoutSeconds: 120,\n maxConcurrency: 100,\n batchSize: 10\n});",
5865
+ "remarks": "The StactoolsItemGenerator is part of a two-phase serverless STAC ingestion pipeline\nthat generates STAC items from source data. This construct creates the\ninfrastructure for the first phase of the pipeline - processing metadata\nabout assets and transforming them into standardized STAC items.",
5866
+ "stability": "experimental",
5867
+ "summary": "Configuration properties for the StactoolsItemGenerator construct."
5868
+ },
5869
+ "fqn": "eoapi-cdk.StactoolsItemGeneratorProps",
5870
+ "kind": "interface",
5871
+ "locationInModule": {
5872
+ "filename": "lib/stactools-item-generator/index.ts",
5873
+ "line": 31
5874
+ },
5875
+ "name": "StactoolsItemGeneratorProps",
5876
+ "properties": [
5877
+ {
5878
+ "abstract": true,
5879
+ "docs": {
5880
+ "remarks": "This is typically the topic from a StacItemLoader construct.\nGenerated STAC items will be published here for downstream\nprocessing and database insertion.",
5881
+ "stability": "experimental",
5882
+ "summary": "ARN of the SNS topic to publish generated items to."
5883
+ },
5884
+ "immutable": true,
5885
+ "locationInModule": {
5886
+ "filename": "lib/stactools-item-generator/index.ts",
5887
+ "line": 107
5888
+ },
5889
+ "name": "itemLoadTopicArn",
5890
+ "type": {
5891
+ "primitive": "string"
5892
+ }
5893
+ },
5894
+ {
5895
+ "abstract": true,
5896
+ "docs": {
5897
+ "default": "10",
5898
+ "remarks": "This determines how many generation requests are processed together\nin a single lambda invocation. Unlike the loader, generation typically\nprocesses items individually, so smaller batch sizes are common.",
5899
+ "stability": "experimental",
5900
+ "summary": "SQS batch size for lambda event source."
5901
+ },
5902
+ "immutable": true,
5903
+ "locationInModule": {
5904
+ "filename": "lib/stactools-item-generator/index.ts",
5905
+ "line": 89
5906
+ },
5907
+ "name": "batchSize",
5908
+ "optional": true,
5909
+ "type": {
5910
+ "primitive": "number"
5911
+ }
5912
+ },
5913
+ {
5914
+ "abstract": true,
5915
+ "docs": {
5916
+ "remarks": "These will be merged with default environment variables including\nITEM_LOAD_TOPIC_ARN and LOG_LEVEL. Use this for custom configuration\nor to pass credentials for external data sources.",
5917
+ "stability": "experimental",
5918
+ "summary": "Additional environment variables for the lambda function."
5919
+ },
5920
+ "immutable": true,
5921
+ "locationInModule": {
5922
+ "filename": "lib/stactools-item-generator/index.ts",
5923
+ "line": 98
5924
+ },
5925
+ "name": "environment",
5926
+ "optional": true,
5927
+ "type": {
5928
+ "collection": {
5929
+ "elementtype": {
5930
+ "primitive": "string"
5931
+ },
5932
+ "kind": "map"
5933
+ }
5934
+ }
5935
+ },
5936
+ {
5937
+ "abstract": true,
5938
+ "docs": {
5939
+ "default": "lambda.Runtime.PYTHON_3_11",
5940
+ "remarks": "The function is containerized using Docker and can accommodate various\nstactools packages. The runtime version should be compatible with the\npackages you plan to use for STAC item generation.",
5941
+ "stability": "experimental",
5942
+ "summary": "The lambda runtime to use for the item generation function."
5943
+ },
5944
+ "immutable": true,
5945
+ "locationInModule": {
5946
+ "filename": "lib/stactools-item-generator/index.ts",
5947
+ "line": 41
5948
+ },
5949
+ "name": "lambdaRuntime",
5950
+ "optional": true,
5951
+ "type": {
5952
+ "fqn": "aws-cdk-lib.aws_lambda.Runtime"
5953
+ }
5954
+ },
5955
+ {
5956
+ "abstract": true,
5957
+ "docs": {
5958
+ "default": "120",
5959
+ "remarks": "This should accommodate the time needed to:\n- Install stactools packages using uvx\n- Download and process source data\n- Generate STAC metadata\n- Publish results to SNS\n\nThe SQS visibility timeout will be set to this value plus 10 seconds.",
5960
+ "stability": "experimental",
5961
+ "summary": "The timeout for the item generation lambda in seconds."
5962
+ },
5963
+ "immutable": true,
5964
+ "locationInModule": {
5965
+ "filename": "lib/stactools-item-generator/index.ts",
5966
+ "line": 56
5967
+ },
5968
+ "name": "lambdaTimeoutSeconds",
5969
+ "optional": true,
5970
+ "type": {
5971
+ "primitive": "number"
5972
+ }
5973
+ },
5974
+ {
5975
+ "abstract": true,
5976
+ "docs": {
5977
+ "default": "100",
5978
+ "remarks": "This controls how many item generation tasks can run simultaneously.\nHigher concurrency enables faster processing of large batches but\nmay strain downstream systems or external data sources.",
5979
+ "stability": "experimental",
5980
+ "summary": "Maximum number of concurrent executions."
5981
+ },
5982
+ "immutable": true,
5983
+ "locationInModule": {
5984
+ "filename": "lib/stactools-item-generator/index.ts",
5985
+ "line": 78
5986
+ },
5987
+ "name": "maxConcurrency",
5988
+ "optional": true,
5989
+ "type": {
5990
+ "primitive": "number"
5991
+ }
5992
+ },
5993
+ {
5994
+ "abstract": true,
5995
+ "docs": {
5996
+ "default": "1024",
5997
+ "remarks": "Higher memory allocation may be needed for processing large geospatial\ndatasets or when stactools packages have high memory requirements.\nMore memory also provides proportionally more CPU power.",
5998
+ "stability": "experimental",
5999
+ "summary": "Memory size for the lambda function in MB."
6000
+ },
6001
+ "immutable": true,
6002
+ "locationInModule": {
6003
+ "filename": "lib/stactools-item-generator/index.ts",
6004
+ "line": 67
6005
+ },
6006
+ "name": "memorySize",
6007
+ "optional": true,
6008
+ "type": {
6009
+ "primitive": "number"
6010
+ }
6011
+ }
6012
+ ],
6013
+ "symbolId": "lib/stactools-item-generator/index:StactoolsItemGeneratorProps"
6014
+ },
5447
6015
  "eoapi-cdk.TiPgApiLambda": {
5448
6016
  "assembly": "eoapi-cdk",
5449
6017
  "base": "constructs.Construct",
@@ -5915,6 +6483,6 @@
5915
6483
  "symbolId": "lib/titiler-pgstac-api/index:TitilerPgstacApiLambda"
5916
6484
  }
5917
6485
  },
5918
- "version": "8.1.0",
5919
- "fingerprint": "P912To9BQxA8vUvBUyuaAexQ0TQFsm0a+p1BQVOsp2Q="
6486
+ "version": "8.2.0",
6487
+ "fingerprint": "JVUml3IdUs10f+0ZGUviU7bZ2hZTYqXC7NyzJiNYy0s="
5920
6488
  }