aws logo
AWS Classic v5.41.0, May 15 23

aws.organizations.getResourceTags

Explore with Pulumi AI

Get tags attached to the specified AWS Organizations resource.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var account = Aws.Organizations.GetResourceTags.Invoke(new()
    {
        ResourceId = "123456123846",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := organizations.GetResourceTags(ctx, &organizations.GetResourceTagsArgs{
			ResourceId: "123456123846",
		}, nil)
		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.aws.organizations.OrganizationsFunctions;
import com.pulumi.aws.organizations.inputs.GetResourceTagsArgs;
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) {
        final var account = OrganizationsFunctions.getResourceTags(GetResourceTagsArgs.builder()
            .resourceId("123456123846")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

account = aws.organizations.get_resource_tags(resource_id="123456123846")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const account = aws.organizations.getResourceTags({
    resourceId: "123456123846",
});
variables:
  account:
    fn::invoke:
      Function: aws:organizations:getResourceTags
      Arguments:
        resourceId: '123456123846'

Using getResourceTags

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getResourceTags(args: GetResourceTagsArgs, opts?: InvokeOptions): Promise<GetResourceTagsResult>
function getResourceTagsOutput(args: GetResourceTagsOutputArgs, opts?: InvokeOptions): Output<GetResourceTagsResult>
def get_resource_tags(resource_id: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetResourceTagsResult
def get_resource_tags_output(resource_id: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetResourceTagsResult]
func GetResourceTags(ctx *Context, args *GetResourceTagsArgs, opts ...InvokeOption) (*GetResourceTagsResult, error)
func GetResourceTagsOutput(ctx *Context, args *GetResourceTagsOutputArgs, opts ...InvokeOption) GetResourceTagsResultOutput

> Note: This function is named GetResourceTags in the Go SDK.

public static class GetResourceTags 
{
    public static Task<GetResourceTagsResult> InvokeAsync(GetResourceTagsArgs args, InvokeOptions? opts = null)
    public static Output<GetResourceTagsResult> Invoke(GetResourceTagsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetResourceTagsResult> getResourceTags(GetResourceTagsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: aws:organizations/getResourceTags:getResourceTags
  arguments:
    # arguments dictionary

The following arguments are supported:

ResourceId string

ID of the resource with the tags to list. See details below.

Tags Dictionary<string, string>

Map of key=value pairs for each tag set on the resource.

ResourceId string

ID of the resource with the tags to list. See details below.

Tags map[string]string

Map of key=value pairs for each tag set on the resource.

resourceId String

ID of the resource with the tags to list. See details below.

tags Map<String,String>

Map of key=value pairs for each tag set on the resource.

resourceId string

ID of the resource with the tags to list. See details below.

tags {[key: string]: string}

Map of key=value pairs for each tag set on the resource.

resource_id str

ID of the resource with the tags to list. See details below.

tags Mapping[str, str]

Map of key=value pairs for each tag set on the resource.

resourceId String

ID of the resource with the tags to list. See details below.

tags Map<String>

Map of key=value pairs for each tag set on the resource.

getResourceTags Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

ResourceId string
Tags Dictionary<string, string>

Map of key=value pairs for each tag set on the resource.

Id string

The provider-assigned unique ID for this managed resource.

ResourceId string
Tags map[string]string

Map of key=value pairs for each tag set on the resource.

id String

The provider-assigned unique ID for this managed resource.

resourceId String
tags Map<String,String>

Map of key=value pairs for each tag set on the resource.

id string

The provider-assigned unique ID for this managed resource.

resourceId string
tags {[key: string]: string}

Map of key=value pairs for each tag set on the resource.

id str

The provider-assigned unique ID for this managed resource.

resource_id str
tags Mapping[str, str]

Map of key=value pairs for each tag set on the resource.

id String

The provider-assigned unique ID for this managed resource.

resourceId String
tags Map<String>

Map of key=value pairs for each tag set on the resource.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.