We recommend using Azure Native.
azure.chaosstudio.Experiment
Explore with Pulumi AI
Manages a Chaos Studio Experiment.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example",
location: "westeurope",
});
const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
resourceGroupName: example.name,
location: example.location,
name: "example",
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
name: "example",
addressSpaces: ["10.0.0.0/16"],
location: example.location,
resourceGroupName: example.name,
});
const exampleSubnet = new azure.network.Subnet("example", {
name: "internal",
resourceGroupName: example.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefixes: ["10.0.2.0/24"],
});
const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
name: "example",
location: example.location,
resourceGroupName: example.name,
ipConfigurations: [{
name: "example",
subnetId: exampleSubnet.id,
privateIpAddressAllocation: "Dynamic",
}],
});
const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("example", {
name: "example",
resourceGroupName: example.name,
location: example.location,
size: "Standard_F2",
adminUsername: "adminuser",
adminPassword: "example",
disablePasswordAuthentication: false,
networkInterfaceIds: [exampleNetworkInterface.id],
osDisk: {
caching: "ReadWrite",
storageAccountType: "Standard_LRS",
},
sourceImageReference: {
publisher: "Canonical",
offer: "0001-com-ubuntu-server-jammy",
sku: "22_04-lts",
version: "latest",
},
});
const exampleTarget = new azure.chaosstudio.Target("example", {
location: example.location,
targetResourceId: exampleLinuxVirtualMachine.id,
targetType: "Microsoft-VirtualMachine",
});
const exampleCapability = new azure.chaosstudio.Capability("example", {
chaosStudioTargetId: exampleTarget.id,
capabilityType: "Shutdown-1.0",
});
const exampleExperiment = new azure.chaosstudio.Experiment("example", {
location: example.location,
name: "example",
resourceGroupName: example.name,
identity: {
type: "SystemAssigned",
},
selectors: [{
name: "Selector1",
chaosStudioTargetIds: [exampleTarget.id],
}],
steps: [{
name: "example",
branches: [{
name: "example",
actions: [{
urn: exampleCapability.capabilityUrn,
selectorName: "Selector1",
parameters: {
abruptShutdown: "false",
},
actionType: "continuous",
duration: "PT10M",
}],
}],
}],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example",
location="westeurope")
example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
resource_group_name=example.name,
location=example.location,
name="example")
example_virtual_network = azure.network.VirtualNetwork("example",
name="example",
address_spaces=["10.0.0.0/16"],
location=example.location,
resource_group_name=example.name)
example_subnet = azure.network.Subnet("example",
name="internal",
resource_group_name=example.name,
virtual_network_name=example_virtual_network.name,
address_prefixes=["10.0.2.0/24"])
example_network_interface = azure.network.NetworkInterface("example",
name="example",
location=example.location,
resource_group_name=example.name,
ip_configurations=[{
"name": "example",
"subnet_id": example_subnet.id,
"private_ip_address_allocation": "Dynamic",
}])
example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("example",
name="example",
resource_group_name=example.name,
location=example.location,
size="Standard_F2",
admin_username="adminuser",
admin_password="example",
disable_password_authentication=False,
network_interface_ids=[example_network_interface.id],
os_disk={
"caching": "ReadWrite",
"storage_account_type": "Standard_LRS",
},
source_image_reference={
"publisher": "Canonical",
"offer": "0001-com-ubuntu-server-jammy",
"sku": "22_04-lts",
"version": "latest",
})
example_target = azure.chaosstudio.Target("example",
location=example.location,
target_resource_id=example_linux_virtual_machine.id,
target_type="Microsoft-VirtualMachine")
example_capability = azure.chaosstudio.Capability("example",
chaos_studio_target_id=example_target.id,
capability_type="Shutdown-1.0")
example_experiment = azure.chaosstudio.Experiment("example",
location=example.location,
name="example",
resource_group_name=example.name,
identity={
"type": "SystemAssigned",
},
selectors=[{
"name": "Selector1",
"chaos_studio_target_ids": [example_target.id],
}],
steps=[{
"name": "example",
"branches": [{
"name": "example",
"actions": [{
"urn": example_capability.capability_urn,
"selector_name": "Selector1",
"parameters": {
"abrupt_shutdown": "false",
},
"action_type": "continuous",
"duration": "PT10M",
}],
}],
}])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/chaosstudio"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example"),
Location: pulumi.String("westeurope"),
})
if err != nil {
return err
}
_, err = authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
ResourceGroupName: example.Name,
Location: example.Location,
Name: pulumi.String("example"),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
Name: pulumi.String("example"),
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
Location: example.Location,
ResourceGroupName: example.Name,
})
if err != nil {
return err
}
exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
Name: pulumi.String("internal"),
ResourceGroupName: example.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefixes: pulumi.StringArray{
pulumi.String("10.0.2.0/24"),
},
})
if err != nil {
return err
}
exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
Name: pulumi.String("example"),
Location: example.Location,
ResourceGroupName: example.Name,
IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
&network.NetworkInterfaceIpConfigurationArgs{
Name: pulumi.String("example"),
SubnetId: exampleSubnet.ID(),
PrivateIpAddressAllocation: pulumi.String("Dynamic"),
},
},
})
if err != nil {
return err
}
exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "example", &compute.LinuxVirtualMachineArgs{
Name: pulumi.String("example"),
ResourceGroupName: example.Name,
Location: example.Location,
Size: pulumi.String("Standard_F2"),
AdminUsername: pulumi.String("adminuser"),
AdminPassword: pulumi.String("example"),
DisablePasswordAuthentication: pulumi.Bool(false),
NetworkInterfaceIds: pulumi.StringArray{
exampleNetworkInterface.ID(),
},
OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{
Caching: pulumi.String("ReadWrite"),
StorageAccountType: pulumi.String("Standard_LRS"),
},
SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{
Publisher: pulumi.String("Canonical"),
Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
Sku: pulumi.String("22_04-lts"),
Version: pulumi.String("latest"),
},
})
if err != nil {
return err
}
exampleTarget, err := chaosstudio.NewTarget(ctx, "example", &chaosstudio.TargetArgs{
Location: example.Location,
TargetResourceId: exampleLinuxVirtualMachine.ID(),
TargetType: pulumi.String("Microsoft-VirtualMachine"),
})
if err != nil {
return err
}
exampleCapability, err := chaosstudio.NewCapability(ctx, "example", &chaosstudio.CapabilityArgs{
ChaosStudioTargetId: exampleTarget.ID(),
CapabilityType: pulumi.String("Shutdown-1.0"),
})
if err != nil {
return err
}
_, err = chaosstudio.NewExperiment(ctx, "example", &chaosstudio.ExperimentArgs{
Location: example.Location,
Name: pulumi.String("example"),
ResourceGroupName: example.Name,
Identity: &chaosstudio.ExperimentIdentityArgs{
Type: pulumi.String("SystemAssigned"),
},
Selectors: chaosstudio.ExperimentSelectorArray{
&chaosstudio.ExperimentSelectorArgs{
Name: pulumi.String("Selector1"),
ChaosStudioTargetIds: pulumi.StringArray{
exampleTarget.ID(),
},
},
},
Steps: chaosstudio.ExperimentStepArray{
&chaosstudio.ExperimentStepArgs{
Name: pulumi.String("example"),
Branches: chaosstudio.ExperimentStepBranchArray{
&chaosstudio.ExperimentStepBranchArgs{
Name: pulumi.String("example"),
Actions: chaosstudio.ExperimentStepBranchActionArray{
&chaosstudio.ExperimentStepBranchActionArgs{
Urn: exampleCapability.CapabilityUrn,
SelectorName: pulumi.String("Selector1"),
Parameters: pulumi.StringMap{
"abruptShutdown": pulumi.String("false"),
},
ActionType: pulumi.String("continuous"),
Duration: pulumi.String("PT10M"),
},
},
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example",
Location = "westeurope",
});
var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
{
ResourceGroupName = example.Name,
Location = example.Location,
Name = "example",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
{
Name = "example",
AddressSpaces = new[]
{
"10.0.0.0/16",
},
Location = example.Location,
ResourceGroupName = example.Name,
});
var exampleSubnet = new Azure.Network.Subnet("example", new()
{
Name = "internal",
ResourceGroupName = example.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefixes = new[]
{
"10.0.2.0/24",
},
});
var exampleNetworkInterface = new Azure.Network.NetworkInterface("example", new()
{
Name = "example",
Location = example.Location,
ResourceGroupName = example.Name,
IpConfigurations = new[]
{
new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
{
Name = "example",
SubnetId = exampleSubnet.Id,
PrivateIpAddressAllocation = "Dynamic",
},
},
});
var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("example", new()
{
Name = "example",
ResourceGroupName = example.Name,
Location = example.Location,
Size = "Standard_F2",
AdminUsername = "adminuser",
AdminPassword = "example",
DisablePasswordAuthentication = false,
NetworkInterfaceIds = new[]
{
exampleNetworkInterface.Id,
},
OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs
{
Caching = "ReadWrite",
StorageAccountType = "Standard_LRS",
},
SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs
{
Publisher = "Canonical",
Offer = "0001-com-ubuntu-server-jammy",
Sku = "22_04-lts",
Version = "latest",
},
});
var exampleTarget = new Azure.ChaosStudio.Target("example", new()
{
Location = example.Location,
TargetResourceId = exampleLinuxVirtualMachine.Id,
TargetType = "Microsoft-VirtualMachine",
});
var exampleCapability = new Azure.ChaosStudio.Capability("example", new()
{
ChaosStudioTargetId = exampleTarget.Id,
CapabilityType = "Shutdown-1.0",
});
var exampleExperiment = new Azure.ChaosStudio.Experiment("example", new()
{
Location = example.Location,
Name = "example",
ResourceGroupName = example.Name,
Identity = new Azure.ChaosStudio.Inputs.ExperimentIdentityArgs
{
Type = "SystemAssigned",
},
Selectors = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentSelectorArgs
{
Name = "Selector1",
ChaosStudioTargetIds = new[]
{
exampleTarget.Id,
},
},
},
Steps = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepArgs
{
Name = "example",
Branches = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepBranchArgs
{
Name = "example",
Actions = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepBranchActionArgs
{
Urn = exampleCapability.CapabilityUrn,
SelectorName = "Selector1",
Parameters =
{
{ "abruptShutdown", "false" },
},
ActionType = "continuous",
Duration = "PT10M",
},
},
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.authorization.UserAssignedIdentity;
import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.NetworkInterface;
import com.pulumi.azure.network.NetworkInterfaceArgs;
import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
import com.pulumi.azure.compute.LinuxVirtualMachine;
import com.pulumi.azure.compute.LinuxVirtualMachineArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
import com.pulumi.azure.chaosstudio.Target;
import com.pulumi.azure.chaosstudio.TargetArgs;
import com.pulumi.azure.chaosstudio.Capability;
import com.pulumi.azure.chaosstudio.CapabilityArgs;
import com.pulumi.azure.chaosstudio.Experiment;
import com.pulumi.azure.chaosstudio.ExperimentArgs;
import com.pulumi.azure.chaosstudio.inputs.ExperimentIdentityArgs;
import com.pulumi.azure.chaosstudio.inputs.ExperimentSelectorArgs;
import com.pulumi.azure.chaosstudio.inputs.ExperimentStepArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example")
.location("westeurope")
.build());
var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
.resourceGroupName(example.name())
.location(example.location())
.name("example")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("example")
.addressSpaces("10.0.0.0/16")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("internal")
.resourceGroupName(example.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.build());
var exampleNetworkInterface = new NetworkInterface("exampleNetworkInterface", NetworkInterfaceArgs.builder()
.name("example")
.location(example.location())
.resourceGroupName(example.name())
.ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
.name("example")
.subnetId(exampleSubnet.id())
.privateIpAddressAllocation("Dynamic")
.build())
.build());
var exampleLinuxVirtualMachine = new LinuxVirtualMachine("exampleLinuxVirtualMachine", LinuxVirtualMachineArgs.builder()
.name("example")
.resourceGroupName(example.name())
.location(example.location())
.size("Standard_F2")
.adminUsername("adminuser")
.adminPassword("example")
.disablePasswordAuthentication(false)
.networkInterfaceIds(exampleNetworkInterface.id())
.osDisk(LinuxVirtualMachineOsDiskArgs.builder()
.caching("ReadWrite")
.storageAccountType("Standard_LRS")
.build())
.sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
.publisher("Canonical")
.offer("0001-com-ubuntu-server-jammy")
.sku("22_04-lts")
.version("latest")
.build())
.build());
var exampleTarget = new Target("exampleTarget", TargetArgs.builder()
.location(example.location())
.targetResourceId(exampleLinuxVirtualMachine.id())
.targetType("Microsoft-VirtualMachine")
.build());
var exampleCapability = new Capability("exampleCapability", CapabilityArgs.builder()
.chaosStudioTargetId(exampleTarget.id())
.capabilityType("Shutdown-1.0")
.build());
var exampleExperiment = new Experiment("exampleExperiment", ExperimentArgs.builder()
.location(example.location())
.name("example")
.resourceGroupName(example.name())
.identity(ExperimentIdentityArgs.builder()
.type("SystemAssigned")
.build())
.selectors(ExperimentSelectorArgs.builder()
.name("Selector1")
.chaosStudioTargetIds(exampleTarget.id())
.build())
.steps(ExperimentStepArgs.builder()
.name("example")
.branches(ExperimentStepBranchArgs.builder()
.name("example")
.actions(ExperimentStepBranchActionArgs.builder()
.urn(exampleCapability.capabilityUrn())
.selectorName("Selector1")
.parameters(Map.of("abruptShutdown", "false"))
.actionType("continuous")
.duration("PT10M")
.build())
.build())
.build())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example
location: westeurope
exampleUserAssignedIdentity:
type: azure:authorization:UserAssignedIdentity
name: example
properties:
resourceGroupName: ${example.name}
location: ${example.location}
name: example
exampleVirtualNetwork:
type: azure:network:VirtualNetwork
name: example
properties:
name: example
addressSpaces:
- 10.0.0.0/16
location: ${example.location}
resourceGroupName: ${example.name}
exampleSubnet:
type: azure:network:Subnet
name: example
properties:
name: internal
resourceGroupName: ${example.name}
virtualNetworkName: ${exampleVirtualNetwork.name}
addressPrefixes:
- 10.0.2.0/24
exampleNetworkInterface:
type: azure:network:NetworkInterface
name: example
properties:
name: example
location: ${example.location}
resourceGroupName: ${example.name}
ipConfigurations:
- name: example
subnetId: ${exampleSubnet.id}
privateIpAddressAllocation: Dynamic
exampleLinuxVirtualMachine:
type: azure:compute:LinuxVirtualMachine
name: example
properties:
name: example
resourceGroupName: ${example.name}
location: ${example.location}
size: Standard_F2
adminUsername: adminuser
adminPassword: example
disablePasswordAuthentication: false
networkInterfaceIds:
- ${exampleNetworkInterface.id}
osDisk:
caching: ReadWrite
storageAccountType: Standard_LRS
sourceImageReference:
publisher: Canonical
offer: 0001-com-ubuntu-server-jammy
sku: 22_04-lts
version: latest
exampleTarget:
type: azure:chaosstudio:Target
name: example
properties:
location: ${example.location}
targetResourceId: ${exampleLinuxVirtualMachine.id}
targetType: Microsoft-VirtualMachine
exampleCapability:
type: azure:chaosstudio:Capability
name: example
properties:
chaosStudioTargetId: ${exampleTarget.id}
capabilityType: Shutdown-1.0
exampleExperiment:
type: azure:chaosstudio:Experiment
name: example
properties:
location: ${example.location}
name: example
resourceGroupName: ${example.name}
identity:
type: SystemAssigned
selectors:
- name: Selector1
chaosStudioTargetIds:
- ${exampleTarget.id}
steps:
- name: example
branches:
- name: example
actions:
- urn: ${exampleCapability.capabilityUrn}
selectorName: Selector1
parameters:
abruptShutdown: 'false'
actionType: continuous
duration: PT10M
Create Experiment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Experiment(name: string, args: ExperimentArgs, opts?: CustomResourceOptions);
@overload
def Experiment(resource_name: str,
args: ExperimentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Experiment(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
selectors: Optional[Sequence[ExperimentSelectorArgs]] = None,
steps: Optional[Sequence[ExperimentStepArgs]] = None,
identity: Optional[ExperimentIdentityArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None)
func NewExperiment(ctx *Context, name string, args ExperimentArgs, opts ...ResourceOption) (*Experiment, error)
public Experiment(string name, ExperimentArgs args, CustomResourceOptions? opts = null)
public Experiment(String name, ExperimentArgs args)
public Experiment(String name, ExperimentArgs args, CustomResourceOptions options)
type: azure:chaosstudio:Experiment
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 ExperimentArgs
- 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 ExperimentArgs
- 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 ExperimentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExperimentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExperimentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var experimentResource = new Azure.ChaosStudio.Experiment("experimentResource", new()
{
ResourceGroupName = "string",
Selectors = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentSelectorArgs
{
ChaosStudioTargetIds = new[]
{
"string",
},
Name = "string",
},
},
Steps = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepArgs
{
Branches = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepBranchArgs
{
Actions = new[]
{
new Azure.ChaosStudio.Inputs.ExperimentStepBranchActionArgs
{
ActionType = "string",
Duration = "string",
Parameters =
{
{ "string", "string" },
},
SelectorName = "string",
Urn = "string",
},
},
Name = "string",
},
},
Name = "string",
},
},
Identity = new Azure.ChaosStudio.Inputs.ExperimentIdentityArgs
{
Type = "string",
IdentityIds = new[]
{
"string",
},
PrincipalId = "string",
TenantId = "string",
},
Location = "string",
Name = "string",
});
example, err := chaosstudio.NewExperiment(ctx, "experimentResource", &chaosstudio.ExperimentArgs{
ResourceGroupName: pulumi.String("string"),
Selectors: chaosstudio.ExperimentSelectorArray{
&chaosstudio.ExperimentSelectorArgs{
ChaosStudioTargetIds: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
},
},
Steps: chaosstudio.ExperimentStepArray{
&chaosstudio.ExperimentStepArgs{
Branches: chaosstudio.ExperimentStepBranchArray{
&chaosstudio.ExperimentStepBranchArgs{
Actions: chaosstudio.ExperimentStepBranchActionArray{
&chaosstudio.ExperimentStepBranchActionArgs{
ActionType: pulumi.String("string"),
Duration: pulumi.String("string"),
Parameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
SelectorName: pulumi.String("string"),
Urn: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
},
},
Identity: &chaosstudio.ExperimentIdentityArgs{
Type: pulumi.String("string"),
IdentityIds: pulumi.StringArray{
pulumi.String("string"),
},
PrincipalId: pulumi.String("string"),
TenantId: pulumi.String("string"),
},
Location: pulumi.String("string"),
Name: pulumi.String("string"),
})
var experimentResource = new Experiment("experimentResource", ExperimentArgs.builder()
.resourceGroupName("string")
.selectors(ExperimentSelectorArgs.builder()
.chaosStudioTargetIds("string")
.name("string")
.build())
.steps(ExperimentStepArgs.builder()
.branches(ExperimentStepBranchArgs.builder()
.actions(ExperimentStepBranchActionArgs.builder()
.actionType("string")
.duration("string")
.parameters(Map.of("string", "string"))
.selectorName("string")
.urn("string")
.build())
.name("string")
.build())
.name("string")
.build())
.identity(ExperimentIdentityArgs.builder()
.type("string")
.identityIds("string")
.principalId("string")
.tenantId("string")
.build())
.location("string")
.name("string")
.build());
experiment_resource = azure.chaosstudio.Experiment("experimentResource",
resource_group_name="string",
selectors=[{
"chaosStudioTargetIds": ["string"],
"name": "string",
}],
steps=[{
"branches": [{
"actions": [{
"actionType": "string",
"duration": "string",
"parameters": {
"string": "string",
},
"selectorName": "string",
"urn": "string",
}],
"name": "string",
}],
"name": "string",
}],
identity={
"type": "string",
"identityIds": ["string"],
"principalId": "string",
"tenantId": "string",
},
location="string",
name="string")
const experimentResource = new azure.chaosstudio.Experiment("experimentResource", {
resourceGroupName: "string",
selectors: [{
chaosStudioTargetIds: ["string"],
name: "string",
}],
steps: [{
branches: [{
actions: [{
actionType: "string",
duration: "string",
parameters: {
string: "string",
},
selectorName: "string",
urn: "string",
}],
name: "string",
}],
name: "string",
}],
identity: {
type: "string",
identityIds: ["string"],
principalId: "string",
tenantId: "string",
},
location: "string",
name: "string",
});
type: azure:chaosstudio:Experiment
properties:
identity:
identityIds:
- string
principalId: string
tenantId: string
type: string
location: string
name: string
resourceGroupName: string
selectors:
- chaosStudioTargetIds:
- string
name: string
steps:
- branches:
- actions:
- actionType: string
duration: string
parameters:
string: string
selectorName: string
urn: string
name: string
name: string
Experiment 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 Experiment resource accepts the following input properties:
- Resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Selectors
List<Experiment
Selector> - One or more
selectors
blocks as defined below. - Steps
List<Experiment
Step> - One or more
steps
blocks as defined below. - Identity
Experiment
Identity - A
identity
block as defined below. - Location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- Resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Selectors
[]Experiment
Selector Args - One or more
selectors
blocks as defined below. - Steps
[]Experiment
Step Args - One or more
steps
blocks as defined below. - Identity
Experiment
Identity Args - A
identity
block as defined below. - Location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group StringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
List<Experiment
Selector> - One or more
selectors
blocks as defined below. - steps
List<Experiment
Step> - One or more
steps
blocks as defined below. - identity
Experiment
Identity - A
identity
block as defined below. - location String
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name String
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
Experiment
Selector[] - One or more
selectors
blocks as defined below. - steps
Experiment
Step[] - One or more
steps
blocks as defined below. - identity
Experiment
Identity - A
identity
block as defined below. - location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource_
group_ strname - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
Sequence[Experiment
Selector Args] - One or more
selectors
blocks as defined below. - steps
Sequence[Experiment
Step Args] - One or more
steps
blocks as defined below. - identity
Experiment
Identity Args - A
identity
block as defined below. - location str
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name str
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group StringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors List<Property Map>
- One or more
selectors
blocks as defined below. - steps List<Property Map>
- One or more
steps
blocks as defined below. - identity Property Map
- A
identity
block as defined below. - location String
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name String
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Experiment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Experiment Resource
Get an existing Experiment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ExperimentState, opts?: CustomResourceOptions): Experiment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
identity: Optional[ExperimentIdentityArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
selectors: Optional[Sequence[ExperimentSelectorArgs]] = None,
steps: Optional[Sequence[ExperimentStepArgs]] = None) -> Experiment
func GetExperiment(ctx *Context, name string, id IDInput, state *ExperimentState, opts ...ResourceOption) (*Experiment, error)
public static Experiment Get(string name, Input<string> id, ExperimentState? state, CustomResourceOptions? opts = null)
public static Experiment get(String name, Output<String> id, ExperimentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Identity
Experiment
Identity - A
identity
block as defined below. - Location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- Resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Selectors
List<Experiment
Selector> - One or more
selectors
blocks as defined below. - Steps
List<Experiment
Step> - One or more
steps
blocks as defined below.
- Identity
Experiment
Identity Args - A
identity
block as defined below. - Location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- Resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- Selectors
[]Experiment
Selector Args - One or more
selectors
blocks as defined below. - Steps
[]Experiment
Step Args - One or more
steps
blocks as defined below.
- identity
Experiment
Identity - A
identity
block as defined below. - location String
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name String
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group StringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
List<Experiment
Selector> - One or more
selectors
blocks as defined below. - steps
List<Experiment
Step> - One or more
steps
blocks as defined below.
- identity
Experiment
Identity - A
identity
block as defined below. - location string
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name string
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group stringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
Experiment
Selector[] - One or more
selectors
blocks as defined below. - steps
Experiment
Step[] - One or more
steps
blocks as defined below.
- identity
Experiment
Identity Args - A
identity
block as defined below. - location str
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name str
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource_
group_ strname - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors
Sequence[Experiment
Selector Args] - One or more
selectors
blocks as defined below. - steps
Sequence[Experiment
Step Args] - One or more
steps
blocks as defined below.
- identity Property Map
- A
identity
block as defined below. - location String
- The Azure Region where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- name String
- The name which should be used for this Chaos Studio Experiment. Changing this forces a new Chaos Studio Experiment to be created.
- resource
Group StringName - The name of the Resource Group where the Chaos Studio Experiment should exist. Changing this forces a new Chaos Studio Experiment to be created.
- selectors List<Property Map>
- One or more
selectors
blocks as defined below. - steps List<Property Map>
- One or more
steps
blocks as defined below.
Supporting Types
ExperimentIdentity, ExperimentIdentityArgs
- Type string
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - Identity
Ids List<string> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- Principal
Id string - The Principal ID associated with this Managed Service Identity.
- Tenant
Id string - The Tenant ID associated with this Managed Service Identity.
- Type string
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - Identity
Ids []string A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- Principal
Id string - The Principal ID associated with this Managed Service Identity.
- Tenant
Id string - The Tenant ID associated with this Managed Service Identity.
- type String
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - identity
Ids List<String> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- principal
Id String - The Principal ID associated with this Managed Service Identity.
- tenant
Id String - The Tenant ID associated with this Managed Service Identity.
- type string
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - identity
Ids string[] A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- principal
Id string - The Principal ID associated with this Managed Service Identity.
- tenant
Id string - The Tenant ID associated with this Managed Service Identity.
- type str
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - identity_
ids Sequence[str] A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- principal_
id str - The Principal ID associated with this Managed Service Identity.
- tenant_
id str - The Tenant ID associated with this Managed Service Identity.
- type String
- The Type of Managed Identity which should be added to this Policy Definition. Possible values are
SystemAssigned
andUserAssigned
. - identity
Ids List<String> A list of User Managed Identity IDs which should be assigned to the Policy Definition.
NOTE: This is required when
type
is set toUserAssigned
.- principal
Id String - The Principal ID associated with this Managed Service Identity.
- tenant
Id String - The Tenant ID associated with this Managed Service Identity.
ExperimentSelector, ExperimentSelectorArgs
- Chaos
Studio List<string>Target Ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- Name string
- The name of this Selector.
- Chaos
Studio []stringTarget Ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- Name string
- The name of this Selector.
- chaos
Studio List<String>Target Ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- name String
- The name of this Selector.
- chaos
Studio string[]Target Ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- name string
- The name of this Selector.
- chaos_
studio_ Sequence[str]target_ ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- name str
- The name of this Selector.
- chaos
Studio List<String>Target Ids - A list of Chaos Studio Target IDs that should be part of this Selector.
- name String
- The name of this Selector.
ExperimentStep, ExperimentStepArgs
- Branches
List<Experiment
Step Branch> - One or more
branch
blocks as defined above. - Name string
- The name of the Step.
- Branches
[]Experiment
Step Branch - One or more
branch
blocks as defined above. - Name string
- The name of the Step.
- branches
List<Experiment
Step Branch> - One or more
branch
blocks as defined above. - name String
- The name of the Step.
- branches
Experiment
Step Branch[] - One or more
branch
blocks as defined above. - name string
- The name of the Step.
- branches
Sequence[Experiment
Step Branch] - One or more
branch
blocks as defined above. - name str
- The name of the Step.
- branches List<Property Map>
- One or more
branch
blocks as defined above. - name String
- The name of the Step.
ExperimentStepBranch, ExperimentStepBranchArgs
- Actions
List<Experiment
Step Branch Action> - One or more
actions
blocks as defined above. - Name string
- The name of the branch.
- Actions
[]Experiment
Step Branch Action - One or more
actions
blocks as defined above. - Name string
- The name of the branch.
- actions
List<Experiment
Step Branch Action> - One or more
actions
blocks as defined above. - name String
- The name of the branch.
- actions
Experiment
Step Branch Action[] - One or more
actions
blocks as defined above. - name string
- The name of the branch.
- actions
Sequence[Experiment
Step Branch Action] - One or more
actions
blocks as defined above. - name str
- The name of the branch.
- actions List<Property Map>
- One or more
actions
blocks as defined above. - name String
- The name of the branch.
ExperimentStepBranchAction, ExperimentStepBranchActionArgs
- Action
Type string - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - Duration string
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - Parameters Dictionary<string, string>
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - Selector
Name string - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - Urn string
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
- Action
Type string - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - Duration string
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - Parameters map[string]string
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - Selector
Name string - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - Urn string
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
- action
Type String - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - duration String
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - parameters Map<String,String>
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - selector
Name String - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - urn String
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
- action
Type string - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - duration string
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - parameters {[key: string]: string}
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - selector
Name string - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - urn string
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
- action_
type str - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - duration str
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - parameters Mapping[str, str]
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - selector_
name str - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - urn str
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
- action
Type String - The type of action that should be added to the experiment. Possible values are
continuous
,delay
anddiscrete
. - duration String
- An ISO8601 formatted string specifying the duration for a
delay
orcontinuous
action. - parameters Map<String>
- A key-value map of additional parameters to configure the action. The values that are accepted by this depend on the
urn
i.e. the capability/fault that is applied. Possible parameter values can be found in this documentation - selector
Name String - The name of the Selector to which this action should apply to. This must be specified if the
action_type
iscontinuous
ordiscrete
. - urn String
- The Unique Resource Name of the action, this value is provided by the
azure.chaosstudio.Capability
resource e.g.azurerm_chaos_studio_capability.example.urn
. This must be specified if theaction_type
iscontinuous
ordiscrete
.
Import
Chaos Studio Experiments can be imported using the resource id
, e.g.
$ pulumi import azure:chaosstudio/experiment:Experiment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Chaos/experiments/experiment1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.