Azure Native

Pulumi Official
Package maintained by Pulumi
v1.67.0 published on Tuesday, Jul 12, 2022 by Pulumi

TagAtScope

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

Example Usage

Update tags on a resource

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var tagAtScope = new AzureNative.Resources.TagAtScope("tagAtScope", new AzureNative.Resources.TagAtScopeArgs
        {
            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/go/azure/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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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 Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var tagAtScope = new AzureNative.Resources.TagAtScope("tagAtScope", new AzureNative.Resources.TagAtScopeArgs
        {
            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/go/azure/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 java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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 a 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
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0