ResilienceHubV2 / Client / create_test

create_test

ResilienceHubV2.Client.create_test(**kwargs)

Creates a test for a service by configuring a test template. Each service has one test per template.

See also: AWS API Documentation

Request Syntax

response = client.create_test(
    serviceArn='string',
    testTemplateArn='string',
    loggingConfiguration={
        's3BucketName': 'string',
        'cloudWatchLogGroupArn': 'string',
        'logSchemaVersion': 'string'
    },
    stopConditions=[
        {
            'source': 'aws:cloudwatch:alarm'|'none',
            'value': 'string'
        },
    ],
    roleName='string',
    parameters={
        'string': [
            'string',
        ]
    }
)
Parameters:
  • serviceArn (string) –

    [REQUIRED]

    The ARN of the service to create the test for.

  • testTemplateArn (string) –

    [REQUIRED]

    The ARN of the test template to configure.

  • loggingConfiguration (dict) –

    The logging configuration for the test.

    • s3BucketName (string) –

      The name of the S3 bucket for log delivery.

    • cloudWatchLogGroupArn (string) –

      The ARN of the CloudWatch Logs log group for log delivery.

    • logSchemaVersion (string) –

      The version of the log schema.

  • stopConditions (list) –

    The stop conditions for the test.

    • (dict) –

      A CloudWatch alarm that automatically stops a test run if it breaches its threshold.

      • source (string) – [REQUIRED]

        The source of the stop condition.

      • value (string) – [REQUIRED]

        The value of the stop condition, such as the ARN of the CloudWatch alarm.

  • roleName (string) – The name of the IAM execution role to use when running the test.

  • parameters (dict) –

    The parameter values for the test.

    • (string) –

      The key of a test parameter.

      • (list) –

        • (string) –

          A value of a test parameter.

Return type:

dict

Returns:

Response Syntax

{
    'test': {
        'testId': 'string',
        'testTemplateArn': 'string',
        'serviceArn': 'string',
        'name': 'string',
        'actions': [
            {
                'actionId': 'string',
                'description': 'string',
                'resourceType': 'string'
            },
        ],
        'loggingConfiguration': {
            's3BucketName': 'string',
            'cloudWatchLogGroupArn': 'string',
            'logSchemaVersion': 'string'
        },
        'stopConditions': [
            {
                'source': 'aws:cloudwatch:alarm'|'none',
                'value': 'string'
            },
        ],
        'roleName': 'string',
        'parameters': {
            'string': [
                'string',
            ]
        },
        'totalTestRuns': 123,
        'successfulTestRuns': 123,
        'creationTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    • test (dict) –

      The created test.

      • testId (string) –

        The unique identifier of the test.

      • testTemplateArn (string) –

        The ARN of the test template the test was created from.

      • serviceArn (string) –

        The ARN of the service the test belongs to.

      • name (string) –

        The name of the test.

      • actions (list) –

        The fault actions the test runs.

        • (dict) –

          Represents a fault action that a test runs, along with the resource type it targets.

          • actionId (string) –

            The identifier of the fault action.

          • description (string) –

            A description of the fault action.

          • resourceType (string) –

            The resource type that the action targets.

      • loggingConfiguration (dict) –

        The logging configuration for the test.

        • s3BucketName (string) –

          The name of the S3 bucket for log delivery.

        • cloudWatchLogGroupArn (string) –

          The ARN of the CloudWatch Logs log group for log delivery.

        • logSchemaVersion (string) –

          The version of the log schema.

      • stopConditions (list) –

        The stop conditions for the test.

        • (dict) –

          A CloudWatch alarm that automatically stops a test run if it breaches its threshold.

          • source (string) –

            The source of the stop condition.

          • value (string) –

            The value of the stop condition, such as the ARN of the CloudWatch alarm.

      • roleName (string) –

        The name of the IAM execution role used to run the test.

      • parameters (dict) –

        The parameter values configured for the test.

        • (string) –

          The key of a test parameter.

          • (list) –

            • (string) –

              A value of a test parameter.

      • totalTestRuns (integer) –

        The total number of runs of the test.

      • successfulTestRuns (integer) –

        The number of successful runs of the test.

      • creationTime (datetime) –

        The timestamp when the test was created.

Exceptions

  • ResilienceHubV2.Client.exceptions.InternalServerException

  • ResilienceHubV2.Client.exceptions.ResourceNotFoundException

  • ResilienceHubV2.Client.exceptions.ValidationException

  • ResilienceHubV2.Client.exceptions.ConflictException

  • ResilienceHubV2.Client.exceptions.AccessDeniedException