Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

AWSChaos allows you to inject faults into AWS services, including stopping EC2 instances, restarting instances, and detaching EBS volumes.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: AWSChaos

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the AWSChaos resource.
metadata.namespace
string
Namespace of the AWSChaos resource. Defaults to default.

Spec Fields

spec
AWSChaosSpec
required
Defines the behavior of the AWS chaos experiment.

AWSChaosSpec

action
AWSChaosAction
required
Specific AWS chaos action to perform.Enum values:
  • ec2-stop - Stop an EC2 instance
  • ec2-restart - Restart an EC2 instance (one-shot)
  • detach-volume - Detach an EBS volume from an EC2 instance
Default: ec2-stop
duration
*string
Duration of the chaos action.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
secretName
*string
Name of Kubernetes secret containing AWS credentials.The secret should contain aws_access_key_id and aws_secret_access_key keys.
awsRegion
string
required
AWS region where the target resources are located.Part of AWSSelector (inline).
awsRegion: "us-west-2"
ec2Instance
string
required
ID of the EC2 instance to target.Part of AWSSelector (inline).
ec2Instance: "i-1234567890abcdef0"
volumeID
*string
ID of the EBS volume. Required when action is detach-volume.Part of AWSSelector (inline).
volumeID: "vol-0123456789abcdef0"
deviceName
*string
Name of the device. Required when action is detach-volume.Part of AWSSelector (inline).
deviceName: "/dev/sdf"
endpoint
*string
Endpoint of the AWS server. Used for testing only.Part of AWSSelector (inline).
remoteCluster
string
Name of the remote cluster where the chaos will be deployed. If not specified, chaos is applied to the local cluster.

Status Fields

status
AWSChaosStatus
Current status of the chaos experiment.

AWSChaosStatus

conditions
[]ChaosCondition
Current global conditions. See ChaosStatus in Common Types.
experiment
ExperimentStatus
Last known experiment state including desired phase and container records.

Examples

Stop EC2 Instance

apiVersion: chaos-mesh.org/v1alpha1
kind: AWSChaos
metadata:
  name: ec2-stop
  namespace: chaos-mesh
spec:
  action: ec2-stop
  secretName: aws-credentials
  awsRegion: us-west-2
  ec2Instance: i-1234567890abcdef0
  duration: 5m

Detach EBS Volume

apiVersion: chaos-mesh.org/v1alpha1
kind: AWSChaos
metadata:
  name: volume-detach
  namespace: chaos-mesh
spec:
  action: detach-volume
  secretName: aws-credentials
  awsRegion: us-east-1
  ec2Instance: i-0987654321fedcba0
  volumeID: vol-0123456789abcdef0
  deviceName: /dev/sdf
  duration: 3m