Skip to content

Commit

Permalink
chore: update upstream to version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
callicles committed Sep 4, 2024
1 parent 4135d3c commit 0fcf953
Show file tree
Hide file tree
Showing 29 changed files with 1,200 additions and 155 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/create-clickhouse-service/py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulumi>=3.0.0,<4.0.0
pulumiverse_clickhouse>=0.0.4,
pulumiverse_clickhouse>=1.0.0,
2 changes: 1 addition & 1 deletion examples/create-clickhouse-service/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"dependencies": {
"@pulumi/pulumi": "^3.113.0",
"@pulumiverse/clickhouse": "^0.0.4"
"@pulumiverse/clickhouse": "^1.0.0"
}
}
16 changes: 4 additions & 12 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down
90 changes: 66 additions & 24 deletions provider/cmd/pulumi-resource-clickhouse/schema.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
38 changes: 36 additions & 2 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package provider

import (
"context"
_ "embed"
"fmt"
"path/filepath"
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
56 changes: 56 additions & 0 deletions sdk/dotnet/PrivateEndpoint/Registration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,44 @@

namespace Pulumiverse.Clickhouse.PrivateEndpoint
{
/// <summary>
/// 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(() =&gt;
/// {
/// 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
/// ```
/// </summary>
[ClickhouseResourceType("clickhouse:PrivateEndpoint/registration:Registration")]
public partial class Registration : global::Pulumi.CustomResource
{
Expand All @@ -25,6 +63,12 @@ public partial class Registration : global::Pulumi.CustomResource
[Output("description")]
public Output<string?> Description { get; private set; } = null!;

/// <summary>
/// ID of the private endpoint (replaces deprecated attribute `id`)
/// </summary>
[Output("privateEndpointId")]
public Output<string> PrivateEndpointId { get; private set; } = null!;

/// <summary>
/// Region of the private endpoint
/// </summary>
Expand Down Expand Up @@ -90,6 +134,12 @@ public sealed class RegistrationArgs : global::Pulumi.ResourceArgs
[Input("description")]
public Input<string>? Description { get; set; }

/// <summary>
/// ID of the private endpoint (replaces deprecated attribute `id`)
/// </summary>
[Input("privateEndpointId", required: true)]
public Input<string> PrivateEndpointId { get; set; } = null!;

/// <summary>
/// Region of the private endpoint
/// </summary>
Expand All @@ -116,6 +166,12 @@ public sealed class RegistrationState : global::Pulumi.ResourceArgs
[Input("description")]
public Input<string>? Description { get; set; }

/// <summary>
/// ID of the private endpoint (replaces deprecated attribute `id`)
/// </summary>
[Input("privateEndpointId")]
public Input<string>? PrivateEndpointId { get; set; }

/// <summary>
/// Region of the private endpoint
/// </summary>
Expand Down
32 changes: 2 additions & 30 deletions sdk/dotnet/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
namespace Pulumiverse.Clickhouse
{
/// <summary>
/// You can use the *clickhouse_service* resource to deploy ClickHouse cloud instances on supported cloud providers.
///
/// ## Example Usage
///
/// ```csharp
Expand Down Expand Up @@ -151,12 +153,6 @@ public partial class Service : global::Pulumi.CustomResource
[Output("privateEndpointConfig")]
public Output<Outputs.ServicePrivateEndpointConfig> PrivateEndpointConfig { get; private set; } = null!;

/// <summary>
/// List of private endpoint IDs
/// </summary>
[Output("privateEndpointIds")]
public Output<ImmutableArray<string>> PrivateEndpointIds { get; private set; } = null!;

/// <summary>
/// Region within the cloud provider in which the service is deployed in.
/// </summary>
Expand Down Expand Up @@ -336,18 +332,6 @@ public Input<string>? PasswordHash
}
}

[Input("privateEndpointIds")]
private InputList<string>? _privateEndpointIds;

/// <summary>
/// List of private endpoint IDs
/// </summary>
public InputList<string> PrivateEndpointIds
{
get => _privateEndpointIds ?? (_privateEndpointIds = new InputList<string>());
set => _privateEndpointIds = value;
}

/// <summary>
/// Region within the cloud provider in which the service is deployed in.
/// </summary>
Expand Down Expand Up @@ -506,18 +490,6 @@ public Input<string>? PasswordHash
[Input("privateEndpointConfig")]
public Input<Inputs.ServicePrivateEndpointConfigGetArgs>? PrivateEndpointConfig { get; set; }

[Input("privateEndpointIds")]
private InputList<string>? _privateEndpointIds;

/// <summary>
/// List of private endpoint IDs
/// </summary>
public InputList<string> PrivateEndpointIds
{
get => _privateEndpointIds ?? (_privateEndpointIds = new InputList<string>());
set => _privateEndpointIds = value;
}

/// <summary>
/// Region within the cloud provider in which the service is deployed in.
/// </summary>
Expand Down
Loading

0 comments on commit 0fcf953

Please sign in to comment.