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);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:
Outputs
All input properties are implicitly available as output properties. Additionally, the Tag resource produces the following output properties:
- Databases
Count int A count of the database clusters that the tag is applied to.
- Droplets
Count int A count of the Droplets the tag is applied to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Images
Count int A count of the images that the tag is applied to.
- Total
Resource intCount A count of the total number of resources that the tag is applied to.
- Volume
Snapshots intCount A count of the volume snapshots that the tag is applied to.
- Volumes
Count int A count of the volumes that the tag is applied to.
- Databases
Count int A count of the database clusters that the tag is applied to.
- Droplets
Count int A count of the Droplets the tag is applied to.
- Id string
- The provider-assigned unique ID for this managed resource.
- Images
Count int A count of the images that the tag is applied to.
- Total
Resource intCount A count of the total number of resources that the tag is applied to.
- Volume
Snapshots intCount A count of the volume snapshots that the tag is applied to.
- Volumes
Count int A count of the volumes that the tag is applied to.
- databases
Count number A count of the database clusters that the tag is applied to.
- droplets
Count number A count of the Droplets the tag is applied to.
- id string
- The provider-assigned unique ID for this managed resource.
- images
Count number A count of the images that the tag is applied to.
- total
Resource numberCount A count of the total number of resources that the tag is applied to.
- volume
Snapshots numberCount A count of the volume snapshots that the tag is applied to.
- volumes
Count 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_ floatcount A count of the total number of resources that the tag is applied to.
- volume_
snapshots_ floatcount 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): Tagstatic 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);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:
- Databases
Count int A count of the database clusters that the tag is applied to.
- Droplets
Count int A count of the Droplets the tag is applied to.
- Images
Count int A count of the images that the tag is applied to.
- Name string
The name of the tag
- Total
Resource intCount A count of the total number of resources that the tag is applied to.
- Volume
Snapshots intCount A count of the volume snapshots that the tag is applied to.
- Volumes
Count int A count of the volumes that the tag is applied to.
- Databases
Count int A count of the database clusters that the tag is applied to.
- Droplets
Count int A count of the Droplets the tag is applied to.
- Images
Count int A count of the images that the tag is applied to.
- Name string
The name of the tag
- Total
Resource intCount A count of the total number of resources that the tag is applied to.
- Volume
Snapshots intCount A count of the volume snapshots that the tag is applied to.
- Volumes
Count int A count of the volumes that the tag is applied to.
- databases
Count number A count of the database clusters that the tag is applied to.
- droplets
Count number A count of the Droplets the tag is applied to.
- images
Count number A count of the images that the tag is applied to.
- name string
The name of the tag
- total
Resource numberCount A count of the total number of resources that the tag is applied to.
- volume
Snapshots numberCount A count of the volume snapshots that the tag is applied to.
- volumes
Count 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_ floatcount A count of the total number of resources that the tag is applied to.
- volume_
snapshots_ floatcount 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
digitaloceanTerraform Provider.