azure-native.resources.TagAtScope

Explore with Pulumi AI

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());

    }
}
import pulumi
import pulumi_azure_native as azure_native

tag_at_scope = azure_native.resources.TagAtScope("tagAtScope",
    properties=azure_native.resources.TagsArgs(
        tags={
            "tagKey1": "tagValue1",
            "tagKey2": "tagValue2",
        },
    ),
    scope="subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/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: "tagValue1",
            tagKey2: "tagValue2",
        },
    },
    scope: "subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/providers/myPRNameSpace/VM/myVm",
});
resources:
  tagAtScope:
    type: azure-native:resources:TagAtScope
    properties:
      properties:
        tags:
          tagKey1: tagValue1
          tagKey2: tagValue2
      scope: subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/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", "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 pulumi
import pulumi_azure_native as azure_native

tag_at_scope = azure_native.resources.TagAtScope("tagAtScope",
    properties=azure_native.resources.TagsArgs(
        tags={
            "tagKey1": "tagValue1",
            "tagKey2": "tagValue2",
        },
    ),
    scope="subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd")
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: "tagValue1",
            tagKey2: "tagValue2",
        },
    },
    scope: "subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd",
});
resources:
  tagAtScope:
    type: azure-native:resources:TagAtScope
    properties:
      properties:
        tags:
          tagKey1: tagValue1
          tagKey2: tagValue2
      scope: subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd

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.AzureNative.Resources.Inputs.TagsArgs

The set of tags.

Scope string

The resource scope.

Properties TagsArgs

The set of tags.

Scope string

The resource scope.

properties TagsArgs

The set of tags.

scope String

The resource scope.

properties TagsArgs

The set of tags.

scope string

The resource scope.

properties TagsArgs

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:

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the tags wrapper resource.

Type string

The type of the tags wrapper resource.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the tags wrapper resource.

Type string

The type of the tags wrapper resource.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the tags wrapper resource.

type String

The type of the tags wrapper resource.

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the tags wrapper resource.

type string

The type of the tags wrapper resource.

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the tags wrapper resource.

type str

The type of the tags wrapper resource.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the tags wrapper resource.

type String

The type of the tags wrapper resource.

Supporting Types

Tags

Tags Dictionary<string, string>
Tags map[string]string
tags Map<String,String>
tags {[key: string]: string}
tags Mapping[str, str]
tags Map<String>

TagsResponse

Tags Dictionary<string, string>
Tags map[string]string
tags Map<String,String>
tags {[key: string]: string}
tags Mapping[str, str]
tags 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