From 0fcf953772b9f3e12f597bfdf7151f0b0c3ad93c Mon Sep 17 00:00:00 2001 From: Nicolas Joseph Date: Wed, 4 Sep 2024 14:17:29 -0700 Subject: [PATCH] chore: update upstream to version 1.0 --- Makefile | 2 +- .../py/requirements.txt | 2 +- .../create-clickhouse-service/ts/package.json | 2 +- go.work.sum | 16 +- .../pulumi-resource-clickhouse/schema.json | 90 +++++-- provider/go.mod | 3 +- provider/go.sum | 6 +- provider/resources.go | 38 ++- sdk/dotnet/PrivateEndpoint/Registration.cs | 56 ++++ sdk/dotnet/Service.cs | 32 +-- .../ServicePrivateEndpoints/Attachment.cs | 139 ++++++++++ sdk/dotnet/ServicePrivateEndpoints/README.md | 1 + .../privateendpoint/registration.go | 62 +++++ sdk/go/clickhouse/service.go | 17 +- .../serviceprivateendpoints/attachment.go | 242 ++++++++++++++++++ .../serviceprivateendpoints/init.go | 44 ++++ sdk/nodejs/index.ts | 2 + sdk/nodejs/package.json | 2 +- sdk/nodejs/privateendpoint/registration.ts | 48 ++++ sdk/nodejs/service.ts | 16 +- .../serviceprivateendpoints/attachment.ts | 110 ++++++++ sdk/nodejs/serviceprivateendpoints/index.ts | 25 ++ sdk/nodejs/tsconfig.json | 2 + sdk/python/pulumiverse_clickhouse/__init__.py | 11 + .../privateendpoint/registration.py | 108 +++++++- sdk/python/pulumiverse_clickhouse/service.py | 53 +--- .../serviceprivateendpoints/__init__.py | 8 + .../serviceprivateendpoints/attachment.py | 216 ++++++++++++++++ upstream | 2 +- 29 files changed, 1200 insertions(+), 155 deletions(-) create mode 100644 sdk/dotnet/ServicePrivateEndpoints/Attachment.cs create mode 100644 sdk/dotnet/ServicePrivateEndpoints/README.md create mode 100644 sdk/go/clickhouse/serviceprivateendpoints/attachment.go create mode 100644 sdk/go/clickhouse/serviceprivateendpoints/init.go create mode 100644 sdk/nodejs/serviceprivateendpoints/attachment.ts create mode 100644 sdk/nodejs/serviceprivateendpoints/index.ts create mode 100644 sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/__init__.py create mode 100644 sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/attachment.py diff --git a/Makefile b/Makefile index 1456518..c413689 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROJECT := github.com/pulumiverse/pulumi-clickhouse NODE_MODULE_NAME := @pulumiverse/clickhouse TF_NAME := clickhouse PROVIDER_PATH := provider -PROVIDER_VERSION := 0.3.0 +PROVIDER_VERSION := 1.0.0 VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version JAVA_GEN := pulumi-java-gen diff --git a/examples/create-clickhouse-service/py/requirements.txt b/examples/create-clickhouse-service/py/requirements.txt index e719a0c..03621ba 100644 --- a/examples/create-clickhouse-service/py/requirements.txt +++ b/examples/create-clickhouse-service/py/requirements.txt @@ -1,2 +1,2 @@ pulumi>=3.0.0,<4.0.0 -pulumiverse_clickhouse>=0.0.4, \ No newline at end of file +pulumiverse_clickhouse>=1.0.0, \ No newline at end of file diff --git a/examples/create-clickhouse-service/ts/package.json b/examples/create-clickhouse-service/ts/package.json index 0fa9579..52d8604 100644 --- a/examples/create-clickhouse-service/ts/package.json +++ b/examples/create-clickhouse-service/ts/package.json @@ -7,6 +7,6 @@ }, "dependencies": { "@pulumi/pulumi": "^3.113.0", - "@pulumiverse/clickhouse": "^0.0.4" + "@pulumiverse/clickhouse": "^1.0.0" } } diff --git a/go.work.sum b/go.work.sum index d7c83f0..0729138 100644 --- a/go.work.sum +++ b/go.work.sum @@ -131,6 +131,8 @@ github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcP github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/ClickHouse/terraform-provider-clickhouse v1.0.0 h1:0m1bDDnUWkhCelLpOV2/zGoI7gvG032Rc5tknZin7MU= +github.com/ClickHouse/terraform-provider-clickhouse v1.0.0/go.mod h1:QB1qgNLuongoSNcAM4OeQnukpm0tpFr/1UX+7VM69NY= github.com/GoogleCloudPlatform/cloudsql-proxy v1.34.0/go.mod h1:XNDFTVaBS0jJYam3A88dpdzImNh0RRhBF4k05CNEENs= github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= @@ -140,7 +142,6 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= github.com/alecthomas/chroma/v2 v2.13.0/go.mod h1:BUGjjsD+ndS6eX37YgTchSEG+Jg9Jv1GiZs9sqPqztk= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= @@ -154,6 +155,8 @@ github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd3 github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc= @@ -243,14 +246,6 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/prometheus v0.50.1/go.mod h1:FvE8dtQ1Ww63IlyKBn1V4s+zMwF9kHkVNkQBR1pM4CU= -github.com/pulumi/pulumi-terraform-bridge/pf v0.42.0 h1:+nuhPROS9Dl8EatzGqtYxmXipAGBTDD7ICowpGMFxf8= -github.com/pulumi/pulumi-terraform-bridge/pf v0.42.0/go.mod h1:aK6RyeNLjmEHeMuwAbDgUXlAD8BTv+rK3HCs02JopSw= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.89.0 h1:Om0Yw07/5dVABB2ou8+XBCmbp9TUUtDZJEh2B5jPGgI= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.89.0/go.mod h1:EWGqRo+ogMPty23b6rVUajgJXUDSNXU+WqcZTPlzyEI= -github.com/pulumi/pulumi/pkg/v3 v3.128.0 h1:K3qtJYjHg4DkA7LxknY/MoQZ+QHdHQDh/k2njjmjHXM= -github.com/pulumi/pulumi/pkg/v3 v3.128.0/go.mod h1:/spoJXy/mqQ8fBLgXBEbUrAnL7pHdfXOviIo5fZROEY= -github.com/pulumi/pulumi/sdk/v3 v3.128.0 h1:5VPFfygxt6rva0bEYVQZXxsGAo2/D1wsb9erGOtXxzk= -github.com/pulumi/pulumi/sdk/v3 v3.128.0/go.mod h1:p1U24en3zt51agx+WlNboSOV8eLlPWYAkxMzVEXKbnY= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= @@ -271,14 +266,11 @@ github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hM github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/yuin/goldmark v1.5.2/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= -github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg= -github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= diff --git a/provider/cmd/pulumi-resource-clickhouse/schema.json b/provider/cmd/pulumi-resource-clickhouse/schema.json index dc357f6..e31a92b 100644 --- a/provider/cmd/pulumi-resource-clickhouse/schema.json +++ b/provider/cmd/pulumi-resource-clickhouse/schema.json @@ -38,7 +38,7 @@ }, "nodejs": { "packageName": "@pulumiverse/clickhouse", - "packageDescription": "A Pulumi package for creating and managing Clickhouse Cloud resources. Based on terraform-provider-clickhouse: version v0.3.0", + "packageDescription": "A Pulumi package for creating and managing Clickhouse Cloud resources. Based on terraform-provider-clickhouse: version v1.0.0", "readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/ClickHouse/terraform-provider-clickhouse)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-clickhouse` repo](https://github.com/pulumiverse/pulumi-clickhouse/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-clickhouse` repo](https://github.com/ClickHouse/terraform-provider-clickhouse/issues).", "dependencies": { "@pulumi/pulumi": "^3.0.0" @@ -189,6 +189,7 @@ }, "resources": { "clickhouse:PrivateEndpoint/registration:Registration": { + "description": "ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*.\n\nYou can use the *private_endpoint_registration* resource to set up the private link feature.\n\nCheck the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as clickhouse from \"@pulumiverse/clickhouse\";\n\nconst endpoint = new clickhouse.privateendpoint.Registration(\"endpoint\", {\n cloudProvider: \"aws\",\n description: \"Private Link from VPC foo\",\n privateEndpointId: \"vpce-...\",\n region: \"us-west-2\",\n});\n```\n```python\nimport pulumi\nimport pulumiverse_clickhouse as clickhouse\n\nendpoint = clickhouse.private_endpoint.Registration(\"endpoint\",\n cloud_provider=\"aws\",\n description=\"Private Link from VPC foo\",\n private_endpoint_id=\"vpce-...\",\n region=\"us-west-2\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Clickhouse = Pulumiverse.Clickhouse;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var endpoint = new Clickhouse.PrivateEndpoint.Registration(\"endpoint\", new()\n {\n CloudProvider = \"aws\",\n Description = \"Private Link from VPC foo\",\n PrivateEndpointId = \"vpce-...\",\n Region = \"us-west-2\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/PrivateEndpoint\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := PrivateEndpoint.NewRegistration(ctx, \"endpoint\", \u0026PrivateEndpoint.RegistrationArgs{\n\t\t\tCloudProvider: pulumi.String(\"aws\"),\n\t\t\tDescription: pulumi.String(\"Private Link from VPC foo\"),\n\t\t\tPrivateEndpointId: pulumi.String(\"vpce-...\"),\n\t\t\tRegion: pulumi.String(\"us-west-2\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.clickhouse.PrivateEndpoint.Registration;\nimport com.pulumi.clickhouse.PrivateEndpoint.RegistrationArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var endpoint = new Registration(\"endpoint\", RegistrationArgs.builder()\n .cloudProvider(\"aws\")\n .description(\"Private Link from VPC foo\")\n .privateEndpointId(\"vpce-...\")\n .region(\"us-west-2\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n endpoint:\n type: clickhouse:PrivateEndpoint:Registration\n properties:\n cloudProvider: aws\n description: Private Link from VPC foo\n privateEndpointId: vpce-...\n region: us-west-2\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nEndpoint Attachments can be imported by specifying the Cloud provider private endpoint ID\n\nFor example for AWS you could run:\n\n```sh\n$ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx\n```\n\n", "properties": { "cloudProvider": { "type": "string", @@ -198,6 +199,10 @@ "type": "string", "description": "Description of the private endpoint\n" }, + "privateEndpointId": { + "type": "string", + "description": "ID of the private endpoint (replaces deprecated attribute `id`)\n" + }, "region": { "type": "string", "description": "Region of the private endpoint\n" @@ -205,6 +210,7 @@ }, "required": [ "cloudProvider", + "privateEndpointId", "region" ], "inputProperties": { @@ -216,6 +222,10 @@ "type": "string", "description": "Description of the private endpoint\n" }, + "privateEndpointId": { + "type": "string", + "description": "ID of the private endpoint (replaces deprecated attribute `id`)\n" + }, "region": { "type": "string", "description": "Region of the private endpoint\n" @@ -223,6 +233,7 @@ }, "requiredInputs": [ "cloudProvider", + "privateEndpointId", "region" ], "stateInputs": { @@ -236,6 +247,10 @@ "type": "string", "description": "Description of the private endpoint\n" }, + "privateEndpointId": { + "type": "string", + "description": "ID of the private endpoint (replaces deprecated attribute `id`)\n" + }, "region": { "type": "string", "description": "Region of the private endpoint\n" @@ -244,8 +259,57 @@ "type": "object" } }, + "clickhouse:ServicePrivateEndpoints/attachment:Attachment": { + "description": "Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*.\n\nSee private_endpoint_registration for how to create a *private endpoint*.\n\nSee full example on GitHub.\n\n## Import\n\nEndpoint Attachments can be imported by specifying the clickhouse service UUID\n\n```sh\n$ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n```\n\n", + "properties": { + "privateEndpointIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of private endpoint IDs\n" + }, + "serviceId": { + "type": "string", + "description": "ClickHouse Servie ID\n" + } + }, + "required": [ + "privateEndpointIds" + ], + "inputProperties": { + "privateEndpointIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of private endpoint IDs\n" + }, + "serviceId": { + "type": "string", + "description": "ClickHouse Servie ID\n" + } + }, + "stateInputs": { + "description": "Input properties used for looking up and filtering Attachment resources.\n", + "properties": { + "privateEndpointIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of private endpoint IDs\n" + }, + "serviceId": { + "type": "string", + "description": "ClickHouse Servie ID\n" + } + }, + "type": "object" + } + }, "clickhouse:index/service:Service": { - "description": "## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as clickhouse from \"@pulumiverse/clickhouse\";\n\nconst service = new clickhouse.Service(\"service\", {\n cloudProvider: \"aws\",\n idleScaling: true,\n idleTimeoutMinutes: 5,\n ipAccesses: [{\n description: \"Test IP\",\n source: \"192.168.2.63\",\n }],\n maxTotalMemoryGb: 360,\n minTotalMemoryGb: 24,\n passwordHash: \"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n region: \"us-east-1\",\n tier: \"production\",\n});\n```\n```python\nimport pulumi\nimport pulumiverse_clickhouse as clickhouse\n\nservice = clickhouse.Service(\"service\",\n cloud_provider=\"aws\",\n idle_scaling=True,\n idle_timeout_minutes=5,\n ip_accesses=[{\n \"description\": \"Test IP\",\n \"source\": \"192.168.2.63\",\n }],\n max_total_memory_gb=360,\n min_total_memory_gb=24,\n password_hash=\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n region=\"us-east-1\",\n tier=\"production\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Clickhouse = Pulumiverse.Clickhouse;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var service = new Clickhouse.Service(\"service\", new()\n {\n CloudProvider = \"aws\",\n IdleScaling = true,\n IdleTimeoutMinutes = 5,\n IpAccesses = new[]\n {\n new Clickhouse.Inputs.ServiceIpAccessArgs\n {\n Description = \"Test IP\",\n Source = \"192.168.2.63\",\n },\n },\n MaxTotalMemoryGb = 360,\n MinTotalMemoryGb = 24,\n PasswordHash = \"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n Region = \"us-east-1\",\n Tier = \"production\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := clickhouse.NewService(ctx, \"service\", \u0026clickhouse.ServiceArgs{\n\t\t\tCloudProvider: pulumi.String(\"aws\"),\n\t\t\tIdleScaling: pulumi.Bool(true),\n\t\t\tIdleTimeoutMinutes: pulumi.Int(5),\n\t\t\tIpAccesses: clickhouse.ServiceIpAccessArray{\n\t\t\t\t\u0026clickhouse.ServiceIpAccessArgs{\n\t\t\t\t\tDescription: pulumi.String(\"Test IP\"),\n\t\t\t\t\tSource: pulumi.String(\"192.168.2.63\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tMaxTotalMemoryGb: pulumi.Int(360),\n\t\t\tMinTotalMemoryGb: pulumi.Int(24),\n\t\t\tPasswordHash: pulumi.String(\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\"),\n\t\t\tRegion: pulumi.String(\"us-east-1\"),\n\t\t\tTier: pulumi.String(\"production\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.clickhouse.Service;\nimport com.pulumi.clickhouse.ServiceArgs;\nimport com.pulumi.clickhouse.inputs.ServiceIpAccessArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var service = new Service(\"service\", ServiceArgs.builder()\n .cloudProvider(\"aws\")\n .idleScaling(true)\n .idleTimeoutMinutes(5)\n .ipAccesses(ServiceIpAccessArgs.builder()\n .description(\"Test IP\")\n .source(\"192.168.2.63\")\n .build())\n .maxTotalMemoryGb(360)\n .minTotalMemoryGb(24)\n .passwordHash(\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\")\n .region(\"us-east-1\")\n .tier(\"production\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n service:\n type: clickhouse:Service\n properties:\n cloudProvider: aws\n idleScaling: true\n idleTimeoutMinutes: 5\n ipAccesses:\n - description: Test IP\n source: 192.168.2.63\n maxTotalMemoryGb: 360\n minTotalMemoryGb: 24\n passwordHash: n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\n # base64 encoded sha256 hash of \"test\"\n region: us-east-1\n tier: production\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nServices can be imported by specifying the UUID.\n\n```sh\n$ pulumi import clickhouse:index/service:Service example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n```\n\n", + "description": "You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers.\n\n## Example Usage\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as clickhouse from \"@pulumiverse/clickhouse\";\n\nconst service = new clickhouse.Service(\"service\", {\n cloudProvider: \"aws\",\n idleScaling: true,\n idleTimeoutMinutes: 5,\n ipAccesses: [{\n description: \"Test IP\",\n source: \"192.168.2.63\",\n }],\n maxTotalMemoryGb: 360,\n minTotalMemoryGb: 24,\n passwordHash: \"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n region: \"us-east-1\",\n tier: \"production\",\n});\n```\n```python\nimport pulumi\nimport pulumiverse_clickhouse as clickhouse\n\nservice = clickhouse.Service(\"service\",\n cloud_provider=\"aws\",\n idle_scaling=True,\n idle_timeout_minutes=5,\n ip_accesses=[{\n \"description\": \"Test IP\",\n \"source\": \"192.168.2.63\",\n }],\n max_total_memory_gb=360,\n min_total_memory_gb=24,\n password_hash=\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n region=\"us-east-1\",\n tier=\"production\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Clickhouse = Pulumiverse.Clickhouse;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var service = new Clickhouse.Service(\"service\", new()\n {\n CloudProvider = \"aws\",\n IdleScaling = true,\n IdleTimeoutMinutes = 5,\n IpAccesses = new[]\n {\n new Clickhouse.Inputs.ServiceIpAccessArgs\n {\n Description = \"Test IP\",\n Source = \"192.168.2.63\",\n },\n },\n MaxTotalMemoryGb = 360,\n MinTotalMemoryGb = 24,\n PasswordHash = \"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\",\n Region = \"us-east-1\",\n Tier = \"production\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := clickhouse.NewService(ctx, \"service\", \u0026clickhouse.ServiceArgs{\n\t\t\tCloudProvider: pulumi.String(\"aws\"),\n\t\t\tIdleScaling: pulumi.Bool(true),\n\t\t\tIdleTimeoutMinutes: pulumi.Int(5),\n\t\t\tIpAccesses: clickhouse.ServiceIpAccessArray{\n\t\t\t\t\u0026clickhouse.ServiceIpAccessArgs{\n\t\t\t\t\tDescription: pulumi.String(\"Test IP\"),\n\t\t\t\t\tSource: pulumi.String(\"192.168.2.63\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tMaxTotalMemoryGb: pulumi.Int(360),\n\t\t\tMinTotalMemoryGb: pulumi.Int(24),\n\t\t\tPasswordHash: pulumi.String(\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\"),\n\t\t\tRegion: pulumi.String(\"us-east-1\"),\n\t\t\tTier: pulumi.String(\"production\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.clickhouse.Service;\nimport com.pulumi.clickhouse.ServiceArgs;\nimport com.pulumi.clickhouse.inputs.ServiceIpAccessArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var service = new Service(\"service\", ServiceArgs.builder()\n .cloudProvider(\"aws\")\n .idleScaling(true)\n .idleTimeoutMinutes(5)\n .ipAccesses(ServiceIpAccessArgs.builder()\n .description(\"Test IP\")\n .source(\"192.168.2.63\")\n .build())\n .maxTotalMemoryGb(360)\n .minTotalMemoryGb(24)\n .passwordHash(\"n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\")\n .region(\"us-east-1\")\n .tier(\"production\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n service:\n type: clickhouse:Service\n properties:\n cloudProvider: aws\n idleScaling: true\n idleTimeoutMinutes: 5\n ipAccesses:\n - description: Test IP\n source: 192.168.2.63\n maxTotalMemoryGb: 360\n minTotalMemoryGb: 24\n passwordHash: n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=\n # base64 encoded sha256 hash of \"test\"\n region: us-east-1\n tier: production\n```\n\u003c!--End PulumiCodeChooser --\u003e\n\n## Import\n\nServices can be imported by specifying the UUID.\n\n```sh\n$ pulumi import clickhouse:index/service:Service example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n```\n\n", "properties": { "cloudProvider": { "type": "string", @@ -321,13 +385,6 @@ "description": "Service config for private endpoints\n", "deprecationMessage": "Please use the `clickhouse.PrivateEndpoint.getConfig` data source instead." }, - "privateEndpointIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of private endpoint IDs\n" - }, "region": { "type": "string", "description": "Region within the cloud provider in which the service is deployed in.\n" @@ -344,7 +401,6 @@ "ipAccesses", "name", "privateEndpointConfig", - "privateEndpointIds", "region", "tier" ], @@ -407,13 +463,6 @@ "description": "SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified.\n", "secret": true }, - "privateEndpointIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of private endpoint IDs\n" - }, "region": { "type": "string", "description": "Region within the cloud provider in which the service is deployed in.\n" @@ -506,13 +555,6 @@ "description": "Service config for private endpoints\n", "deprecationMessage": "Please use the `clickhouse.PrivateEndpoint.getConfig` data source instead." }, - "privateEndpointIds": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of private endpoint IDs\n" - }, "region": { "type": "string", "description": "Region within the cloud provider in which the service is deployed in.\n" diff --git a/provider/go.mod b/provider/go.mod index d39b5da..c3e8823 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -3,7 +3,7 @@ module github.com/pulumiverse/pulumi-clickhouse/provider go 1.22.5 require ( - github.com/ClickHouse/terraform-provider-clickhouse v0.3.0 + github.com/ClickHouse/terraform-provider-clickhouse v1.0.0 github.com/ettle/strcase v0.1.1 github.com/pulumi/pulumi-terraform-bridge/pf v0.42.0 github.com/pulumi/pulumi-terraform-bridge/v3 v3.89.0 @@ -59,6 +59,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/blang/semver v3.5.1+incompatible // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/charmbracelet/bubbles v0.16.1 // indirect github.com/charmbracelet/bubbletea v0.25.0 // indirect github.com/charmbracelet/lipgloss v0.7.1 // indirect diff --git a/provider/go.sum b/provider/go.sum index 135aa19..c61d488 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -212,8 +212,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ClickHouse/terraform-provider-clickhouse v0.3.0 h1:N5JxxAu9IVUpMZdGl2zrv5zfZu8/6z2AIhELpkUsd8Q= -github.com/ClickHouse/terraform-provider-clickhouse v0.3.0/go.mod h1:4PxVfIni0Hzgm/FWooDxXkf/qWvFuwuAPbxl/Pgf+Q0= +github.com/ClickHouse/terraform-provider-clickhouse v1.0.0 h1:0m1bDDnUWkhCelLpOV2/zGoI7gvG032Rc5tknZin7MU= +github.com/ClickHouse/terraform-provider-clickhouse v1.0.0/go.mod h1:QB1qgNLuongoSNcAM4OeQnukpm0tpFr/1UX+7VM69NY= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= @@ -310,6 +310,8 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= diff --git a/provider/resources.go b/provider/resources.go index 916229a..924c484 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -15,6 +15,7 @@ package provider import ( + "context" _ "embed" "fmt" "path/filepath" @@ -149,7 +150,7 @@ func Provider() tfbridge.ProviderInfo { Version: version.Version, GitHubOrg: "ClickHouse", MetadataInfo: tfbridge.NewProviderMetadata(bridgeMetadata), - TFProviderVersion: "0.3.0", + TFProviderVersion: "1.0.0", UpstreamRepoPath: "./upstream", Config: map[string]*tfbridge.SchemaInfo{ // Add any required configuration here, or remove the example below if @@ -162,12 +163,45 @@ func Provider() tfbridge.ProviderInfo { // }, }, PreConfigureCallback: preConfigureCallback, - Resources: map[string]*tfbridge.ResourceInfo{ + Resources: map[string]*tfbridge.ResourceInfo{ // Map each resource in the Terraform provider to a Pulumi type. // // "aws_iam_role": { // Tok: makeResource(mainMod, "aws_iam_role"), // }, + "clickhouse_service_private_endpoints_attachment": { + Tok: makeResource("clickhouse_service_private_endpoints_attachment"), + ComputeID: func(ctx context.Context, state resource.PropertyMap) (resource.ID, error) { + serviceId := state["service_id"] + privateEndpointIds := state["private_endpoint_ids"] + + if serviceId.IsNull() { + return "", fmt.Errorf("service_id is required") + } + + if privateEndpointIds.IsNull() || !privateEndpointIds.IsArray() { + return "", fmt.Errorf("private_endpoint_ids must be a non-empty array") + } + + idParts := []string{serviceId.StringValue()} + for _, id := range privateEndpointIds.ArrayValue() { + idParts = append(idParts, id.StringValue()) + } + + return resource.ID(strings.Join(idParts, ":")), nil + }, + }, + "clickhouse_private_endpoint_registration": { + Tok: makeResource("clickhouse_private_endpoint_registration"), + ComputeID: func(ctx context.Context, state resource.PropertyMap) (resource.ID, error) { + privateEndpointId := state["private_endpoint_id"] + cloudProvider := state["cloud_provider"] + if privateEndpointId.IsNull() || cloudProvider.IsNull() { + return "", fmt.Errorf("cloud_provider and region are required") + } + return resource.ID(fmt.Sprintf("%s-%s", cloudProvider.StringValue(), privateEndpointId.StringValue())), nil + }, + }, }, DataSources: map[string]*tfbridge.DataSourceInfo{ // Map each data source in the Terraform provider to a Pulumi function. diff --git a/sdk/dotnet/PrivateEndpoint/Registration.cs b/sdk/dotnet/PrivateEndpoint/Registration.cs index cbe81f3..c0c6ea9 100644 --- a/sdk/dotnet/PrivateEndpoint/Registration.cs +++ b/sdk/dotnet/PrivateEndpoint/Registration.cs @@ -10,6 +10,44 @@ namespace Pulumiverse.Clickhouse.PrivateEndpoint { + /// + /// ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*. + /// + /// You can use the *private_endpoint_registration* resource to set up the private link feature. + /// + /// Check the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Clickhouse = Pulumiverse.Clickhouse; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var endpoint = new Clickhouse.PrivateEndpoint.Registration("endpoint", new() + /// { + /// CloudProvider = "aws", + /// Description = "Private Link from VPC foo", + /// PrivateEndpointId = "vpce-...", + /// Region = "us-west-2", + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// Endpoint Attachments can be imported by specifying the Cloud provider private endpoint ID + /// + /// For example for AWS you could run: + /// + /// ```sh + /// $ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx + /// ``` + /// [ClickhouseResourceType("clickhouse:PrivateEndpoint/registration:Registration")] public partial class Registration : global::Pulumi.CustomResource { @@ -25,6 +63,12 @@ public partial class Registration : global::Pulumi.CustomResource [Output("description")] public Output Description { get; private set; } = null!; + /// + /// ID of the private endpoint (replaces deprecated attribute `id`) + /// + [Output("privateEndpointId")] + public Output PrivateEndpointId { get; private set; } = null!; + /// /// Region of the private endpoint /// @@ -90,6 +134,12 @@ public sealed class RegistrationArgs : global::Pulumi.ResourceArgs [Input("description")] public Input? Description { get; set; } + /// + /// ID of the private endpoint (replaces deprecated attribute `id`) + /// + [Input("privateEndpointId", required: true)] + public Input PrivateEndpointId { get; set; } = null!; + /// /// Region of the private endpoint /// @@ -116,6 +166,12 @@ public sealed class RegistrationState : global::Pulumi.ResourceArgs [Input("description")] public Input? Description { get; set; } + /// + /// ID of the private endpoint (replaces deprecated attribute `id`) + /// + [Input("privateEndpointId")] + public Input? PrivateEndpointId { get; set; } + /// /// Region of the private endpoint /// diff --git a/sdk/dotnet/Service.cs b/sdk/dotnet/Service.cs index 06e1fc4..21b0f1d 100644 --- a/sdk/dotnet/Service.cs +++ b/sdk/dotnet/Service.cs @@ -11,6 +11,8 @@ namespace Pulumiverse.Clickhouse { /// + /// You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers. + /// /// ## Example Usage /// /// ```csharp @@ -151,12 +153,6 @@ public partial class Service : global::Pulumi.CustomResource [Output("privateEndpointConfig")] public Output PrivateEndpointConfig { get; private set; } = null!; - /// - /// List of private endpoint IDs - /// - [Output("privateEndpointIds")] - public Output> PrivateEndpointIds { get; private set; } = null!; - /// /// Region within the cloud provider in which the service is deployed in. /// @@ -336,18 +332,6 @@ public Input? PasswordHash } } - [Input("privateEndpointIds")] - private InputList? _privateEndpointIds; - - /// - /// List of private endpoint IDs - /// - public InputList PrivateEndpointIds - { - get => _privateEndpointIds ?? (_privateEndpointIds = new InputList()); - set => _privateEndpointIds = value; - } - /// /// Region within the cloud provider in which the service is deployed in. /// @@ -506,18 +490,6 @@ public Input? PasswordHash [Input("privateEndpointConfig")] public Input? PrivateEndpointConfig { get; set; } - [Input("privateEndpointIds")] - private InputList? _privateEndpointIds; - - /// - /// List of private endpoint IDs - /// - public InputList PrivateEndpointIds - { - get => _privateEndpointIds ?? (_privateEndpointIds = new InputList()); - set => _privateEndpointIds = value; - } - /// /// Region within the cloud provider in which the service is deployed in. /// diff --git a/sdk/dotnet/ServicePrivateEndpoints/Attachment.cs b/sdk/dotnet/ServicePrivateEndpoints/Attachment.cs new file mode 100644 index 0000000..88cc792 --- /dev/null +++ b/sdk/dotnet/ServicePrivateEndpoints/Attachment.cs @@ -0,0 +1,139 @@ +// *** 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; +using Pulumi; + +namespace Pulumiverse.Clickhouse.ServicePrivateEndpoints +{ + /// + /// Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*. + /// + /// See private_endpoint_registration for how to create a *private endpoint*. + /// + /// See full example on GitHub. + /// + /// ## Import + /// + /// Endpoint Attachments can be imported by specifying the clickhouse service UUID + /// + /// ```sh + /// $ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + /// ``` + /// + [ClickhouseResourceType("clickhouse:ServicePrivateEndpoints/attachment:Attachment")] + public partial class Attachment : global::Pulumi.CustomResource + { + /// + /// List of private endpoint IDs + /// + [Output("privateEndpointIds")] + public Output> PrivateEndpointIds { get; private set; } = null!; + + /// + /// ClickHouse Servie ID + /// + [Output("serviceId")] + public Output ServiceId { get; private set; } = null!; + + + /// + /// Create a Attachment resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Attachment(string name, AttachmentArgs? args = null, CustomResourceOptions? options = null) + : base("clickhouse:ServicePrivateEndpoints/attachment:Attachment", name, args ?? new AttachmentArgs(), MakeResourceOptions(options, "")) + { + } + + private Attachment(string name, Input id, AttachmentState? state = null, CustomResourceOptions? options = null) + : base("clickhouse:ServicePrivateEndpoints/attachment:Attachment", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/pulumiverse/pulumi-clickhouse", + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Attachment resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static Attachment Get(string name, Input id, AttachmentState? state = null, CustomResourceOptions? options = null) + { + return new Attachment(name, id, state, options); + } + } + + public sealed class AttachmentArgs : global::Pulumi.ResourceArgs + { + [Input("privateEndpointIds")] + private InputList? _privateEndpointIds; + + /// + /// List of private endpoint IDs + /// + public InputList PrivateEndpointIds + { + get => _privateEndpointIds ?? (_privateEndpointIds = new InputList()); + set => _privateEndpointIds = value; + } + + /// + /// ClickHouse Servie ID + /// + [Input("serviceId")] + public Input? ServiceId { get; set; } + + public AttachmentArgs() + { + } + public static new AttachmentArgs Empty => new AttachmentArgs(); + } + + public sealed class AttachmentState : global::Pulumi.ResourceArgs + { + [Input("privateEndpointIds")] + private InputList? _privateEndpointIds; + + /// + /// List of private endpoint IDs + /// + public InputList PrivateEndpointIds + { + get => _privateEndpointIds ?? (_privateEndpointIds = new InputList()); + set => _privateEndpointIds = value; + } + + /// + /// ClickHouse Servie ID + /// + [Input("serviceId")] + public Input? ServiceId { get; set; } + + public AttachmentState() + { + } + public static new AttachmentState Empty => new AttachmentState(); + } +} diff --git a/sdk/dotnet/ServicePrivateEndpoints/README.md b/sdk/dotnet/ServicePrivateEndpoints/README.md new file mode 100644 index 0000000..03ab6e6 --- /dev/null +++ b/sdk/dotnet/ServicePrivateEndpoints/README.md @@ -0,0 +1 @@ +A Pulumi package for creating and managing Clickhouse Cloud resources diff --git a/sdk/go/clickhouse/privateendpoint/registration.go b/sdk/go/clickhouse/privateendpoint/registration.go index 0693aa9..e97387c 100644 --- a/sdk/go/clickhouse/privateendpoint/registration.go +++ b/sdk/go/clickhouse/privateendpoint/registration.go @@ -12,6 +12,50 @@ import ( "github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/internal" ) +// ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*. +// +// You can use the *private_endpoint_registration* resource to set up the private link feature. +// +// Check the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/PrivateEndpoint" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := PrivateEndpoint.NewRegistration(ctx, "endpoint", &PrivateEndpoint.RegistrationArgs{ +// CloudProvider: pulumi.String("aws"), +// Description: pulumi.String("Private Link from VPC foo"), +// PrivateEndpointId: pulumi.String("vpce-..."), +// Region: pulumi.String("us-west-2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// # Endpoint Attachments can be imported by specifying the Cloud provider private endpoint ID +// +// For example for AWS you could run: +// +// ```sh +// $ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx +// ``` type Registration struct { pulumi.CustomResourceState @@ -19,6 +63,8 @@ type Registration struct { CloudProvider pulumi.StringOutput `pulumi:"cloudProvider"` // Description of the private endpoint Description pulumi.StringPtrOutput `pulumi:"description"` + // ID of the private endpoint (replaces deprecated attribute `id`) + PrivateEndpointId pulumi.StringOutput `pulumi:"privateEndpointId"` // Region of the private endpoint Region pulumi.StringOutput `pulumi:"region"` } @@ -33,6 +79,9 @@ func NewRegistration(ctx *pulumi.Context, if args.CloudProvider == nil { return nil, errors.New("invalid value for required argument 'CloudProvider'") } + if args.PrivateEndpointId == nil { + return nil, errors.New("invalid value for required argument 'PrivateEndpointId'") + } if args.Region == nil { return nil, errors.New("invalid value for required argument 'Region'") } @@ -63,6 +112,8 @@ type registrationState struct { CloudProvider *string `pulumi:"cloudProvider"` // Description of the private endpoint Description *string `pulumi:"description"` + // ID of the private endpoint (replaces deprecated attribute `id`) + PrivateEndpointId *string `pulumi:"privateEndpointId"` // Region of the private endpoint Region *string `pulumi:"region"` } @@ -72,6 +123,8 @@ type RegistrationState struct { CloudProvider pulumi.StringPtrInput // Description of the private endpoint Description pulumi.StringPtrInput + // ID of the private endpoint (replaces deprecated attribute `id`) + PrivateEndpointId pulumi.StringPtrInput // Region of the private endpoint Region pulumi.StringPtrInput } @@ -85,6 +138,8 @@ type registrationArgs struct { CloudProvider string `pulumi:"cloudProvider"` // Description of the private endpoint Description *string `pulumi:"description"` + // ID of the private endpoint (replaces deprecated attribute `id`) + PrivateEndpointId string `pulumi:"privateEndpointId"` // Region of the private endpoint Region string `pulumi:"region"` } @@ -95,6 +150,8 @@ type RegistrationArgs struct { CloudProvider pulumi.StringInput // Description of the private endpoint Description pulumi.StringPtrInput + // ID of the private endpoint (replaces deprecated attribute `id`) + PrivateEndpointId pulumi.StringInput // Region of the private endpoint Region pulumi.StringInput } @@ -196,6 +253,11 @@ func (o RegistrationOutput) Description() pulumi.StringPtrOutput { return o.ApplyT(func(v *Registration) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) } +// ID of the private endpoint (replaces deprecated attribute `id`) +func (o RegistrationOutput) PrivateEndpointId() pulumi.StringOutput { + return o.ApplyT(func(v *Registration) pulumi.StringOutput { return v.PrivateEndpointId }).(pulumi.StringOutput) +} + // Region of the private endpoint func (o RegistrationOutput) Region() pulumi.StringOutput { return o.ApplyT(func(v *Registration) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput) diff --git a/sdk/go/clickhouse/service.go b/sdk/go/clickhouse/service.go index 97395e9..f33b0cf 100644 --- a/sdk/go/clickhouse/service.go +++ b/sdk/go/clickhouse/service.go @@ -12,6 +12,8 @@ import ( "github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/internal" ) +// You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers. +// // ## Example Usage // // ```go @@ -95,8 +97,6 @@ type Service struct { // // Deprecated: Please use the `PrivateEndpoint.getConfig` data source instead. PrivateEndpointConfig ServicePrivateEndpointConfigOutput `pulumi:"privateEndpointConfig"` - // List of private endpoint IDs - PrivateEndpointIds pulumi.StringArrayOutput `pulumi:"privateEndpointIds"` // Region within the cloud provider in which the service is deployed in. Region pulumi.StringOutput `pulumi:"region"` // Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. @@ -194,8 +194,6 @@ type serviceState struct { // // Deprecated: Please use the `PrivateEndpoint.getConfig` data source instead. PrivateEndpointConfig *ServicePrivateEndpointConfig `pulumi:"privateEndpointConfig"` - // List of private endpoint IDs - PrivateEndpointIds []string `pulumi:"privateEndpointIds"` // Region within the cloud provider in which the service is deployed in. Region *string `pulumi:"region"` // Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. @@ -237,8 +235,6 @@ type ServiceState struct { // // Deprecated: Please use the `PrivateEndpoint.getConfig` data source instead. PrivateEndpointConfig ServicePrivateEndpointConfigPtrInput - // List of private endpoint IDs - PrivateEndpointIds pulumi.StringArrayInput // Region within the cloud provider in which the service is deployed in. Region pulumi.StringPtrInput // Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. @@ -276,8 +272,6 @@ type serviceArgs struct { Password *string `pulumi:"password"` // SHA256 hash of password for the default user. One of either `password` or `passwordHash` must be specified. PasswordHash *string `pulumi:"passwordHash"` - // List of private endpoint IDs - PrivateEndpointIds []string `pulumi:"privateEndpointIds"` // Region within the cloud provider in which the service is deployed in. Region string `pulumi:"region"` // Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. @@ -312,8 +306,6 @@ type ServiceArgs struct { Password pulumi.StringPtrInput // SHA256 hash of password for the default user. One of either `password` or `passwordHash` must be specified. PasswordHash pulumi.StringPtrInput - // List of private endpoint IDs - PrivateEndpointIds pulumi.StringArrayInput // Region within the cloud provider in which the service is deployed in. Region pulumi.StringInput // Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. @@ -489,11 +481,6 @@ func (o ServiceOutput) PrivateEndpointConfig() ServicePrivateEndpointConfigOutpu return o.ApplyT(func(v *Service) ServicePrivateEndpointConfigOutput { return v.PrivateEndpointConfig }).(ServicePrivateEndpointConfigOutput) } -// List of private endpoint IDs -func (o ServiceOutput) PrivateEndpointIds() pulumi.StringArrayOutput { - return o.ApplyT(func(v *Service) pulumi.StringArrayOutput { return v.PrivateEndpointIds }).(pulumi.StringArrayOutput) -} - // Region within the cloud provider in which the service is deployed in. func (o ServiceOutput) Region() pulumi.StringOutput { return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput) diff --git a/sdk/go/clickhouse/serviceprivateendpoints/attachment.go b/sdk/go/clickhouse/serviceprivateendpoints/attachment.go new file mode 100644 index 0000000..258d730 --- /dev/null +++ b/sdk/go/clickhouse/serviceprivateendpoints/attachment.go @@ -0,0 +1,242 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package serviceprivateendpoints + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/internal" +) + +// Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*. +// +// See privateEndpointRegistration for how to create a *private endpoint*. +// +// See full example on GitHub. +// +// ## Import +// +// # Endpoint Attachments can be imported by specifying the clickhouse service UUID +// +// ```sh +// $ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +// ``` +type Attachment struct { + pulumi.CustomResourceState + + // List of private endpoint IDs + PrivateEndpointIds pulumi.StringArrayOutput `pulumi:"privateEndpointIds"` + // ClickHouse Servie ID + ServiceId pulumi.StringPtrOutput `pulumi:"serviceId"` +} + +// NewAttachment registers a new resource with the given unique name, arguments, and options. +func NewAttachment(ctx *pulumi.Context, + name string, args *AttachmentArgs, opts ...pulumi.ResourceOption) (*Attachment, error) { + if args == nil { + args = &AttachmentArgs{} + } + + opts = internal.PkgResourceDefaultOpts(opts) + var resource Attachment + err := ctx.RegisterResource("clickhouse:ServicePrivateEndpoints/attachment:Attachment", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetAttachment gets an existing Attachment resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetAttachment(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *AttachmentState, opts ...pulumi.ResourceOption) (*Attachment, error) { + var resource Attachment + err := ctx.ReadResource("clickhouse:ServicePrivateEndpoints/attachment:Attachment", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Attachment resources. +type attachmentState struct { + // List of private endpoint IDs + PrivateEndpointIds []string `pulumi:"privateEndpointIds"` + // ClickHouse Servie ID + ServiceId *string `pulumi:"serviceId"` +} + +type AttachmentState struct { + // List of private endpoint IDs + PrivateEndpointIds pulumi.StringArrayInput + // ClickHouse Servie ID + ServiceId pulumi.StringPtrInput +} + +func (AttachmentState) ElementType() reflect.Type { + return reflect.TypeOf((*attachmentState)(nil)).Elem() +} + +type attachmentArgs struct { + // List of private endpoint IDs + PrivateEndpointIds []string `pulumi:"privateEndpointIds"` + // ClickHouse Servie ID + ServiceId *string `pulumi:"serviceId"` +} + +// The set of arguments for constructing a Attachment resource. +type AttachmentArgs struct { + // List of private endpoint IDs + PrivateEndpointIds pulumi.StringArrayInput + // ClickHouse Servie ID + ServiceId pulumi.StringPtrInput +} + +func (AttachmentArgs) ElementType() reflect.Type { + return reflect.TypeOf((*attachmentArgs)(nil)).Elem() +} + +type AttachmentInput interface { + pulumi.Input + + ToAttachmentOutput() AttachmentOutput + ToAttachmentOutputWithContext(ctx context.Context) AttachmentOutput +} + +func (*Attachment) ElementType() reflect.Type { + return reflect.TypeOf((**Attachment)(nil)).Elem() +} + +func (i *Attachment) ToAttachmentOutput() AttachmentOutput { + return i.ToAttachmentOutputWithContext(context.Background()) +} + +func (i *Attachment) ToAttachmentOutputWithContext(ctx context.Context) AttachmentOutput { + return pulumi.ToOutputWithContext(ctx, i).(AttachmentOutput) +} + +// AttachmentArrayInput is an input type that accepts AttachmentArray and AttachmentArrayOutput values. +// You can construct a concrete instance of `AttachmentArrayInput` via: +// +// AttachmentArray{ AttachmentArgs{...} } +type AttachmentArrayInput interface { + pulumi.Input + + ToAttachmentArrayOutput() AttachmentArrayOutput + ToAttachmentArrayOutputWithContext(context.Context) AttachmentArrayOutput +} + +type AttachmentArray []AttachmentInput + +func (AttachmentArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*Attachment)(nil)).Elem() +} + +func (i AttachmentArray) ToAttachmentArrayOutput() AttachmentArrayOutput { + return i.ToAttachmentArrayOutputWithContext(context.Background()) +} + +func (i AttachmentArray) ToAttachmentArrayOutputWithContext(ctx context.Context) AttachmentArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(AttachmentArrayOutput) +} + +// AttachmentMapInput is an input type that accepts AttachmentMap and AttachmentMapOutput values. +// You can construct a concrete instance of `AttachmentMapInput` via: +// +// AttachmentMap{ "key": AttachmentArgs{...} } +type AttachmentMapInput interface { + pulumi.Input + + ToAttachmentMapOutput() AttachmentMapOutput + ToAttachmentMapOutputWithContext(context.Context) AttachmentMapOutput +} + +type AttachmentMap map[string]AttachmentInput + +func (AttachmentMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*Attachment)(nil)).Elem() +} + +func (i AttachmentMap) ToAttachmentMapOutput() AttachmentMapOutput { + return i.ToAttachmentMapOutputWithContext(context.Background()) +} + +func (i AttachmentMap) ToAttachmentMapOutputWithContext(ctx context.Context) AttachmentMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(AttachmentMapOutput) +} + +type AttachmentOutput struct{ *pulumi.OutputState } + +func (AttachmentOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Attachment)(nil)).Elem() +} + +func (o AttachmentOutput) ToAttachmentOutput() AttachmentOutput { + return o +} + +func (o AttachmentOutput) ToAttachmentOutputWithContext(ctx context.Context) AttachmentOutput { + return o +} + +// List of private endpoint IDs +func (o AttachmentOutput) PrivateEndpointIds() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Attachment) pulumi.StringArrayOutput { return v.PrivateEndpointIds }).(pulumi.StringArrayOutput) +} + +// ClickHouse Servie ID +func (o AttachmentOutput) ServiceId() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Attachment) pulumi.StringPtrOutput { return v.ServiceId }).(pulumi.StringPtrOutput) +} + +type AttachmentArrayOutput struct{ *pulumi.OutputState } + +func (AttachmentArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*Attachment)(nil)).Elem() +} + +func (o AttachmentArrayOutput) ToAttachmentArrayOutput() AttachmentArrayOutput { + return o +} + +func (o AttachmentArrayOutput) ToAttachmentArrayOutputWithContext(ctx context.Context) AttachmentArrayOutput { + return o +} + +func (o AttachmentArrayOutput) Index(i pulumi.IntInput) AttachmentOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Attachment { + return vs[0].([]*Attachment)[vs[1].(int)] + }).(AttachmentOutput) +} + +type AttachmentMapOutput struct{ *pulumi.OutputState } + +func (AttachmentMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*Attachment)(nil)).Elem() +} + +func (o AttachmentMapOutput) ToAttachmentMapOutput() AttachmentMapOutput { + return o +} + +func (o AttachmentMapOutput) ToAttachmentMapOutputWithContext(ctx context.Context) AttachmentMapOutput { + return o +} + +func (o AttachmentMapOutput) MapIndex(k pulumi.StringInput) AttachmentOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Attachment { + return vs[0].(map[string]*Attachment)[vs[1].(string)] + }).(AttachmentOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*AttachmentInput)(nil)).Elem(), &Attachment{}) + pulumi.RegisterInputType(reflect.TypeOf((*AttachmentArrayInput)(nil)).Elem(), AttachmentArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*AttachmentMapInput)(nil)).Elem(), AttachmentMap{}) + pulumi.RegisterOutputType(AttachmentOutput{}) + pulumi.RegisterOutputType(AttachmentArrayOutput{}) + pulumi.RegisterOutputType(AttachmentMapOutput{}) +} diff --git a/sdk/go/clickhouse/serviceprivateendpoints/init.go b/sdk/go/clickhouse/serviceprivateendpoints/init.go new file mode 100644 index 0000000..422f2fa --- /dev/null +++ b/sdk/go/clickhouse/serviceprivateendpoints/init.go @@ -0,0 +1,44 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package serviceprivateendpoints + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumiverse/pulumi-clickhouse/sdk/go/clickhouse/internal" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "clickhouse:ServicePrivateEndpoints/attachment:Attachment": + r = &Attachment{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "clickhouse", + "ServicePrivateEndpoints/attachment", + &module{version}, + ) +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 2de4454..6d044b4 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -19,11 +19,13 @@ utilities.lazyLoad(exports, ["Service"], () => require("./service")); // Export sub-modules: import * as config from "./config"; import * as privateendpoint from "./privateendpoint"; +import * as serviceprivateendpoints from "./serviceprivateendpoints"; import * as types from "./types"; export { config, privateendpoint, + serviceprivateendpoints, types, }; diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index b5fbf11..ca1720f 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -1,7 +1,7 @@ { "name": "@pulumiverse/clickhouse", "version": "${VERSION}", - "description": "A Pulumi package for creating and managing Clickhouse Cloud resources. Based on terraform-provider-clickhouse: version v0.3.0", + "description": "A Pulumi package for creating and managing Clickhouse Cloud resources. Based on terraform-provider-clickhouse: version v1.0.0", "keywords": [ "pulumi", "clickhouse", diff --git a/sdk/nodejs/privateendpoint/registration.ts b/sdk/nodejs/privateendpoint/registration.ts index 407a055..dbe62c5 100644 --- a/sdk/nodejs/privateendpoint/registration.ts +++ b/sdk/nodejs/privateendpoint/registration.ts @@ -4,6 +4,37 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*. + * + * You can use the *private_endpoint_registration* resource to set up the private link feature. + * + * Check the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as clickhouse from "@pulumiverse/clickhouse"; + * + * const endpoint = new clickhouse.privateendpoint.Registration("endpoint", { + * cloudProvider: "aws", + * description: "Private Link from VPC foo", + * privateEndpointId: "vpce-...", + * region: "us-west-2", + * }); + * ``` + * + * ## Import + * + * Endpoint Attachments can be imported by specifying the Cloud provider private endpoint ID + * + * For example for AWS you could run: + * + * ```sh + * $ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx + * ``` + */ export class Registration extends pulumi.CustomResource { /** * Get an existing Registration resource's state with the given name, ID, and optional extra @@ -40,6 +71,10 @@ export class Registration extends pulumi.CustomResource { * Description of the private endpoint */ public readonly description!: pulumi.Output; + /** + * ID of the private endpoint (replaces deprecated attribute `id`) + */ + public readonly privateEndpointId!: pulumi.Output; /** * Region of the private endpoint */ @@ -60,17 +95,22 @@ export class Registration extends pulumi.CustomResource { const state = argsOrState as RegistrationState | undefined; resourceInputs["cloudProvider"] = state ? state.cloudProvider : undefined; resourceInputs["description"] = state ? state.description : undefined; + resourceInputs["privateEndpointId"] = state ? state.privateEndpointId : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState as RegistrationArgs | undefined; if ((!args || args.cloudProvider === undefined) && !opts.urn) { throw new Error("Missing required property 'cloudProvider'"); } + if ((!args || args.privateEndpointId === undefined) && !opts.urn) { + throw new Error("Missing required property 'privateEndpointId'"); + } if ((!args || args.region === undefined) && !opts.urn) { throw new Error("Missing required property 'region'"); } resourceInputs["cloudProvider"] = args ? args.cloudProvider : undefined; resourceInputs["description"] = args ? args.description : undefined; + resourceInputs["privateEndpointId"] = args ? args.privateEndpointId : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); @@ -90,6 +130,10 @@ export interface RegistrationState { * Description of the private endpoint */ description?: pulumi.Input; + /** + * ID of the private endpoint (replaces deprecated attribute `id`) + */ + privateEndpointId?: pulumi.Input; /** * Region of the private endpoint */ @@ -108,6 +152,10 @@ export interface RegistrationArgs { * Description of the private endpoint */ description?: pulumi.Input; + /** + * ID of the private endpoint (replaces deprecated attribute `id`) + */ + privateEndpointId: pulumi.Input; /** * Region of the private endpoint */ diff --git a/sdk/nodejs/service.ts b/sdk/nodejs/service.ts index 2a0f474..81ec554 100644 --- a/sdk/nodejs/service.ts +++ b/sdk/nodejs/service.ts @@ -7,6 +7,8 @@ import * as outputs from "./types/output"; import * as utilities from "./utilities"; /** + * You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers. + * * ## Example Usage * * ```typescript @@ -131,10 +133,6 @@ export class Service extends pulumi.CustomResource { * @deprecated Please use the `clickhouse.PrivateEndpoint.getConfig` data source instead. */ public /*out*/ readonly privateEndpointConfig!: pulumi.Output; - /** - * List of private endpoint IDs - */ - public readonly privateEndpointIds!: pulumi.Output; /** * Region within the cloud provider in which the service is deployed in. */ @@ -173,7 +171,6 @@ export class Service extends pulumi.CustomResource { resourceInputs["password"] = state ? state.password : undefined; resourceInputs["passwordHash"] = state ? state.passwordHash : undefined; resourceInputs["privateEndpointConfig"] = state ? state.privateEndpointConfig : undefined; - resourceInputs["privateEndpointIds"] = state ? state.privateEndpointIds : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tier"] = state ? state.tier : undefined; } else { @@ -203,7 +200,6 @@ export class Service extends pulumi.CustomResource { resourceInputs["numReplicas"] = args ? args.numReplicas : undefined; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["passwordHash"] = args?.passwordHash ? pulumi.secret(args.passwordHash) : undefined; - resourceInputs["privateEndpointIds"] = args ? args.privateEndpointIds : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tier"] = args ? args.tier : undefined; resourceInputs["endpoints"] = undefined /*out*/; @@ -287,10 +283,6 @@ export interface ServiceState { * @deprecated Please use the `clickhouse.PrivateEndpoint.getConfig` data source instead. */ privateEndpointConfig?: pulumi.Input; - /** - * List of private endpoint IDs - */ - privateEndpointIds?: pulumi.Input[]>; /** * Region within the cloud provider in which the service is deployed in. */ @@ -357,10 +349,6 @@ export interface ServiceArgs { * SHA256 hash of password for the default user. One of either `password` or `passwordHash` must be specified. */ passwordHash?: pulumi.Input; - /** - * List of private endpoint IDs - */ - privateEndpointIds?: pulumi.Input[]>; /** * Region within the cloud provider in which the service is deployed in. */ diff --git a/sdk/nodejs/serviceprivateendpoints/attachment.ts b/sdk/nodejs/serviceprivateendpoints/attachment.ts new file mode 100644 index 0000000..f2ddbaa --- /dev/null +++ b/sdk/nodejs/serviceprivateendpoints/attachment.ts @@ -0,0 +1,110 @@ +// *** 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 utilities from "../utilities"; + +/** + * Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*. + * + * See privateEndpointRegistration for how to create a *private endpoint*. + * + * See full example on GitHub. + * + * ## Import + * + * Endpoint Attachments can be imported by specifying the clickhouse service UUID + * + * ```sh + * $ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + * ``` + */ +export class Attachment extends pulumi.CustomResource { + /** + * Get an existing Attachment resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: AttachmentState, opts?: pulumi.CustomResourceOptions): Attachment { + return new Attachment(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'clickhouse:ServicePrivateEndpoints/attachment:Attachment'; + + /** + * Returns true if the given object is an instance of Attachment. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is Attachment { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Attachment.__pulumiType; + } + + /** + * List of private endpoint IDs + */ + public readonly privateEndpointIds!: pulumi.Output; + /** + * ClickHouse Servie ID + */ + public readonly serviceId!: pulumi.Output; + + /** + * Create a Attachment resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args?: AttachmentArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: AttachmentArgs | AttachmentState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as AttachmentState | undefined; + resourceInputs["privateEndpointIds"] = state ? state.privateEndpointIds : undefined; + resourceInputs["serviceId"] = state ? state.serviceId : undefined; + } else { + const args = argsOrState as AttachmentArgs | undefined; + resourceInputs["privateEndpointIds"] = args ? args.privateEndpointIds : undefined; + resourceInputs["serviceId"] = args ? args.serviceId : undefined; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(Attachment.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering Attachment resources. + */ +export interface AttachmentState { + /** + * List of private endpoint IDs + */ + privateEndpointIds?: pulumi.Input[]>; + /** + * ClickHouse Servie ID + */ + serviceId?: pulumi.Input; +} + +/** + * The set of arguments for constructing a Attachment resource. + */ +export interface AttachmentArgs { + /** + * List of private endpoint IDs + */ + privateEndpointIds?: pulumi.Input[]>; + /** + * ClickHouse Servie ID + */ + serviceId?: pulumi.Input; +} diff --git a/sdk/nodejs/serviceprivateendpoints/index.ts b/sdk/nodejs/serviceprivateendpoints/index.ts new file mode 100644 index 0000000..9ab837c --- /dev/null +++ b/sdk/nodejs/serviceprivateendpoints/index.ts @@ -0,0 +1,25 @@ +// *** 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 utilities from "../utilities"; + +// Export members: +export { AttachmentArgs, AttachmentState } from "./attachment"; +export type Attachment = import("./attachment").Attachment; +export const Attachment: typeof import("./attachment").Attachment = null as any; +utilities.lazyLoad(exports, ["Attachment"], () => require("./attachment")); + + +const _module = { + version: utilities.getVersion(), + construct: (name: string, type: string, urn: string): pulumi.Resource => { + switch (type) { + case "clickhouse:ServicePrivateEndpoints/attachment:Attachment": + return new Attachment(name, undefined, { urn }) + default: + throw new Error(`unknown resource type ${type}`); + } + }, +}; +pulumi.runtime.registerResourceModule("clickhouse", "ServicePrivateEndpoints/attachment", _module) diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 1277698..c93f8c6 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -21,6 +21,8 @@ "privateendpoint/registration.ts", "provider.ts", "service.ts", + "serviceprivateendpoints/attachment.ts", + "serviceprivateendpoints/index.ts", "types/index.ts", "types/input.ts", "types/output.ts", diff --git a/sdk/python/pulumiverse_clickhouse/__init__.py b/sdk/python/pulumiverse_clickhouse/__init__.py index f6d6290..4f8d387 100644 --- a/sdk/python/pulumiverse_clickhouse/__init__.py +++ b/sdk/python/pulumiverse_clickhouse/__init__.py @@ -16,9 +16,12 @@ config = __config import pulumiverse_clickhouse.privateendpoint as __privateendpoint privateendpoint = __privateendpoint + import pulumiverse_clickhouse.serviceprivateendpoints as __serviceprivateendpoints + serviceprivateendpoints = __serviceprivateendpoints else: config = _utilities.lazy_import('pulumiverse_clickhouse.config') privateendpoint = _utilities.lazy_import('pulumiverse_clickhouse.privateendpoint') + serviceprivateendpoints = _utilities.lazy_import('pulumiverse_clickhouse.serviceprivateendpoints') _utilities.register( resource_modules=""" @@ -31,6 +34,14 @@ "clickhouse:PrivateEndpoint/registration:Registration": "Registration" } }, + { + "pkg": "clickhouse", + "mod": "ServicePrivateEndpoints/attachment", + "fqn": "pulumiverse_clickhouse.serviceprivateendpoints", + "classes": { + "clickhouse:ServicePrivateEndpoints/attachment:Attachment": "Attachment" + } + }, { "pkg": "clickhouse", "mod": "index/service", diff --git a/sdk/python/pulumiverse_clickhouse/privateendpoint/registration.py b/sdk/python/pulumiverse_clickhouse/privateendpoint/registration.py index 197a107..518df86 100644 --- a/sdk/python/pulumiverse_clickhouse/privateendpoint/registration.py +++ b/sdk/python/pulumiverse_clickhouse/privateendpoint/registration.py @@ -15,15 +15,18 @@ class RegistrationArgs: def __init__(__self__, *, cloud_provider: pulumi.Input[str], + private_endpoint_id: pulumi.Input[str], region: pulumi.Input[str], description: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Registration resource. :param pulumi.Input[str] cloud_provider: Cloud provider of the private endpoint ID + :param pulumi.Input[str] private_endpoint_id: ID of the private endpoint (replaces deprecated attribute `id`) :param pulumi.Input[str] region: Region of the private endpoint :param pulumi.Input[str] description: Description of the private endpoint """ pulumi.set(__self__, "cloud_provider", cloud_provider) + pulumi.set(__self__, "private_endpoint_id", private_endpoint_id) pulumi.set(__self__, "region", region) if description is not None: pulumi.set(__self__, "description", description) @@ -40,6 +43,18 @@ def cloud_provider(self) -> pulumi.Input[str]: def cloud_provider(self, value: pulumi.Input[str]): pulumi.set(self, "cloud_provider", value) + @property + @pulumi.getter(name="privateEndpointId") + def private_endpoint_id(self) -> pulumi.Input[str]: + """ + ID of the private endpoint (replaces deprecated attribute `id`) + """ + return pulumi.get(self, "private_endpoint_id") + + @private_endpoint_id.setter + def private_endpoint_id(self, value: pulumi.Input[str]): + pulumi.set(self, "private_endpoint_id", value) + @property @pulumi.getter def region(self) -> pulumi.Input[str]: @@ -70,17 +85,21 @@ class _RegistrationState: def __init__(__self__, *, cloud_provider: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, + private_endpoint_id: Optional[pulumi.Input[str]] = None, region: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering Registration resources. :param pulumi.Input[str] cloud_provider: Cloud provider of the private endpoint ID :param pulumi.Input[str] description: Description of the private endpoint + :param pulumi.Input[str] private_endpoint_id: ID of the private endpoint (replaces deprecated attribute `id`) :param pulumi.Input[str] region: Region of the private endpoint """ if cloud_provider is not None: pulumi.set(__self__, "cloud_provider", cloud_provider) if description is not None: pulumi.set(__self__, "description", description) + if private_endpoint_id is not None: + pulumi.set(__self__, "private_endpoint_id", private_endpoint_id) if region is not None: pulumi.set(__self__, "region", region) @@ -108,6 +127,18 @@ def description(self) -> Optional[pulumi.Input[str]]: def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) + @property + @pulumi.getter(name="privateEndpointId") + def private_endpoint_id(self) -> Optional[pulumi.Input[str]]: + """ + ID of the private endpoint (replaces deprecated attribute `id`) + """ + return pulumi.get(self, "private_endpoint_id") + + @private_endpoint_id.setter + def private_endpoint_id(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "private_endpoint_id", value) + @property @pulumi.getter def region(self) -> Optional[pulumi.Input[str]]: @@ -128,14 +159,44 @@ def __init__(__self__, opts: Optional[pulumi.ResourceOptions] = None, cloud_provider: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, + private_endpoint_id: Optional[pulumi.Input[str]] = None, region: Optional[pulumi.Input[str]] = None, __props__=None): """ - Create a Registration resource with the given unique name, props, and options. + ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*. + + You can use the *private_endpoint_registration* resource to set up the private link feature. + + Check the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*. + + ## Example Usage + + ```python + import pulumi + import pulumiverse_clickhouse as clickhouse + + endpoint = clickhouse.private_endpoint.Registration("endpoint", + cloud_provider="aws", + description="Private Link from VPC foo", + private_endpoint_id="vpce-...", + region="us-west-2") + ``` + + ## Import + + Endpoint Attachments can be imported by specifying the Cloud provider private endpoint ID + + For example for AWS you could run: + + ```sh + $ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] cloud_provider: Cloud provider of the private endpoint ID :param pulumi.Input[str] description: Description of the private endpoint + :param pulumi.Input[str] private_endpoint_id: ID of the private endpoint (replaces deprecated attribute `id`) :param pulumi.Input[str] region: Region of the private endpoint """ ... @@ -145,7 +206,35 @@ def __init__(__self__, args: RegistrationArgs, opts: Optional[pulumi.ResourceOptions] = None): """ - Create a Registration resource with the given unique name, props, and options. + ClickHouse Cloud provides the ability to connect your services to your cloud virtual network through a feature named *Private Link*. + + You can use the *private_endpoint_registration* resource to set up the private link feature. + + Check the [docs](https://clickhouse.com/docs/en/cloud/security/private-link-overview) for more details on *private link*. + + ## Example Usage + + ```python + import pulumi + import pulumiverse_clickhouse as clickhouse + + endpoint = clickhouse.private_endpoint.Registration("endpoint", + cloud_provider="aws", + description="Private Link from VPC foo", + private_endpoint_id="vpce-...", + region="us-west-2") + ``` + + ## Import + + Endpoint Attachments can be imported by specifying the Cloud provider private endpoint ID + + For example for AWS you could run: + + ```sh + $ pulumi import clickhouse:PrivateEndpoint/registration:Registration example vpce-xxxxxx + ``` + :param str resource_name: The name of the resource. :param RegistrationArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. @@ -163,6 +252,7 @@ def _internal_init(__self__, opts: Optional[pulumi.ResourceOptions] = None, cloud_provider: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, + private_endpoint_id: Optional[pulumi.Input[str]] = None, region: Optional[pulumi.Input[str]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) @@ -177,6 +267,9 @@ def _internal_init(__self__, raise TypeError("Missing required property 'cloud_provider'") __props__.__dict__["cloud_provider"] = cloud_provider __props__.__dict__["description"] = description + if private_endpoint_id is None and not opts.urn: + raise TypeError("Missing required property 'private_endpoint_id'") + __props__.__dict__["private_endpoint_id"] = private_endpoint_id if region is None and not opts.urn: raise TypeError("Missing required property 'region'") __props__.__dict__["region"] = region @@ -192,6 +285,7 @@ def get(resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cloud_provider: Optional[pulumi.Input[str]] = None, description: Optional[pulumi.Input[str]] = None, + private_endpoint_id: Optional[pulumi.Input[str]] = None, region: Optional[pulumi.Input[str]] = None) -> 'Registration': """ Get an existing Registration resource's state with the given name, id, and optional extra @@ -202,6 +296,7 @@ def get(resource_name: str, :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] cloud_provider: Cloud provider of the private endpoint ID :param pulumi.Input[str] description: Description of the private endpoint + :param pulumi.Input[str] private_endpoint_id: ID of the private endpoint (replaces deprecated attribute `id`) :param pulumi.Input[str] region: Region of the private endpoint """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) @@ -210,6 +305,7 @@ def get(resource_name: str, __props__.__dict__["cloud_provider"] = cloud_provider __props__.__dict__["description"] = description + __props__.__dict__["private_endpoint_id"] = private_endpoint_id __props__.__dict__["region"] = region return Registration(resource_name, opts=opts, __props__=__props__) @@ -229,6 +325,14 @@ def description(self) -> pulumi.Output[Optional[str]]: """ return pulumi.get(self, "description") + @property + @pulumi.getter(name="privateEndpointId") + def private_endpoint_id(self) -> pulumi.Output[str]: + """ + ID of the private endpoint (replaces deprecated attribute `id`) + """ + return pulumi.get(self, "private_endpoint_id") + @property @pulumi.getter def region(self) -> pulumi.Output[str]: diff --git a/sdk/python/pulumiverse_clickhouse/service.py b/sdk/python/pulumiverse_clickhouse/service.py index b2722fd..17a4f85 100644 --- a/sdk/python/pulumiverse_clickhouse/service.py +++ b/sdk/python/pulumiverse_clickhouse/service.py @@ -30,8 +30,7 @@ def __init__(__self__, *, name: Optional[pulumi.Input[str]] = None, num_replicas: Optional[pulumi.Input[int]] = None, password: Optional[pulumi.Input[str]] = None, - password_hash: Optional[pulumi.Input[str]] = None, - private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): + password_hash: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Service resource. :param pulumi.Input[str] cloud_provider: Cloud provider ('aws', 'gcp', or 'azure') in which the service is deployed in. @@ -49,7 +48,6 @@ def __init__(__self__, *, :param pulumi.Input[int] num_replicas: Number of replicas for the service. Available only for 'production' services. Must be between 3 and 20. Contact support to enable this feature. :param pulumi.Input[str] password: Password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input[str] password_hash: SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified. - :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs """ pulumi.set(__self__, "cloud_provider", cloud_provider) pulumi.set(__self__, "ip_accesses", ip_accesses) @@ -77,8 +75,6 @@ def __init__(__self__, *, pulumi.set(__self__, "password", password) if password_hash is not None: pulumi.set(__self__, "password_hash", password_hash) - if private_endpoint_ids is not None: - pulumi.set(__self__, "private_endpoint_ids", private_endpoint_ids) @property @pulumi.getter(name="cloudProvider") @@ -260,18 +256,6 @@ def password_hash(self) -> Optional[pulumi.Input[str]]: def password_hash(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "password_hash", value) - @property - @pulumi.getter(name="privateEndpointIds") - def private_endpoint_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: - """ - List of private endpoint IDs - """ - return pulumi.get(self, "private_endpoint_ids") - - @private_endpoint_ids.setter - def private_endpoint_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): - pulumi.set(self, "private_endpoint_ids", value) - @pulumi.input_type class _ServiceState: @@ -292,7 +276,6 @@ def __init__(__self__, *, password: Optional[pulumi.Input[str]] = None, password_hash: Optional[pulumi.Input[str]] = None, private_endpoint_config: Optional[pulumi.Input['ServicePrivateEndpointConfigArgs']] = None, - private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, region: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] = None): """ @@ -313,7 +296,6 @@ def __init__(__self__, *, :param pulumi.Input[str] password: Password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input[str] password_hash: SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input['ServicePrivateEndpointConfigArgs'] private_endpoint_config: Service config for private endpoints - :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs :param pulumi.Input[str] region: Region within the cloud provider in which the service is deployed in. :param pulumi.Input[str] tier: Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. """ @@ -352,8 +334,6 @@ def __init__(__self__, *, pulumi.log.warn("""private_endpoint_config is deprecated: Please use the `private_endpoint_get_config` data source instead.""") if private_endpoint_config is not None: pulumi.set(__self__, "private_endpoint_config", private_endpoint_config) - if private_endpoint_ids is not None: - pulumi.set(__self__, "private_endpoint_ids", private_endpoint_ids) if region is not None: pulumi.set(__self__, "region", region) if tier is not None: @@ -552,18 +532,6 @@ def private_endpoint_config(self) -> Optional[pulumi.Input['ServicePrivateEndpoi def private_endpoint_config(self, value: Optional[pulumi.Input['ServicePrivateEndpointConfigArgs']]): pulumi.set(self, "private_endpoint_config", value) - @property - @pulumi.getter(name="privateEndpointIds") - def private_endpoint_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: - """ - List of private endpoint IDs - """ - return pulumi.get(self, "private_endpoint_ids") - - @private_endpoint_ids.setter - def private_endpoint_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): - pulumi.set(self, "private_endpoint_ids", value) - @property @pulumi.getter def region(self) -> Optional[pulumi.Input[str]]: @@ -607,11 +575,12 @@ def __init__(__self__, num_replicas: Optional[pulumi.Input[int]] = None, password: Optional[pulumi.Input[str]] = None, password_hash: Optional[pulumi.Input[str]] = None, - private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, region: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] = None, __props__=None): """ + You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers. + ## Example Usage ```python @@ -656,7 +625,6 @@ def __init__(__self__, :param pulumi.Input[int] num_replicas: Number of replicas for the service. Available only for 'production' services. Must be between 3 and 20. Contact support to enable this feature. :param pulumi.Input[str] password: Password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input[str] password_hash: SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified. - :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs :param pulumi.Input[str] region: Region within the cloud provider in which the service is deployed in. :param pulumi.Input[str] tier: Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. """ @@ -667,6 +635,8 @@ def __init__(__self__, args: ServiceArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers. + ## Example Usage ```python @@ -724,7 +694,6 @@ def _internal_init(__self__, num_replicas: Optional[pulumi.Input[int]] = None, password: Optional[pulumi.Input[str]] = None, password_hash: Optional[pulumi.Input[str]] = None, - private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, region: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] = None, __props__=None): @@ -753,7 +722,6 @@ def _internal_init(__self__, __props__.__dict__["num_replicas"] = num_replicas __props__.__dict__["password"] = None if password is None else pulumi.Output.secret(password) __props__.__dict__["password_hash"] = None if password_hash is None else pulumi.Output.secret(password_hash) - __props__.__dict__["private_endpoint_ids"] = private_endpoint_ids if region is None and not opts.urn: raise TypeError("Missing required property 'region'") __props__.__dict__["region"] = region @@ -791,7 +759,6 @@ def get(resource_name: str, password: Optional[pulumi.Input[str]] = None, password_hash: Optional[pulumi.Input[str]] = None, private_endpoint_config: Optional[pulumi.Input[Union['ServicePrivateEndpointConfigArgs', 'ServicePrivateEndpointConfigArgsDict']]] = None, - private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, region: Optional[pulumi.Input[str]] = None, tier: Optional[pulumi.Input[str]] = None) -> 'Service': """ @@ -817,7 +784,6 @@ def get(resource_name: str, :param pulumi.Input[str] password: Password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input[str] password_hash: SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified. :param pulumi.Input[Union['ServicePrivateEndpointConfigArgs', 'ServicePrivateEndpointConfigArgsDict']] private_endpoint_config: Service config for private endpoints - :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs :param pulumi.Input[str] region: Region within the cloud provider in which the service is deployed in. :param pulumi.Input[str] tier: Tier of the service: 'development', 'production'. Production services scale, Development are fixed size. """ @@ -841,7 +807,6 @@ def get(resource_name: str, __props__.__dict__["password"] = password __props__.__dict__["password_hash"] = password_hash __props__.__dict__["private_endpoint_config"] = private_endpoint_config - __props__.__dict__["private_endpoint_ids"] = private_endpoint_ids __props__.__dict__["region"] = region __props__.__dict__["tier"] = tier return Service(resource_name, opts=opts, __props__=__props__) @@ -975,14 +940,6 @@ def private_endpoint_config(self) -> pulumi.Output['outputs.ServicePrivateEndpoi """ return pulumi.get(self, "private_endpoint_config") - @property - @pulumi.getter(name="privateEndpointIds") - def private_endpoint_ids(self) -> pulumi.Output[Sequence[str]]: - """ - List of private endpoint IDs - """ - return pulumi.get(self, "private_endpoint_ids") - @property @pulumi.getter def region(self) -> pulumi.Output[str]: diff --git a/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/__init__.py b/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/__init__.py new file mode 100644 index 0000000..c78c9c2 --- /dev/null +++ b/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/__init__.py @@ -0,0 +1,8 @@ +# 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! *** + +from .. import _utilities +import typing +# Export this package's modules as members: +from .attachment import * diff --git a/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/attachment.py b/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/attachment.py new file mode 100644 index 0000000..b86617c --- /dev/null +++ b/sdk/python/pulumiverse_clickhouse/serviceprivateendpoints/attachment.py @@ -0,0 +1,216 @@ +# 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from .. import _utilities + +__all__ = ['AttachmentArgs', 'Attachment'] + +@pulumi.input_type +class AttachmentArgs: + def __init__(__self__, *, + private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + service_id: Optional[pulumi.Input[str]] = None): + """ + The set of arguments for constructing a Attachment resource. + :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs + :param pulumi.Input[str] service_id: ClickHouse Servie ID + """ + if private_endpoint_ids is not None: + pulumi.set(__self__, "private_endpoint_ids", private_endpoint_ids) + if service_id is not None: + pulumi.set(__self__, "service_id", service_id) + + @property + @pulumi.getter(name="privateEndpointIds") + def private_endpoint_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + """ + List of private endpoint IDs + """ + return pulumi.get(self, "private_endpoint_ids") + + @private_endpoint_ids.setter + def private_endpoint_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "private_endpoint_ids", value) + + @property + @pulumi.getter(name="serviceId") + def service_id(self) -> Optional[pulumi.Input[str]]: + """ + ClickHouse Servie ID + """ + return pulumi.get(self, "service_id") + + @service_id.setter + def service_id(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "service_id", value) + + +@pulumi.input_type +class _AttachmentState: + def __init__(__self__, *, + private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + service_id: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering Attachment resources. + :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs + :param pulumi.Input[str] service_id: ClickHouse Servie ID + """ + if private_endpoint_ids is not None: + pulumi.set(__self__, "private_endpoint_ids", private_endpoint_ids) + if service_id is not None: + pulumi.set(__self__, "service_id", service_id) + + @property + @pulumi.getter(name="privateEndpointIds") + def private_endpoint_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + """ + List of private endpoint IDs + """ + return pulumi.get(self, "private_endpoint_ids") + + @private_endpoint_ids.setter + def private_endpoint_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "private_endpoint_ids", value) + + @property + @pulumi.getter(name="serviceId") + def service_id(self) -> Optional[pulumi.Input[str]]: + """ + ClickHouse Servie ID + """ + return pulumi.get(self, "service_id") + + @service_id.setter + def service_id(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "service_id", value) + + +class Attachment(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + service_id: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*. + + See private_endpoint_registration for how to create a *private endpoint*. + + See full example on GitHub. + + ## Import + + Endpoint Attachments can be imported by specifying the clickhouse service UUID + + ```sh + $ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs + :param pulumi.Input[str] service_id: ClickHouse Servie ID + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: Optional[AttachmentArgs] = None, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Use the *clickhouse_service_private_endpoints_attachment* resource to attach a ClickHouse *service* to a *Private Endpoint*. + + See private_endpoint_registration for how to create a *private endpoint*. + + See full example on GitHub. + + ## Import + + Endpoint Attachments can be imported by specifying the clickhouse service UUID + + ```sh + $ pulumi import clickhouse:ServicePrivateEndpoints/attachment:Attachment example xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + ``` + + :param str resource_name: The name of the resource. + :param AttachmentArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(AttachmentArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + service_id: Optional[pulumi.Input[str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = AttachmentArgs.__new__(AttachmentArgs) + + __props__.__dict__["private_endpoint_ids"] = private_endpoint_ids + __props__.__dict__["service_id"] = service_id + super(Attachment, __self__).__init__( + 'clickhouse:ServicePrivateEndpoints/attachment:Attachment', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + private_endpoint_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + service_id: Optional[pulumi.Input[str]] = None) -> 'Attachment': + """ + Get an existing Attachment resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[Sequence[pulumi.Input[str]]] private_endpoint_ids: List of private endpoint IDs + :param pulumi.Input[str] service_id: ClickHouse Servie ID + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _AttachmentState.__new__(_AttachmentState) + + __props__.__dict__["private_endpoint_ids"] = private_endpoint_ids + __props__.__dict__["service_id"] = service_id + return Attachment(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="privateEndpointIds") + def private_endpoint_ids(self) -> pulumi.Output[Sequence[str]]: + """ + List of private endpoint IDs + """ + return pulumi.get(self, "private_endpoint_ids") + + @property + @pulumi.getter(name="serviceId") + def service_id(self) -> pulumi.Output[Optional[str]]: + """ + ClickHouse Servie ID + """ + return pulumi.get(self, "service_id") + diff --git a/upstream b/upstream index 9d8757f..94954f1 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 9d8757f30dc8175122d10ced2d248dc43ed70836 +Subproject commit 94954f1082dd3dab7773190eff27caa98e20942a