Skip to content

Commit

Permalink
sqs queues, lambda functions with hardcoded names
Browse files Browse the repository at this point in the history
  • Loading branch information
cnfait committed Mar 26, 2024
1 parent 894a819 commit c968be5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
19 changes: 14 additions & 5 deletions sdlf-cicd/template-cicd-domain-roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ Resources:
Action:
- lambda:CreateFunction
- lambda:UpdateFunctionConfiguration
Resource: !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
Resource:
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf2-*
Condition: !If
- RunInVpc
- StringEquals:
Expand All @@ -417,7 +419,9 @@ Resources:
- lambda:UpdateFunctionCode
- lambda:AddPermission
- lambda:RemovePermission
Resource: !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
Resource:
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf2-*
- Effect: Allow
Action:
- lambda:GetEventSourceMapping # W11 exception
Expand All @@ -429,8 +433,10 @@ Resources:
- lambda:UpdateEventSourceMapping # can only be controlled through lambda:FunctionArn condition key
Resource: "*"
Condition:
ArnLike:
"lambda:FunctionArn": !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
"ForAnyValue:ArnLike":
"lambda:FunctionArn":
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf-*
- !Sub arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:sdlf2-*
- Effect: Allow
Action:
- logs:CreateLogGroup
Expand All @@ -443,6 +449,7 @@ Resources:
- logs:TagLogGroup
Resource:
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/*/sdlf-*
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/*/sdlf2-*
- Effect: Allow
Action:
- logs:DescribeLogGroups # W11 exception
Expand Down Expand Up @@ -544,7 +551,9 @@ Resources:
- sqs:SetQueueAttributes
- sqs:TagQueue
- sqs:UntagQueue
Resource: !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-*
Resource:
- !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf-*
- !Sub arn:${AWS::Partition}:sqs:${AWS::Region}:${AWS::AccountId}:sdlf2-*
- Effect: Allow
Action:
- ssm:AddTagsToResource
Expand Down
14 changes: 7 additions & 7 deletions sdlf-foundations/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Resources:
- logs:PutLogEvents
- logs:AssociateKmsKey
Resource:
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf-glue-replication
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf2-glue-replication
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/glue/*
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/sdlf-*
- !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:sdlf-*
Expand Down Expand Up @@ -712,7 +712,7 @@ Resources:
DeletionPolicy: Delete
UpdateReplacePolicy: Delete
Properties:
QueueName: sdlf-catalog-queue
QueueName: sdlf2-catalog-queue
RedrivePolicy:
deadLetterTargetArn: !GetAtt rDeadLetterQueueCatalog.Arn
maxReceiveCount: 1
Expand All @@ -725,7 +725,7 @@ Resources:
DeletionPolicy: Delete
UpdateReplacePolicy: Delete
Properties:
QueueName: sdlf-catalog-dlq
QueueName: sdlf2-catalog-dlq
MessageRetentionPeriod: 1209600
VisibilityTimeout: 60
KmsMasterKeyId: !GetAtt rKMSKey.Arn
Expand All @@ -742,7 +742,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./lambda/catalog/src
FunctionName: sdlf-catalog
FunctionName: sdlf2-catalog
Environment:
Variables:
ENV: !Ref pEnvironment
Expand All @@ -755,7 +755,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./lambda/catalog-redrive/src
FunctionName: sdlf-catalog-redrive
FunctionName: sdlf2-catalog-redrive
Environment:
Variables:
QUEUE: !GetAtt rQueueCatalog.QueueName
Expand Down Expand Up @@ -827,7 +827,7 @@ Resources:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf-catalog*
Resource: !Sub arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/sdlf2-catalog*
- Effect: Allow
Action:
- sqs:DeleteMessage
Expand Down Expand Up @@ -1480,7 +1480,7 @@ Resources:
rLambdaReplicate:
Type: AWS::Serverless::Function
Properties:
FunctionName: sdlf-glue-replication
FunctionName: sdlf2-glue-replication
Description: Replicates Glue Catalog Metadata and Data Quality to Octagon Schemas Table
CodeUri: ./lambda/replicate/src
Environment:
Expand Down

0 comments on commit c968be5

Please sign in to comment.