AWS Fault Injection Simulator

2024/09/04 - AWS Fault Injection Simulator - 2 new 4 updated api methods

Changes  This release adds safety levers, a new mechanism to stop all running experiments and prevent new experiments from starting.

UpdateSafetyLeverState (new) Link ¶

Updates the specified safety lever state.

See also: AWS API Documentation

Request Syntax

client.update_safety_lever_state(
    id='string',
    state={
        'status': 'disengaged'|'engaged',
        'reason': 'string'
    }
)
type id

string

param id

[REQUIRED]

The ID of the safety lever.

type state

dict

param state

[REQUIRED]

The state of the safety lever.

  • status (string) -- [REQUIRED]

    The updated state of the safety lever.

  • reason (string) -- [REQUIRED]

    The reason for updating the state of the safety lever.

rtype

dict

returns

Response Syntax

{
    'safetyLever': {
        'id': 'string',
        'arn': 'string',
        'state': {
            'status': 'disengaged'|'engaged'|'engaging',
            'reason': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • safetyLever (dict) --

      Information about the safety lever.

      • id (string) --

        The ID of the safety lever.

      • arn (string) --

        The Amazon Resource Name (ARN) of the safety lever.

      • state (dict) --

        The state of the safety lever.

        • status (string) --

          The state of the safety lever.

        • reason (string) --

          The reason for the state of the safety lever.

GetSafetyLever (new) Link ¶

Gets information about the specified safety lever.

See also: AWS API Documentation

Request Syntax

client.get_safety_lever(
    id='string'
)
type id

string

param id

[REQUIRED]

The ID of the safety lever.

rtype

dict

returns

Response Syntax

{
    'safetyLever': {
        'id': 'string',
        'arn': 'string',
        'state': {
            'status': 'disengaged'|'engaged'|'engaging',
            'reason': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • safetyLever (dict) --

      Information about the safety lever.

      • id (string) --

        The ID of the safety lever.

      • arn (string) --

        The Amazon Resource Name (ARN) of the safety lever.

      • state (dict) --

        The state of the safety lever.

        • status (string) --

          The state of the safety lever.

        • reason (string) --

          The reason for the state of the safety lever.

GetExperiment (updated) Link ¶
Changes (response)
{'experiment': {'state': {'status': {'cancelled'}}}}

Gets information about the specified experiment.

See also: AWS API Documentation

Request Syntax

client.get_experiment(
    id='string'
)
type id

string

param id

[REQUIRED]

The ID of the experiment.

rtype

dict

returns

Response Syntax

{
    'experiment': {
        'id': 'string',
        'arn': 'string',
        'experimentTemplateId': 'string',
        'roleArn': 'string',
        'state': {
            'status': 'pending'|'initiating'|'running'|'completed'|'stopping'|'stopped'|'failed'|'cancelled',
            'reason': 'string',
            'error': {
                'accountId': 'string',
                'code': 'string',
                'location': 'string'
            }
        },
        'targets': {
            'string': {
                'resourceType': 'string',
                'resourceArns': [
                    'string',
                ],
                'resourceTags': {
                    'string': 'string'
                },
                'filters': [
                    {
                        'path': 'string',
                        'values': [
                            'string',
                        ]
                    },
                ],
                'selectionMode': 'string',
                'parameters': {
                    'string': 'string'
                }
            }
        },
        'actions': {
            'string': {
                'actionId': 'string',
                'description': 'string',
                'parameters': {
                    'string': 'string'
                },
                'targets': {
                    'string': 'string'
                },
                'startAfter': [
                    'string',
                ],
                'state': {
                    'status': 'pending'|'initiating'|'running'|'completed'|'cancelled'|'stopping'|'stopped'|'failed'|'skipped',
                    'reason': 'string'
                },
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1)
            }
        },
        'stopConditions': [
            {
                'source': 'string',
                'value': 'string'
            },
        ],
        'creationTime': datetime(2015, 1, 1),
        'startTime': datetime(2015, 1, 1),
        'endTime': datetime(2015, 1, 1),
        'tags': {
            'string': 'string'
        },
        'logConfiguration': {
            'cloudWatchLogsConfiguration': {
                'logGroupArn': 'string'
            },
            's3Configuration': {
                'bucketName': 'string',
                'prefix': 'string'
            },
            'logSchemaVersion': 123
        },
        'experimentOptions': {
            'accountTargeting': 'single-account'|'multi-account',
            'emptyTargetResolutionMode': 'fail'|'skip',
            'actionsMode': 'skip-all'|'run-all'
        },
        'targetAccountConfigurationsCount': 123
    }
}

Response Structure

  • (dict) --

    • experiment (dict) --

      Information about the experiment.

      • id (string) --

        The ID of the experiment.

      • arn (string) --

        The Amazon Resource Name (ARN) of the experiment.

      • experimentTemplateId (string) --

        The ID of the experiment template.

      • roleArn (string) --

        The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.

      • state (dict) --

        The state of the experiment.

        • status (string) --

          The state of the experiment.

        • reason (string) --

          The reason for the state.

        • error (dict) --

          The error information of the experiment when the action has failed .

          • accountId (string) --

            The Amazon Web Services Account ID where the experiment failure occurred.

          • code (string) --

            The error code for the failed experiment.

          • location (string) --

            Context for the section of the experiment template that failed.

      • targets (dict) --

        The targets for the experiment.

        • (string) --

          • (dict) --

            Describes a target for an experiment.

            • resourceType (string) --

              The resource type.

            • resourceArns (list) --

              The Amazon Resource Names (ARNs) of the resources.

              • (string) --

            • resourceTags (dict) --

              The tags for the target resources.

              • (string) --

                • (string) --

            • filters (list) --

              The filters to apply to identify target resources using specific attributes.

              • (dict) --

                Describes a filter used for the target resources in an experiment.

                • path (string) --

                  The attribute path for the filter.

                • values (list) --

                  The attribute values for the filter.

                  • (string) --

            • selectionMode (string) --

              Scopes the identified resources to a specific count or percentage.

            • parameters (dict) --

              The resource type parameters.

              • (string) --

                • (string) --

      • actions (dict) --

        The actions for the experiment.

        • (string) --

          • (dict) --

            Describes the action for an experiment.

            • actionId (string) --

              The ID of the action.

            • description (string) --

              The description for the action.

            • parameters (dict) --

              The parameters for the action.

              • (string) --

                • (string) --

            • targets (dict) --

              The targets for the action.

              • (string) --

                • (string) --

            • startAfter (list) --

              The name of the action that must be completed before this action starts.

              • (string) --

            • state (dict) --

              The state of the action.

              • status (string) --

                The state of the action.

              • reason (string) --

                The reason for the state.

            • startTime (datetime) --

              The time that the action started.

            • endTime (datetime) --

              The time that the action ended.

      • stopConditions (list) --

        The stop conditions for the experiment.

        • (dict) --

          Describes the stop condition for an experiment.

          • source (string) --

            The source for the stop condition.

          • value (string) --

            The Amazon Resource Name (ARN) of the CloudWatch alarm, if applicable.

      • creationTime (datetime) --

        The time that the experiment was created.

      • startTime (datetime) --

        The time that the experiment started.

      • endTime (datetime) --

        The time that the experiment ended.

      • tags (dict) --

        The tags for the experiment.

        • (string) --

          • (string) --

      • logConfiguration (dict) --

        The configuration for experiment logging.

        • cloudWatchLogsConfiguration (dict) --

          The configuration for experiment logging to Amazon CloudWatch Logs.

          • logGroupArn (string) --

            The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log group.

        • s3Configuration (dict) --

          The configuration for experiment logging to Amazon S3.

          • bucketName (string) --

            The name of the destination bucket.

          • prefix (string) --

            The bucket prefix.

        • logSchemaVersion (integer) --

          The schema version.

      • experimentOptions (dict) --

        The experiment options for the experiment.

        • accountTargeting (string) --

          The account targeting setting for an experiment.

        • emptyTargetResolutionMode (string) --

          The empty target resolution mode for an experiment.

        • actionsMode (string) --

          The actions mode of the experiment that is set from the StartExperiment API command.

      • targetAccountConfigurationsCount (integer) --

        The count of target account configurations for the experiment.

ListExperiments (updated) Link ¶
Changes (response)
{'experiments': {'state': {'status': {'cancelled'}}}}

Lists your experiments.

See also: AWS API Documentation

Request Syntax

client.list_experiments(
    maxResults=123,
    nextToken='string',
    experimentTemplateId='string'
)
type maxResults

integer

param maxResults

The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

type nextToken

string

param nextToken

The token for the next page of results.

type experimentTemplateId

string

param experimentTemplateId

The ID of the experiment template.

rtype

dict

returns

Response Syntax

{
    'experiments': [
        {
            'id': 'string',
            'arn': 'string',
            'experimentTemplateId': 'string',
            'state': {
                'status': 'pending'|'initiating'|'running'|'completed'|'stopping'|'stopped'|'failed'|'cancelled',
                'reason': 'string',
                'error': {
                    'accountId': 'string',
                    'code': 'string',
                    'location': 'string'
                }
            },
            'creationTime': datetime(2015, 1, 1),
            'tags': {
                'string': 'string'
            },
            'experimentOptions': {
                'accountTargeting': 'single-account'|'multi-account',
                'emptyTargetResolutionMode': 'fail'|'skip',
                'actionsMode': 'skip-all'|'run-all'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • experiments (list) --

      The experiments.

      • (dict) --

        Provides a summary of an experiment.

        • id (string) --

          The ID of the experiment.

        • arn (string) --

          The Amazon Resource Name (ARN) of the experiment.

        • experimentTemplateId (string) --

          The ID of the experiment template.

        • state (dict) --

          The state of the experiment.

          • status (string) --

            The state of the experiment.

          • reason (string) --

            The reason for the state.

          • error (dict) --

            The error information of the experiment when the action has failed .

            • accountId (string) --

              The Amazon Web Services Account ID where the experiment failure occurred.

            • code (string) --

              The error code for the failed experiment.

            • location (string) --

              Context for the section of the experiment template that failed.

        • creationTime (datetime) --

          The time that the experiment was created.

        • tags (dict) --

          The tags for the experiment.

          • (string) --

            • (string) --

        • experimentOptions (dict) --

          The experiment options for the experiment.

          • accountTargeting (string) --

            The account targeting setting for an experiment.

          • emptyTargetResolutionMode (string) --

            The empty target resolution mode for an experiment.

          • actionsMode (string) --

            The actions mode of the experiment that is set from the StartExperiment API command.

    • nextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.

StartExperiment (updated) Link ¶
Changes (response)
{'experiment': {'state': {'status': {'cancelled'}}}}

Starts running an experiment from the specified experiment template.

See also: AWS API Documentation

Request Syntax

client.start_experiment(
    clientToken='string',
    experimentTemplateId='string',
    experimentOptions={
        'actionsMode': 'skip-all'|'run-all'
    },
    tags={
        'string': 'string'
    }
)
type clientToken

string

param clientToken

[REQUIRED]

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

This field is autopopulated if not provided.

type experimentTemplateId

string

param experimentTemplateId

[REQUIRED]

The ID of the experiment template.

type experimentOptions

dict

param experimentOptions

The experiment options for running the experiment.

  • actionsMode (string) --

    Specifies the actions mode for experiment options.

type tags

dict

param tags

The tags to apply to the experiment.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'experiment': {
        'id': 'string',
        'arn': 'string',
        'experimentTemplateId': 'string',
        'roleArn': 'string',
        'state': {
            'status': 'pending'|'initiating'|'running'|'completed'|'stopping'|'stopped'|'failed'|'cancelled',
            'reason': 'string',
            'error': {
                'accountId': 'string',
                'code': 'string',
                'location': 'string'
            }
        },
        'targets': {
            'string': {
                'resourceType': 'string',
                'resourceArns': [
                    'string',
                ],
                'resourceTags': {
                    'string': 'string'
                },
                'filters': [
                    {
                        'path': 'string',
                        'values': [
                            'string',
                        ]
                    },
                ],
                'selectionMode': 'string',
                'parameters': {
                    'string': 'string'
                }
            }
        },
        'actions': {
            'string': {
                'actionId': 'string',
                'description': 'string',
                'parameters': {
                    'string': 'string'
                },
                'targets': {
                    'string': 'string'
                },
                'startAfter': [
                    'string',
                ],
                'state': {
                    'status': 'pending'|'initiating'|'running'|'completed'|'cancelled'|'stopping'|'stopped'|'failed'|'skipped',
                    'reason': 'string'
                },
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1)
            }
        },
        'stopConditions': [
            {
                'source': 'string',
                'value': 'string'
            },
        ],
        'creationTime': datetime(2015, 1, 1),
        'startTime': datetime(2015, 1, 1),
        'endTime': datetime(2015, 1, 1),
        'tags': {
            'string': 'string'
        },
        'logConfiguration': {
            'cloudWatchLogsConfiguration': {
                'logGroupArn': 'string'
            },
            's3Configuration': {
                'bucketName': 'string',
                'prefix': 'string'
            },
            'logSchemaVersion': 123
        },
        'experimentOptions': {
            'accountTargeting': 'single-account'|'multi-account',
            'emptyTargetResolutionMode': 'fail'|'skip',
            'actionsMode': 'skip-all'|'run-all'
        },
        'targetAccountConfigurationsCount': 123
    }
}

Response Structure

  • (dict) --

    • experiment (dict) --

      Information about the experiment.

      • id (string) --

        The ID of the experiment.

      • arn (string) --

        The Amazon Resource Name (ARN) of the experiment.

      • experimentTemplateId (string) --

        The ID of the experiment template.

      • roleArn (string) --

        The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.

      • state (dict) --

        The state of the experiment.

        • status (string) --

          The state of the experiment.

        • reason (string) --

          The reason for the state.

        • error (dict) --

          The error information of the experiment when the action has failed .

          • accountId (string) --

            The Amazon Web Services Account ID where the experiment failure occurred.

          • code (string) --

            The error code for the failed experiment.

          • location (string) --

            Context for the section of the experiment template that failed.

      • targets (dict) --

        The targets for the experiment.

        • (string) --

          • (dict) --

            Describes a target for an experiment.

            • resourceType (string) --

              The resource type.

            • resourceArns (list) --

              The Amazon Resource Names (ARNs) of the resources.

              • (string) --

            • resourceTags (dict) --

              The tags for the target resources.

              • (string) --

                • (string) --

            • filters (list) --

              The filters to apply to identify target resources using specific attributes.

              • (dict) --

                Describes a filter used for the target resources in an experiment.

                • path (string) --

                  The attribute path for the filter.

                • values (list) --

                  The attribute values for the filter.

                  • (string) --

            • selectionMode (string) --

              Scopes the identified resources to a specific count or percentage.

            • parameters (dict) --

              The resource type parameters.

              • (string) --

                • (string) --

      • actions (dict) --

        The actions for the experiment.

        • (string) --

          • (dict) --

            Describes the action for an experiment.

            • actionId (string) --

              The ID of the action.

            • description (string) --

              The description for the action.

            • parameters (dict) --

              The parameters for the action.

              • (string) --

                • (string) --

            • targets (dict) --

              The targets for the action.

              • (string) --

                • (string) --

            • startAfter (list) --

              The name of the action that must be completed before this action starts.

              • (string) --

            • state (dict) --

              The state of the action.

              • status (string) --

                The state of the action.

              • reason (string) --

                The reason for the state.

            • startTime (datetime) --

              The time that the action started.

            • endTime (datetime) --

              The time that the action ended.

      • stopConditions (list) --

        The stop conditions for the experiment.

        • (dict) --

          Describes the stop condition for an experiment.

          • source (string) --

            The source for the stop condition.

          • value (string) --

            The Amazon Resource Name (ARN) of the CloudWatch alarm, if applicable.

      • creationTime (datetime) --

        The time that the experiment was created.

      • startTime (datetime) --

        The time that the experiment started.

      • endTime (datetime) --

        The time that the experiment ended.

      • tags (dict) --

        The tags for the experiment.

        • (string) --

          • (string) --

      • logConfiguration (dict) --

        The configuration for experiment logging.

        • cloudWatchLogsConfiguration (dict) --

          The configuration for experiment logging to Amazon CloudWatch Logs.

          • logGroupArn (string) --

            The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log group.

        • s3Configuration (dict) --

          The configuration for experiment logging to Amazon S3.

          • bucketName (string) --

            The name of the destination bucket.

          • prefix (string) --

            The bucket prefix.

        • logSchemaVersion (integer) --

          The schema version.

      • experimentOptions (dict) --

        The experiment options for the experiment.

        • accountTargeting (string) --

          The account targeting setting for an experiment.

        • emptyTargetResolutionMode (string) --

          The empty target resolution mode for an experiment.

        • actionsMode (string) --

          The actions mode of the experiment that is set from the StartExperiment API command.

      • targetAccountConfigurationsCount (integer) --

        The count of target account configurations for the experiment.

StopExperiment (updated) Link ¶
Changes (response)
{'experiment': {'state': {'status': {'cancelled'}}}}

Stops the specified experiment.

See also: AWS API Documentation

Request Syntax

client.stop_experiment(
    id='string'
)
type id

string

param id

[REQUIRED]

The ID of the experiment.

rtype

dict

returns

Response Syntax

{
    'experiment': {
        'id': 'string',
        'arn': 'string',
        'experimentTemplateId': 'string',
        'roleArn': 'string',
        'state': {
            'status': 'pending'|'initiating'|'running'|'completed'|'stopping'|'stopped'|'failed'|'cancelled',
            'reason': 'string',
            'error': {
                'accountId': 'string',
                'code': 'string',
                'location': 'string'
            }
        },
        'targets': {
            'string': {
                'resourceType': 'string',
                'resourceArns': [
                    'string',
                ],
                'resourceTags': {
                    'string': 'string'
                },
                'filters': [
                    {
                        'path': 'string',
                        'values': [
                            'string',
                        ]
                    },
                ],
                'selectionMode': 'string',
                'parameters': {
                    'string': 'string'
                }
            }
        },
        'actions': {
            'string': {
                'actionId': 'string',
                'description': 'string',
                'parameters': {
                    'string': 'string'
                },
                'targets': {
                    'string': 'string'
                },
                'startAfter': [
                    'string',
                ],
                'state': {
                    'status': 'pending'|'initiating'|'running'|'completed'|'cancelled'|'stopping'|'stopped'|'failed'|'skipped',
                    'reason': 'string'
                },
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1)
            }
        },
        'stopConditions': [
            {
                'source': 'string',
                'value': 'string'
            },
        ],
        'creationTime': datetime(2015, 1, 1),
        'startTime': datetime(2015, 1, 1),
        'endTime': datetime(2015, 1, 1),
        'tags': {
            'string': 'string'
        },
        'logConfiguration': {
            'cloudWatchLogsConfiguration': {
                'logGroupArn': 'string'
            },
            's3Configuration': {
                'bucketName': 'string',
                'prefix': 'string'
            },
            'logSchemaVersion': 123
        },
        'experimentOptions': {
            'accountTargeting': 'single-account'|'multi-account',
            'emptyTargetResolutionMode': 'fail'|'skip',
            'actionsMode': 'skip-all'|'run-all'
        },
        'targetAccountConfigurationsCount': 123
    }
}

Response Structure

  • (dict) --

    • experiment (dict) --

      Information about the experiment.

      • id (string) --

        The ID of the experiment.

      • arn (string) --

        The Amazon Resource Name (ARN) of the experiment.

      • experimentTemplateId (string) --

        The ID of the experiment template.

      • roleArn (string) --

        The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.

      • state (dict) --

        The state of the experiment.

        • status (string) --

          The state of the experiment.

        • reason (string) --

          The reason for the state.

        • error (dict) --

          The error information of the experiment when the action has failed .

          • accountId (string) --

            The Amazon Web Services Account ID where the experiment failure occurred.

          • code (string) --

            The error code for the failed experiment.

          • location (string) --

            Context for the section of the experiment template that failed.

      • targets (dict) --

        The targets for the experiment.

        • (string) --

          • (dict) --

            Describes a target for an experiment.

            • resourceType (string) --

              The resource type.

            • resourceArns (list) --

              The Amazon Resource Names (ARNs) of the resources.

              • (string) --

            • resourceTags (dict) --

              The tags for the target resources.

              • (string) --

                • (string) --

            • filters (list) --

              The filters to apply to identify target resources using specific attributes.

              • (dict) --

                Describes a filter used for the target resources in an experiment.

                • path (string) --

                  The attribute path for the filter.

                • values (list) --

                  The attribute values for the filter.

                  • (string) --

            • selectionMode (string) --

              Scopes the identified resources to a specific count or percentage.

            • parameters (dict) --

              The resource type parameters.

              • (string) --

                • (string) --

      • actions (dict) --

        The actions for the experiment.

        • (string) --

          • (dict) --

            Describes the action for an experiment.

            • actionId (string) --

              The ID of the action.

            • description (string) --

              The description for the action.

            • parameters (dict) --

              The parameters for the action.

              • (string) --

                • (string) --

            • targets (dict) --

              The targets for the action.

              • (string) --

                • (string) --

            • startAfter (list) --

              The name of the action that must be completed before this action starts.

              • (string) --

            • state (dict) --

              The state of the action.

              • status (string) --

                The state of the action.

              • reason (string) --

                The reason for the state.

            • startTime (datetime) --

              The time that the action started.

            • endTime (datetime) --

              The time that the action ended.

      • stopConditions (list) --

        The stop conditions for the experiment.

        • (dict) --

          Describes the stop condition for an experiment.

          • source (string) --

            The source for the stop condition.

          • value (string) --

            The Amazon Resource Name (ARN) of the CloudWatch alarm, if applicable.

      • creationTime (datetime) --

        The time that the experiment was created.

      • startTime (datetime) --

        The time that the experiment started.

      • endTime (datetime) --

        The time that the experiment ended.

      • tags (dict) --

        The tags for the experiment.

        • (string) --

          • (string) --

      • logConfiguration (dict) --

        The configuration for experiment logging.

        • cloudWatchLogsConfiguration (dict) --

          The configuration for experiment logging to Amazon CloudWatch Logs.

          • logGroupArn (string) --

            The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log group.

        • s3Configuration (dict) --

          The configuration for experiment logging to Amazon S3.

          • bucketName (string) --

            The name of the destination bucket.

          • prefix (string) --

            The bucket prefix.

        • logSchemaVersion (integer) --

          The schema version.

      • experimentOptions (dict) --

        The experiment options for the experiment.

        • accountTargeting (string) --

          The account targeting setting for an experiment.

        • emptyTargetResolutionMode (string) --

          The empty target resolution mode for an experiment.

        • actionsMode (string) --

          The actions mode of the experiment that is set from the StartExperiment API command.

      • targetAccountConfigurationsCount (integer) --

        The count of target account configurations for the experiment.