1

当我想对 DaynamoDB 使用老化策略时,不会过滤表和备份,它会删除所有表的所有备份,这些表的年龄在定义的时间间隔内。有什么方法可以过滤和删除一些 DynamoDB 表的备份吗?(例如查找刚刚标记为“...”的表并删除名称仅在该特定表中包含“...”的备份)

policies:
  - name: dynamodb-delete-backup
    resource: dynamodb-backup
    filters:
      - type: value
        key: BackupCreationDateTime
        op: greater-than
        value_type: age
        value: 28
    actions:
      - type: delete
4

1 回答 1

0

我找到了一种解决方法,如下所示,为备份名称添加前缀;

policies:
  - name: dynamodb-create-backup
    resource: dynamodb-table
    filters:
      - not:
        - "tag:Backup": absent
    actions:
      - type: backup
        prefix: custom

  - name: dynamodb-delete-backup
    resource: dynamodb-backup
    filters:
      - type: value
        key: BackupCreationDateTime
        op: greater-than
        value_type: age
        value: 30
      - type: value
        key: BackupName
        op: regex
        value: custom-.*
于 2018-11-22T23:02:03.347 回答