Skip to content

Commit

Permalink
WIP Initial mapping to PF
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Jul 17, 2024
1 parent 55a46d4 commit 3e0b7b1
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 1,786 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "upstream"]
path = upstream
url = https://github.com/dnsimple/terraform-provider-dnsimple.git
ignore = dirty
23 changes: 23 additions & 0 deletions patches/0001-Expose-the-provider-object.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ian Wahbe <[email protected]>
Date: Tue, 16 Jul 2024 13:22:33 -0700
Subject: [PATCH] Expose the provider object


diff --git a/shim/shim.go b/shim/shim.go
new file mode 100644
index 0000000..d37ab92
--- /dev/null
+++ b/shim/shim.go
@@ -0,0 +1,11 @@
+package shim
+
+import (
+ "github.com/hashicorp/terraform-plugin-framework/provider"
+
+ framework "github.com/terraform-providers/terraform-provider-dnsimple/internal/framework/provider"
+)
+
+func Provider(version string) provider.Provider {
+ return framework.New(version)()
+}
2 changes: 0 additions & 2 deletions patches/noop.patch

This file was deleted.

19 changes: 11 additions & 8 deletions provider/cmd/pulumi-resource-dnsimple/bridge-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@
"auto-aliasing": {
"resources": {
"dnsimple_domain": {
"current": "dnsimple:index/domain:Domain"
"current": "dnsimple:index/domain:Domain",
"majorVersion": 3
},
"dnsimple_email_forward": {
"current": "dnsimple:index/emailForward:EmailForward"
"current": "dnsimple:index/emailForward:EmailForward",
"majorVersion": 3
},
"dnsimple_lets_encrypt_certificate": {
"current": "dnsimple:index/letsEncryptCertificate:LetsEncryptCertificate"
},
"dnsimple_record": {
"current": "dnsimple:index/record:Record"
"current": "dnsimple:index/letsEncryptCertificate:LetsEncryptCertificate",
"majorVersion": 3
},
"dnsimple_zone_record": {
"current": "dnsimple:index/zoneRecord:ZoneRecord"
"current": "dnsimple:index/zoneRecord:ZoneRecord",
"majorVersion": 3
}
},
"datasources": {
"dnsimple_certificate": {
"current": "dnsimple:index/getCertificate:getCertificate",
"majorVersion": 3,
"fields": {
"certificate_chain": {
"maxItemsOne": false
}
}
},
"dnsimple_zone": {
"current": "dnsimple:index/getZone:getZone"
"current": "dnsimple:index/getZone:getZone",
"majorVersion": 3
}
}
},
Expand Down
9 changes: 6 additions & 3 deletions provider/cmd/pulumi-resource-dnsimple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
package main

import (
"context"

_ "embed"

"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
"github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge"

dnsimple "github.com/pulumi/pulumi-dnsimple/provider/v3"
"github.com/pulumi/pulumi-dnsimple/provider/v3/pkg/version"
)

//go:embed schema-embed.json
var pulumiSchema []byte

func main() {
// Modify the path to point to the new provider
tfbridge.Main("dnsimple", version.Version, dnsimple.Provider(), pulumiSchema)
tfbridge.Main(context.Background(), "dnsimple", dnsimple.Provider(), tfbridge.ProviderMetadata{
PackageSchema: pulumiSchema,
})
}
284 changes: 91 additions & 193 deletions provider/cmd/pulumi-resource-dnsimple/schema.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions provider/cmd/pulumi-tfgen-dnsimple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
package main

import (
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen"
"github.com/pulumi/pulumi-terraform-bridge/pf/tfgen"

dnsimple "github.com/pulumi/pulumi-dnsimple/provider/v3"
"github.com/pulumi/pulumi-dnsimple/provider/v3/pkg/version"
)

func main() {
tfgen.Main("dnsimple", version.Version, dnsimple.Provider())
tfgen.Main("dnsimple", dnsimple.Provider())
}
12 changes: 4 additions & 8 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/pulumi/pulumi-dnsimple/provider/v3
go 1.21.12

require (
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.87.0
github.com/pulumi/pulumi/sdk/v3 v3.124.0
github.com/terraform-providers/terraform-provider-dnsimple v0.0.0
)

Expand Down Expand Up @@ -69,7 +69,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.5.0 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/dnsimple/dnsimple-go v1.0.0 // indirect
github.com/dnsimple/dnsimple-go v1.2.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/ettle/strcase v0.1.1 // indirect
Expand All @@ -87,7 +87,6 @@ require (
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
Expand All @@ -98,7 +97,6 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-getter v1.7.5 // indirect
Expand All @@ -117,12 +115,11 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.20.0 // indirect
github.com/hashicorp/terraform-json v0.21.0 // indirect
github.com/hashicorp/terraform-plugin-framework v1.6.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/vault/api v1.12.0 // indirect
Expand Down Expand Up @@ -176,8 +173,8 @@ require (
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 // indirect
github.com/pulumi/pulumi-yaml v1.9.1 // indirect
github.com/pulumi/pulumi/pkg/v3 v3.124.0 // indirect
github.com/pulumi/pulumi/sdk/v3 v3.124.0 // indirect
github.com/pulumi/schema-tools v0.1.2 // indirect
github.com/pulumi/terraform-diff-reader v0.0.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand All @@ -199,7 +196,6 @@ require (
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
Expand Down
Loading

0 comments on commit 3e0b7b1

Please sign in to comment.