Skip to content

Commit

Permalink
Upgrade to v2.0.0 of the DigitalOcean Terraform Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed Oct 23, 2020
1 parent a2c42c0 commit 6eaf2a1
Show file tree
Hide file tree
Showing 141 changed files with 2,554 additions and 4,279 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
- windows
- linux
ldflags:
- -X github.com/pulumi/pulumi-digitalocean/provider/v2/pkg/version.Version={{.Tag}}
- -X github.com/pulumi/pulumi-digitalocean/provider/v3/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-digitalocean/
changelog:
skip: true
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ builds:
- windows
- linux
ldflags:
- -X github.com/pulumi/pulumi-digitalocean/provider/v2/pkg/version.Version={{.Tag}}
- -X github.com/pulumi/pulumi-digitalocean/provider/v3/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-digitalocean/
changelog:
skip: true
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CHANGELOG
=========

## HEAD (Unreleased)
* Upgrade to pulumi-terraform-bridge v2.11.0
* Upgrade to Pulumi v2.12.0
* Upgrade to v2.0.0 of the DigitalOcean Terraform Provider
* Upgrade to Pulumi v2.12.0 and pulumi-terraform-bridge v2.11.0
* Improving the accuracy of previews leading to a more accurate understanding of what will actually change rather than assuming all output properties will change

---
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ORG := pulumi
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @pulumi/${PACK}
TF_NAME := ${PACK}
PROVIDER_PATH := provider/v2
PROVIDER_PATH := provider/v3
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version

TFGEN := pulumi-tfgen-${PACK}
Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/pulumi/pulumi-digitalocean/examples/v2
module github.com/pulumi/pulumi-digitalocean/examples/v3

go 1.14

Expand Down
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-digitalocean/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package main

import (
digitalocean "github.com/pulumi/pulumi-digitalocean/provider/v2"
"github.com/pulumi/pulumi-digitalocean/provider/v2/pkg/version"
digitalocean "github.com/pulumi/pulumi-digitalocean/provider/v3"
"github.com/pulumi/pulumi-digitalocean/provider/v3/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge"
)

Expand Down
392 changes: 348 additions & 44 deletions provider/cmd/pulumi-resource-digitalocean/schema.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions provider/cmd/pulumi-tfgen-digitalocean/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package main

import (
digitalocean "github.com/pulumi/pulumi-digitalocean/provider/v2"
"github.com/pulumi/pulumi-digitalocean/provider/v2/pkg/version"
digitalocean "github.com/pulumi/pulumi-digitalocean/provider/v3"
"github.com/pulumi/pulumi-digitalocean/provider/v3/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfgen"
)

Expand Down
5 changes: 3 additions & 2 deletions provider/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/pulumi/pulumi-digitalocean/provider/v2
module github.com/pulumi/pulumi-digitalocean/provider/v3

go 1.14

Expand All @@ -10,8 +10,9 @@ require (
)

