aws.redshift

Filters

default-vpc

Matches if an redshift database is in the default vpc

example

policies:
  - name: redshift-default-vpc
    resource: redshift
    filters:
      - default-vpc
properties:
  type:
    enum:
    - default-vpc
required:
- type

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: redshift-kms-key-filters
      resource: redshift
      filters:
        - type: kms-key
          key: c7n:AliasName
          value: "^(alias/aws/)"
          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

param

Filter redshift clusters based on parameter values

example

policies:
  - name: redshift-param-ssl
    resource: redshift
    filters:
      - type: param
        key: require_ssl
        value: false
        op: eq
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:
    - param
  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

Actions

delete

Action to delete a redshift cluster

To prevent unwanted deletion of redshift clusters, it is recommended to apply a filter to the rule

example

policies:
  - name: redshift-no-ssl
    resource: redshift
    filters:
      - type: param
        key: require_ssl
        value: false
        op: eq
    actions:
      - type: delete
properties:
  skip-snapshot:
    type: boolean
  type:
    enum:
    - delete
required:
- type

enable-vpc-routing

Action to enable enhanced vpc routing on a redshift cluster

More: https://docs.aws.amazon.com/redshift/latest/mgmt/enhanced-vpc-routing.html

example

policies:
  - name: redshift-enable-enhanced-routing
    resource: redshift
    filters:
      - type: value
        key: EnhancedVpcRouting
        value: false
        op: eq
    actions:
      - type: enable-vpc-routing
        value: true
properties:
  type:
    enum:
    - enable-vpc-routing
  value:
    type: boolean
required:
- type

retention

Action to set the snapshot retention period (in days)

example

policies:
  - name: redshift-snapshot-retention
    resource: redshift
    filters:
      - type: value
        key: AutomatedSnapshotRetentionPeriod
        value: 21
        op: ne
    actions:
      - type: retention
        days: 21
properties:
  days:
    type: number
  type:
    enum:
    - retention
required:
- type

set-public-access

Action to set the ‘PubliclyAccessible’ setting on a redshift cluster

example

policies:
    - name: redshift-set-public-access
      resource: redshift
      filters:
        - PubliclyAccessible: true
      actions:
        - type: set-public-access
          state: false
properties:
  state:
    type: boolean
  type:
    enum:
    - set-public-access
required:
- type

snapshot

Action to take a snapshot of a redshift cluster

example

policies:
  - name: redshift-snapshot
    resource: redshift
    filters:
      - type: value
        key: ClusterStatus
        value: available
        op: eq
    actions:
      - snapshot
properties:
  type:
    enum:
    - snapshot
required:
- type