Class CfnExperimentTemplate
- All Implemented Interfaces:
IInspectable,IExperimentTemplateRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnExperimentTemplate.static interfaceThe CloudWatch dashboards to include as data sources in the experiment report.static interfaceSpecifies the configuration for experiment logging to CloudWatch Logs .static interfaceDescribes the data sources for the experiment report.static interfaceThe S3 destination for the experiment report.static interfaceSpecifies an action for an experiment template.static interfaceDescribes the experiment options for an experiment template.static interfaceDescribes the report configuration for the experiment template.static interfaceSpecifies the configuration for experiment logging.static interfaceSpecifies a stop condition for an experiment template.static interfaceSpecifies a filter used for the target resource input in an experiment template.static interfaceSpecifies a target for an experiment.static interfaceDescribes the output destinations of the experiment report.static interfaceSpecifies the configuration for experiment logging to Amazon S3 .Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.fis.IExperimentTemplateRef
IExperimentTemplateRef.Jsii$Default, IExperimentTemplateRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnExperimentTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnExperimentTemplate(software.amazon.jsii.JsiiObjectRef objRef) CfnExperimentTemplate(software.constructs.Construct scope, String id, CfnExperimentTemplateProps props) Create a newAWS::FIS::ExperimentTemplate. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe actions for the experiment.The ID of the experiment template.The description for the experiment template.The experiment options for an experiment template.Describes the report configuration for the experiment template.A reference to a ExperimentTemplate resource.The configuration for experiment logging.The Amazon Resource Name (ARN) of an IAM role.The stop conditions for the experiment.getTags()Tag Manager which manages the tags for this resource.The tags for the experiment template.The targets for the experiment.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnExperimentTemplate.renderProperties(Map<String, Object> props) voidsetActions(Map<String, Object> value) The actions for the experiment.voidsetActions(IResolvable value) The actions for the experiment.voidsetDescription(String value) The description for the experiment template.voidsetExperimentOptions(IResolvable value) The experiment options for an experiment template.voidThe experiment options for an experiment template.voidDescribes the report configuration for the experiment template.voidsetExperimentReportConfiguration(CfnExperimentTemplate.ExperimentTemplateExperimentReportConfigurationProperty value) Describes the report configuration for the experiment template.voidsetLogConfiguration(IResolvable value) The configuration for experiment logging.voidThe configuration for experiment logging.voidsetRoleArn(String value) The Amazon Resource Name (ARN) of an IAM role.voidsetStopConditions(List<Object> value) The stop conditions for the experiment.voidsetStopConditions(IResolvable value) The stop conditions for the experiment.voidsetTagsRaw(Map<String, String> value) The tags for the experiment template.voidsetTargets(Map<String, Object> value) The targets for the experiment.voidsetTargets(IResolvable value) The targets for the experiment.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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) Create a newAWS::FIS::ExperimentTemplate.- 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
-
arnForExperimentTemplate
@Stability(Stable) @NotNull public static String arnForExperimentTemplate(@NotNull IExperimentTemplateRef resource) - Parameters:
resource- This parameter is required.
-
isCfnExperimentTemplate
Checks whether the given object is a CfnExperimentTemplate.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The ID of the experiment template. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getExperimentTemplateRef
A reference to a ExperimentTemplate resource.- Specified by:
getExperimentTemplateRefin interfaceIExperimentTemplateRef
-
getTags
Tag Manager which manages the tags for this resource. -
getDescription
The description for the experiment template. -
setDescription
The description for the experiment template. -
getRoleArn
The Amazon Resource Name (ARN) of an IAM role. -
setRoleArn
The Amazon Resource Name (ARN) of an IAM role. -
getStopConditions
The stop conditions for the experiment.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnExperimentTemplate.ExperimentTemplateStopConditionProperty> -
setStopConditions
The stop conditions for the experiment. -
setStopConditions
The stop conditions for the experiment. -
getTargets
The targets for the experiment.Returns union: either
IResolvableor Mapinvalid input: '<'String, eitherIResolvableorCfnExperimentTemplate.ExperimentTemplateTargetProperty> -
setTargets
The targets for the experiment. -
setTargets
The targets for the experiment. -
getActions
The actions for the experiment.Returns union: either
IResolvableor Mapinvalid input: '<'String, eitherIResolvableorCfnExperimentTemplate.ExperimentTemplateActionProperty> -
setActions
The actions for the experiment. -
setActions
The actions for the experiment. -
getExperimentOptions
The experiment options for an experiment template.Returns union: either
IResolvableorCfnExperimentTemplate.ExperimentTemplateExperimentOptionsProperty -
setExperimentOptions
The experiment options for an experiment template. -
setExperimentOptions
@Stability(Stable) public void setExperimentOptions(@Nullable CfnExperimentTemplate.ExperimentTemplateExperimentOptionsProperty value) The experiment options for an experiment template. -
getExperimentReportConfiguration
Describes the report configuration for the experiment template.Returns union: either
IResolvableorCfnExperimentTemplate.ExperimentTemplateExperimentReportConfigurationProperty -
setExperimentReportConfiguration
Describes the report configuration for the experiment template. -
setExperimentReportConfiguration
@Stability(Stable) public void setExperimentReportConfiguration(@Nullable CfnExperimentTemplate.ExperimentTemplateExperimentReportConfigurationProperty value) Describes the report configuration for the experiment template. -
getLogConfiguration
The configuration for experiment logging.Returns union: either
IResolvableorCfnExperimentTemplate.ExperimentTemplateLogConfigurationProperty -
setLogConfiguration
The configuration for experiment logging. -
setLogConfiguration
@Stability(Stable) public void setLogConfiguration(@Nullable CfnExperimentTemplate.ExperimentTemplateLogConfigurationProperty value) The configuration for experiment logging. -
getTagsRaw
The tags for the experiment template. -
setTagsRaw
The tags for the experiment template.
-