replace (
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20200910230100-328eb4ff41df
github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.3+incompatible
github.com/digitalocean/terraform-provider-digitalocean => github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20201014100851-1c33389dce60
github.com/digitalocean/terraform-provider-digitalocean => github.com/pulumi/terraform-provider-digitalocean v1.19.1-0.20201023114808-70dd36edc427
github.com/hashicorp/terraform-plugin-test => github.com/hashicorp/terraform-plugin-test v1.3.0
github.com/hashicorp/vault => github.com/hashicorp/vault v1.2.0
github.com/keybase/go-crypto => github.com/keybase/go-crypto v0.0.0-20190416182011-b785b22cc757
Expand Down
530 changes: 13 additions & 517 deletions provider/go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import (
"unicode"

"github.com/digitalocean/terraform-provider-digitalocean/digitalocean"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfbridge"
shimv1 "github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfshim/sdk-v1"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v2/pkg/tfshim/sdk-v2"
"github.com/pulumi/pulumi/sdk/v2/go/common/tokens"
)

Expand Down Expand Up @@ -60,12 +59,12 @@ func makeResource(mod string, res string) tokens.Type {

// Provider returns additional overlaid schema and metadata associated with the Digital Ocean package.
func Provider() tfbridge.ProviderInfo {
p := shimv1.NewProvider(digitalocean.Provider().(*schema.Provider))
p := shimv2.NewProvider(digitalocean.Provider())
prov := tfbridge.ProviderInfo{
P: p,
Name: "digitalocean",
Description: "A Pulumi package for creating and managing Digital Ocean cloud resources.",
Keywords: []string{"pulumi", "digital ocean"},
Keywords: []string{"pulumi", "digitalocean"},
License: "Apache-2.0",
Homepage: "https://pulumi.io",
Repository: "https://github.com/pulumi/pulumi-digitalocean",
Expand Down Expand Up @@ -327,6 +326,7 @@ func Provider() tfbridge.ProviderInfo {
"digitalocean_tags": {Tok: makeDataSource(digitalOceanMod, "getTags")},
"digitalocean_app": {Tok: makeDataSource(digitalOceanMod, "getApp")},
"digitalocean_domains": {Tok: makeDataSource(digitalOceanMod, "getDomains")},
"digitalocean_records": {Tok: makeDataSource(digitalOceanMod, "getRecords")},
},
JavaScript: &tfbridge.JavaScriptInfo{
Dependencies: map[string]string{
Expand Down
28 changes: 23 additions & 5 deletions sdk/dotnet/Cdn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace Pulumi.DigitalOcean
/// {
/// Origin = mybucket.BucketDomainName,
/// CustomDomain = "static.example.com",
/// CertificateId = cert.Id,
/// CertificateName = cert.Name,
/// });
/// }
///
Expand All @@ -81,10 +81,16 @@ namespace Pulumi.DigitalOcean
public partial class Cdn : Pulumi.CustomResource
{
/// <summary>
/// The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// **Deprecated** The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Output("certificateId")]
public Output<string?> CertificateId { get; private set; } = null!;
public Output<string> CertificateId { get; private set; } = null!;

/// <summary>
/// The unique name of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Output("certificateName")]
public Output<string> CertificateName { get; private set; } = null!;

/// <summary>
/// The date and time when the CDN Endpoint was created.
Expand Down Expand Up @@ -163,11 +169,17 @@ public static Cdn Get(string name, Input<string> id, CdnState? state = null, Cus
public sealed class CdnArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// **Deprecated** The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Input("certificateId")]
public Input<string>? CertificateId { get; set; }

/// <summary>
/// The unique name of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Input("certificateName")]
public Input<string>? CertificateName { get; set; }

/// <summary>
/// The fully qualified domain name (FQDN) of the custom subdomain used with the CDN Endpoint.
/// </summary>
Expand All @@ -194,11 +206,17 @@ public CdnArgs()
public sealed class CdnState : Pulumi.ResourceArgs
{
/// <summary>
/// The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// **Deprecated** The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Input("certificateId")]
public Input<string>? CertificateId { get; set; }

/// <summary>
/// The unique name of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.
/// </summary>
[Input("certificateName")]
public Input<string>? CertificateName { get; set; }

/// <summary>
/// The date and time when the CDN Endpoint was created.
/// </summary>
Expand Down
20 changes: 16 additions & 4 deletions sdk/dotnet/Certificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ namespace Pulumi.DigitalOcean
/// var cert = new DigitalOcean.Certificate("cert", new DigitalOcean.CertificateArgs
/// {
/// Type = "custom",
/// PrivateKey = File.ReadAllText("/Users/myuser/certs/privkey.pem"),
/// LeafCertificate = File.ReadAllText("/Users/myuser/certs/cert.pem"),
/// CertificateChain = File.ReadAllText("/Users/myuser/certs/fullchain.pem"),
/// PrivateKey = File.ReadAllText("/Users/terraform/certs/privkey.pem"),
/// LeafCertificate = File.ReadAllText("/Users/terraform/certs/cert.pem"),
/// CertificateChain = File.ReadAllText("/Users/terraform/certs/fullchain.pem"),
/// });
/// }
///
Expand Down Expand Up @@ -96,7 +96,7 @@ namespace Pulumi.DigitalOcean
/// EntryProtocol = "https",
/// TargetPort = 80,
/// TargetProtocol = "http",
/// CertificateId = cert.Id,
/// CertificateName = cert.Name,
/// },
/// },
/// });
Expand Down Expand Up @@ -165,6 +165,12 @@ public partial class Certificate : Pulumi.CustomResource
[Output("type")]
public Output<string?> Type { get; private set; } = null!;

/// <summary>
/// The UUID of the certificate
/// </summary>
[Output("uuid")]
public Output<string> Uuid { get; private set; } = null!;


/// <summary>
/// Create a Certificate resource with the given unique name, arguments, and options.
Expand Down Expand Up @@ -331,6 +337,12 @@ public InputList<string> Domains
[Input("type")]
public Input<string>? Type { get; set; }

/// <summary>
/// The UUID of the certificate
/// </summary>
[Input("uuid")]
public Input<string>? Uuid { get; set; }

public CertificateState()
{
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/dotnet/GetApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public sealed class GetAppResult
/// <summary>
/// A DigitalOcean App spec describing the app.
/// </summary>
public readonly Outputs.GetAppSpecResult Spec;
public readonly ImmutableArray<Outputs.GetAppSpecResult> Specs;
/// <summary>
/// The date and time of when the app was last updated.
/// </summary>
Expand All @@ -108,7 +108,7 @@ private GetAppResult(

string liveUrl,

Outputs.GetAppSpecResult spec,
ImmutableArray<Outputs.GetAppSpecResult> specs,

string updatedAt)
{
Expand All @@ -118,7 +118,7 @@ private GetAppResult(
DefaultIngress = defaultIngress;
Id = id;
LiveUrl = liveUrl;
Spec = spec;
Specs = specs;
UpdatedAt = updatedAt;
}
}
Expand Down
39 changes: 5 additions & 34 deletions sdk/dotnet/GetCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ namespace Pulumi.DigitalOcean
{
public static class GetCertificate
{
/// <summary>
/// Get information on a certificate. This data source provides the name, type, state,
/// domains, expiry date, and the sha1 fingerprint as configured on your DigitalOcean account.
/// This is useful if the certificate in question is not managed by this provider or you need to utilize
/// any of the certificates data.
///
/// An error is triggered if the provided certificate name does not exist.
///
/// {{% examples %}}
/// ## Example Usage
/// {{% example %}}
///
/// Get the certificate:
///
/// ```csharp
/// using Pulumi;
/// using DigitalOcean = Pulumi.DigitalOcean;
///
/// class MyStack : Stack
/// {
/// public MyStack()
/// {
/// var example = Output.Create(DigitalOcean.GetCertificate.InvokeAsync(new DigitalOcean.GetCertificateArgs
/// {
/// Name = "example",
/// }));
/// }
///
/// }
/// ```
/// {{% /example %}}
/// {{% /examples %}}
/// </summary>
public static Task<GetCertificateResult> InvokeAsync(GetCertificateArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetCertificateResult>("digitalocean:index/getCertificate:getCertificate", args ?? new GetCertificateArgs(), options.WithVersion());
}
Expand Down Expand Up @@ -76,6 +43,7 @@ public sealed class GetCertificateResult
public readonly string Sha1Fingerprint;
public readonly string State;
public readonly string Type;
public readonly string Uuid;

[OutputConstructor]
private GetCertificateResult(
Expand All @@ -91,7 +59,9 @@ private GetCertificateResult(

string state,

string type)
string type,

string uuid)
{
Domains = domains;
Id = id;
Expand All @@ -100,6 +70,7 @@ private GetCertificateResult(
Sha1Fingerprint = sha1Fingerprint;
State = state;
Type = type;
Uuid = uuid;
}
}
}
34 changes: 0 additions & 34 deletions sdk/dotnet/GetContainerRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,6 @@ namespace Pulumi.DigitalOcean
{
public static class GetContainerRegistry
{
/// <summary>
/// Get information on a container registry. This data source provides the name as
/// configured on your DigitalOcean account. This is useful if the container
/// registry name in question is not managed by this provider or you need validate if
/// the container registry exists in the account.
///
/// An error is triggered if the provided container registry name does not exist.
///
/// {{% examples %}}
/// ## Example Usage
/// {{% example %}}
/// ### Basic Example
///
/// Get the container registry:
///
/// ```csharp
/// using Pulumi;
/// using DigitalOcean = Pulumi.DigitalOcean;
///
/// class MyStack : Stack
/// {
/// public MyStack()
/// {
/// var example = Output.Create(DigitalOcean.GetContainerRegistry.InvokeAsync(new DigitalOcean.GetContainerRegistryArgs
/// {
/// Name = "example",
/// }));
/// }
///
/// }
/// ```
/// {{% /example %}}
/// {{% /examples %}}
/// </summary>
public static Task<GetContainerRegistryResult> InvokeAsync(GetContainerRegistryArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetContainerRegistryResult>("digitalocean:index/getContainerRegistry:getContainerRegistry", args ?? new GetContainerRegistryArgs(), options.WithVersion());
}
Expand Down
Loading

0 comments on commit 6eaf2a1

Please sign in to comment.