run idempotency
This commit is contained in:
@@ -41,6 +41,21 @@ Resources:
|
||||
LogGroupName: /aws/lambda/eth-demo-sign-pdfs
|
||||
RetentionInDays: 7
|
||||
|
||||
DedupTable:
|
||||
Type: AWS::DynamoDB::Table
|
||||
Properties:
|
||||
TableName: !Sub ${AWS::StackName}-sign-pdfs-dedup
|
||||
BillingMode: PAY_PER_REQUEST
|
||||
AttributeDefinitions:
|
||||
- AttributeName: id
|
||||
AttributeType: S
|
||||
KeySchema:
|
||||
- AttributeName: id
|
||||
KeyType: HASH
|
||||
TimeToLiveSpecification:
|
||||
AttributeName: ttl
|
||||
Enabled: true
|
||||
|
||||
SignPdfsFunction:
|
||||
Type: AWS::Serverless::Function
|
||||
Properties:
|
||||
@@ -55,6 +70,7 @@ Resources:
|
||||
BUCKET_NAME: !Ref ReportsBucket
|
||||
PREFIX: !Ref Prefix
|
||||
URL_EXPIRY_SECONDS: "900"
|
||||
DEDUP_TABLE: !Ref DedupTable
|
||||
Policies:
|
||||
- Statement:
|
||||
- Sid: ListReportsBucket
|
||||
@@ -69,6 +85,12 @@ Resources:
|
||||
Effect: Allow
|
||||
Action: s3:PutObject
|
||||
Resource: !Sub "${ReportsBucket.Arn}/manifests/*"
|
||||
- Sid: DedupTableAccess
|
||||
Effect: Allow
|
||||
Action:
|
||||
- dynamodb:GetItem
|
||||
- dynamodb:PutItem
|
||||
Resource: !GetAtt DedupTable.Arn
|
||||
|
||||
Outputs:
|
||||
ReportsBucketName:
|
||||
|
||||
Reference in New Issue
Block a user