Tag

Provides a DigitalOcean Tag resource. A Tag is a label that can be applied to a Droplet resource in order to better organize or facilitate the lookups and actions on it. Tags created with this resource can be referenced in your Droplet configuration via their ID or name.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new tag
        var foobar = new DigitalOcean.Tag("foobar", new DigitalOcean.TagArgs
        {
        });
        // Create a new Droplet in nyc3 with the foobar tag
        var web = new DigitalOcean.Droplet("web", new DigitalOcean.DropletArgs
        {
            Image = "ubuntu-18-04-x64",
            Region = "nyc3",
            Size = "s-1vcpu-1gb",
            Tags = 
            {
                foobar.Id,
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

# Create a new tag
foobar = digitalocean.Tag("foobar")
# Create a new Droplet in nyc3 with the foobar tag
web = digitalocean.Droplet("web",
    image="ubuntu-18-04-x64",
    region="nyc3",
    size="s-1vcpu-1gb",
    tags=[foobar.id])
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

// Create a new tag
const foobar = new digitalocean.Tag("foobar", {});
// Create a new Droplet in nyc3 with the foobar tag
const web = new digitalocean.Droplet("web", {
    image: "ubuntu-18-04-x64",
    region: "nyc3",
    size: "s-1vcpu-1gb",
    tags: [foobar.id],
});

Create a Tag Resource

new Tag(name: string, args?: TagArgs, opts?: CustomResourceOptions);
def Tag(resource_name, opts=None, name=None, __props__=None);
func NewTag(ctx *Context, name string, args *TagArgs, opts ...ResourceOption) (*Tag, error)
public Tag(string name, TagArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TagArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TagArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TagArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Tag Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Tag resource accepts the following input properties:

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

Outputs

All input properties are implicitly available as output properties. Additionally, the Tag resource produces the following output properties:

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.

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.

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.

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.

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.

Look up an Existing Tag Resource

Get an existing Tag resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TagState, opts?: CustomResourceOptions): Tag
static get(resource_name, id, opts=None, databases_count=None, droplets_count=None, images_count=None, name=None, total_resource_count=None, volume_snapshots_count=None, volumes_count=None, __props__=None);
func GetTag(ctx *Context, name string, id IDInput, state *TagState, opts ...ResourceOption) (*Tag, error)
public static Tag Get(string name, Input<string> id, TagState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

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.

ImagesCount int

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

Name string

The name of the tag

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.

ImagesCount int

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

Name string

The name of the tag

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.

imagesCount number

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

name string

The name of the tag

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.

images_count float

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

name str

The name of the tag

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.