Auto Scaling Groups (ASG)

Filters

Actions

remove-tag or untag or unmark

Removes tag from ASG.

Schema:
{
  "key": {
    "type": "string"
  }
}
tag or mark

Create or update tag on ASG.

Schema:
{
  "key": {
    "type": "string"
  },
  "msg": {
    "type": "string"
  },
  "propagate": {
    "type": "boolean"
  },
  "tag": {
    "type": "string"
  },
  "value": {
    "type": "string"
  }
}
propagate-tags

Propagate tags to an ASG instances. In AWS changing an ASG tag does not propagate to instances. This action exists to do that, and can also trim older tags not present on the ASG anymore that are still present on instances.

Schema:
{
  "tags": {
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "trim": {
    "type": "boolean"
  }
}
rename-tag

Rename a tag on an AutoScaleGroup.

Schema:
{
  "dest": {
    "required": true,
    "type": "string"
  },
  "propagate": {
    "type": "boolean"
  },
  "source": {
    "required": true,
    "type": "string"
  }
}
mark-for-op

Tag ASG for an operation.

Schema:
{
  "days": {
    "minimum": 0,
    "type": "number"
  },
  "key": {
    "type": "string"
  },
  "message": {
    "type": "string"
  },
  "op": {
    "enum": [
      "suspend",
      "resume",
      "delete"
    ]
  },
  "tag": {
    "type": "string"
  }
}
suspend

Multistep process to stop an ASG. Suspend processes, note load balancer in tag, detach load balancer, and then stop instances.

Schema:
{
  "exclude": {
    "items": {
      "enum": [
        "Launch",
        "Terminate",
        "HealthCheck",
        "ReplaceUnhealthy",
        "AZRebalance",
        "AlarmNotification",
        "ScheduledActions",
        "AddToLoadBalancer"
      ]
    },
    "title": "ASG Processes to not suspend",
    "type": "array"
  }
}
resume

Multi-step process to resume an ASG. Start any stopped EC2 instances, reattach ELB, and resume ASG processes.

Schema:
{
  "delay": {
    "type": "number"
  }
}
delete

Delete ASG.

Schema:
{
  "force": {
    "type": "boolean"
  }
}
offhour or OffHour

Turn resources off based on a schedule. :py:class:c7n.offhours

Schema:
{
  "default_tz": {
    "required": true,
    "type": "string"
  },
  "offhour": {
    "maximum": 23,
    "minimum": 0,
    "required": true,
    "type": "integer"
  },
  "opt-out": {
    "type": "boolean"
  },
  "skip-days": {
    "items": {
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}",
      "type": "string"
    },
    "type": "array"
  },
  "skip-days-from": {
    "additionalProperties": "False",
    "properties": {
      "expr": {
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "format": {
        "enum": [
          "csv",
          "json",
          "txt",
          "csv2dict"
        ]
      },
      "url": {
        "type": "string"
      }
    },
    "required": [
      "url"
    ],
    "type": "object"
  },
  "tag": {
    "type": "string"
  },
  "weekends": {
    "type": "boolean"
  },
  "weekends-only": {
    "type": "boolean"
  }
}
onhour or onhour

Turn resources on based on a schedule. :py:class:c7n.offhours

Schema:
{
  "default_tz": {
    "required": true,
    "type": "string"
  },
  "onhour": {
    "maximum": 23,
    "minimum": 0,
    "required": true,
    "type": "integer"
  },
  "opt-out": {
    "type": "boolean"
  },
  "skip-days": {
    "items": {
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}",
      "type": "string"
    },
    "type": "array"
  },
  "skip-days-from": {
    "additionalProperties": "False",
    "properties": {
      "expr": {
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "string"
          }
        ]
      },
      "format": {
        "enum": [
          "csv",
          "json",
          "txt",
          "csv2dict"
        ]
      },
      "url": {
        "type": "string"
      }
    },
    "required": [
      "url"
    ],
    "type": "object"
  },
  "tag": {
    "type": "string"
  },
  "weekends": {
    "type": "boolean"
  },
  "weekends-only": {
    "type": "boolean"
  }
}