GetTag

Get information on a tag. This data source provides the name as configured on your DigitalOcean account. This is useful if the tag name in question is not managed by this provider or you need validate if the tag exists in the account.

An error is triggered if the provided tag name does not exist.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleTag = Output.Create(DigitalOcean.GetTag.InvokeAsync(new DigitalOcean.GetTagArgs
        {
            Name = "example",
        }));
        var exampleDroplet = new DigitalOcean.Droplet("exampleDroplet", new DigitalOcean.DropletArgs
        {
            Image = "ubuntu-18-04-x64",
            Region = "nyc2",
            Size = "s-1vcpu-1gb",
            Tags = 
            {
                exampleTag.Apply(exampleTag => exampleTag.Name),
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example_tag = digitalocean.get_tag(name="example")
example_droplet = digitalocean.Droplet("exampleDroplet",
    image="ubuntu-18-04-x64",
    region="nyc2",
    size="s-1vcpu-1gb",
    tags=[example_tag.name])
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const exampleTag = digitalocean.getTag({
    name: "example",
});
const exampleDroplet = new digitalocean.Droplet("exampleDroplet", {
    image: "ubuntu-18-04-x64",
    region: "nyc2",
    size: "s-1vcpu-1gb",
    tags: [exampleTag.then(exampleTag => exampleTag.name)],
});

Using GetTag

function getTag(args: GetTagArgs, opts?: InvokeOptions): Promise<GetTagResult>
function  get_tag(name=None, opts=None)
func LookupTag(ctx *Context, args *LookupTagArgs, opts ...InvokeOption) (*LookupTagResult, error)

Note: This function is named LookupTag in the Go SDK.

public static class GetTag {
    public static Task<GetTagResult> InvokeAsync(GetTagArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the tag.

Name string

The name of the tag.

name string

The name of the tag.

name str

The name of the tag.

GetTag Result

The following output properties are available:

DatabasesCount int

A count of the database clusters that the tag is applied to.

DropletsCount int

A count of the Droplets the tag is applied to.

Id string

The provider-assigned unique ID for this managed resource.

ImagesCount int

A count of the images that the tag is applied to.

Name string
TotalResourceCount int

A count of the total number of resources that the tag is applied to.

VolumeSnapshotsCount int

A count of the volume snapshots that the tag is applied to.

VolumesCount int

A count of the volumes that the tag is applied to.

DatabasesCount int

A count of the database clusters that the tag is applied to.

DropletsCount int

A count of the Droplets the tag is applied to.

Id string

The provider-assigned unique ID for this managed resource.

ImagesCount int

A count of the images that the tag is applied to.

Name string
TotalResourceCount int

A count of the total number of resources that the tag is applied to.

VolumeSnapshotsCount int

A count of the volume snapshots that the tag is applied to.

VolumesCount int

A count of the volumes that the tag is applied to.

databasesCount number

A count of the database clusters that the tag is applied to.

dropletsCount number

A count of the Droplets the tag is applied to.

id string

The provider-assigned unique ID for this managed resource.

imagesCount number

A count of the images that the tag is applied to.

name string
totalResourceCount number

A count of the total number of resources that the tag is applied to.

volumeSnapshotsCount number

A count of the volume snapshots that the tag is applied to.

volumesCount number

A count of the volumes that the tag is applied to.

databases_count float

A count of the database clusters that the tag is applied to.

droplets_count float

A count of the Droplets the tag is applied to.

id str

The provider-assigned unique ID for this managed resource.

images_count float

A count of the images that the tag is applied to.

name str
total_resource_count float

A count of the total number of resources that the tag is applied to.

volume_snapshots_count float

A count of the volume snapshots that the tag is applied to.

volumes_count float

A count of the volumes that the tag is applied to.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.