Skip to content

Commit

Permalink
add back original table name
Browse files Browse the repository at this point in the history
  • Loading branch information
jdub233 committed Nov 14, 2023
1 parent 9c9362b commit f53bfc3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Resources:
Action: "*"
# Allow user to write rules to the DynamoDB table.
- Effect: Allow
Resource: !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${TempAccessControlDynamoDB}
Resource: !Sub arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${AccessControlDynamoDB}
Action:
- dynamodb:PutItem
- dynamodb:GetItem
Expand Down Expand Up @@ -147,12 +147,12 @@ Resources:
Timeout: 30
Environment:
Variables:
DYNAMODB_TABLE: !Ref TempAccessControlDynamoDB
DYNAMODB_TABLE: !Ref AccessControlDynamoDB
ORIGINAL_BUCKET: !Ref S3Bucket
# The function needs permission to call back to the S3 Object Lambda Access Point with the WriteGetObjectResponse.
Policies:
- DynamoDBReadPolicy:
TableName: !Ref TempAccessControlDynamoDB
TableName: !Ref AccessControlDynamoDB
- S3CrudPolicy:
BucketName: !Ref S3Bucket
- Statement:
Expand All @@ -161,6 +161,14 @@ Resources:
Resource: '*'

# DynamoDB table
AccessControlDynamoDB:
Type: AWS::Serverless::SimpleTable
Properties:
PrimaryKey:
Name: PK
Type: String
TableName: !Sub ${AWS::StackName}-AccessControl

TempAccessControlDynamoDB:
Type: AWS::Serverless::SimpleTable
Properties:
Expand Down

0 comments on commit f53bfc3

Please sign in to comment.