1. Packages
  2. Azure Native v1
  3. API Docs
  4. resources
  5. TagAtScope
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.resources.TagAtScope

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    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

    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 = 
        {
            { "tags", 
            {
                { "string", "string" },
            } },
        },
        Scope = "string",
    });
    
    example, err := resources.NewTagAtScope(ctx, "tagAtScopeResource", &resources.TagAtScopeArgs{
    	Properties: map[string]interface{}{
    		"tags": map[string]interface{}{
    			"string": "string",
    		},
    	},
    	Scope: "string",
    })
    
    var tagAtScopeResource = new TagAtScope("tagAtScopeResource", TagAtScopeArgs.builder()
        .properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .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

    The TagAtScope resource accepts the following input properties:

    Properties Pulumi.AzureNative.Resources.Inputs.Tags
    The set of tags.
    Scope string
    The resource scope.
    Properties TagsArgs
    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 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, TagsArgs

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

    TagsResponse, TagsResponseArgs

    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 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    azure-native-v1 pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi