@@ -32,6 +32,10 @@ Parameters:
3232 Description : KMS key set as infra key for the dataset
3333 Type : String
3434 Default : " " # if not provided, pDatasetDeploymentInstance must be specified
35+ pBucketPrefix :
36+ Description : Bucket prefix for the dataset
37+ Type : String
38+ Default : " " # if not provided, pDatasetDeploymentInstance must be specified
3539 pEventBus :
3640 Description : EventBridge bus for the dataset
3741 Type : String
@@ -56,10 +60,6 @@ Parameters:
5660 # Description: Analytics bucket
5761 # Type: String
5862 # Default: "" # if not provided, pStorageDeploymentInstance must be specified
59- pDataset :
60- Description : The name of the dataset (all lowercase, no symbols or spaces)
61- Type : String
62- AllowedPattern : " [a-z0-9]{2,14}"
6363 pStageEnabled :
6464 Description : Whether the stage is enabled or not
6565 Type : String
@@ -158,7 +158,7 @@ Globals:
158158 - " {{resolve:ssm:/SDLF/Lambda/LatestDatalakeLibraryLayer}}"
159159 Environment :
160160 Variables :
161- DATASET : !Ref pDataset
161+ S3_PREFIX : !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rS3Prefix/${pDatasetDeploymentInstance}}}", ! Ref pBucketPrefix]
162162 DEPLOYMENT_INSTANCE : !Ref pDeploymentInstance
163163 STORAGE_DEPLOYMENT_INSTANCE : !Ref pStorageDeploymentInstance
164164 DATASET_DEPLOYMENT_INSTANCE : !Ref pDatasetDeploymentInstance
@@ -182,7 +182,6 @@ Resources:
182182 pInfraKmsKey : !Ref pInfraKmsKey
183183 pEventBus : !Ref pEventBus
184184 pScheduleGroup : !Ref pScheduleGroup
185- pDataset : !Ref pDataset
186185 pStageEnabled : !Ref pStageEnabled
187186 pTriggerType : !Ref pTriggerType
188187 pSchedule : !Ref pSchedule
@@ -193,7 +192,7 @@ Resources:
193192 rLambdaCommonPolicy :
194193 Type : AWS::IAM::ManagedPolicy
195194 Properties :
196- Path : !Sub /sdlf-${pDataset }/
195+ Path : !Sub /sdlf-${pDeploymentInstance }/
197196 PolicyDocument :
198197 Version : " 2012-10-17"
199198 Statement :
@@ -203,7 +202,7 @@ Resources:
203202 - logs:CreateLogStream
204203 - logs:PutLogEvents
205204 Resource :
206- - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf-${pDataset}-${ pDeploymentInstance}-*
205+ - !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf-${pDeploymentInstance}-*
207206 - Effect : Allow
208207 Action :
209208 - ssm:GetParameter
@@ -238,7 +237,7 @@ Resources:
238237 rRoleLambdaExecutionRoutingStep :
239238 Type : AWS::IAM::Role
240239 Properties :
241- Path : !Sub /sdlf-${pDataset }/
240+ Path : !Sub /sdlf-${pDeploymentInstance }/
242241 # PermissionsBoundary: !Sub "{{resolve:ssm:/SDLF/IAM/${pDataset}/TeamPermissionsBoundary}}"
243242 ManagedPolicyArns :
244243 - !Ref rLambdaCommonPolicy
@@ -254,7 +253,7 @@ Resources:
254253 Service : lambda.amazonaws.com
255254 Action : sts:AssumeRole
256255 Policies :
257- - PolicyName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-routing
256+ - PolicyName : !Sub sdlf-${pDeploymentInstance}-routing
258257 PolicyDocument :
259258 Version : " 2012-10-17"
260259 Statement :
@@ -274,14 +273,14 @@ Resources:
274273 - sqs:ReceiveMessage
275274 - sqs:SendMessage
276275 Resource :
277- - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDataset}-${ pDeploymentInstance}-queue-*
278- - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDataset}-${ pDeploymentInstance}-dlq-*
276+ - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDeploymentInstance}-queue.fifo
277+ - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDeploymentInstance}-dlq.fifo
279278
280279 # Metadata Step Role (fetch metadata, update pipeline execution history...)
281280 rRoleLambdaExecutionMetadataStep :
282281 Type : AWS::IAM::Role
283282 Properties :
284- Path : !Sub /sdlf-${pDataset }/
283+ Path : !Sub /sdlf-${pDeploymentInstance }/
285284 # PermissionsBoundary: !Sub "{{resolve:ssm:/SDLF/IAM/${pDataset}/TeamPermissionsBoundary}}"
286285 ManagedPolicyArns :
287286 - !Ref rLambdaCommonPolicy
@@ -301,7 +300,7 @@ Resources:
301300 rRoleLambdaExecutionErrorStep :
302301 Type : AWS::IAM::Role
303302 Properties :
304- Path : !Sub /sdlf-${pDataset }/
303+ Path : !Sub /sdlf-${pDeploymentInstance }/
305304 # PermissionsBoundary: !Sub "{{resolve:ssm:/SDLF/IAM/${pDataset}/TeamPermissionsBoundary}}"
306305 ManagedPolicyArns :
307306 - !Ref rLambdaCommonPolicy
@@ -317,7 +316,7 @@ Resources:
317316 Service : lambda.amazonaws.com
318317 Action : sts:AssumeRole
319318 Policies :
320- - PolicyName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-error
319+ - PolicyName : !Sub sdlf-${pDeploymentInstance}-error
321320 PolicyDocument :
322321 Version : " 2012-10-17"
323322 Statement :
@@ -332,7 +331,7 @@ Resources:
332331 - sqs:ReceiveMessage
333332 - sqs:SendMessage
334333 Resource :
335- - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDataset}-${ pDeploymentInstance}-dlq-*
334+ - !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-${pDeploymentInstance}-dlq.fifo
336335
337336 # ####### LAMBDA FUNCTIONS #########
338337 rLambdaRoutingStep :
@@ -344,7 +343,7 @@ Resources:
344343 reason : Permissions to write CloudWatch Logs are granted by rLambdaCommonPolicy
345344 Properties :
346345 CodeUri : ./lambda/routing/src
347- FunctionName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-routing
346+ FunctionName : !Sub sdlf-${pDeploymentInstance}-routing
348347 Description : Checks if items are to be processed and route them to state machine
349348 Environment :
350349 Variables :
@@ -362,7 +361,7 @@ Resources:
362361 reason : Permissions to write CloudWatch Logs are granted by rLambdaCommonPolicy
363362 Properties :
364363 CodeUri : ./lambda/redrive/src
365- FunctionName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-redrive
364+ FunctionName : !Sub sdlf-${pDeploymentInstance}-redrive
366365 Description : Redrives Failed messages to the routing queue
367366 MemorySize : 192
368367 Timeout : 300
@@ -377,7 +376,7 @@ Resources:
377376 reason : Permissions to write CloudWatch Logs are granted by rLambdaCommonPolicy
378377 Properties :
379378 CodeUri : ./lambda/postupdate-metadata/src
380- FunctionName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-postupdate
379+ FunctionName : !Sub sdlf-${pDeploymentInstance}-postupdate
381380 Description : Post-Update the metadata in the DynamoDB Catalog table
382381 MemorySize : 192
383382 Timeout : 300
@@ -392,7 +391,7 @@ Resources:
392391 reason : Permissions to write CloudWatch Logs are granted by rLambdaCommonPolicy
393392 Properties :
394393 CodeUri : ./lambda/error/src
395- FunctionName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-error
394+ FunctionName : !Sub sdlf-${pDeploymentInstance}-error
396395 Description : Fallback lambda to handle messages which failed processing
397396 MemorySize : 192
398397 Timeout : 300
@@ -405,7 +404,7 @@ Resources:
405404 Name : !Sub /sdlf/pipeline/rLambdaRoutingStep/${pDeploymentInstance}
406405 Type : String
407406 Value : !GetAtt rLambdaRoutingStep.Arn
408- Description : !Sub "ARN of the ${pDataset} ${ pDeploymentInstance} Routing Lambda" # TODO
407+ Description : !Sub "ARN of the ${pDeploymentInstance} Routing Lambda" # TODO
409408
410409 rLambdaRoutingStepLogGroup :
411410 Type : AWS::Logs::LogGroup
@@ -452,7 +451,7 @@ Resources:
452451 - id : W11
453452 reason : The actions with "*" are all ones that do not have resource limitations associated with them
454453 Properties :
455- Path : !Sub /sdlf-${pDataset }/
454+ Path : !Sub /sdlf-${pDeploymentInstance }/
456455 # PermissionsBoundary: !Sub "{{resolve:ssm:/SDLF/IAM/${pDataset}/TeamPermissionsBoundary}}"
457456 AssumeRolePolicyDocument :
458457 Version : " 2012-10-17"
@@ -466,26 +465,26 @@ Resources:
466465 StringEquals :
467466 " aws:SourceAccount " : !Sub ${AWS::AccountId}
468467 Policies :
469- - PolicyName : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-sm
468+ - PolicyName : !Sub sdlf-${pDeploymentInstance}-sm
470469 PolicyDocument :
471470 Version : " 2012-10-17"
472471 Statement :
473472 - Effect : Allow
474473 Action :
475474 - lambda:InvokeFunction
476- Resource : !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-${pDataset}-${ pDeploymentInstance}-*
475+ Resource : !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-${pDeploymentInstance}-*
477476 - Effect : Allow
478477 Action :
479478 - glue:StartJobRun
480479 - glue:GetJobRun
481480 - glue:GetJobRuns
482481 - glue:BatchStopJobRun
483- Resource : !Sub arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:job/sdlf-${pDataset }-*
482+ Resource : !Sub arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:job/sdlf-${pDeploymentInstance }-*
484483 - Effect : Allow
485484 Action :
486485 - glue:StartCrawler
487486 - glue:GetCrawler
488- Resource : !Sub arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:crawler/sdlf-${pDataset }-*
487+ Resource : !Sub arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:crawler/sdlf-${pDatasetDeploymentInstance }-*
489488 - Effect : Allow
490489 Action :
491490 - xray:PutTraceSegments # W11 exception
@@ -514,7 +513,7 @@ Resources:
514513 rStateMachine :
515514 Type : AWS::Serverless::StateMachine
516515 Properties :
517- Name : !Sub sdlf-${pDataset}-${ pDeploymentInstance}-sm
516+ Name : !Sub sdlf-${pDeploymentInstance}-sm
518517 DefinitionUri : ./state-machine/stage-glue.asl.json
519518 DefinitionSubstitutions :
520519 lPostMetadata : !GetAtt rLambdaPostMetadataStep.Arn
@@ -537,7 +536,7 @@ Resources:
537536 Name : !Sub /sdlf/pipeline/rStateMachine/${pDeploymentInstance}
538537 Type : String
539538 Value : !Ref rStateMachine
540- Description : !Sub "ARN of the ${pDataset} ${ pDeploymentInstance} State Machine" # TODO
539+ Description : !Sub "ARN of the ${pDeploymentInstance} State Machine" # TODO
541540
542541Outputs :
543542 oPipelineReference :
0 commit comments