actionS3

toggle_versioning

Toggles versioning on a S3 bucket

Activity as code

Below are the details and signature of the activity Python module.

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

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