SQL Database

the azure.sqldatabase resource is a child resource of the SQL Server resource, and the SQL Server parent id is available as the c7n:parent-id property.

Filters

  • Standard Value Filter (see Generic Filters)
  • ARM Resource Filters (see Generic Filters)
    • Metric Filter - Filter on metrics from Azure Monitor - (see SQL Server Supported Metrics)

    • Tag Filter - Filter on tag presence and/or values

    • Marked-For-Op Filter - Filter on tag that indicates a scheduled operation for a resource

  • short-term-backup-retention
    • Filter on the retention period (in days) of the database’s short term backup retention policy.

    • more info on Short Term Backups

    • If there is no short term backup retention policy set on the database, it is treated as if the retention is zero days.

    • The default comparison operation is eq

    properties:
      op:
        enum:
        - eq
        - equal
        - ne
        - not-equal
        - gt
        - greater-than
        - ge
        - gte
        - le
        - lte
        - lt
        - less-than
      retention-period-days:
        type: number
      type:
        enum:
        - short-term-backup-retention-policy
        - short-term-backup-retention
    required:
    - retention-period-days
    - type
    
  • long-term-backup-retention
    • Filter on the retention period of the database’s long term backup retention policy.

    • more info on Long Term Backups

    • If the specified backup type has not been set on the resource, it is treated as if the retention period is zero.

    • The default comparison operation is eq

    • The azure.sqldatabase resource will only get through the filter if the retention-period-units field matches the units specified in the actual long term backup retention policy.
      • Example: if the filter is looking for backups less than 1 year, and the retention policy is set to 6 months, then the database will not get through the filter because there is a unit mismatch.

    properties:
      backup-type:
        enum:
        - weekly
        - monthly
        - yearly
      op:
        enum:
        - eq
        - equal
        - ne
        - not-equal
        - gt
        - greater-than
        - ge
        - gte
        - le
        - lte
        - lt
        - less-than
      retention-period:
        type: number
      retention-period-units:
        enum:
        - day
        - days
        - week
        - weeks
        - month
        - months
        - year
        - years
      type:
        enum:
        - long-term-backup-retention-policy
        - long-term-backup-retention
    required:
    - backup-type
    - retention-period
    - retention-period-units
    - type
    

Actions

  • ARM Resource Actions (see Generic Actions)

  • update-short-term-backup-retention
    • Update the retention period (in days) for a database’s short term backup retention policy.

    properties:
      op: null
      retention-period-days:
        type: number
      type:
        enum:
        - update-short-term-backup-retention-policy
        - update-short-term-backup-retention
    required:
    - type
    
  • update-long-term-backup-retention
    • Update the retention period for a database’s long term backup retention policy.

    properties:
      backup-type:
        enum:
        - weekly
        - monthly
        - yearly
      op: null
      retention-period:
        type: number
      retention-period-units:
        enum:
        - day
        - days
        - week
        - weeks
        - month
        - months
        - year
        - years
      type:
        enum:
        - update-long-term-backup-retention-policy
        - update-long-term-backup-retention
    required:
    - type