Skip to content

FIS

CloudMock emulates AWS Fault Injection Simulator (FIS), supporting experiment template management and experiment execution lifecycle.

OperationStatusNotes
CreateExperimentTemplateSupportedCreates an experiment template
GetExperimentTemplateSupportedReturns template details
ListExperimentTemplatesSupportedLists all templates
UpdateExperimentTemplateSupportedUpdates description, roleArn, and tags of a template
DeleteExperimentTemplateSupportedDeletes a template
StartExperimentSupportedStarts an experiment from a template
GetExperimentSupportedReturns experiment details with action/target states
ListExperimentsSupportedLists all experiments
StopExperimentSupportedStops a running experiment
ListTargetResourceTypesSupportedReturns supported target resource types
ListActionsSupportedReturns available FIS actions
TagResourceSupportedAdds tags to a template or experiment
UntagResourceSupportedRemoves tags from a template or experiment
ListTagsForResourceSupportedLists tags for a template or experiment
import { FisClient, CreateExperimentTemplateCommand, StartExperimentCommand } from '@aws-sdk/client-fis';
const client = new FisClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { experimentTemplate } = await client.send(new CreateExperimentTemplateCommand({
description: 'Stop instances experiment',
roleArn: 'arn:aws:iam::000000000000:role/fis-role',
stopConditions: [{ source: 'none' }],
actions: { stopInstances: { actionId: 'aws:ec2:stop-instances', targets: { Instances: 'myTargets' } } },
targets: { myTargets: { resourceType: 'aws:ec2:instance', selectionMode: 'ALL', resourceTags: { env: 'test' } } },
}));
await client.send(new StartExperimentCommand({
experimentTemplateId: experimentTemplate.id,
}));
import boto3
client = boto3.client('fis',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
template = client.create_experiment_template(
description='Stop instances experiment',
roleArn='arn:aws:iam::000000000000:role/fis-role',
stopConditions=[{'source': 'none'}],
actions={'stopInstances': {'actionId': 'aws:ec2:stop-instances', 'targets': {'Instances': 'myTargets'}}},
targets={'myTargets': {'resourceType': 'aws:ec2:instance', 'selectionMode': 'ALL', 'resourceTags': {'env': 'test'}}})
client.start_experiment(
experimentTemplateId=template['experimentTemplate']['id'])
cloudmock.yml
services:
fis:
enabled: true
  • Experiments do not actually inject faults into resources
  • Experiment status transitions are simulated
  • Stop conditions are not evaluated