aws.dynamodb-table

Filters

continuous-backup

Check for continuous backups and point in time recovery (PITR) on a dynamodb table.

example

policies:
  - name: dynamodb-continuous-backups-disabled
    resource: aws.dynamodb-table
    filters:
      - type: continuous-backup
        key: ContinuousBackupsStatus
        op: eq
        value: DISABLED
  - name: dynamodb-pitr-disabled
    resource: aws.dynamodb-table
    filters:
      - type: continuous-backup
        key: PointInTimeRecoveryDescription.PointInTimeRecoveryStatus
        op: ne
        value: ENABLED
properties:
  default:
    type: object
  key:
    type: string
  op:
    enum:
    - eq
    - equal
    - ne
    - not-equal
    - gt
    - greater-than
    - ge
    - gte
    - le
    - lte
    - lt
    - less-than
    - glob
    - regex
    - regex-case
    - in
    - ni
    - not-in
    - contains
    - difference
    - intersect
  type:
    enum:
    - continuous-backup
  value:
    oneOf:
    - type: array
    - type: string
    - type: boolean
    - type: number
    - type: 'null'
  value_from:
    additionalProperties: 'False'
    properties:
      expr:
        oneOf:
        - type: integer
        - type: string
      format:
        enum:
        - csv
        - json
        - txt
        - csv2dict
      url:
        type: string
    required:
    - url
    type: object
  value_regex:
    type: string
  value_type:
    enum:
    - age
    - integer
    - expiration
    - normalize
    - size
    - cidr
    - cidr_size
    - swap
    - resource_count
    - expr
    - unique_size
    - date
    - version
required:
- type

Permissions - dynamodb:DescribeContinuousBackups

json-diff

Compute the diff from the current resource to a previous version.

A resource matches the filter if a diff exists between the current resource and the selected revision.

Utilizes config as a resource revision database.

Revisions can be selected by date, against the previous version, and against a locked version (requires use of is-locked filter).

properties:
  selector:
    enum:
    - previous
    - date
    - locked
  selector_value:
    type: string
  type:
    enum:
    - json-diff
required:
- type

Permissions - config:GetResourceConfigHistory

kms-key

Filter a resource by its associcated kms key and optionally the aliasname of the kms key by using ‘c7n:AliasName’

example

policies:
  - name: dynamodb-kms-key-filters
    resource: dynamodb-table
    filters:
      - type: kms-key
        key: c7n:AliasName
        value: "^(alias/aws/dynamodb)"
        op: regex
properties:
  default:
    type: object
  key:
    type: string
  match-resource:
    type: boolean
  op:
    enum:
    - eq
    - equal
    - ne
    - not-equal
    - gt
    - greater-than
    - ge
    - gte
    - le
    - lte
    - lt
    - less-than
    - glob
    - regex
    - regex-case
    - in
    - ni
    - not-in
    - contains
    - difference
    - intersect
  operator:
    enum:
    - and
    - or
  type:
    enum:
    - kms-key
  value:
    oneOf:
    - type: array
    - type: string
    - type: boolean
    - type: number
    - type: 'null'
  value_from:
    additionalProperties: 'False'
    properties:
      expr:
        oneOf:
        - type: integer
        - type: string
      format:
        enum:
        - csv
        - json
        - txt
        - csv2dict
      url:
        type: string
    required:
    - url
    type: object
  value_regex:
    type: string
  value_type:
    enum:
    - age
    - integer
    - expiration
    - normalize
    - size
    - cidr
    - cidr_size
    - swap
    - resource_count
    - expr
    - unique_size
    - date
    - version
required:
- type

Permissions - kms:ListKeys

Actions

backup

Creates a manual backup of a DynamoDB table. Use of the optional

prefix flag will attach a user specified prefix. Otherwise, the backup prefix will default to ‘Backup’.

example

policies:
  - name: dynamodb-create-backup
    resource: dynamodb-table
    actions:
      - type: backup
        prefix: custom
properties:
  prefix:
    type: string
  type:
    enum:
    - backup
required:
- type

Permissions - dynamodb:CreateBackup

delete

Action to delete dynamodb tables

example

policies:
  - name: delete-empty-tables
    resource: dynamodb-table
    filters:
      - TableSizeBytes: 0
    actions:
      - delete
properties:
  type:
    enum:
    - delete
required:
- type

Permissions - dynamodb:DeleteTable

set-continuous-backup

Set continuous backups and point in time recovery (PITR) on a dynamodb table.

example

policies:
  - name: dynamodb-continuous-backups-disabled-set
    resource: aws.dynamodb-table
    filters:
      - type: continuous-backup
        key: ContinuousBackupsStatus
        op: eq
        value: DISABLED
    actions:
      - type: set-continuous-backup
properties:
  state:
    default: true
    type: boolean
  type:
    enum:
    - set-continuous-backup
required:
- type

Permissions - dynamodb:UpdateContinuousBackups

set-stream

Action to enable/disable streams on table.

example

policies:
  - name: stream-update
    resource: dynamodb-table
    filters:
      - TableName: 'test'
      - TableStatus: 'ACTIVE'
    actions:
      - type: set-stream
        state: True
        stream_view_type: 'NEW_IMAGE'
properties:
  state:
    type: boolean
  stream_view_type:
    type: string
  type:
    enum:
    - set-stream
required:
- type

Permissions - dynamodb:UpdateTable