Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdlf-pipeline/stage-glue] handling of dataset parameters #486

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions sdlf-pipeline/src/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ Parameters:
pDeploymentInstance:
Type: String
Description: A string uniquely identifying this deployment in this AWS account
Default: dev
pDatasetInfraKmsKey:
Default: pipeline
pDatasetDeploymentInstance:
Type: String
Description: The string uniquely identifying a sdlf-dataset deployment in this AWS account
Default: "" # see below comments
pInfraKmsKey:
Description: KMS key set as infra key for the dataset
Type: String
Default: "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/dev}}"
pDatasetEventBus:
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pEventBus:
Description: EventBridge bus for the dataset
Type: String
Default: "{{resolve:ssm:/sdlf/dataset/rEventBus/dev}}"
pDatasetScheduleGroup:
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pScheduleGroup:
Description: EventBridge schedule group for the dataset
Type: String
Default: "{{resolve:ssm:/sdlf/dataset/rScheduleGroup/dev}}"
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pDataset:
Description: The name of the dataset (all lowercase, no symbols or spaces)
Type: String
Expand Down Expand Up @@ -57,6 +61,7 @@ Parameters:
Type: String

Conditions:
FetchFromDatasetSsm: !Not [!Equals [!Ref pDatasetDeploymentInstance, ""]]
HasSourceEvents: !Not [!Equals [!Ref pEventPattern, ""]] # infra needed for event and event-schedule (trigger-type in ["event", "schedule"], and event_pattern specified)
EventBased: !And # infra needed for event only
- !Equals [!Ref pTriggerType, "event"]
Expand All @@ -75,7 +80,7 @@ Resources:
FifoQueue: True
MessageRetentionPeriod: 1209600
VisibilityTimeout: 60
KmsMasterKeyId: !Ref pDatasetInfraKmsKey
KmsMasterKeyId: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/${pDatasetDeploymentInstance}}}", !Ref pInfraKmsKey]

rDeadLetterQueueRoutingStepSsm:
Type: AWS::SSM::Parameter
Expand All @@ -100,7 +105,7 @@ Resources:
maxReceiveCount: 1
VisibilityTimeout: 60
MessageRetentionPeriod: 604800
KmsMasterKeyId: !Ref pDatasetInfraKmsKey
KmsMasterKeyId: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/${pDatasetDeploymentInstance}}}", !Ref pInfraKmsKey]

rQueueRoutingStepSsm:
Type: AWS::SSM::Parameter
Expand All @@ -118,7 +123,7 @@ Resources:
Name: !Sub sdlf-${pDataset}-${pPipelineName}-rule-${pStageName}
Description: !Sub Send events to ${pStageName} queue
EventPattern: !Ref pEventPattern
EventBusName: !Ref pDatasetEventBus
EventBusName: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rEventBus/${pDatasetDeploymentInstance}}}", !Ref pEventBus]
State: !If
- StageEnabled
- ENABLED
Expand Down Expand Up @@ -188,15 +193,15 @@ Resources:
Action:
- kms:Decrypt
Resource:
- !Ref pDatasetInfraKmsKey
- !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/${pDatasetDeploymentInstance}}}", !Ref pInfraKmsKey]

rPostStateSchedule:
Type: AWS::Scheduler::Schedule
Condition: ScheduleBased
Properties:
Description: !Sub Trigger ${pStageName} Routing Lambda on a specified schedule
GroupName: !Ref pDatasetScheduleGroup
KmsKeyArn: !Ref pDatasetInfraKmsKey
GroupName: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rScheduleGroup/${pDatasetDeploymentInstance}}}", !Ref pScheduleGroup]
KmsKeyArn: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/${pDatasetDeploymentInstance}}}", !Ref pInfraKmsKey]
Name: !Sub sdlf-${pDataset}-${pPipelineName}-schedule-rule-${pStageName}
ScheduleExpression: !Ref pSchedule
FlexibleTimeWindow:
Expand Down
14 changes: 14 additions & 0 deletions sdlf-stage-glue/src/glue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ Parameters:
Description: KMS key set as infra key for the dataset
Type: String
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pEventBus:
Description: EventBridge bus for the dataset
Type: String
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pScheduleGroup:
Description: EventBridge schedule group for the dataset
Type: String
Default: "" # if not provided, pDatasetDeploymentInstance must be specified
pRawBucket:
Description: Raw bucket
Type: String
Expand Down Expand Up @@ -148,6 +156,8 @@ Globals:
DEPLOYMENT_INSTANCE: !Ref pDeploymentInstance
STORAGE_DEPLOYMENT_INSTANCE: dev # TODO
DATASET_DEPLOYMENT_INSTANCE: !Ref pDatasetDeploymentInstance
PIPELINE_EXECUTION_HISTORY_DYNAMO_TABLE: !Ref pPipelineExecutionHistoryDynamoTable
MANIFESTS_DYNAMO_TABLE: !Ref pManifestsDynamoTable
KmsKeyArn: !If [FetchFromDatasetSsm, !Sub "{{resolve:ssm:/sdlf/dataset/rKMSInfraKey/${pDatasetDeploymentInstance}}}", !Ref pInfraKmsKey]
VpcConfig: !If
- RunInVpc
Expand All @@ -162,6 +172,10 @@ Resources:
Properties:
pPipelineReference: !Ref pPipelineReference
pDeploymentInstance: !Ref pDeploymentInstance
pDatasetDeploymentInstance: !Ref pDatasetDeploymentInstance
pInfraKmsKey: !Ref pInfraKmsKey
pEventBus: !Ref pEventBus
pScheduleGroup: !Ref pScheduleGroup
pDataset: !Ref pDataset
pPipelineName: !Ref pPipeline
pStageName: !Ref pStageName
Expand Down