azure-native.resources.TagAtScope
Explore with Pulumi AI
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, 2024-03-01, 2024-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 (
resources "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={
"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 (
resources "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={
"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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TagAtScope(name: string, args: TagAtScopeArgs, opts?: CustomResourceOptions);
@overload
def TagAtScope(resource_name: str,
args: TagAtScopeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TagAtScope(resource_name: str,
opts: Optional[ResourceOptions] = None,
properties: Optional[TagsArgs] = None,
scope: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var tagAtScopeResource = new AzureNative.Resources.TagAtScope("tagAtScopeResource", new()
{
Properties = new AzureNative.Resources.Inputs.TagsArgs
{
Tags =
{
{ "string", "string" },
},
},
Scope = "string",
});
example, err := resources.NewTagAtScope(ctx, "tagAtScopeResource", &resources.TagAtScopeArgs{
Properties: &resources.TagsArgs{
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Scope: pulumi.String("string"),
})
var tagAtScopeResource = new TagAtScope("tagAtScopeResource", TagAtScopeArgs.builder()
.properties(TagsArgs.builder()
.tags(Map.of("string", "string"))
.build())
.scope("string")
.build());
tag_at_scope_resource = azure_native.resources.TagAtScope("tagAtScopeResource",
properties={
"tags": {
"string": "string",
},
},
scope="string")
const tagAtScopeResource = new azure_native.resources.TagAtScope("tagAtScopeResource", {
properties: {
tags: {
string: "string",
},
},
scope: "string",
});
type: azure-native:resources:TagAtScope
properties:
properties:
tags:
string: string
scope: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0