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
LookupTagin the Go SDK.
public static class GetTag {
public static Task<GetTagResult> InvokeAsync(GetTagArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetTag Result
The following output properties are available:
- 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.
- Name string
- 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.
- Name string
- 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.
- name string
- 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.
- name str
- 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.