This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.34.0 published on Thursday, Mar 28, 2024 by Pulumi
azure-native.resources.TagAtScope
Explore with Pulumi AI
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.34.0 published on Thursday, Mar 28, 2024 by Pulumi
Wrapper resource for tags API requests and responses. Azure REST API version: 2022-09-01. Prior API version in Azure Native 1.x: 2019-10-01.
Other available API versions: 2023-07-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", "tag-value-1" },
{ "tagKey2", "tag-value-2" },
},
},
Scope = "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/resources/v2"
"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("tag-value-1"),
"tagKey2": pulumi.String("tag-value-2"),
},
},
Scope: pulumi.String("subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/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 com.pulumi.azurenative.resources.inputs.TagsArgs;
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(TagsArgs.builder()
.tags(Map.ofEntries(
Map.entry("tagKey1", "tag-value-1"),
Map.entry("tagKey2", "tag-value-2")
))
.build())
.scope("subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
tag_at_scope = azure_native.resources.TagAtScope("tagAtScope",
properties=azure_native.resources.TagsArgs(
tags={
"tagKey1": "tag-value-1",
"tagKey2": "tag-value-2",
},
),
scope="subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const tagAtScope = new azure_native.resources.TagAtScope("tagAtScope", {
properties: {
tags: {
tagKey1: "tag-value-1",
tagKey2: "tag-value-2",
},
},
scope: "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm",
});
resources:
tagAtScope:
type: azure-native:resources:TagAtScope
properties:
properties:
tags:
tagKey1: tag-value-1
tagKey2: tag-value-2
scope: subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm
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", "tag-value-1" },
{ "tagKey2", "tag-value-2" },
},
},
Scope = "subscriptions/00000000-0000-0000-0000-000000000000",
});
});
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/resources/v2"
"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("tag-value-1"),
"tagKey2": pulumi.String("tag-value-2"),
},
},
Scope: pulumi.String("subscriptions/00000000-0000-0000-0000-000000000000"),
})
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 com.pulumi.azurenative.resources.inputs.TagsArgs;
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(TagsArgs.builder()
.tags(Map.ofEntries(
Map.entry("tagKey1", "tag-value-1"),
Map.entry("tagKey2", "tag-value-2")
))
.build())
.scope("subscriptions/00000000-0000-0000-0000-000000000000")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
tag_at_scope = azure_native.resources.TagAtScope("tagAtScope",
properties=azure_native.resources.TagsArgs(
tags={
"tagKey1": "tag-value-1",
"tagKey2": "tag-value-2",
},
),
scope="subscriptions/00000000-0000-0000-0000-000000000000")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const tagAtScope = new azure_native.resources.TagAtScope("tagAtScope", {
properties: {
tags: {
tagKey1: "tag-value-1",
tagKey2: "tag-value-2",
},
},
scope: "subscriptions/00000000-0000-0000-0000-000000000000",
});
resources:
tagAtScope:
type: azure-native:resources:TagAtScope
properties:
properties:
tags:
tagKey1: tag-value-1
tagKey2: tag-value-2
scope: subscriptions/00000000-0000-0000-0000-000000000000
Create TagAtScope Resource
new TagAtScope(name: string, args: TagAtScopeArgs, opts?: CustomResourceOptions);
@overload
def TagAtScope(resource_name: str,
opts: Optional[ResourceOptions] = None,
properties: Optional[TagsArgs] = None,
scope: Optional[str] = None)
@overload
def TagAtScope(resource_name: str,
args: TagAtScopeArgs,
opts: Optional[ResourceOptions] = None)
func NewTagAtScope(ctx *Context, name string, args TagAtScopeArgs, opts ...ResourceOption) (*TagAtScope, error)
public TagAtScope(string name, TagAtScopeArgs args, CustomResourceOptions? opts = null)
public TagAtScope(String name, TagAtScopeArgs args)
public TagAtScope(String name, TagAtScopeArgs args, CustomResourceOptions options)
type: azure-native:resources:TagAtScope
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagAtScopeArgs
- 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 TagAtScopeArgs
- 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 TagAtScopeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagAtScopeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TagAtScopeArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TagAtScope 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 TagAtScope resource accepts the following input properties:
- Properties
Pulumi.
Azure Native. Resources. Inputs. Tags - The set of tags.
- Scope string
- The resource scope.
- Properties
Tags
Args - The set of tags.
- Scope string
- The resource scope.
- properties Tags
- The set of tags.
- scope String
- The resource scope.
- properties Tags
- The set of tags.
- scope string
- The resource scope.
- properties
Tags
Args - The set of tags.
- scope str
- The resource scope.
- properties Property Map
- The set of tags.
- scope String
- The resource scope.
Outputs
All input properties are implicitly available as output properties. Additionally, the TagAtScope resource produces the following output properties:
Supporting Types
Tags, TagsArgs
- Dictionary<string, string>
- map[string]string
- Map<String,String>
- {[key: string]: string}
- Mapping[str, str]
- Map<String>
TagsResponse, TagsResponseArgs
- Dictionary<string, string>
- map[string]string
- Map<String,String>
- {[key: string]: string}
- Mapping[str, str]
- Map<String>
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
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.34.0 published on Thursday, Mar 28, 2024 by Pulumi