AWS
action S3

# toggle_versioning

Toggles versioning on a S3 bucket

Run it now
View details

Type | action
Module | chaosaws.s3.actions
Name | toggle_versioning
Return | null

Usage

JSON

    {
      "name": "toggle-versioning",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosaws.s3.actions",
        "func": "toggle_versioning",
        "arguments": {
          "bucket_name": ""
        }
      }
    }

YAML

    name: toggle-versioning
    provider:
      arguments:
        bucket_name: ""
      func: toggle_versioning
      module: chaosaws.s3.actions
      type: python
    type: action

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
bucket_name | string |  | Yes | Bucket | Name of the bucket
status | string | null | No | Status | Bucket status: Enabled, Suspended
owner | string | null | No | Owner | Account ID of the bucket owner
mfa | string | null | No | MFA Serial | Serial number and value from device in the form “SN Code”
mfa_delete | string | null | No | MFA Delete Enabled | Whether the MFA deletion is enabled on the bucket

- bucket_name: The S3 bucket name
- status: “Enabled” to turn on versioning, “Suspended” to disable
- mfa: The authentication device serial number, a space, and the value from the device (optional)
- mfa_delete: Specifies if MFA delete is enabled in the bucket versioning (optional)
- owner: The account ID of the expected bucket owner (optional)

If the “status” parameter is not provided, the bucket will be scanned to determine if versioning is enabled. If it is enabled, it will be suspended. If it is suspended it will be enabled using basic values unless MFA is provided.

Signature

    def toggle_versioning(bucket_name: str,
                          mfa_delete: str = None,
                          status: str = None,
                          mfa: str = None,
                          owner: str = None,
                          configuration: Dict[str, Dict[str, str]] = None,
                          secrets: Dict[str, Dict[str, str]] = None) -> None:
        pass

## Related starters

- AWS
  probe S3

  ## `bucket_exists`

  Validate that a bucket exists
- AWS
  action S3

  ## `delete_object`

  Delete an object in a S3 bucket
- AWS
  action S3

  ## `object_exists`

  Validate that an object exists in a S3 bucket