create_experiment_template
(**kwargs)¶Creates an experiment template.
An experiment template includes the following components:
For more information, see Experiment templates in the Fault Injection Simulator User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_experiment_template(
clientToken='string',
description='string',
stopConditions=[
{
'source': 'string',
'value': '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',
]
}
},
roleArn='string',
tags={
'string': 'string'
},
logConfiguration={
'cloudWatchLogsConfiguration': {
'logGroupArn': 'string'
},
's3Configuration': {
'bucketName': 'string',
'prefix': 'string'
},
'logSchemaVersion': 123
}
)
[REQUIRED]
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
[REQUIRED]
A description for the experiment template.
[REQUIRED]
The stop conditions.
Specifies a stop condition for an experiment template.
The source for the stop condition. Specify aws:cloudwatch:alarm
if the stop condition is defined by a CloudWatch alarm. Specify none
if there is no stop condition.
The Amazon Resource Name (ARN) of the CloudWatch alarm. This is required if the source is a CloudWatch alarm.
The targets for the experiment.
Specifies a target for an experiment. You must specify at least one Amazon Resource Name (ARN) or at least one resource tag. You cannot specify both ARNs and tags.
For more information, see Targets in the Fault Injection Simulator User Guide .
The resource type. The resource type must be supported for the specified action.
The Amazon Resource Names (ARNs) of the resources.
The tags for the target resources.
The filters to apply to identify target resources using specific attributes.
Specifies a filter used for the target resource input in an experiment template.
For more information, see Resource filters in the Fault Injection Simulator User Guide .
The attribute path for the filter.
The attribute values for the filter.
Scopes the identified resources to a specific count of the resources at random, or a percentage of the resources. All identified resources are included in the target.
The resource type parameters.
[REQUIRED]
The actions for the experiment.
Specifies an action for an experiment template.
For more information, see Actions in the Fault Injection Simulator User Guide .
The ID of the action. The format of the action ID is: aws:service-name :action-type .
A description for the action.
The parameters for the action, if applicable.
The targets for the action.
The name of the action that must be completed before the current action starts. Omit this parameter to run the action at the start of the experiment.
[REQUIRED]
The Amazon Resource Name (ARN) of an IAM role that grants the FIS service permission to perform service actions on your behalf.
The tags to apply to the experiment template.
The configuration for experiment logging.
The configuration for experiment logging to Amazon CloudWatch Logs.
The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log group.
The configuration for experiment logging to Amazon S3.
The name of the destination bucket.
The bucket prefix.
The schema version.
dict
Response Syntax
{
'experimentTemplate': {
'id': 'string',
'description': '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',
]
}
},
'stopConditions': [
{
'source': 'string',
'value': 'string'
},
],
'creationTime': datetime(2015, 1, 1),
'lastUpdateTime': datetime(2015, 1, 1),
'roleArn': 'string',
'tags': {
'string': 'string'
},
'logConfiguration': {
'cloudWatchLogsConfiguration': {
'logGroupArn': 'string'
},
's3Configuration': {
'bucketName': 'string',
'prefix': 'string'
},
'logSchemaVersion': 123
}
}
}
Response Structure
(dict) --
experimentTemplate (dict) --
Information about the experiment template.
id (string) --
The ID of the experiment template.
description (string) --
The description for the experiment template.
targets (dict) --
The targets for the experiment.
(string) --
(dict) --
Describes a target for an experiment template.
resourceType (string) --
The resource type.
resourceArns (list) --
The Amazon Resource Names (ARNs) of the targets.
resourceTags (dict) --
The tags for the target resources.
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 template.
path (string) --
The attribute path for the filter.
values (list) --
The attribute values for the filter.
selectionMode (string) --
Scopes the identified resources to a specific count or percentage.
parameters (dict) --
The resource type parameters.
actions (dict) --
The actions for the experiment.
(string) --
(dict) --
Describes an action for an experiment template.
actionId (string) --
The ID of the action.
description (string) --
A description for the action.
parameters (dict) --
The parameters for the action.
targets (dict) --
The targets for the action.
startAfter (list) --
The name of the action that must be completed before the current action starts.
stopConditions (list) --
The stop conditions for the experiment.
(dict) --
Describes a stop condition for an experiment template.
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 the experiment template was created.
lastUpdateTime (datetime) --
The time the experiment template was last updated.
roleArn (string) --
The Amazon Resource Name (ARN) of an IAM role.
tags (dict) --
The tags for the experiment template.
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.
Exceptions
FIS.Client.exceptions.ValidationException
FIS.Client.exceptions.ConflictException
FIS.Client.exceptions.ResourceNotFoundException
FIS.Client.exceptions.ServiceQuotaExceededException