1. Packages
  2. Azure Classic
  3. API Docs
  4. chaosstudio
  5. Target

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.chaosstudio.Target

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages a Chaos Studio Target.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const example = new azure.containerservice.KubernetesCluster("example", {
        name: "example",
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        dnsPrefix: "acctestaksexample",
        defaultNodePool: {
            name: "example-value",
            nodeCount: "example-value",
            vmSize: "example-value",
            upgradeSettings: {
                maxSurge: "example-value",
            },
        },
        identity: {
            type: "example-value",
        },
    });
    const exampleTarget = new azure.chaosstudio.Target("example", {
        location: exampleResourceGroup.location,
        targetResourceId: example.id,
        targetType: "example-value",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example = azure.containerservice.KubernetesCluster("example",
        name="example",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        dns_prefix="acctestaksexample",
        default_node_pool={
            "name": "example-value",
            "node_count": "example-value",
            "vm_size": "example-value",
            "upgrade_settings": {
                "max_surge": "example-value",
            },
        },
        identity={
            "type": "example-value",
        })
    example_target = azure.chaosstudio.Target("example",
        location=example_resource_group.location,
        target_resource_id=example.id,
        target_type="example-value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/chaosstudio"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerservice"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		example, err := containerservice.NewKubernetesCluster(ctx, "example", &containerservice.KubernetesClusterArgs{
    			Name:              pulumi.String("example"),
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			DnsPrefix:         pulumi.String("acctestaksexample"),
    			DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{
    				Name:      pulumi.String("example-value"),
    				NodeCount: pulumi.Int("example-value"),
    				VmSize:    pulumi.String("example-value"),
    				UpgradeSettings: &containerservice.KubernetesClusterDefaultNodePoolUpgradeSettingsArgs{
    					MaxSurge: pulumi.String("example-value"),
    				},
    			},
    			Identity: &containerservice.KubernetesClusterIdentityArgs{
    				Type: pulumi.String("example-value"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = chaosstudio.NewTarget(ctx, "example", &chaosstudio.TargetArgs{
    			Location:         exampleResourceGroup.Location,
    			TargetResourceId: example.ID(),
    			TargetType:       pulumi.String("example-value"),
    		})
    		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 exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var example = new Azure.ContainerService.KubernetesCluster("example", new()
        {
            Name = "example",
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            DnsPrefix = "acctestaksexample",
            DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs
            {
                Name = "example-value",
                NodeCount = "example-value",
                VmSize = "example-value",
                UpgradeSettings = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolUpgradeSettingsArgs
                {
                    MaxSurge = "example-value",
                },
            },
            Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs
            {
                Type = "example-value",
            },
        });
    
        var exampleTarget = new Azure.ChaosStudio.Target("example", new()
        {
            Location = exampleResourceGroup.Location,
            TargetResourceId = example.Id,
            TargetType = "example-value",
        });
    
    });
    
    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.containerservice.KubernetesCluster;
    import com.pulumi.azure.containerservice.KubernetesClusterArgs;
    import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
    import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolUpgradeSettingsArgs;
    import com.pulumi.azure.containerservice.inputs.KubernetesClusterIdentityArgs;
    import com.pulumi.azure.chaosstudio.Target;
    import com.pulumi.azure.chaosstudio.TargetArgs;
    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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var example = new KubernetesCluster("example", KubernetesClusterArgs.builder()
                .name("example")
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .dnsPrefix("acctestaksexample")
                .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
                    .name("example-value")
                    .nodeCount("example-value")
                    .vmSize("example-value")
                    .upgradeSettings(KubernetesClusterDefaultNodePoolUpgradeSettingsArgs.builder()
                        .maxSurge("example-value")
                        .build())
                    .build())
                .identity(KubernetesClusterIdentityArgs.builder()
                    .type("example-value")
                    .build())
                .build());
    
            var exampleTarget = new Target("exampleTarget", TargetArgs.builder()
                .location(exampleResourceGroup.location())
                .targetResourceId(example.id())
                .targetType("example-value")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:containerservice:KubernetesCluster
        properties:
          name: example
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          dnsPrefix: acctestaksexample
          defaultNodePool:
            name: example-value
            nodeCount: example-value
            vmSize: example-value
            upgradeSettings:
              maxSurge: example-value
          identity:
            type: example-value
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        name: example
        properties:
          name: example-resources
          location: West Europe
      exampleTarget:
        type: azure:chaosstudio:Target
        name: example
        properties:
          location: ${exampleResourceGroup.location}
          targetResourceId: ${example.id}
          targetType: example-value
    

    Create Target Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Target(name: string, args: TargetArgs, opts?: CustomResourceOptions);
    @overload
    def Target(resource_name: str,
               args: TargetArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Target(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               target_resource_id: Optional[str] = None,
               target_type: Optional[str] = None,
               location: Optional[str] = None)
    func NewTarget(ctx *Context, name string, args TargetArgs, opts ...ResourceOption) (*Target, error)
    public Target(string name, TargetArgs args, CustomResourceOptions? opts = null)
    public Target(String name, TargetArgs args)
    public Target(String name, TargetArgs args, CustomResourceOptions options)
    
    type: azure:chaosstudio:Target
    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 TargetArgs
    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 TargetArgs
    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 TargetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TargetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TargetArgs
    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 targetResource = new Azure.ChaosStudio.Target("targetResource", new()
    {
        TargetResourceId = "string",
        TargetType = "string",
        Location = "string",
    });
    
    example, err := chaosstudio.NewTarget(ctx, "targetResource", &chaosstudio.TargetArgs{
    	TargetResourceId: pulumi.String("string"),
    	TargetType:       pulumi.String("string"),
    	Location:         pulumi.String("string"),
    })
    
    var targetResource = new Target("targetResource", TargetArgs.builder()
        .targetResourceId("string")
        .targetType("string")
        .location("string")
        .build());
    
    target_resource = azure.chaosstudio.Target("targetResource",
        target_resource_id="string",
        target_type="string",
        location="string")
    
    const targetResource = new azure.chaosstudio.Target("targetResource", {
        targetResourceId: "string",
        targetType: "string",
        location: "string",
    });
    
    type: azure:chaosstudio:Target
    properties:
        location: string
        targetResourceId: string
        targetType: string
    

    Target Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Target resource accepts the following input properties:

    TargetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    Location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    Location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId String
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType String
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location String
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    target_resource_id str
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    target_type str
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location str
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId String
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType String
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location String
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Target 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 Target Resource

    Get an existing Target 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?: TargetState, opts?: CustomResourceOptions): Target
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            location: Optional[str] = None,
            target_resource_id: Optional[str] = None,
            target_type: Optional[str] = None) -> Target
    func GetTarget(ctx *Context, name string, id IDInput, state *TargetState, opts ...ResourceOption) (*Target, error)
    public static Target Get(string name, Input<string> id, TargetState? state, CustomResourceOptions? opts = null)
    public static Target get(String name, Output<String> id, TargetState 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.
    The following state arguments are supported:
    Location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    Location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    TargetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location String
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId String
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType String
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location string
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId string
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType string
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location str
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    target_resource_id str
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    target_type str
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.
    location String
    The Azure Region where the Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetResourceId String
    Specifies the Target Resource Id within which this Chaos Studio Target should exist. Changing this forces a new Chaos Studio Target to be created.
    targetType String
    The name of the Chaos Studio Target. This has the format of [publisher]-[targetType] e.g. Microsoft-StorageAccount. For supported values please see this Target Type column in this table. Changing this forces a new Chaos Studio Target to be created.

    Import

    An existing Chaos Studio Target can be imported into Pulumi using the resource id, e.g.

    $ pulumi import azure:chaosstudio/target:Target example /{scope}/providers/Microsoft.Chaos/targets/{targetName}
    
    • Where {scope} is the ID of the Azure Resource under which the Chaos Studio Target exists. For example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group.

    • Where {targetName} is the name of the Target. For example targetValue.

    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.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi