AWS Native is in preview. AWS Classic is fully supported.
AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi
aws-native.fis.ExperimentTemplate
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi
Resource schema for AWS::FIS::ExperimentTemplate
Example Usage
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var fisRole = new AwsNative.Iam.Role("fisRole", new()
{
AssumeRolePolicyDocument = new Dictionary<string, object?>
{
["version"] = "2012-10-17",
["statement"] = new[]
{
new Dictionary<string, object?>
{
["effect"] = "Allow",
["principal"] = new Dictionary<string, object?>
{
["service"] = "fis.amazonaws.com",
},
["action"] = "sts:AssumeRole",
},
},
},
Policies = new[]
{
new AwsNative.Iam.Inputs.RolePolicyArgs
{
PolicyName = "FISRoleEC2Actions",
PolicyDocument = new Dictionary<string, object?>
{
["version"] = "2012-10-17",
["statement"] = new[]
{
new Dictionary<string, object?>
{
["effect"] = "Allow",
["action"] = new[]
{
"ec2:RebootInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:TerminateInstances",
},
["resource"] = "arn:aws:ec2:*:*:instance/*",
},
},
},
},
},
});
var experimentTemplate = new AwsNative.Fis.ExperimentTemplate("experimentTemplate", new()
{
Description = "stop an instance based on a tag",
Actions =
{
{ "stopInstances", new AwsNative.Fis.Inputs.ExperimentTemplateActionArgs
{
ActionId = "aws:ec2:stop-instances",
Parameters =
{
{ "startInstancesAfterDuration", "PT2M" },
},
Targets =
{
{ "instances", "oneRandomInstance" },
},
} },
},
Targets =
{
{ "oneRandomInstance", new AwsNative.Fis.Inputs.ExperimentTemplateTargetArgs
{
ResourceTags =
{
{ "env", "prod" },
},
ResourceType = "aws:ec2:instance",
SelectionMode = "COUNT(1)",
} },
},
StopConditions = new[]
{
new AwsNative.Fis.Inputs.ExperimentTemplateStopConditionArgs
{
Source = "none",
},
},
Tags =
{
{ "name", "fisStopInstances" },
},
RoleArn = fisRole.Arn,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/fis"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fisRole, err := iam.NewRole(ctx, "fisRole", &iam.RoleArgs{
AssumeRolePolicyDocument: pulumi.Any(map[string]interface{}{
"version": "2012-10-17",
"statement": []map[string]interface{}{
map[string]interface{}{
"effect": "Allow",
"principal": map[string]interface{}{
"service": "fis.amazonaws.com",
},
"action": "sts:AssumeRole",
},
},
}),
Policies: iam.RolePolicyTypeArray{
&iam.RolePolicyTypeArgs{
PolicyName: pulumi.String("FISRoleEC2Actions"),
PolicyDocument: pulumi.Any(map[string]interface{}{
"version": "2012-10-17",
"statement": []map[string]interface{}{
map[string]interface{}{
"effect": "Allow",
"action": []string{
"ec2:RebootInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:TerminateInstances",
},
"resource": "arn:aws:ec2:*:*:instance/*",
},
},
}),
},
},
})
if err != nil {
return err
}
_, err = fis.NewExperimentTemplate(ctx, "experimentTemplate", &fis.ExperimentTemplateArgs{
Description: pulumi.String("stop an instance based on a tag"),
Actions: fis.ExperimentTemplateActionMap{
"stopInstances": &fis.ExperimentTemplateActionArgs{
ActionId: pulumi.String("aws:ec2:stop-instances"),
Parameters: pulumi.StringMap{
"startInstancesAfterDuration": pulumi.String("PT2M"),
},
Targets: pulumi.StringMap{
"instances": pulumi.String("oneRandomInstance"),
},
},
},
Targets: fis.ExperimentTemplateTargetMap{
"oneRandomInstance": &fis.ExperimentTemplateTargetArgs{
ResourceTags: pulumi.StringMap{
"env": pulumi.String("prod"),
},
ResourceType: pulumi.String("aws:ec2:instance"),
SelectionMode: pulumi.String("COUNT(1)"),
},
},
StopConditions: fis.ExperimentTemplateStopConditionArray{
&fis.ExperimentTemplateStopConditionArgs{
Source: pulumi.String("none"),
},
},
Tags: pulumi.StringMap{
"name": pulumi.String("fisStopInstances"),
},
RoleArn: fisRole.Arn,
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_aws_native as aws_native
fis_role = aws_native.iam.Role("fisRole",
assume_role_policy_document={
"version": "2012-10-17",
"statement": [{
"effect": "Allow",
"principal": {
"service": "fis.amazonaws.com",
},
"action": "sts:AssumeRole",
}],
},
policies=[aws_native.iam.RolePolicyArgs(
policy_name="FISRoleEC2Actions",
policy_document={
"version": "2012-10-17",
"statement": [{
"effect": "Allow",
"action": [
"ec2:RebootInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:TerminateInstances",
],
"resource": "arn:aws:ec2:*:*:instance/*",
}],
},
)])
experiment_template = aws_native.fis.ExperimentTemplate("experimentTemplate",
description="stop an instance based on a tag",
actions={
"stopInstances": aws_native.fis.ExperimentTemplateActionArgs(
action_id="aws:ec2:stop-instances",
parameters={
"startInstancesAfterDuration": "PT2M",
},
targets={
"instances": "oneRandomInstance",
},
),
},
targets={
"oneRandomInstance": aws_native.fis.ExperimentTemplateTargetArgs(
resource_tags={
"env": "prod",
},
resource_type="aws:ec2:instance",
selection_mode="COUNT(1)",
),
},
stop_conditions=[aws_native.fis.ExperimentTemplateStopConditionArgs(
source="none",
)],
tags={
"name": "fisStopInstances",
},
role_arn=fis_role.arn)
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const fisRole = new aws_native.iam.Role("fisRole", {
assumeRolePolicyDocument: {
version: "2012-10-17",
statement: [{
effect: "Allow",
principal: {
service: "fis.amazonaws.com",
},
action: "sts:AssumeRole",
}],
},
policies: [{
policyName: "FISRoleEC2Actions",
policyDocument: {
version: "2012-10-17",
statement: [{
effect: "Allow",
action: [
"ec2:RebootInstances",
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:TerminateInstances",
],
resource: "arn:aws:ec2:*:*:instance/*",
}],
},
}],
});
const experimentTemplate = new aws_native.fis.ExperimentTemplate("experimentTemplate", {
description: "stop an instance based on a tag",
actions: {
stopInstances: {
actionId: "aws:ec2:stop-instances",
parameters: {
startInstancesAfterDuration: "PT2M",
},
targets: {
instances: "oneRandomInstance",
},
},
},
targets: {
oneRandomInstance: {
resourceTags: {
env: "prod",
},
resourceType: "aws:ec2:instance",
selectionMode: "COUNT(1)",
},
},
stopConditions: [{
source: "none",
}],
tags: {
name: "fisStopInstances",
},
roleArn: fisRole.arn,
});
Coming soon!
Create ExperimentTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ExperimentTemplate(name: string, args: ExperimentTemplateArgs, opts?: CustomResourceOptions);
@overload
def ExperimentTemplate(resource_name: str,
args: ExperimentTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ExperimentTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
role_arn: Optional[str] = None,
stop_conditions: Optional[Sequence[ExperimentTemplateStopConditionArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
targets: Optional[Mapping[str, ExperimentTemplateTargetArgs]] = None,
actions: Optional[Mapping[str, ExperimentTemplateActionArgs]] = None,
experiment_options: Optional[ExperimentTemplateExperimentOptionsArgs] = None,
log_configuration: Optional[ExperimentTemplateLogConfigurationArgs] = None)
func NewExperimentTemplate(ctx *Context, name string, args ExperimentTemplateArgs, opts ...ResourceOption) (*ExperimentTemplate, error)
public ExperimentTemplate(string name, ExperimentTemplateArgs args, CustomResourceOptions? opts = null)
public ExperimentTemplate(String name, ExperimentTemplateArgs args)
public ExperimentTemplate(String name, ExperimentTemplateArgs args, CustomResourceOptions options)
type: aws-native:fis:ExperimentTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ExperimentTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ExperimentTemplateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ExperimentTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExperimentTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExperimentTemplateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ExperimentTemplate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ExperimentTemplate resource accepts the following input properties:
- Description string
- The description for the experiment template.
- Role
Arn string - The Amazon Resource Name (ARN) of an IAM role.
- Stop
Conditions List<Pulumi.Aws Native. Fis. Inputs. Experiment Template Stop Condition> - The stop conditions for the experiment.
- Dictionary<string, string>
- The tags for the experiment template.
- Targets
Dictionary<string, Pulumi.
Aws Native. Fis. Inputs. Experiment Template Target Args> - The targets for the experiment.
- Actions
Dictionary<string, Pulumi.
Aws Native. Fis. Inputs. Experiment Template Action Args> - The actions for the experiment.
- Experiment
Options Pulumi.Aws Native. Fis. Inputs. Experiment Template Experiment Options - The experiment options for an experiment template.
- Log
Configuration Pulumi.Aws Native. Fis. Inputs. Experiment Template Log Configuration - The configuration for experiment logging.
- Description string
- The description for the experiment template.
- Role
Arn string - The Amazon Resource Name (ARN) of an IAM role.
- Stop
Conditions []ExperimentTemplate Stop Condition Args - The stop conditions for the experiment.
- map[string]string
- The tags for the experiment template.
- Targets
map[string]Experiment
Template Target Args - The targets for the experiment.
- Actions
map[string]Experiment
Template Action Args - The actions for the experiment.
- Experiment
Options ExperimentTemplate Experiment Options Args - The experiment options for an experiment template.
- Log
Configuration ExperimentTemplate Log Configuration Args - The configuration for experiment logging.
- description String
- The description for the experiment template.
- role
Arn String - The Amazon Resource Name (ARN) of an IAM role.
- stop
Conditions List<ExperimentTemplate Stop Condition> - The stop conditions for the experiment.
- Map<String,String>
- The tags for the experiment template.
- targets
Map<String,Experiment
Template Target Args> - The targets for the experiment.
- actions
Map<String,Experiment
Template Action Args> - The actions for the experiment.
- experiment
Options ExperimentTemplate Experiment Options - The experiment options for an experiment template.
- log
Configuration ExperimentTemplate Log Configuration - The configuration for experiment logging.
- description string
- The description for the experiment template.
- role
Arn string - The Amazon Resource Name (ARN) of an IAM role.
- stop
Conditions ExperimentTemplate Stop Condition[] - The stop conditions for the experiment.
- {[key: string]: string}
- The tags for the experiment template.
- targets
{[key: string]: Experiment
Template Target Args} - The targets for the experiment.
- actions
{[key: string]: Experiment
Template Action Args} - The actions for the experiment.
- experiment
Options ExperimentTemplate Experiment Options - The experiment options for an experiment template.
- log
Configuration ExperimentTemplate Log Configuration - The configuration for experiment logging.
- description str
- The description for the experiment template.
- role_
arn str - The Amazon Resource Name (ARN) of an IAM role.
- stop_
conditions Sequence[ExperimentTemplate Stop Condition Args] - The stop conditions for the experiment.
- Mapping[str, str]
- The tags for the experiment template.
- targets
Mapping[str, Experiment
Template Target Args] - The targets for the experiment.
- actions
Mapping[str, Experiment
Template Action Args] - The actions for the experiment.
- experiment_
options ExperimentTemplate Experiment Options Args - The experiment options for an experiment template.
- log_
configuration ExperimentTemplate Log Configuration Args - The configuration for experiment logging.
- description String
- The description for the experiment template.
- role
Arn String - The Amazon Resource Name (ARN) of an IAM role.
- stop
Conditions List<Property Map> - The stop conditions for the experiment.
- Map<String>
- The tags for the experiment template.
- targets Map<Property Map>
- The targets for the experiment.
- actions Map<Property Map>
- The actions for the experiment.
- experiment
Options Property Map - The experiment options for an experiment template.
- log
Configuration Property Map - The configuration for experiment logging.
Outputs
All input properties are implicitly available as output properties. Additionally, the ExperimentTemplate resource produces the following output properties:
Supporting Types
ExperimentTemplateAction, ExperimentTemplateActionArgs
- Action
Id string - The ID of the action.
- Description string
- A description for the action.
- Parameters Dictionary<string, string>
- The parameters for the action, if applicable.
- Start
After List<string> - The name of the action that must be completed before the current action starts.
- Targets Dictionary<string, string>
- One or more targets for the action.
- Action
Id string - The ID of the action.
- Description string
- A description for the action.
- Parameters map[string]string
- The parameters for the action, if applicable.
- Start
After []string - The name of the action that must be completed before the current action starts.
- Targets map[string]string
- One or more targets for the action.
- action
Id String - The ID of the action.
- description String
- A description for the action.
- parameters Map<String,String>
- The parameters for the action, if applicable.
- start
After List<String> - The name of the action that must be completed before the current action starts.
- targets Map<String,String>
- One or more targets for the action.
- action
Id string - The ID of the action.
- description string
- A description for the action.
- parameters {[key: string]: string}
- The parameters for the action, if applicable.
- start
After string[] - The name of the action that must be completed before the current action starts.
- targets {[key: string]: string}
- One or more targets for the action.
- action_
id str - The ID of the action.
- description str
- A description for the action.
- parameters Mapping[str, str]
- The parameters for the action, if applicable.
- start_
after Sequence[str] - The name of the action that must be completed before the current action starts.
- targets Mapping[str, str]
- One or more targets for the action.
- action
Id String - The ID of the action.
- description String
- A description for the action.
- parameters Map<String>
- The parameters for the action, if applicable.
- start
After List<String> - The name of the action that must be completed before the current action starts.
- targets Map<String>
- One or more targets for the action.
ExperimentTemplateExperimentOptions, ExperimentTemplateExperimentOptionsArgs
- Account
Targeting Pulumi.Aws Native. Fis. Experiment Template Experiment Options Account Targeting - The account targeting setting for the experiment template.
- Empty
Target Pulumi.Resolution Mode Aws Native. Fis. Experiment Template Experiment Options Empty Target Resolution Mode - The target resolution failure mode for the experiment template.
- Account
Targeting ExperimentTemplate Experiment Options Account Targeting - The account targeting setting for the experiment template.
- Empty
Target ExperimentResolution Mode Template Experiment Options Empty Target Resolution Mode - The target resolution failure mode for the experiment template.
- account
Targeting ExperimentTemplate Experiment Options Account Targeting - The account targeting setting for the experiment template.
- empty
Target ExperimentResolution Mode Template Experiment Options Empty Target Resolution Mode - The target resolution failure mode for the experiment template.
- account
Targeting ExperimentTemplate Experiment Options Account Targeting - The account targeting setting for the experiment template.
- empty
Target ExperimentResolution Mode Template Experiment Options Empty Target Resolution Mode - The target resolution failure mode for the experiment template.
- account_
targeting ExperimentTemplate Experiment Options Account Targeting - The account targeting setting for the experiment template.
- empty_
target_ Experimentresolution_ mode Template Experiment Options Empty Target Resolution Mode - The target resolution failure mode for the experiment template.
- account
Targeting "multi-account" | "single-account" - The account targeting setting for the experiment template.
- empty
Target "fail" | "skip"Resolution Mode - The target resolution failure mode for the experiment template.
ExperimentTemplateExperimentOptionsAccountTargeting, ExperimentTemplateExperimentOptionsAccountTargetingArgs
- Multi
Account - multi-account
- Single
Account - single-account
- Experiment
Template Experiment Options Account Targeting Multi Account - multi-account
- Experiment
Template Experiment Options Account Targeting Single Account - single-account
- Multi
Account - multi-account
- Single
Account - single-account
- Multi
Account - multi-account
- Single
Account - single-account
- MULTI_ACCOUNT
- multi-account
- SINGLE_ACCOUNT
- single-account
- "multi-account"
- multi-account
- "single-account"
- single-account
ExperimentTemplateExperimentOptionsEmptyTargetResolutionMode, ExperimentTemplateExperimentOptionsEmptyTargetResolutionModeArgs
- Fail
- fail
- Skip
- skip
- Experiment
Template Experiment Options Empty Target Resolution Mode Fail - fail
- Experiment
Template Experiment Options Empty Target Resolution Mode Skip - skip
- Fail
- fail
- Skip
- skip
- Fail
- fail
- Skip
- skip
- FAIL
- fail
- SKIP
- skip
- "fail"
- fail
- "skip"
- skip
ExperimentTemplateLogConfiguration, ExperimentTemplateLogConfigurationArgs
- Log
Schema intVersion - The schema version.
- Cloud
Watch Pulumi.Logs Configuration Aws Native. Fis. Inputs. Experiment Template Log Configuration Cloud Watch Logs Configuration Properties - The configuration for experiment logging to CloudWatch Logs .
- S3Configuration
Pulumi.
Aws Native. Fis. Inputs. Experiment Template Log Configuration S3Configuration Properties - The configuration for experiment logging to Amazon S3 .
- Log
Schema intVersion - The schema version.
- Cloud
Watch ExperimentLogs Configuration Template Log Configuration Cloud Watch Logs Configuration Properties - The configuration for experiment logging to CloudWatch Logs .
- S3Configuration
Experiment
Template Log Configuration S3Configuration Properties - The configuration for experiment logging to Amazon S3 .
- log
Schema IntegerVersion - The schema version.
- cloud
Watch ExperimentLogs Configuration Template Log Configuration Cloud Watch Logs Configuration Properties - The configuration for experiment logging to CloudWatch Logs .
- s3Configuration
Experiment
Template Log Configuration S3Configuration Properties - The configuration for experiment logging to Amazon S3 .
- log
Schema numberVersion - The schema version.
- cloud
Watch ExperimentLogs Configuration Template Log Configuration Cloud Watch Logs Configuration Properties - The configuration for experiment logging to CloudWatch Logs .
- s3Configuration
Experiment
Template Log Configuration S3Configuration Properties - The configuration for experiment logging to Amazon S3 .
- log_
schema_ intversion - The schema version.
- cloud_
watch_ Experimentlogs_ configuration Template Log Configuration Cloud Watch Logs Configuration Properties - The configuration for experiment logging to CloudWatch Logs .
- s3_
configuration ExperimentTemplate Log Configuration S3Configuration Properties - The configuration for experiment logging to Amazon S3 .
- log
Schema NumberVersion - The schema version.
- cloud
Watch Property MapLogs Configuration - The configuration for experiment logging to CloudWatch Logs .
- s3Configuration Property Map
- The configuration for experiment logging to Amazon S3 .
ExperimentTemplateLogConfigurationCloudWatchLogsConfigurationProperties, ExperimentTemplateLogConfigurationCloudWatchLogsConfigurationPropertiesArgs
- Log
Group stringArn
- Log
Group stringArn
- log
Group StringArn
- log
Group stringArn
- log_
group_ strarn
- log
Group StringArn
ExperimentTemplateLogConfigurationS3ConfigurationProperties, ExperimentTemplateLogConfigurationS3ConfigurationPropertiesArgs
- Bucket
Name string - Prefix string
- Bucket
Name string - Prefix string
- bucket
Name String - prefix String
- bucket
Name string - prefix string
- bucket_
name str - prefix str
- bucket
Name String - prefix String
ExperimentTemplateStopCondition, ExperimentTemplateStopConditionArgs
ExperimentTemplateTarget, ExperimentTemplateTargetArgs
- Resource
Type string - The resource type.
- Selection
Mode string - Scopes the identified resources to a specific count or percentage.
- Filters
List<Pulumi.
Aws Native. Fis. Inputs. Experiment Template Target Filter> - The filters to apply to identify target resources using specific attributes.
- Parameters Dictionary<string, string>
- The parameters for the resource type.
- Resource
Arns List<string> - The Amazon Resource Names (ARNs) of the targets.
- Dictionary<string, string>
- The tags for the target resources.
- Resource
Type string - The resource type.
- Selection
Mode string - Scopes the identified resources to a specific count or percentage.
- Filters
[]Experiment
Template Target Filter - The filters to apply to identify target resources using specific attributes.
- Parameters map[string]string
- The parameters for the resource type.
- Resource
Arns []string - The Amazon Resource Names (ARNs) of the targets.
- map[string]string
- The tags for the target resources.
- resource
Type String - The resource type.
- selection
Mode String - Scopes the identified resources to a specific count or percentage.
- filters
List<Experiment
Template Target Filter> - The filters to apply to identify target resources using specific attributes.
- parameters Map<String,String>
- The parameters for the resource type.
- resource
Arns List<String> - The Amazon Resource Names (ARNs) of the targets.
- Map<String,String>
- The tags for the target resources.
- resource
Type string - The resource type.
- selection
Mode string - Scopes the identified resources to a specific count or percentage.
- filters
Experiment
Template Target Filter[] - The filters to apply to identify target resources using specific attributes.
- parameters {[key: string]: string}
- The parameters for the resource type.
- resource
Arns string[] - The Amazon Resource Names (ARNs) of the targets.
- {[key: string]: string}
- The tags for the target resources.
- resource_
type str - The resource type.
- selection_
mode str - Scopes the identified resources to a specific count or percentage.
- filters
Sequence[Experiment
Template Target Filter] - The filters to apply to identify target resources using specific attributes.
- parameters Mapping[str, str]
- The parameters for the resource type.
- resource_
arns Sequence[str] - The Amazon Resource Names (ARNs) of the targets.
- Mapping[str, str]
- The tags for the target resources.
- resource
Type String - The resource type.
- selection
Mode String - Scopes the identified resources to a specific count or percentage.
- filters List<Property Map>
- The filters to apply to identify target resources using specific attributes.
- parameters Map<String>
- The parameters for the resource type.
- resource
Arns List<String> - The Amazon Resource Names (ARNs) of the targets.
- Map<String>
- The tags for the target resources.
ExperimentTemplateTargetFilter, ExperimentTemplateTargetFilterArgs
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.
AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi