Skip to content

Commit

Permalink
Write DiscoverGranulesMap output to S3
Browse files Browse the repository at this point in the history
Fixes #300
  • Loading branch information
chuckwondo committed Nov 28, 2023
1 parent 6af1af1 commit 44562a1
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 60 deletions.
9 changes: 6 additions & 3 deletions app/stacks/cumulus/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ data "aws_iam_policy_document" "allow_sfn_distributed_maps" {
resources = ["*"]
}

# Allow StepFunctions to read input from S3, which is necessary when the size
# of the input array message might exceed the quota (256KiB).
# Allow StepFunctions to read input from S3, as well as write output to it,
# which is necessary when the size of the input array message might exceed the
# quota (256KiB).
statement {
effect = "Allow"
actions = [
"s3:Get*",
"s3:List*"
"s3:List*",
"s3:PutObject",
"s3:AbortMultipartUpload",
]
resources = ["*"]
}
Expand Down
18 changes: 18 additions & 0 deletions app/stacks/cumulus/templates/discover-granules-workflow.asl.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
"Key.$": "$.key"
}
},
"ResultWriter": {
"Resource": "arn:aws:states:::s3:putObject",
"Parameters": {
"Bucket.$": "$.bucket",
"Prefix": "mapRun"
}
},
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "DISTRIBUTED",
Expand Down Expand Up @@ -140,7 +147,18 @@
"MaxConcurrency": 10,
"ToleratedFailurePercentage": 0,
"ItemsPath": "$",
"ResultWriter": {
"Resource": "arn:aws:states:::s3:putObject",
"Parameters": {
"Bucket.$": "$.[0].cumulus_meta.system_bucket",
"Prefix": "mapRun"
}
},
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "DISTRIBUTED",
"ExecutionType": "STANDARD"
},
"StartAt": "UnbatchGranules",
"States": {
"UnbatchGranules": {
Expand Down
Loading

0 comments on commit 44562a1

Please sign in to comment.