action S3

toggle_versioning

Toggles versioning on a S3 bucket

Run it now
View details
Typeaction
Modulechaosaws.s3.actions
Nametoggle_versioning
Returnnull

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

NameTypeDefaultRequiredTitleDescription
bucket_namestringYesBucketName of the bucket
statusstringnullNoStatusBucket status: Enabled, Suspended
ownerstringnullNoOwnerAccount ID of the bucket owner
mfastringnullNoMFA SerialSerial number and value from device in the form “SN Code”
mfa_deletestringnullNoMFA Delete EnabledWhether 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