Class CfnExperimentTemplate

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IEnvironmentAware, IInspectable, ITaggable, IExperimentTemplateRef, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)", date="2025-11-04T09:27:42.129Z") @Stability(Stable) public class CfnExperimentTemplate extends CfnResource implements IInspectable, IExperimentTemplateRef, ITaggable
Specifies an experiment template.

An experiment template includes the following components:

  • Targets : A target can be a specific resource in your AWS environment, or one or more resources that match criteria that you specify, for example, resources that have specific tags.
  • Actions : The actions to carry out on the target. You can specify multiple actions, the duration of each action, and when to start each action during an experiment.
  • Stop conditions : If a stop condition is triggered while an experiment is running, the experiment is automatically stopped. You can define a stop condition as a CloudWatch alarm.

For more information, see Experiment templates in the AWS Fault Injection Service User Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.fis.*;
 Object cloudWatchLogsConfiguration;
 Object s3Configuration;
 CfnExperimentTemplate cfnExperimentTemplate = CfnExperimentTemplate.Builder.create(this, "MyCfnExperimentTemplate")
         .description("description")
         .roleArn("roleArn")
         .stopConditions(List.of(ExperimentTemplateStopConditionProperty.builder()
                 .source("source")
                 // the properties below are optional
                 .value("value")
                 .build()))
         .targets(Map.of(
                 "targetsKey", ExperimentTemplateTargetProperty.builder()
                         .resourceType("resourceType")
                         .selectionMode("selectionMode")
                         // the properties below are optional
                         .filters(List.of(ExperimentTemplateTargetFilterProperty.builder()
                                 .path("path")
                                 .values(List.of("values"))
                                 .build()))
                         .parameters(Map.of(
                                 "parametersKey", "parameters"))
                         .resourceArns(List.of("resourceArns"))
                         .resourceTags(Map.of(
                                 "resourceTagsKey", "resourceTags"))
                         .build()))
         // the properties below are optional
         .actions(Map.of(
                 "actionsKey", ExperimentTemplateActionProperty.builder()
                         .actionId("actionId")
                         // the properties below are optional
                         .description("description")
                         .parameters(Map.of(
                                 "parametersKey", "parameters"))
                         .startAfter(List.of("startAfter"))
                         .targets(Map.of(
                                 "targetsKey", "targets"))
                         .build()))
         .experimentOptions(ExperimentTemplateExperimentOptionsProperty.builder()
                 .accountTargeting("accountTargeting")
                 .emptyTargetResolutionMode("emptyTargetResolutionMode")
                 .build())
         .experimentReportConfiguration(ExperimentTemplateExperimentReportConfigurationProperty.builder()
                 .outputs(OutputsProperty.builder()
                         .experimentReportS3Configuration(ExperimentReportS3ConfigurationProperty.builder()
                                 .bucketName("bucketName")
                                 // the properties below are optional
                                 .prefix("prefix")
                                 .build())
                         .build())
                 // the properties below are optional
                 .dataSources(DataSourcesProperty.builder()
                         .cloudWatchDashboards(List.of(CloudWatchDashboardProperty.builder()
                                 .dashboardIdentifier("dashboardIdentifier")
                                 .build()))
                         .build())
                 .postExperimentDuration("postExperimentDuration")
                 .preExperimentDuration("preExperimentDuration")
                 .build())
         .logConfiguration(ExperimentTemplateLogConfigurationProperty.builder()
                 .logSchemaVersion(123)
                 // the properties below are optional
                 .cloudWatchLogsConfiguration(cloudWatchLogsConfiguration)
                 .s3Configuration(s3Configuration)
                 .build())
         .tags(Map.of(
                 "tagsKey", "tags"))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnExperimentTemplate

      protected CfnExperimentTemplate(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnExperimentTemplate

      protected CfnExperimentTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnExperimentTemplate

      @Stability(Stable) public CfnExperimentTemplate(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnExperimentTemplateProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details