run idempotency

This commit is contained in:
2026-05-18 06:48:51 -03:00
parent 84fef80339
commit d3008676e0
2 changed files with 80 additions and 1 deletions

View File

@@ -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: