Target Args
Model that represents a Target resource. Uses Azure REST API version 2024-03-22-preview. In version 2.x of the Azure Native provider, it used API version 2023-04-15-preview. Other available API versions: 2023-04-15-preview, 2023-09-01-preview, 2023-10-27-preview, 2023-11-01, 2024-01-01, 2024-11-01-preview, 2025-01-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native chaos [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
Create/update a Target that extends a virtual machine resource.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var target = new AzureNative.Chaos.Target("target", new()
{
ParentProviderNamespace = "Microsoft.Compute",
ParentResourceName = "exampleVM",
ParentResourceType = "virtualMachines",
Properties = new Dictionary<string, object?>
{
["identities"] = new[]
{
new Dictionary<string, object?>
{
["subject"] = "CN=example.subject",
["type"] = "CertificateSubjectIssuer",
},
},
},
ResourceGroupName = "exampleRG",
TargetName = "Microsoft-Agent",
});
});
package main
import (
chaos "github.com/pulumi/pulumi-azure-native-sdk/chaos/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := chaos.NewTarget(ctx, "target", &chaos.TargetArgs{
ParentProviderNamespace: pulumi.String("Microsoft.Compute"),
ParentResourceName: pulumi.String("exampleVM"),
ParentResourceType: pulumi.String("virtualMachines"),
Properties: pulumi.Any(map[string]interface{}{
"identities": []map[string]interface{}{
map[string]interface{}{
"subject": "CN=example.subject",
"type": "CertificateSubjectIssuer",
},
},
}),
ResourceGroupName: pulumi.String("exampleRG"),
TargetName: pulumi.String("Microsoft-Agent"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.chaos.Target;
import com.pulumi.azurenative.chaos.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 target = new Target("target", TargetArgs.builder()
.parentProviderNamespace("Microsoft.Compute")
.parentResourceName("exampleVM")
.parentResourceType("virtualMachines")
.properties(Map.of("identities", Map.ofEntries(
Map.entry("subject", "CN=example.subject"),
Map.entry("type", "CertificateSubjectIssuer")
)))
.resourceGroupName("exampleRG")
.targetName("Microsoft-Agent")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:chaos:Target Microsoft-Agent /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}
Properties
String that represents a resource provider namespace.
String that represents a resource name.
String that represents a resource type.
The properties of the target resource.
String that represents an Azure resource group.
String that represents a Target resource name.