From 731f64c9e2129757290b82be4fd0b3e351d64c02 Mon Sep 17 00:00:00 2001 From: stack72 Date: Tue, 16 Jun 2020 16:27:53 +0300 Subject: [PATCH 1/3] Upgrade to v1.20.0 of the DigitalOcean Terraform Provider --- provider/go.mod | 2 +- provider/go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/provider/go.mod b/provider/go.mod index 21e343df..78cb67d3 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -15,7 +15,7 @@ replace ( github.com/hashicorp/vault => github.com/hashicorp/vault v1.2.0 github.com/keybase/go-crypto => github.com/keybase/go-crypto v0.0.0-20190416182011-b785b22cc757 github.com/terraform-providers/terraform-provider-aws v2.32.0+incompatible => github.com/terraform-providers/terraform-provider-aws v1.60.1-0.20191010190908-1261a98537f2 - github.com/terraform-providers/terraform-provider-digitalocean => github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200604100646-572682296547 + github.com/terraform-providers/terraform-provider-digitalocean => github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200616132413-016bf6859393 github.com/terraform-providers/terraform-provider-google v2.17.0+incompatible => github.com/terraform-providers/terraform-provider-google v1.20.1-0.20191008212436-363f2d283518 github.com/terraform-providers/terraform-provider-random v2.2.1+incompatible => github.com/terraform-providers/terraform-provider-random v1.3.2-0.20190925210718-83518d96ae4f golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 diff --git a/provider/go.sum b/provider/go.sum index 5c219e01..ea4b54cf 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -776,7 +776,6 @@ github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pulumi/pulumi-digitalocean v2.5.1+incompatible h1:bhqi/fBbCmXrfZ6yYIMhcplwCnFhb5pwRQmj8WM21pY= github.com/pulumi/pulumi-terraform-bridge/v2 v2.0.0/go.mod h1:CShKXRvffj8fOwzDfBM8qxEpqfMpLLbEAb6QCtcGeUw= github.com/pulumi/pulumi-terraform-bridge/v2 v2.4.1-0.20200608011815-6feeb51f2d39 h1:8Y0+ZfJpafOyPsxXf+TFLjCEMudDlsl/uv3o1Pg7qWM= github.com/pulumi/pulumi-terraform-bridge/v2 v2.4.1-0.20200608011815-6feeb51f2d39/go.mod h1:GI/1DagEgBD0PJUCt5wmaPLI8cx66IMzLRpy0oeucoo= @@ -789,8 +788,8 @@ github.com/pulumi/pulumi/sdk/v2 v2.0.0/go.mod h1:W7k1UDYerc5o97mHnlHHp5iQZKEby+o github.com/pulumi/pulumi/sdk/v2 v2.2.2-0.20200519081838-f66100ce28b0/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4= github.com/pulumi/pulumi/sdk/v2 v2.3.1-0.20200607162109-9754465b04db h1:Q1/Azshl983zTcWXMqkbEcFt1UN88unn9tdMv5ouQ80= github.com/pulumi/pulumi/sdk/v2 v2.3.1-0.20200607162109-9754465b04db/go.mod h1:llk6tmXss8kJrt3vEXAkwiwgZOuINEFmKIfMveVIwO8= -github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200604100646-572682296547 h1:mvIHG/QqwfXEzdkHrVFVLRW27GOrY7QwNbbxoTyFpfc= -github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200604100646-572682296547/go.mod h1:fmkoHCZCH38dQOOHhKGDgYZBvq1NfFWKV98XAmakYIM= +github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200616132413-016bf6859393 h1:dOaePp2GQPxMhe+1nokbs5VDgrYPP5S2jACrD6ecXYM= +github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20200616132413-016bf6859393/go.mod h1:fmkoHCZCH38dQOOHhKGDgYZBvq1NfFWKV98XAmakYIM= github.com/pulumi/tf2pulumi v0.8.1-0.20200519092335-cb56a4dfa88d h1:1JtzB9Gx0YX2UgKKkqJwTgBXxfg2cbLUEqTJKwKBK7s= github.com/pulumi/tf2pulumi v0.8.1-0.20200519092335-cb56a4dfa88d/go.mod h1:yv9XozKsue9ZELHQbrBGgIaFtE3OX3Q4m7koTzTqgpE= github.com/pulumi/tf2pulumi v0.8.1-0.20200528170746-c1234defe2b5 h1:h+pUwgEser1Ole6TMCc66njRPcw7SEVXpeoClG+ihEM= From 4960372e2e286c31b678cd19aa5ec1ca36ba275e Mon Sep 17 00:00:00 2001 From: stack72 Date: Tue, 16 Jun 2020 16:29:31 +0300 Subject: [PATCH 2/3] Regenerate SDK based on v1.20.0 of the DigitalOcean Terraform Provider --- .../pulumi-resource-digitalocean/schema.json | 281 ++++++++++++- provider/resources.go | 1 + sdk/dotnet/GetSizes.cs | 2 +- sdk/dotnet/GetTag.cs | 44 +- sdk/dotnet/GetTags.cs | 88 ++++ sdk/dotnet/Inputs/GetTagsFilterArgs.cs | 38 ++ sdk/dotnet/Inputs/GetTagsSortArgs.cs | 31 ++ sdk/dotnet/Outputs/GetTagsFilterResult.cs | 36 ++ sdk/dotnet/Outputs/GetTagsSortResult.cs | 35 ++ sdk/dotnet/Outputs/GetTagsTagResult.cs | 70 ++++ sdk/dotnet/Tag.cs | 72 ++++ sdk/go/digitalocean/getTag.go | 16 +- sdk/go/digitalocean/getTags.go | 39 ++ sdk/go/digitalocean/pulumiTypes.go | 378 ++++++++++++++++++ sdk/go/digitalocean/tag.go | 36 ++ sdk/nodejs/getTag.ts | 24 ++ sdk/nodejs/getTags.ts | 56 +++ sdk/nodejs/index.ts | 1 + sdk/nodejs/tag.ts | 60 +++ sdk/nodejs/tsconfig.json | 1 + sdk/nodejs/types/input.ts | 23 ++ sdk/nodejs/types/output.ts | 54 +++ sdk/python/pulumi_digitalocean/__init__.py | 1 + sdk/python/pulumi_digitalocean/get_tag.py | 54 ++- sdk/python/pulumi_digitalocean/get_tags.py | 83 ++++ sdk/python/pulumi_digitalocean/tables.py | 12 + sdk/python/pulumi_digitalocean/tag.py | 44 +- 27 files changed, 1570 insertions(+), 10 deletions(-) create mode 100644 sdk/dotnet/GetTags.cs create mode 100644 sdk/dotnet/Inputs/GetTagsFilterArgs.cs create mode 100644 sdk/dotnet/Inputs/GetTagsSortArgs.cs create mode 100644 sdk/dotnet/Outputs/GetTagsFilterResult.cs create mode 100644 sdk/dotnet/Outputs/GetTagsSortResult.cs create mode 100644 sdk/dotnet/Outputs/GetTagsTagResult.cs create mode 100644 sdk/go/digitalocean/getTags.go create mode 100644 sdk/nodejs/getTags.ts create mode 100644 sdk/python/pulumi_digitalocean/get_tags.py diff --git a/provider/cmd/pulumi-resource-digitalocean/schema.json b/provider/cmd/pulumi-resource-digitalocean/schema.json index d2b0e7c8..f3d1ec9c 100644 --- a/provider/cmd/pulumi-resource-digitalocean/schema.json +++ b/provider/cmd/pulumi-resource-digitalocean/schema.json @@ -2540,6 +2540,144 @@ "required": [ "key" ] + }, + "digitalocean:/getTagsFilter:getTagsFilter": { + "properties": { + "key": { + "type": "string", + "description": "Filter the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Only retrieves tags which keys has value that matches\none of the values provided here.\n", + "language": { + "python": { + "mapCase": false + } + } + } + }, + "type": "object", + "required": [ + "key", + "values" + ] + }, + "digitalocean:/getTagsSort:getTagsSort": { + "properties": { + "direction": { + "type": "string", + "description": "The sort direction. This may be either `asc` or `desc`.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "key": { + "type": "string", + "description": "Sort the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`.\n", + "language": { + "python": { + "mapCase": false + } + } + } + }, + "type": "object", + "required": [ + "key" + ] + }, + "digitalocean:/getTagsTag:getTagsTag": { + "properties": { + "databasesCount": { + "type": "integer", + "description": "A count of the database clusters that the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "dropletsCount": { + "type": "integer", + "description": "A count of the Droplets the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "imagesCount": { + "type": "integer", + "description": "A count of the images that the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "name": { + "type": "string", + "description": "The name of the tag.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "totalResourceCount": { + "type": "integer", + "description": "A count of the total number of resources that the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "volumeSnapshotsCount": { + "type": "integer", + "description": "A count of the volume snapshots that the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + }, + "volumesCount": { + "type": "integer", + "description": "A count of the volumes that the tag is applied to.\n", + "language": { + "python": { + "mapCase": false + } + } + } + }, + "type": "object", + "required": [ + "databasesCount", + "dropletsCount", + "imagesCount", + "name", + "totalResourceCount", + "volumeSnapshotsCount", + "volumesCount" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } } }, "provider": { @@ -5582,13 +5720,43 @@ "digitalocean:index/tag:Tag": { "description": "Provides a DigitalOcean Tag resource. A Tag is a label that can be applied to a\nDroplet resource in order to better organize or facilitate the lookups and\nactions on it. Tags created with this resource can be referenced in your Droplet\nconfiguration via their ID or name.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\n// Create a new tag\nconst foobar = new digitalocean.Tag(\"foobar\", {});\n// Create a new Droplet in nyc3 with the foobar tag\nconst web = new digitalocean.Droplet(\"web\", {\n image: \"ubuntu-18-04-x64\",\n region: \"nyc3\",\n size: \"s-1vcpu-1gb\",\n tags: [foobar.id],\n});\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\n# Create a new tag\nfoobar = digitalocean.Tag(\"foobar\")\n# Create a new Droplet in nyc3 with the foobar tag\nweb = digitalocean.Droplet(\"web\",\n image=\"ubuntu-18-04-x64\",\n region=\"nyc3\",\n size=\"s-1vcpu-1gb\",\n tags=[foobar.id])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n // Create a new tag\n var foobar = new DigitalOcean.Tag(\"foobar\", new DigitalOcean.TagArgs\n {\n });\n // Create a new Droplet in nyc3 with the foobar tag\n var web = new DigitalOcean.Droplet(\"web\", new DigitalOcean.DropletArgs\n {\n Image = \"ubuntu-18-04-x64\",\n Region = \"nyc3\",\n Size = \"s-1vcpu-1gb\",\n Tags = \n {\n foobar.Id,\n },\n });\n }\n\n}\n```\n\n{{% /example %}}\n{{% /examples %}}\n", "properties": { + "databasesCount": { + "type": "integer", + "description": "A count of the database clusters that the tag is applied to.\n" + }, + "dropletsCount": { + "type": "integer", + "description": "A count of the Droplets the tag is applied to.\n" + }, + "imagesCount": { + "type": "integer", + "description": "A count of the images that the tag is applied to.\n" + }, "name": { "type": "string", "description": "The name of the tag\n" + }, + "totalResourceCount": { + "type": "integer", + "description": "A count of the total number of resources that the tag is applied to.\n" + }, + "volumeSnapshotsCount": { + "type": "integer", + "description": "A count of the volume snapshots that the tag is applied to.\n" + }, + "volumesCount": { + "type": "integer", + "description": "A count of the volumes that the tag is applied to.\n" } }, "required": [ - "name" + "databasesCount", + "dropletsCount", + "imagesCount", + "name", + "totalResourceCount", + "volumeSnapshotsCount", + "volumesCount" ], "inputProperties": { "name": { @@ -5599,9 +5767,33 @@ "stateInputs": { "description": "Input properties used for looking up and filtering Tag resources.\n", "properties": { + "databasesCount": { + "type": "integer", + "description": "A count of the database clusters that the tag is applied to.\n" + }, + "dropletsCount": { + "type": "integer", + "description": "A count of the Droplets the tag is applied to.\n" + }, + "imagesCount": { + "type": "integer", + "description": "A count of the images that the tag is applied to.\n" + }, "name": { "type": "string", "description": "The name of the tag\n" + }, + "totalResourceCount": { + "type": "integer", + "description": "A count of the total number of resources that the tag is applied to.\n" + }, + "volumeSnapshotsCount": { + "type": "integer", + "description": "A count of the volume snapshots that the tag is applied to.\n" + }, + "volumesCount": { + "type": "integer", + "description": "A count of the volumes that the tag is applied to.\n" } }, "type": "object" @@ -7601,7 +7793,7 @@ } }, "digitalocean:index/getSizes:getSizes": { - "description": "Retrieves information about the Droplet sizes that DigitalOcean supports, with\nthe ability to filter and sort the results. If no filters are specified, all sizes\nwill be returned.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\nMost common usage will probably be to supply a size to droplet:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = digitalocean.getSizes({\n filter: [{\n key: \"slug\",\n values: [\"s-1vcpu-1gb\"],\n }],\n});\nconst web = new digitalocean.Droplet(\"web\", {\n image: \"ubuntu-18-04-x64\",\n region: \"sgp1\",\n size: main.then(main =\u003e main.sizes)[0].then(sizes =\u003e sizes.slug),\n});\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(filter=[{\n \"key\": \"slug\",\n \"values\": [\"s-1vcpu-1gb\"],\n}])\nweb = digitalocean.Droplet(\"web\",\n image=\"ubuntu-18-04-x64\",\n region=\"sgp1\",\n size=main.sizes[0][\"slug\"])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Filter = \n {\n \n {\n { \"key\", \"slug\" },\n { \"values\", \n {\n \"s-1vcpu-1gb\",\n } },\n },\n },\n }));\n var web = new DigitalOcean.Droplet(\"web\", new DigitalOcean.DropletArgs\n {\n Image = \"ubuntu-18-04-x64\",\n Region = \"sgp1\",\n Size = main.Apply(main =\u003e main.Sizes)[0].Apply(sizes =\u003e sizes.Slug),\n });\n }\n\n}\n```\n\nThe data source also supports multiple filters and sorts. For example, to fetch sizes with 1 or 2 virtual CPU that are available \"sgp1\" region, then pick the cheapest one:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = digitalocean.getSizes({\n filter: [\n {\n key: \"vcpus\",\n values: [\n 1,\n 2,\n ],\n },\n {\n key: \"regions\",\n values: [\"sgp1\"],\n },\n ],\n sort: [{\n key: \"price_monthly\",\n direction: \"asc\",\n }],\n});\nconst web = new digitalocean.Droplet(\"web\", {\n image: \"ubuntu-18-04-x64\",\n region: \"sgp1\",\n size: main.then(main =\u003e main.sizes)[0].then(sizes =\u003e sizes.slug),\n});\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(filter=[\n {\n \"key\": \"vcpus\",\n \"values\": [\n 1,\n 2,\n ],\n },\n {\n \"key\": \"regions\",\n \"values\": [\"sgp1\"],\n },\n ],\n sort=[{\n \"key\": \"price_monthly\",\n \"direction\": \"asc\",\n }])\nweb = digitalocean.Droplet(\"web\",\n image=\"ubuntu-18-04-x64\",\n region=\"sgp1\",\n size=main.sizes[0][\"slug\"])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Filter = \n {\n \n {\n { \"key\", \"vcpus\" },\n { \"values\", \n {\n 1,\n 2,\n } },\n },\n \n {\n { \"key\", \"regions\" },\n { \"values\", \n {\n \"sgp1\",\n } },\n },\n },\n Sort = \n {\n \n {\n { \"key\", \"price_monthly\" },\n { \"direction\", \"asc\" },\n },\n },\n }));\n var web = new DigitalOcean.Droplet(\"web\", new DigitalOcean.DropletArgs\n {\n Image = \"ubuntu-18-04-x64\",\n Region = \"sgp1\",\n Size = main.Apply(main =\u003e main.Sizes)[0].Apply(sizes =\u003e sizes.Slug),\n });\n }\n\n}\n```\n\nThe data source can also handle multiple sorts. In which case, the sort will be applied in the order it is defined. For example, to sort by memory in ascending order, then sort by disk in descending order between sizes with same memory:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = pulumi.output(digitalocean.getSizes({\n sorts: [\n {\n direction: \"asc\",\n // Sort by memory ascendingly\n key: \"memory\",\n },\n {\n direction: \"desc\",\n // Then sort by disk descendingly for sizes with same memory\n key: \"disk\",\n },\n ],\n}, { async: true }));\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(sorts=[\n {\n \"direction\": \"asc\",\n \"key\": \"memory\",\n },\n {\n \"direction\": \"desc\",\n \"key\": \"disk\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Sorts = \n {\n new DigitalOcean.Inputs.GetSizesSortArgs\n {\n Direction = \"asc\",\n Key = \"memory\",\n },\n new DigitalOcean.Inputs.GetSizesSortArgs\n {\n Direction = \"desc\",\n Key = \"disk\",\n },\n },\n }));\n }\n\n}\n```\n\n{{% /example %}}\n{{% /examples %}}\n", + "description": "Retrieves information about the Droplet sizes that DigitalOcean supports, with\nthe ability to filter and sort the results. If no filters are specified, all sizes\nwill be returned.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\nMost common usage will probably be to supply a size to Droplet:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = digitalocean.getSizes({\n filter: [{\n key: \"slug\",\n values: [\"s-1vcpu-1gb\"],\n }],\n});\nconst web = new digitalocean.Droplet(\"web\", {\n image: \"ubuntu-18-04-x64\",\n region: \"sgp1\",\n size: main.then(main =\u003e main.sizes)[0].then(sizes =\u003e sizes.slug),\n});\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(filter=[{\n \"key\": \"slug\",\n \"values\": [\"s-1vcpu-1gb\"],\n}])\nweb = digitalocean.Droplet(\"web\",\n image=\"ubuntu-18-04-x64\",\n region=\"sgp1\",\n size=main.sizes[0][\"slug\"])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Filter = \n {\n \n {\n { \"key\", \"slug\" },\n { \"values\", \n {\n \"s-1vcpu-1gb\",\n } },\n },\n },\n }));\n var web = new DigitalOcean.Droplet(\"web\", new DigitalOcean.DropletArgs\n {\n Image = \"ubuntu-18-04-x64\",\n Region = \"sgp1\",\n Size = main.Apply(main =\u003e main.Sizes)[0].Apply(sizes =\u003e sizes.Slug),\n });\n }\n\n}\n```\n\nThe data source also supports multiple filters and sorts. For example, to fetch sizes with 1 or 2 virtual CPU that are available \"sgp1\" region, then pick the cheapest one:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = digitalocean.getSizes({\n filter: [\n {\n key: \"vcpus\",\n values: [\n 1,\n 2,\n ],\n },\n {\n key: \"regions\",\n values: [\"sgp1\"],\n },\n ],\n sort: [{\n key: \"price_monthly\",\n direction: \"asc\",\n }],\n});\nconst web = new digitalocean.Droplet(\"web\", {\n image: \"ubuntu-18-04-x64\",\n region: \"sgp1\",\n size: main.then(main =\u003e main.sizes)[0].then(sizes =\u003e sizes.slug),\n});\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(filter=[\n {\n \"key\": \"vcpus\",\n \"values\": [\n 1,\n 2,\n ],\n },\n {\n \"key\": \"regions\",\n \"values\": [\"sgp1\"],\n },\n ],\n sort=[{\n \"key\": \"price_monthly\",\n \"direction\": \"asc\",\n }])\nweb = digitalocean.Droplet(\"web\",\n image=\"ubuntu-18-04-x64\",\n region=\"sgp1\",\n size=main.sizes[0][\"slug\"])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Filter = \n {\n \n {\n { \"key\", \"vcpus\" },\n { \"values\", \n {\n 1,\n 2,\n } },\n },\n \n {\n { \"key\", \"regions\" },\n { \"values\", \n {\n \"sgp1\",\n } },\n },\n },\n Sort = \n {\n \n {\n { \"key\", \"price_monthly\" },\n { \"direction\", \"asc\" },\n },\n },\n }));\n var web = new DigitalOcean.Droplet(\"web\", new DigitalOcean.DropletArgs\n {\n Image = \"ubuntu-18-04-x64\",\n Region = \"sgp1\",\n Size = main.Apply(main =\u003e main.Sizes)[0].Apply(sizes =\u003e sizes.Slug),\n });\n }\n\n}\n```\n\nThe data source can also handle multiple sorts. In which case, the sort will be applied in the order it is defined. For example, to sort by memory in ascending order, then sort by disk in descending order between sizes with same memory:\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as digitalocean from \"@pulumi/digitalocean\";\n\nconst main = pulumi.output(digitalocean.getSizes({\n sorts: [\n {\n direction: \"asc\",\n // Sort by memory ascendingly\n key: \"memory\",\n },\n {\n direction: \"desc\",\n // Then sort by disk descendingly for sizes with same memory\n key: \"disk\",\n },\n ],\n}, { async: true }));\n```\n```python\nimport pulumi\nimport pulumi_digitalocean as digitalocean\n\nmain = digitalocean.get_sizes(sorts=[\n {\n \"direction\": \"asc\",\n \"key\": \"memory\",\n },\n {\n \"direction\": \"desc\",\n \"key\": \"disk\",\n },\n])\n```\n```csharp\nusing Pulumi;\nusing DigitalOcean = Pulumi.DigitalOcean;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var main = Output.Create(DigitalOcean.GetSizes.InvokeAsync(new DigitalOcean.GetSizesArgs\n {\n Sorts = \n {\n new DigitalOcean.Inputs.GetSizesSortArgs\n {\n Direction = \"asc\",\n Key = \"memory\",\n },\n new DigitalOcean.Inputs.GetSizesSortArgs\n {\n Direction = \"desc\",\n Key = \"disk\",\n },\n },\n }));\n }\n\n}\n```\n\n{{% /example %}}\n{{% /examples %}}\n", "inputs": { "description": "A collection of arguments for invoking getSizes.\n", "properties": { @@ -8052,17 +8244,102 @@ "outputs": { "description": "A collection of values returned by getTag.\n", "properties": { + "databasesCount": { + "type": "integer", + "description": "A count of the database clusters that the tag is applied to.\n" + }, + "dropletsCount": { + "type": "integer", + "description": "A count of the Droplets the tag is applied to.\n" + }, "id": { "type": "string", "description": "The provider-assigned unique ID for this managed resource.\n" }, + "imagesCount": { + "type": "integer", + "description": "A count of the images that the tag is applied to.\n" + }, "name": { "type": "string" + }, + "totalResourceCount": { + "type": "integer", + "description": "A count of the total number of resources that the tag is applied to.\n" + }, + "volumeSnapshotsCount": { + "type": "integer", + "description": "A count of the volume snapshots that the tag is applied to.\n" + }, + "volumesCount": { + "type": "integer", + "description": "A count of the volumes that the tag is applied to.\n" } }, "type": "object", "required": [ + "databasesCount", + "dropletsCount", + "imagesCount", "name", + "totalResourceCount", + "volumeSnapshotsCount", + "volumesCount", + "id" + ] + } + }, + "digitalocean:index/getTags:getTags": { + "description": "Returns a list of tags in your DigitalOcean account, with the ability to\nfilter and sort the results. If no filters are specified, all tags will be\nreturned.\n\n{{% examples %}}\n{{% /examples %}}\n", + "inputs": { + "description": "A collection of arguments for invoking getTags.\n", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/types/digitalocean:/getTagsFilter:getTagsFilter" + }, + "description": "Filter the results.\nThe `filter` block is documented below.\n" + }, + "sorts": { + "type": "array", + "items": { + "$ref": "#/types/digitalocean:/getTagsSort:getTagsSort" + }, + "description": "Sort the results.\nThe `sort` block is documented below.\n" + } + }, + "type": "object" + }, + "outputs": { + "description": "A collection of values returned by getTags.\n", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/types/digitalocean:/getTagsFilter:getTagsFilter" + } + }, + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "sorts": { + "type": "array", + "items": { + "$ref": "#/types/digitalocean:/getTagsSort:getTagsSort" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/types/digitalocean:/getTagsTag:getTagsTag" + } + } + }, + "type": "object", + "required": [ + "tags", "id" ] } diff --git a/provider/resources.go b/provider/resources.go index b8e23b0f..2a4bccad 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -321,6 +321,7 @@ func Provider() tfbridge.ProviderInfo { "digitalocean_spaces_bucket_objects": {Tok: makeDataSource(digitalOceanMod, "getSpacesBucketObjects")}, "digitalocean_droplets": {Tok: makeDataSource(digitalOceanMod, "getDroplets")}, "digitalocean_container_registry": {Tok: makeDataSource(digitalOceanMod, "getContainerRegistry")}, + "digitalocean_tags": {Tok: makeDataSource(digitalOceanMod, "getTags")}, }, JavaScript: &tfbridge.JavaScriptInfo{ Dependencies: map[string]string{ diff --git a/sdk/dotnet/GetSizes.cs b/sdk/dotnet/GetSizes.cs index 23e009d5..03fbe324 100644 --- a/sdk/dotnet/GetSizes.cs +++ b/sdk/dotnet/GetSizes.cs @@ -20,7 +20,7 @@ public static class GetSizes /// ## Example Usage /// {{% example %}} /// - /// Most common usage will probably be to supply a size to droplet: + /// Most common usage will probably be to supply a size to Droplet: /// /// ```csharp /// using Pulumi; diff --git a/sdk/dotnet/GetTag.cs b/sdk/dotnet/GetTag.cs index 5abbf671..eb28ce43 100644 --- a/sdk/dotnet/GetTag.cs +++ b/sdk/dotnet/GetTag.cs @@ -76,20 +76,62 @@ public GetTagArgs() [OutputType] public sealed class GetTagResult { + /// + /// A count of the database clusters that the tag is applied to. + /// + public readonly int DatabasesCount; + /// + /// A count of the Droplets the tag is applied to. + /// + public readonly int DropletsCount; /// /// The provider-assigned unique ID for this managed resource. /// public readonly string Id; + /// + /// A count of the images that the tag is applied to. + /// + public readonly int ImagesCount; public readonly string Name; + /// + /// A count of the total number of resources that the tag is applied to. + /// + public readonly int TotalResourceCount; + /// + /// A count of the volume snapshots that the tag is applied to. + /// + public readonly int VolumeSnapshotsCount; + /// + /// A count of the volumes that the tag is applied to. + /// + public readonly int VolumesCount; [OutputConstructor] private GetTagResult( + int databasesCount, + + int dropletsCount, + string id, - string name) + int imagesCount, + + string name, + + int totalResourceCount, + + int volumeSnapshotsCount, + + int volumesCount) { + DatabasesCount = databasesCount; + DropletsCount = dropletsCount; Id = id; + ImagesCount = imagesCount; Name = name; + TotalResourceCount = totalResourceCount; + VolumeSnapshotsCount = volumeSnapshotsCount; + VolumesCount = volumesCount; } } } diff --git a/sdk/dotnet/GetTags.cs b/sdk/dotnet/GetTags.cs new file mode 100644 index 00000000..1018e953 --- /dev/null +++ b/sdk/dotnet/GetTags.cs @@ -0,0 +1,88 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean +{ + public static class GetTags + { + /// + /// Returns a list of tags in your DigitalOcean account, with the ability to + /// filter and sort the results. If no filters are specified, all tags will be + /// returned. + /// + /// {{% examples %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(GetTagsArgs? args = null, InvokeOptions? options = null) + => Pulumi.Deployment.Instance.InvokeAsync("digitalocean:index/getTags:getTags", args ?? new GetTagsArgs(), options.WithVersion()); + } + + + public sealed class GetTagsArgs : Pulumi.InvokeArgs + { + [Input("filters")] + private List? _filters; + + /// + /// Filter the results. + /// The `filter` block is documented below. + /// + public List Filters + { + get => _filters ?? (_filters = new List()); + set => _filters = value; + } + + [Input("sorts")] + private List? _sorts; + + /// + /// Sort the results. + /// The `sort` block is documented below. + /// + public List Sorts + { + get => _sorts ?? (_sorts = new List()); + set => _sorts = value; + } + + public GetTagsArgs() + { + } + } + + + [OutputType] + public sealed class GetTagsResult + { + public readonly ImmutableArray Filters; + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + public readonly ImmutableArray Sorts; + public readonly ImmutableArray Tags; + + [OutputConstructor] + private GetTagsResult( + ImmutableArray filters, + + string id, + + ImmutableArray sorts, + + ImmutableArray tags) + { + Filters = filters; + Id = id; + Sorts = sorts; + Tags = tags; + } + } +} diff --git a/sdk/dotnet/Inputs/GetTagsFilterArgs.cs b/sdk/dotnet/Inputs/GetTagsFilterArgs.cs new file mode 100644 index 00000000..56bcb763 --- /dev/null +++ b/sdk/dotnet/Inputs/GetTagsFilterArgs.cs @@ -0,0 +1,38 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean.Inputs +{ + + public sealed class GetTagsFilterArgs : Pulumi.InvokeArgs + { + /// + /// Filter the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + /// + [Input("key", required: true)] + public string Key { get; set; } = null!; + + [Input("values", required: true)] + private List? _values; + + /// + /// Only retrieves tags which keys has value that matches + /// one of the values provided here. + /// + public List Values + { + get => _values ?? (_values = new List()); + set => _values = value; + } + + public GetTagsFilterArgs() + { + } + } +} diff --git a/sdk/dotnet/Inputs/GetTagsSortArgs.cs b/sdk/dotnet/Inputs/GetTagsSortArgs.cs new file mode 100644 index 00000000..d00ac0f2 --- /dev/null +++ b/sdk/dotnet/Inputs/GetTagsSortArgs.cs @@ -0,0 +1,31 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean.Inputs +{ + + public sealed class GetTagsSortArgs : Pulumi.InvokeArgs + { + /// + /// The sort direction. This may be either `asc` or `desc`. + /// + [Input("direction")] + public string? Direction { get; set; } + + /// + /// Sort the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + /// + [Input("key", required: true)] + public string Key { get; set; } = null!; + + public GetTagsSortArgs() + { + } + } +} diff --git a/sdk/dotnet/Outputs/GetTagsFilterResult.cs b/sdk/dotnet/Outputs/GetTagsFilterResult.cs new file mode 100644 index 00000000..10e85375 --- /dev/null +++ b/sdk/dotnet/Outputs/GetTagsFilterResult.cs @@ -0,0 +1,36 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean.Outputs +{ + + [OutputType] + public sealed class GetTagsFilterResult + { + /// + /// Filter the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + /// + public readonly string Key; + /// + /// Only retrieves tags which keys has value that matches + /// one of the values provided here. + /// + public readonly ImmutableArray Values; + + [OutputConstructor] + private GetTagsFilterResult( + string key, + + ImmutableArray values) + { + Key = key; + Values = values; + } + } +} diff --git a/sdk/dotnet/Outputs/GetTagsSortResult.cs b/sdk/dotnet/Outputs/GetTagsSortResult.cs new file mode 100644 index 00000000..a6904e23 --- /dev/null +++ b/sdk/dotnet/Outputs/GetTagsSortResult.cs @@ -0,0 +1,35 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean.Outputs +{ + + [OutputType] + public sealed class GetTagsSortResult + { + /// + /// The sort direction. This may be either `asc` or `desc`. + /// + public readonly string? Direction; + /// + /// Sort the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + /// + public readonly string Key; + + [OutputConstructor] + private GetTagsSortResult( + string? direction, + + string key) + { + Direction = direction; + Key = key; + } + } +} diff --git a/sdk/dotnet/Outputs/GetTagsTagResult.cs b/sdk/dotnet/Outputs/GetTagsTagResult.cs new file mode 100644 index 00000000..9e5c2cae --- /dev/null +++ b/sdk/dotnet/Outputs/GetTagsTagResult.cs @@ -0,0 +1,70 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.DigitalOcean.Outputs +{ + + [OutputType] + public sealed class GetTagsTagResult + { + /// + /// A count of the database clusters that the tag is applied to. + /// + public readonly int DatabasesCount; + /// + /// A count of the Droplets the tag is applied to. + /// + public readonly int DropletsCount; + /// + /// A count of the images that the tag is applied to. + /// + public readonly int ImagesCount; + /// + /// The name of the tag. + /// + public readonly string Name; + /// + /// A count of the total number of resources that the tag is applied to. + /// + public readonly int TotalResourceCount; + /// + /// A count of the volume snapshots that the tag is applied to. + /// + public readonly int VolumeSnapshotsCount; + /// + /// A count of the volumes that the tag is applied to. + /// + public readonly int VolumesCount; + + [OutputConstructor] + private GetTagsTagResult( + int databasesCount, + + int dropletsCount, + + int imagesCount, + + string name, + + int totalResourceCount, + + int volumeSnapshotsCount, + + int volumesCount) + { + DatabasesCount = databasesCount; + DropletsCount = dropletsCount; + ImagesCount = imagesCount; + Name = name; + TotalResourceCount = totalResourceCount; + VolumeSnapshotsCount = volumeSnapshotsCount; + VolumesCount = volumesCount; + } + } +} diff --git a/sdk/dotnet/Tag.cs b/sdk/dotnet/Tag.cs index b672b18c..5d0d3abb 100644 --- a/sdk/dotnet/Tag.cs +++ b/sdk/dotnet/Tag.cs @@ -49,12 +49,48 @@ namespace Pulumi.DigitalOcean /// public partial class Tag : Pulumi.CustomResource { + /// + /// A count of the database clusters that the tag is applied to. + /// + [Output("databasesCount")] + public Output DatabasesCount { get; private set; } = null!; + + /// + /// A count of the Droplets the tag is applied to. + /// + [Output("dropletsCount")] + public Output DropletsCount { get; private set; } = null!; + + /// + /// A count of the images that the tag is applied to. + /// + [Output("imagesCount")] + public Output ImagesCount { get; private set; } = null!; + /// /// The name of the tag /// [Output("name")] public Output Name { get; private set; } = null!; + /// + /// A count of the total number of resources that the tag is applied to. + /// + [Output("totalResourceCount")] + public Output TotalResourceCount { get; private set; } = null!; + + /// + /// A count of the volume snapshots that the tag is applied to. + /// + [Output("volumeSnapshotsCount")] + public Output VolumeSnapshotsCount { get; private set; } = null!; + + /// + /// A count of the volumes that the tag is applied to. + /// + [Output("volumesCount")] + public Output VolumesCount { get; private set; } = null!; + /// /// Create a Tag resource with the given unique name, arguments, and options. @@ -114,12 +150,48 @@ public TagArgs() public sealed class TagState : Pulumi.ResourceArgs { + /// + /// A count of the database clusters that the tag is applied to. + /// + [Input("databasesCount")] + public Input? DatabasesCount { get; set; } + + /// + /// A count of the Droplets the tag is applied to. + /// + [Input("dropletsCount")] + public Input? DropletsCount { get; set; } + + /// + /// A count of the images that the tag is applied to. + /// + [Input("imagesCount")] + public Input? ImagesCount { get; set; } + /// /// The name of the tag /// [Input("name")] public Input? Name { get; set; } + /// + /// A count of the total number of resources that the tag is applied to. + /// + [Input("totalResourceCount")] + public Input? TotalResourceCount { get; set; } + + /// + /// A count of the volume snapshots that the tag is applied to. + /// + [Input("volumeSnapshotsCount")] + public Input? VolumeSnapshotsCount { get; set; } + + /// + /// A count of the volumes that the tag is applied to. + /// + [Input("volumesCount")] + public Input? VolumesCount { get; set; } + public TagState() { } diff --git a/sdk/go/digitalocean/getTag.go b/sdk/go/digitalocean/getTag.go index f420edbf..1f243895 100644 --- a/sdk/go/digitalocean/getTag.go +++ b/sdk/go/digitalocean/getTag.go @@ -29,7 +29,19 @@ type LookupTagArgs struct { // A collection of values returned by getTag. type LookupTagResult struct { + // A count of the database clusters that the tag is applied to. + DatabasesCount int `pulumi:"databasesCount"` + // A count of the Droplets the tag is applied to. + DropletsCount int `pulumi:"dropletsCount"` // The provider-assigned unique ID for this managed resource. - Id string `pulumi:"id"` - Name string `pulumi:"name"` + Id string `pulumi:"id"` + // A count of the images that the tag is applied to. + ImagesCount int `pulumi:"imagesCount"` + Name string `pulumi:"name"` + // A count of the total number of resources that the tag is applied to. + TotalResourceCount int `pulumi:"totalResourceCount"` + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount int `pulumi:"volumeSnapshotsCount"` + // A count of the volumes that the tag is applied to. + VolumesCount int `pulumi:"volumesCount"` } diff --git a/sdk/go/digitalocean/getTags.go b/sdk/go/digitalocean/getTags.go new file mode 100644 index 00000000..af6c0819 --- /dev/null +++ b/sdk/go/digitalocean/getTags.go @@ -0,0 +1,39 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package digitalocean + +import ( + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" +) + +// Returns a list of tags in your DigitalOcean account, with the ability to +// filter and sort the results. If no filters are specified, all tags will be +// returned. +func GetTags(ctx *pulumi.Context, args *GetTagsArgs, opts ...pulumi.InvokeOption) (*GetTagsResult, error) { + var rv GetTagsResult + err := ctx.Invoke("digitalocean:index/getTags:getTags", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getTags. +type GetTagsArgs struct { + // Filter the results. + // The `filter` block is documented below. + Filters []GetTagsFilter `pulumi:"filters"` + // Sort the results. + // The `sort` block is documented below. + Sorts []GetTagsSort `pulumi:"sorts"` +} + +// A collection of values returned by getTags. +type GetTagsResult struct { + Filters []GetTagsFilter `pulumi:"filters"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + Sorts []GetTagsSort `pulumi:"sorts"` + Tags []GetTagsTag `pulumi:"tags"` +} diff --git a/sdk/go/digitalocean/pulumiTypes.go b/sdk/go/digitalocean/pulumiTypes.go index 88b42a78..fb624c08 100644 --- a/sdk/go/digitalocean/pulumiTypes.go +++ b/sdk/go/digitalocean/pulumiTypes.go @@ -5891,6 +5891,378 @@ func (o GetSpacesBucketsSortArrayOutput) Index(i pulumi.IntInput) GetSpacesBucke }).(GetSpacesBucketsSortOutput) } +type GetTagsFilter struct { + // Filter the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + Key string `pulumi:"key"` + // Only retrieves tags which keys has value that matches + // one of the values provided here. + Values []string `pulumi:"values"` +} + +// GetTagsFilterInput is an input type that accepts GetTagsFilterArgs and GetTagsFilterOutput values. +// You can construct a concrete instance of `GetTagsFilterInput` via: +// +// GetTagsFilterArgs{...} +// +type GetTagsFilterInput interface { + pulumi.Input + + ToGetTagsFilterOutput() GetTagsFilterOutput + ToGetTagsFilterOutputWithContext(context.Context) GetTagsFilterOutput +} + +type GetTagsFilterArgs struct { + // Filter the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + Key pulumi.StringInput `pulumi:"key"` + // Only retrieves tags which keys has value that matches + // one of the values provided here. + Values pulumi.StringArrayInput `pulumi:"values"` +} + +func (GetTagsFilterArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsFilter)(nil)).Elem() +} + +func (i GetTagsFilterArgs) ToGetTagsFilterOutput() GetTagsFilterOutput { + return i.ToGetTagsFilterOutputWithContext(context.Background()) +} + +func (i GetTagsFilterArgs) ToGetTagsFilterOutputWithContext(ctx context.Context) GetTagsFilterOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsFilterOutput) +} + +// GetTagsFilterArrayInput is an input type that accepts GetTagsFilterArray and GetTagsFilterArrayOutput values. +// You can construct a concrete instance of `GetTagsFilterArrayInput` via: +// +// GetTagsFilterArray{ GetTagsFilterArgs{...} } +// +type GetTagsFilterArrayInput interface { + pulumi.Input + + ToGetTagsFilterArrayOutput() GetTagsFilterArrayOutput + ToGetTagsFilterArrayOutputWithContext(context.Context) GetTagsFilterArrayOutput +} + +type GetTagsFilterArray []GetTagsFilterInput + +func (GetTagsFilterArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsFilter)(nil)).Elem() +} + +func (i GetTagsFilterArray) ToGetTagsFilterArrayOutput() GetTagsFilterArrayOutput { + return i.ToGetTagsFilterArrayOutputWithContext(context.Background()) +} + +func (i GetTagsFilterArray) ToGetTagsFilterArrayOutputWithContext(ctx context.Context) GetTagsFilterArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsFilterArrayOutput) +} + +type GetTagsFilterOutput struct{ *pulumi.OutputState } + +func (GetTagsFilterOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsFilter)(nil)).Elem() +} + +func (o GetTagsFilterOutput) ToGetTagsFilterOutput() GetTagsFilterOutput { + return o +} + +func (o GetTagsFilterOutput) ToGetTagsFilterOutputWithContext(ctx context.Context) GetTagsFilterOutput { + return o +} + +// Filter the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. +func (o GetTagsFilterOutput) Key() pulumi.StringOutput { + return o.ApplyT(func(v GetTagsFilter) string { return v.Key }).(pulumi.StringOutput) +} + +// Only retrieves tags which keys has value that matches +// one of the values provided here. +func (o GetTagsFilterOutput) Values() pulumi.StringArrayOutput { + return o.ApplyT(func(v GetTagsFilter) []string { return v.Values }).(pulumi.StringArrayOutput) +} + +type GetTagsFilterArrayOutput struct{ *pulumi.OutputState } + +func (GetTagsFilterArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsFilter)(nil)).Elem() +} + +func (o GetTagsFilterArrayOutput) ToGetTagsFilterArrayOutput() GetTagsFilterArrayOutput { + return o +} + +func (o GetTagsFilterArrayOutput) ToGetTagsFilterArrayOutputWithContext(ctx context.Context) GetTagsFilterArrayOutput { + return o +} + +func (o GetTagsFilterArrayOutput) Index(i pulumi.IntInput) GetTagsFilterOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetTagsFilter { + return vs[0].([]GetTagsFilter)[vs[1].(int)] + }).(GetTagsFilterOutput) +} + +type GetTagsSort struct { + // The sort direction. This may be either `asc` or `desc`. + Direction *string `pulumi:"direction"` + // Sort the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + Key string `pulumi:"key"` +} + +// GetTagsSortInput is an input type that accepts GetTagsSortArgs and GetTagsSortOutput values. +// You can construct a concrete instance of `GetTagsSortInput` via: +// +// GetTagsSortArgs{...} +// +type GetTagsSortInput interface { + pulumi.Input + + ToGetTagsSortOutput() GetTagsSortOutput + ToGetTagsSortOutputWithContext(context.Context) GetTagsSortOutput +} + +type GetTagsSortArgs struct { + // The sort direction. This may be either `asc` or `desc`. + Direction pulumi.StringPtrInput `pulumi:"direction"` + // Sort the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + Key pulumi.StringInput `pulumi:"key"` +} + +func (GetTagsSortArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsSort)(nil)).Elem() +} + +func (i GetTagsSortArgs) ToGetTagsSortOutput() GetTagsSortOutput { + return i.ToGetTagsSortOutputWithContext(context.Background()) +} + +func (i GetTagsSortArgs) ToGetTagsSortOutputWithContext(ctx context.Context) GetTagsSortOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsSortOutput) +} + +// GetTagsSortArrayInput is an input type that accepts GetTagsSortArray and GetTagsSortArrayOutput values. +// You can construct a concrete instance of `GetTagsSortArrayInput` via: +// +// GetTagsSortArray{ GetTagsSortArgs{...} } +// +type GetTagsSortArrayInput interface { + pulumi.Input + + ToGetTagsSortArrayOutput() GetTagsSortArrayOutput + ToGetTagsSortArrayOutputWithContext(context.Context) GetTagsSortArrayOutput +} + +type GetTagsSortArray []GetTagsSortInput + +func (GetTagsSortArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsSort)(nil)).Elem() +} + +func (i GetTagsSortArray) ToGetTagsSortArrayOutput() GetTagsSortArrayOutput { + return i.ToGetTagsSortArrayOutputWithContext(context.Background()) +} + +func (i GetTagsSortArray) ToGetTagsSortArrayOutputWithContext(ctx context.Context) GetTagsSortArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsSortArrayOutput) +} + +type GetTagsSortOutput struct{ *pulumi.OutputState } + +func (GetTagsSortOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsSort)(nil)).Elem() +} + +func (o GetTagsSortOutput) ToGetTagsSortOutput() GetTagsSortOutput { + return o +} + +func (o GetTagsSortOutput) ToGetTagsSortOutputWithContext(ctx context.Context) GetTagsSortOutput { + return o +} + +// The sort direction. This may be either `asc` or `desc`. +func (o GetTagsSortOutput) Direction() pulumi.StringPtrOutput { + return o.ApplyT(func(v GetTagsSort) *string { return v.Direction }).(pulumi.StringPtrOutput) +} + +// Sort the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. +func (o GetTagsSortOutput) Key() pulumi.StringOutput { + return o.ApplyT(func(v GetTagsSort) string { return v.Key }).(pulumi.StringOutput) +} + +type GetTagsSortArrayOutput struct{ *pulumi.OutputState } + +func (GetTagsSortArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsSort)(nil)).Elem() +} + +func (o GetTagsSortArrayOutput) ToGetTagsSortArrayOutput() GetTagsSortArrayOutput { + return o +} + +func (o GetTagsSortArrayOutput) ToGetTagsSortArrayOutputWithContext(ctx context.Context) GetTagsSortArrayOutput { + return o +} + +func (o GetTagsSortArrayOutput) Index(i pulumi.IntInput) GetTagsSortOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetTagsSort { + return vs[0].([]GetTagsSort)[vs[1].(int)] + }).(GetTagsSortOutput) +} + +type GetTagsTag struct { + // A count of the database clusters that the tag is applied to. + DatabasesCount int `pulumi:"databasesCount"` + // A count of the Droplets the tag is applied to. + DropletsCount int `pulumi:"dropletsCount"` + // A count of the images that the tag is applied to. + ImagesCount int `pulumi:"imagesCount"` + // The name of the tag. + Name string `pulumi:"name"` + // A count of the total number of resources that the tag is applied to. + TotalResourceCount int `pulumi:"totalResourceCount"` + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount int `pulumi:"volumeSnapshotsCount"` + // A count of the volumes that the tag is applied to. + VolumesCount int `pulumi:"volumesCount"` +} + +// GetTagsTagInput is an input type that accepts GetTagsTagArgs and GetTagsTagOutput values. +// You can construct a concrete instance of `GetTagsTagInput` via: +// +// GetTagsTagArgs{...} +// +type GetTagsTagInput interface { + pulumi.Input + + ToGetTagsTagOutput() GetTagsTagOutput + ToGetTagsTagOutputWithContext(context.Context) GetTagsTagOutput +} + +type GetTagsTagArgs struct { + // A count of the database clusters that the tag is applied to. + DatabasesCount pulumi.IntInput `pulumi:"databasesCount"` + // A count of the Droplets the tag is applied to. + DropletsCount pulumi.IntInput `pulumi:"dropletsCount"` + // A count of the images that the tag is applied to. + ImagesCount pulumi.IntInput `pulumi:"imagesCount"` + // The name of the tag. + Name pulumi.StringInput `pulumi:"name"` + // A count of the total number of resources that the tag is applied to. + TotalResourceCount pulumi.IntInput `pulumi:"totalResourceCount"` + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount pulumi.IntInput `pulumi:"volumeSnapshotsCount"` + // A count of the volumes that the tag is applied to. + VolumesCount pulumi.IntInput `pulumi:"volumesCount"` +} + +func (GetTagsTagArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsTag)(nil)).Elem() +} + +func (i GetTagsTagArgs) ToGetTagsTagOutput() GetTagsTagOutput { + return i.ToGetTagsTagOutputWithContext(context.Background()) +} + +func (i GetTagsTagArgs) ToGetTagsTagOutputWithContext(ctx context.Context) GetTagsTagOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsTagOutput) +} + +// GetTagsTagArrayInput is an input type that accepts GetTagsTagArray and GetTagsTagArrayOutput values. +// You can construct a concrete instance of `GetTagsTagArrayInput` via: +// +// GetTagsTagArray{ GetTagsTagArgs{...} } +// +type GetTagsTagArrayInput interface { + pulumi.Input + + ToGetTagsTagArrayOutput() GetTagsTagArrayOutput + ToGetTagsTagArrayOutputWithContext(context.Context) GetTagsTagArrayOutput +} + +type GetTagsTagArray []GetTagsTagInput + +func (GetTagsTagArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsTag)(nil)).Elem() +} + +func (i GetTagsTagArray) ToGetTagsTagArrayOutput() GetTagsTagArrayOutput { + return i.ToGetTagsTagArrayOutputWithContext(context.Background()) +} + +func (i GetTagsTagArray) ToGetTagsTagArrayOutputWithContext(ctx context.Context) GetTagsTagArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetTagsTagArrayOutput) +} + +type GetTagsTagOutput struct{ *pulumi.OutputState } + +func (GetTagsTagOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetTagsTag)(nil)).Elem() +} + +func (o GetTagsTagOutput) ToGetTagsTagOutput() GetTagsTagOutput { + return o +} + +func (o GetTagsTagOutput) ToGetTagsTagOutputWithContext(ctx context.Context) GetTagsTagOutput { + return o +} + +// A count of the database clusters that the tag is applied to. +func (o GetTagsTagOutput) DatabasesCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.DatabasesCount }).(pulumi.IntOutput) +} + +// A count of the Droplets the tag is applied to. +func (o GetTagsTagOutput) DropletsCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.DropletsCount }).(pulumi.IntOutput) +} + +// A count of the images that the tag is applied to. +func (o GetTagsTagOutput) ImagesCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.ImagesCount }).(pulumi.IntOutput) +} + +// The name of the tag. +func (o GetTagsTagOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetTagsTag) string { return v.Name }).(pulumi.StringOutput) +} + +// A count of the total number of resources that the tag is applied to. +func (o GetTagsTagOutput) TotalResourceCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.TotalResourceCount }).(pulumi.IntOutput) +} + +// A count of the volume snapshots that the tag is applied to. +func (o GetTagsTagOutput) VolumeSnapshotsCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.VolumeSnapshotsCount }).(pulumi.IntOutput) +} + +// A count of the volumes that the tag is applied to. +func (o GetTagsTagOutput) VolumesCount() pulumi.IntOutput { + return o.ApplyT(func(v GetTagsTag) int { return v.VolumesCount }).(pulumi.IntOutput) +} + +type GetTagsTagArrayOutput struct{ *pulumi.OutputState } + +func (GetTagsTagArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetTagsTag)(nil)).Elem() +} + +func (o GetTagsTagArrayOutput) ToGetTagsTagArrayOutput() GetTagsTagArrayOutput { + return o +} + +func (o GetTagsTagArrayOutput) ToGetTagsTagArrayOutputWithContext(ctx context.Context) GetTagsTagArrayOutput { + return o +} + +func (o GetTagsTagArrayOutput) Index(i pulumi.IntInput) GetTagsTagOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetTagsTag { + return vs[0].([]GetTagsTag)[vs[1].(int)] + }).(GetTagsTagOutput) +} + func init() { pulumi.RegisterOutputType(DatabaseClusterMaintenanceWindowOutput{}) pulumi.RegisterOutputType(DatabaseClusterMaintenanceWindowArrayOutput{}) @@ -5974,4 +6346,10 @@ func init() { pulumi.RegisterOutputType(GetSpacesBucketsFilterArrayOutput{}) pulumi.RegisterOutputType(GetSpacesBucketsSortOutput{}) pulumi.RegisterOutputType(GetSpacesBucketsSortArrayOutput{}) + pulumi.RegisterOutputType(GetTagsFilterOutput{}) + pulumi.RegisterOutputType(GetTagsFilterArrayOutput{}) + pulumi.RegisterOutputType(GetTagsSortOutput{}) + pulumi.RegisterOutputType(GetTagsSortArrayOutput{}) + pulumi.RegisterOutputType(GetTagsTagOutput{}) + pulumi.RegisterOutputType(GetTagsTagArrayOutput{}) } diff --git a/sdk/go/digitalocean/tag.go b/sdk/go/digitalocean/tag.go index 715dbf7f..5953e54d 100644 --- a/sdk/go/digitalocean/tag.go +++ b/sdk/go/digitalocean/tag.go @@ -16,8 +16,20 @@ import ( type Tag struct { pulumi.CustomResourceState + // A count of the database clusters that the tag is applied to. + DatabasesCount pulumi.IntOutput `pulumi:"databasesCount"` + // A count of the Droplets the tag is applied to. + DropletsCount pulumi.IntOutput `pulumi:"dropletsCount"` + // A count of the images that the tag is applied to. + ImagesCount pulumi.IntOutput `pulumi:"imagesCount"` // The name of the tag Name pulumi.StringOutput `pulumi:"name"` + // A count of the total number of resources that the tag is applied to. + TotalResourceCount pulumi.IntOutput `pulumi:"totalResourceCount"` + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount pulumi.IntOutput `pulumi:"volumeSnapshotsCount"` + // A count of the volumes that the tag is applied to. + VolumesCount pulumi.IntOutput `pulumi:"volumesCount"` } // NewTag registers a new resource with the given unique name, arguments, and options. @@ -48,13 +60,37 @@ func GetTag(ctx *pulumi.Context, // Input properties used for looking up and filtering Tag resources. type tagState struct { + // A count of the database clusters that the tag is applied to. + DatabasesCount *int `pulumi:"databasesCount"` + // A count of the Droplets the tag is applied to. + DropletsCount *int `pulumi:"dropletsCount"` + // A count of the images that the tag is applied to. + ImagesCount *int `pulumi:"imagesCount"` // The name of the tag Name *string `pulumi:"name"` + // A count of the total number of resources that the tag is applied to. + TotalResourceCount *int `pulumi:"totalResourceCount"` + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount *int `pulumi:"volumeSnapshotsCount"` + // A count of the volumes that the tag is applied to. + VolumesCount *int `pulumi:"volumesCount"` } type TagState struct { + // A count of the database clusters that the tag is applied to. + DatabasesCount pulumi.IntPtrInput + // A count of the Droplets the tag is applied to. + DropletsCount pulumi.IntPtrInput + // A count of the images that the tag is applied to. + ImagesCount pulumi.IntPtrInput // The name of the tag Name pulumi.StringPtrInput + // A count of the total number of resources that the tag is applied to. + TotalResourceCount pulumi.IntPtrInput + // A count of the volume snapshots that the tag is applied to. + VolumeSnapshotsCount pulumi.IntPtrInput + // A count of the volumes that the tag is applied to. + VolumesCount pulumi.IntPtrInput } func (TagState) ElementType() reflect.Type { diff --git a/sdk/nodejs/getTag.ts b/sdk/nodejs/getTag.ts index e94d8ada..2215da6d 100644 --- a/sdk/nodejs/getTag.ts +++ b/sdk/nodejs/getTag.ts @@ -59,9 +59,33 @@ export interface GetTagArgs { * A collection of values returned by getTag. */ export interface GetTagResult { + /** + * A count of the database clusters that the tag is applied to. + */ + readonly databasesCount: number; + /** + * A count of the Droplets the tag is applied to. + */ + readonly dropletsCount: number; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; + /** + * A count of the images that the tag is applied to. + */ + readonly imagesCount: number; readonly name: string; + /** + * A count of the total number of resources that the tag is applied to. + */ + readonly totalResourceCount: number; + /** + * A count of the volume snapshots that the tag is applied to. + */ + readonly volumeSnapshotsCount: number; + /** + * A count of the volumes that the tag is applied to. + */ + readonly volumesCount: number; } diff --git a/sdk/nodejs/getTags.ts b/sdk/nodejs/getTags.ts new file mode 100644 index 00000000..5ce863c9 --- /dev/null +++ b/sdk/nodejs/getTags.ts @@ -0,0 +1,56 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as inputs from "./types/input"; +import * as outputs from "./types/output"; +import * as utilities from "./utilities"; + +/** + * Returns a list of tags in your DigitalOcean account, with the ability to + * filter and sort the results. If no filters are specified, all tags will be + * returned. + */ +export function getTags(args?: GetTagsArgs, opts?: pulumi.InvokeOptions): Promise { + args = args || {}; + if (!opts) { + opts = {} + } + + if (!opts.version) { + opts.version = utilities.getVersion(); + } + return pulumi.runtime.invoke("digitalocean:index/getTags:getTags", { + "filters": args.filters, + "sorts": args.sorts, + }, opts); +} + +/** + * A collection of arguments for invoking getTags. + */ +export interface GetTagsArgs { + /** + * Filter the results. + * The `filter` block is documented below. + */ + readonly filters?: inputs.GetTagsFilter[]; + /** + * Sort the results. + * The `sort` block is documented below. + */ + readonly sorts?: inputs.GetTagsSort[]; +} + +/** + * A collection of values returned by getTags. + */ +export interface GetTagsResult { + readonly filters?: outputs.GetTagsFilter[]; + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + readonly sorts?: outputs.GetTagsSort[]; + readonly tags: outputs.GetTagsTag[]; +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 895dce5d..0b0a179c 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -49,6 +49,7 @@ export * from "./getSpacesBucketObjects"; export * from "./getSpacesBuckets"; export * from "./getSshKey"; export * from "./getTag"; +export * from "./getTags"; export * from "./getVolume"; export * from "./getVolumeSnapshot"; export * from "./getVpc"; diff --git a/sdk/nodejs/tag.ts b/sdk/nodejs/tag.ts index 402ca3fb..117494ae 100644 --- a/sdk/nodejs/tag.ts +++ b/sdk/nodejs/tag.ts @@ -57,10 +57,34 @@ export class Tag extends pulumi.CustomResource { return obj['__pulumiType'] === Tag.__pulumiType; } + /** + * A count of the database clusters that the tag is applied to. + */ + public /*out*/ readonly databasesCount!: pulumi.Output; + /** + * A count of the Droplets the tag is applied to. + */ + public /*out*/ readonly dropletsCount!: pulumi.Output; + /** + * A count of the images that the tag is applied to. + */ + public /*out*/ readonly imagesCount!: pulumi.Output; /** * The name of the tag */ public readonly name!: pulumi.Output; + /** + * A count of the total number of resources that the tag is applied to. + */ + public /*out*/ readonly totalResourceCount!: pulumi.Output; + /** + * A count of the volume snapshots that the tag is applied to. + */ + public /*out*/ readonly volumeSnapshotsCount!: pulumi.Output; + /** + * A count of the volumes that the tag is applied to. + */ + public /*out*/ readonly volumesCount!: pulumi.Output; /** * Create a Tag resource with the given unique name, arguments, and options. @@ -74,10 +98,22 @@ export class Tag extends pulumi.CustomResource { let inputs: pulumi.Inputs = {}; if (opts && opts.id) { const state = argsOrState as TagState | undefined; + inputs["databasesCount"] = state ? state.databasesCount : undefined; + inputs["dropletsCount"] = state ? state.dropletsCount : undefined; + inputs["imagesCount"] = state ? state.imagesCount : undefined; inputs["name"] = state ? state.name : undefined; + inputs["totalResourceCount"] = state ? state.totalResourceCount : undefined; + inputs["volumeSnapshotsCount"] = state ? state.volumeSnapshotsCount : undefined; + inputs["volumesCount"] = state ? state.volumesCount : undefined; } else { const args = argsOrState as TagArgs | undefined; inputs["name"] = args ? args.name : undefined; + inputs["databasesCount"] = undefined /*out*/; + inputs["dropletsCount"] = undefined /*out*/; + inputs["imagesCount"] = undefined /*out*/; + inputs["totalResourceCount"] = undefined /*out*/; + inputs["volumeSnapshotsCount"] = undefined /*out*/; + inputs["volumesCount"] = undefined /*out*/; } if (!opts) { opts = {} @@ -94,10 +130,34 @@ export class Tag extends pulumi.CustomResource { * Input properties used for looking up and filtering Tag resources. */ export interface TagState { + /** + * A count of the database clusters that the tag is applied to. + */ + readonly databasesCount?: pulumi.Input; + /** + * A count of the Droplets the tag is applied to. + */ + readonly dropletsCount?: pulumi.Input; + /** + * A count of the images that the tag is applied to. + */ + readonly imagesCount?: pulumi.Input; /** * The name of the tag */ readonly name?: pulumi.Input; + /** + * A count of the total number of resources that the tag is applied to. + */ + readonly totalResourceCount?: pulumi.Input; + /** + * A count of the volume snapshots that the tag is applied to. + */ + readonly volumeSnapshotsCount?: pulumi.Input; + /** + * A count of the volumes that the tag is applied to. + */ + readonly volumesCount?: pulumi.Input; } /** diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 5d43ba39..7ab9771a 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -62,6 +62,7 @@ "getSpacesBuckets.ts", "getSshKey.ts", "getTag.ts", + "getTags.ts", "getVolume.ts", "getVolumeSnapshot.ts", "getVpc.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 5c772594..88ae846e 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -268,6 +268,29 @@ export interface GetSpacesBucketsSort { key: string; } +export interface GetTagsFilter { + /** + * Filter the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + */ + key: string; + /** + * Only retrieves tags which keys has value that matches + * one of the values provided here. + */ + values: string[]; +} + +export interface GetTagsSort { + /** + * The sort direction. This may be either `asc` or `desc`. + */ + direction?: string; + /** + * Sort the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + */ + key: string; +} + export interface KubernetesClusterKubeConfig { clientCertificate?: pulumi.Input; clientKey?: pulumi.Input; diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index b1e2c2d3..0bfb5ec4 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -482,6 +482,60 @@ export interface GetSpacesBucketsSort { key: string; } +export interface GetTagsFilter { + /** + * Filter the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + */ + key: string; + /** + * Only retrieves tags which keys has value that matches + * one of the values provided here. + */ + values: string[]; +} + +export interface GetTagsSort { + /** + * The sort direction. This may be either `asc` or `desc`. + */ + direction?: string; + /** + * Sort the tags by this key. This may be one of `name`, `totalResourceCount`, `dropletsCount`, `imagesCount`, `volumesCount`, `volumeSnapshotsCount`, or `databasesCount`. + */ + key: string; +} + +export interface GetTagsTag { + /** + * A count of the database clusters that the tag is applied to. + */ + databasesCount: number; + /** + * A count of the Droplets the tag is applied to. + */ + dropletsCount: number; + /** + * A count of the images that the tag is applied to. + */ + imagesCount: number; + /** + * The name of the tag. + */ + name: string; + /** + * A count of the total number of resources that the tag is applied to. + */ + totalResourceCount: number; + /** + * A count of the volume snapshots that the tag is applied to. + */ + volumeSnapshotsCount: number; + /** + * A count of the volumes that the tag is applied to. + */ + volumesCount: number; +} + export interface KubernetesClusterKubeConfig { clientCertificate: string; clientKey: string; diff --git a/sdk/python/pulumi_digitalocean/__init__.py b/sdk/python/pulumi_digitalocean/__init__.py index 14ed67b4..5c3fe11f 100644 --- a/sdk/python/pulumi_digitalocean/__init__.py +++ b/sdk/python/pulumi_digitalocean/__init__.py @@ -53,6 +53,7 @@ from .get_spaces_buckets import * from .get_ssh_key import * from .get_tag import * +from .get_tags import * from .get_volume import * from .get_volume_snapshot import * from .get_vpc import * diff --git a/sdk/python/pulumi_digitalocean/get_tag.py b/sdk/python/pulumi_digitalocean/get_tag.py index a99f4b86..8388af18 100644 --- a/sdk/python/pulumi_digitalocean/get_tag.py +++ b/sdk/python/pulumi_digitalocean/get_tag.py @@ -13,24 +13,66 @@ class GetTagResult: """ A collection of values returned by getTag. """ - def __init__(__self__, id=None, name=None): + def __init__(__self__, databases_count=None, droplets_count=None, id=None, images_count=None, name=None, total_resource_count=None, volume_snapshots_count=None, volumes_count=None): + if databases_count and not isinstance(databases_count, float): + raise TypeError("Expected argument 'databases_count' to be a float") + __self__.databases_count = databases_count + """ + A count of the database clusters that the tag is applied to. + """ + if droplets_count and not isinstance(droplets_count, float): + raise TypeError("Expected argument 'droplets_count' to be a float") + __self__.droplets_count = droplets_count + """ + A count of the Droplets the tag is applied to. + """ if id and not isinstance(id, str): raise TypeError("Expected argument 'id' to be a str") __self__.id = id """ The provider-assigned unique ID for this managed resource. """ + if images_count and not isinstance(images_count, float): + raise TypeError("Expected argument 'images_count' to be a float") + __self__.images_count = images_count + """ + A count of the images that the tag is applied to. + """ if name and not isinstance(name, str): raise TypeError("Expected argument 'name' to be a str") __self__.name = name + if total_resource_count and not isinstance(total_resource_count, float): + raise TypeError("Expected argument 'total_resource_count' to be a float") + __self__.total_resource_count = total_resource_count + """ + A count of the total number of resources that the tag is applied to. + """ + if volume_snapshots_count and not isinstance(volume_snapshots_count, float): + raise TypeError("Expected argument 'volume_snapshots_count' to be a float") + __self__.volume_snapshots_count = volume_snapshots_count + """ + A count of the volume snapshots that the tag is applied to. + """ + if volumes_count and not isinstance(volumes_count, float): + raise TypeError("Expected argument 'volumes_count' to be a float") + __self__.volumes_count = volumes_count + """ + A count of the volumes that the tag is applied to. + """ class AwaitableGetTagResult(GetTagResult): # pylint: disable=using-constant-test def __await__(self): if False: yield self return GetTagResult( + databases_count=self.databases_count, + droplets_count=self.droplets_count, id=self.id, - name=self.name) + images_count=self.images_count, + name=self.name, + total_resource_count=self.total_resource_count, + volume_snapshots_count=self.volume_snapshots_count, + volumes_count=self.volumes_count) def get_tag(name=None,opts=None): """ @@ -71,5 +113,11 @@ def get_tag(name=None,opts=None): __ret__ = pulumi.runtime.invoke('digitalocean:index/getTag:getTag', __args__, opts=opts).value return AwaitableGetTagResult( + databases_count=__ret__.get('databasesCount'), + droplets_count=__ret__.get('dropletsCount'), id=__ret__.get('id'), - name=__ret__.get('name')) + images_count=__ret__.get('imagesCount'), + name=__ret__.get('name'), + total_resource_count=__ret__.get('totalResourceCount'), + volume_snapshots_count=__ret__.get('volumeSnapshotsCount'), + volumes_count=__ret__.get('volumesCount')) diff --git a/sdk/python/pulumi_digitalocean/get_tags.py b/sdk/python/pulumi_digitalocean/get_tags.py new file mode 100644 index 00000000..b7abbfb1 --- /dev/null +++ b/sdk/python/pulumi_digitalocean/get_tags.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import json +import warnings +import pulumi +import pulumi.runtime +from typing import Union +from . import utilities, tables + +class GetTagsResult: + """ + A collection of values returned by getTags. + """ + def __init__(__self__, filters=None, id=None, sorts=None, tags=None): + if filters and not isinstance(filters, list): + raise TypeError("Expected argument 'filters' to be a list") + __self__.filters = filters + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + __self__.id = id + """ + The provider-assigned unique ID for this managed resource. + """ + if sorts and not isinstance(sorts, list): + raise TypeError("Expected argument 'sorts' to be a list") + __self__.sorts = sorts + if tags and not isinstance(tags, list): + raise TypeError("Expected argument 'tags' to be a list") + __self__.tags = tags +class AwaitableGetTagsResult(GetTagsResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetTagsResult( + filters=self.filters, + id=self.id, + sorts=self.sorts, + tags=self.tags) + +def get_tags(filters=None,sorts=None,opts=None): + """ + Returns a list of tags in your DigitalOcean account, with the ability to + filter and sort the results. If no filters are specified, all tags will be + returned. + + + + + :param list filters: Filter the results. + The `filter` block is documented below. + :param list sorts: Sort the results. + The `sort` block is documented below. + + The **filters** object supports the following: + + * `key` (`str`) - Filter the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + * `values` (`list`) - Only retrieves tags which keys has value that matches + one of the values provided here. + + The **sorts** object supports the following: + + * `direction` (`str`) - The sort direction. This may be either `asc` or `desc`. + * `key` (`str`) - Sort the tags by this key. This may be one of `name`, `total_resource_count`, `droplets_count`, `images_count`, `volumes_count`, `volume_snapshots_count`, or `databases_count`. + """ + __args__ = dict() + + + __args__['filters'] = filters + __args__['sorts'] = sorts + if opts is None: + opts = pulumi.InvokeOptions() + if opts.version is None: + opts.version = utilities.get_version() + __ret__ = pulumi.runtime.invoke('digitalocean:index/getTags:getTags', __args__, opts=opts).value + + return AwaitableGetTagsResult( + filters=__ret__.get('filters'), + id=__ret__.get('id'), + sorts=__ret__.get('sorts'), + tags=__ret__.get('tags')) diff --git a/sdk/python/pulumi_digitalocean/tables.py b/sdk/python/pulumi_digitalocean/tables.py index 823e5c48..cb0de860 100644 --- a/sdk/python/pulumi_digitalocean/tables.py +++ b/sdk/python/pulumi_digitalocean/tables.py @@ -22,6 +22,7 @@ "created_at": "createdAt", "credential_expiration_time": "credentialExpirationTime", "custom_domain": "customDomain", + "databases_count": "databasesCount", "db_name": "dbName", "docker_credentials": "dockerCredentials", "domain_urn": "domainUrn", @@ -29,6 +30,7 @@ "droplet_ids": "dropletIds", "droplet_tag": "dropletTag", "droplet_urn": "dropletUrn", + "droplets_count": "dropletsCount", "enable_backend_keepalive": "enableBackendKeepalive", "enable_proxy_protocol": "enableProxyProtocol", "eviction_policy": "evictionPolicy", @@ -38,6 +40,7 @@ "floating_ip_urn": "floatingIpUrn", "force_destroy": "forceDestroy", "forwarding_rules": "forwardingRules", + "images_count": "imagesCount", "inbound_rules": "inboundRules", "initial_filesystem_label": "initialFilesystemLabel", "initial_filesystem_type": "initialFilesystemType", @@ -81,12 +84,15 @@ "sql_mode": "sqlMode", "ssh_keys": "sshKeys", "sticky_sessions": "stickySessions", + "total_resource_count": "totalResourceCount", "updated_at": "updatedAt", "user_data": "userData", "version_id": "versionId", "volume_id": "volumeId", "volume_ids": "volumeIds", + "volume_snapshots_count": "volumeSnapshotsCount", "volume_urn": "volumeUrn", + "volumes_count": "volumesCount", "vpc_urn": "vpcUrn", "vpc_uuid": "vpcUuid", "website_redirect": "websiteRedirect", @@ -112,6 +118,7 @@ "createdAt": "created_at", "credentialExpirationTime": "credential_expiration_time", "customDomain": "custom_domain", + "databasesCount": "databases_count", "dbName": "db_name", "dockerCredentials": "docker_credentials", "domainUrn": "domain_urn", @@ -119,6 +126,7 @@ "dropletIds": "droplet_ids", "dropletTag": "droplet_tag", "dropletUrn": "droplet_urn", + "dropletsCount": "droplets_count", "enableBackendKeepalive": "enable_backend_keepalive", "enableProxyProtocol": "enable_proxy_protocol", "evictionPolicy": "eviction_policy", @@ -128,6 +136,7 @@ "floatingIpUrn": "floating_ip_urn", "forceDestroy": "force_destroy", "forwardingRules": "forwarding_rules", + "imagesCount": "images_count", "inboundRules": "inbound_rules", "initialFilesystemLabel": "initial_filesystem_label", "initialFilesystemType": "initial_filesystem_type", @@ -171,12 +180,15 @@ "sqlMode": "sql_mode", "sshKeys": "ssh_keys", "stickySessions": "sticky_sessions", + "totalResourceCount": "total_resource_count", "updatedAt": "updated_at", "userData": "user_data", "versionId": "version_id", "volumeId": "volume_id", "volumeIds": "volume_ids", + "volumeSnapshotsCount": "volume_snapshots_count", "volumeUrn": "volume_urn", + "volumesCount": "volumes_count", "vpcUrn": "vpc_urn", "vpcUuid": "vpc_uuid", "websiteRedirect": "website_redirect", diff --git a/sdk/python/pulumi_digitalocean/tag.py b/sdk/python/pulumi_digitalocean/tag.py index 7a5e4ffb..fb3a64fe 100644 --- a/sdk/python/pulumi_digitalocean/tag.py +++ b/sdk/python/pulumi_digitalocean/tag.py @@ -10,10 +10,34 @@ from . import utilities, tables class Tag(pulumi.CustomResource): + databases_count: pulumi.Output[float] + """ + A count of the database clusters that the tag is applied to. + """ + droplets_count: pulumi.Output[float] + """ + A count of the Droplets the tag is applied to. + """ + images_count: pulumi.Output[float] + """ + A count of the images that the tag is applied to. + """ name: pulumi.Output[str] """ The name of the tag """ + total_resource_count: pulumi.Output[float] + """ + A count of the total number of resources that the tag is applied to. + """ + volume_snapshots_count: pulumi.Output[float] + """ + A count of the volume snapshots that the tag is applied to. + """ + volumes_count: pulumi.Output[float] + """ + A count of the volumes that the tag is applied to. + """ def __init__(__self__, resource_name, opts=None, name=None, __props__=None, __name__=None, __opts__=None): """ Provides a DigitalOcean Tag resource. A Tag is a label that can be applied to a @@ -62,6 +86,12 @@ def __init__(__self__, resource_name, opts=None, name=None, __props__=None, __na __props__ = dict() __props__['name'] = name + __props__['databases_count'] = None + __props__['droplets_count'] = None + __props__['images_count'] = None + __props__['total_resource_count'] = None + __props__['volume_snapshots_count'] = None + __props__['volumes_count'] = None super(Tag, __self__).__init__( 'digitalocean:index/tag:Tag', resource_name, @@ -69,7 +99,7 @@ def __init__(__self__, resource_name, opts=None, name=None, __props__=None, __na opts) @staticmethod - def get(resource_name, id, opts=None, name=None): + def 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): """ Get an existing Tag resource's state with the given name, id, and optional extra properties used to qualify the lookup. @@ -77,13 +107,25 @@ def get(resource_name, id, opts=None, name=None): :param str resource_name: The unique name of the resulting resource. :param str id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[float] databases_count: A count of the database clusters that the tag is applied to. + :param pulumi.Input[float] droplets_count: A count of the Droplets the tag is applied to. + :param pulumi.Input[float] images_count: A count of the images that the tag is applied to. :param pulumi.Input[str] name: The name of the tag + :param pulumi.Input[float] total_resource_count: A count of the total number of resources that the tag is applied to. + :param pulumi.Input[float] volume_snapshots_count: A count of the volume snapshots that the tag is applied to. + :param pulumi.Input[float] volumes_count: A count of the volumes that the tag is applied to. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = dict() + __props__["databases_count"] = databases_count + __props__["droplets_count"] = droplets_count + __props__["images_count"] = images_count __props__["name"] = name + __props__["total_resource_count"] = total_resource_count + __props__["volume_snapshots_count"] = volume_snapshots_count + __props__["volumes_count"] = volumes_count return Tag(resource_name, opts=opts, __props__=__props__) def translate_output_property(self, prop): return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop From 070091e22a8844b0d514e13f1a33fd252518b46a Mon Sep 17 00:00:00 2001 From: stack72 Date: Tue, 16 Jun 2020 16:29:59 +0300 Subject: [PATCH 3/3] CHANGELOG for upgrade to v1.20.0 of the DigitalOcean Terraform Provider --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d0b4d8..6b703836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* Upgrade to v1.20.0 of the DigitalOcean Terraform Provider ---