aws.ec2-spot-fleet-request

Custodian resource for managing EC2 Spot Fleet Requests.

Filters

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

Actions

resize

Action to resize the min/max/desired count in an application autoscaling target

There are several ways to use this action:

  1. apply a fixed resize of min, max or desired, optionally saving the previous values to a named tag (for restoring later):

policies:
  - name: offhours-ecs-off
    resource: ecs-service
    filters:
      - type: offhour
        offhour: 19
        default_tz: bst
    actions:
      - type: resize
        min-capacity: 0
        desired: 0
        save-options-tag: OffHoursPrevious
        suspend-scaling: true
  1. restore previous values for min/max/desired from a tag:

policies:
  - name: offhours-ecs-on
    resource: ecs-service
    filters:
      - type: onhour
        onhour: 8
        default_tz: bst
    actions:
      - type: resize
        restore-options-tag: OffHoursPrevious
        restore-scaling: true
properties:
  desired:
    anyOf:
    - enum:
      - current
    - minimum: 0
      type: integer
  max-capacity:
    minimum: 0
    type: integer
  min-capacity:
    minimum: 0
    type: integer
  restore-options-tag:
    type: string
  restore-scaling:
    type: boolean
  save-options-tag:
    type: string
  suspend-scaling:
    type: boolean
  type:
    enum:
    - resize
required:
- type

Permissions - ec2:CreateTags, ec2:ModifySpotFleetRequest