Class 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,
},
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class Tag : CustomResource
Constructors
View SourceTag(String, TagArgs, CustomResourceOptions)
Create a Tag resource with the given unique name, arguments, and options.
Declaration
public Tag(string name, TagArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| TagArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceName
The name of the tag
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, TagState, CustomResourceOptions)
Get an existing Tag resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Tag Get(string name, Input<string> id, TagState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| TagState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Tag |