TagAtScopeArgs

data class TagAtScopeArgs(val properties: Output<TagsArgs>? = null, val scope: Output<String>? = null) : ConvertibleToJava<TagAtScopeArgs>

Wrapper resource for tags API requests and responses. API Version: 2019-10-01.

Example Usage

Update tags on a resource

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var tagAtScope = new AzureNative.Resources.TagAtScope("tagAtScope", new()
{
Properties = new AzureNative.Resources.Inputs.TagsArgs
{
Tags =
{
{ "tagKey1", "tagValue1" },
{ "tagKey2", "tagValue2" },
},
},
Scope = "subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/providers/myPRNameSpace/VM/myVm",
});
});
package main
import (
resources "github.com/pulumi/pulumi-azure-native-sdk/resources"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := resources.NewTagAtScope(ctx, "tagAtScope", &resources.TagAtScopeArgs{
Properties: &resources.TagsArgs{
Tags: pulumi.StringMap{
"tagKey1": pulumi.String("tagValue1"),
"tagKey2": pulumi.String("tagValue2"),
},
},
Scope: pulumi.String("subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/providers/myPRNameSpace/VM/myVm"),
})
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.resources.TagAtScope;
import com.pulumi.azurenative.resources.TagAtScopeArgs;
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 tagAtScope = new TagAtScope("tagAtScope", TagAtScopeArgs.builder()
.properties(Map.of("tags", Map.ofEntries(
Map.entry("tagKey1", "tagValue1"),
Map.entry("tagKey2", "tagValue2")
)))
.scope("subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/providers/myPRNameSpace/VM/myVm")
.build());
}
}

Update tags on a subscription

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var tagAtScope = new AzureNative.Resources.TagAtScope("tagAtScope", new()
{
Properties = new AzureNative.Resources.Inputs.TagsArgs
{
Tags =
{
{ "tagKey1", "tagValue1" },
{ "tagKey2", "tagValue2" },
},
},
Scope = "subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd",
});
});
package main
import (
resources "github.com/pulumi/pulumi-azure-native-sdk/resources"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := resources.NewTagAtScope(ctx, "tagAtScope", &resources.TagAtScopeArgs{
Properties: &resources.TagsArgs{
Tags: pulumi.StringMap{
"tagKey1": pulumi.String("tagValue1"),
"tagKey2": pulumi.String("tagValue2"),
},
},
Scope: pulumi.String("subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd"),
})
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.resources.TagAtScope;
import com.pulumi.azurenative.resources.TagAtScopeArgs;
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 tagAtScope = new TagAtScope("tagAtScope", TagAtScopeArgs.builder()
.properties(Map.of("tags", Map.ofEntries(
Map.entry("tagKey1", "tagValue1"),
Map.entry("tagKey2", "tagValue2")
)))
.scope("subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:resources:TagAtScope myresource1 /{scope}/providers/Microsoft.Resources/tags/default

Constructors

Link copied to clipboard
constructor(properties: Output<TagsArgs>? = null, scope: Output<String>? = null)

Properties

Link copied to clipboard
val properties: Output<TagsArgs>? = null

The set of tags.

Link copied to clipboard
val scope: Output<String>? = null

The resource scope.

Functions

Link copied to clipboard
open override fun toJava(): TagAtScopeArgs