Skip to content

Commit

Permalink
Apply ID type overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Jul 16, 2024
1 parent ab7d23f commit c3ba50f
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 35 deletions.
6 changes: 3 additions & 3 deletions examples/record/csharp/MyStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class MyStack : Stack
{
public MyStack()
{
var record = new Record("test", new RecordArgs()
var record = new ZoneRecord("test", new ZoneRecordArgs()
{
Ttl = "3600",
Domain = "stack72.dev",
Ttl = 3600,
ZoneName = "stack72.dev",
Name = "test-csharp",
Type = "A",
Value = "192.168.0.1",
Expand Down
16 changes: 10 additions & 6 deletions examples/record/py/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import pulumi
import pulumi_dnsimple as dnsimple

foobar = dnsimple.Record("foobar",
domain="stack72.dev",
name="test-py",
ttl=3600,
type="A",
value="192.168.0.11")
record = dnsimple.ZoneRecord(
"foobar",
zone_name="stack72.dev",
name="test-py",
ttl=3600,
type="A",
value="192.168.0.11",
)

pulumi.export("record_urn", record.urn)
6 changes: 3 additions & 3 deletions examples/record/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

import * as dnsimple from "@pulumi/dnsimple";

let record = new dnsimple.Record("test", {
let record = new dnsimple.ZoneRecord("test", {
zoneName: "stack72.dev",
name: "test-ts",
domain: "stack72.dev",
value: "api.devflix.watch.herokudns.com",
type: dnsimple.RecordTypes.CNAME,
value: "api.devflix.watch.herokudns.com"
});

export default record.urn;
18 changes: 10 additions & 8 deletions provider/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/pulumi/pulumi-dnsimple/provider/v3

go 1.21
go 1.21.12

toolchain go1.22.4

require (
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.0
github.com/pulumi/pulumi/sdk/v3 v3.121.0
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.1-0.20240716170737-752fc0bbe4b0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.1-0.20240716170737-752fc0bbe4b0
github.com/terraform-providers/terraform-provider-dnsimple v0.0.0
)

Expand Down Expand Up @@ -101,10 +102,10 @@ require (
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
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect
Expand Down Expand Up @@ -172,8 +173,9 @@ require (
github.com/pulumi/inflector v0.1.1 // indirect
github.com/pulumi/pulumi-java/pkg v0.11.0 // indirect
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 // indirect
github.com/pulumi/pulumi-yaml v1.8.0 // indirect
github.com/pulumi/pulumi/pkg/v3 v3.121.0 // 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/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand Down
31 changes: 16 additions & 15 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,15 @@ github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUK
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs=
github.com/hashicorp/go-getter v1.7.5 h1:dT58k9hQ/vbxNMwoI5+xFYAJuv6152UNvdHokfI5wE4=
github.com/hashicorp/go-getter v1.7.5/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A=
github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
Expand Down Expand Up @@ -579,6 +578,8 @@ github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRy
github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk=
github.com/hashicorp/terraform-plugin-framework v1.6.0 h1:hMPWoCiNGR+yzoDlXtZ/meGlUOCn8r1OFuPG84MkhWg=
github.com/hashicorp/terraform-plugin-framework v1.6.0/go.mod h1:QRG6J+m5QBJum+lzKi0Ci2CB8a/xflS3T/aWoz8WD4Y=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg=
github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co=
github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ=
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
Expand Down Expand Up @@ -745,18 +746,18 @@ github.com/pulumi/providertest v0.0.11 h1:mg8MQ7Cq7+9XlHIkBD+aCqQO4mwAJEISngZgVd
github.com/pulumi/providertest v0.0.11/go.mod h1:HsxjVsytcMIuNj19w1lT2W0QXY0oReXl1+h6eD2JXP8=
github.com/pulumi/pulumi-java/pkg v0.11.0 h1:Jw9gBvyfmfOMq/EkYDm9+zGPxsDAA8jfeMpHmtZ+1oA=
github.com/pulumi/pulumi-java/pkg v0.11.0/go.mod h1:sXAk25P47AQVQL6ilAbFmRNgZykC7og/+87ihnqzFTc=
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.0 h1:yV5LHLTF878wKMQcHVTqKRShaeJTX7ee36pL3cVvCLs=
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.0/go.mod h1:teMSjww/2MdNvGTbtLNrjMDkGXteRJso/1iViv8AnCI=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.0 h1:55ydBXwbNpL+eAPExJSfL1pSDUuPNSGCU08EamVh3qg=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.0/go.mod h1:jyywJUc4gFP5vWOar8qSQWzSrpwht7XDrYQtVvneza4=
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.1-0.20240716170737-752fc0bbe4b0 h1:t53FEUOxHs/oBTd1Ed164zrZO7P5H46g7D1sn5QP4rA=
github.com/pulumi/pulumi-terraform-bridge/pf v0.39.1-0.20240716170737-752fc0bbe4b0/go.mod h1:3UtoFJ/+ZfnKBNjzk+FSzxv4HMAAf4OYAXRHZd1337A=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.1-0.20240716170737-752fc0bbe4b0 h1:1EcUJCh5JHRTdTH/REV21sTWhYOPiHkhmbtwtmoD2T0=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.86.1-0.20240716170737-752fc0bbe4b0/go.mod h1:YuSO+tedA16nS7/6YkWAEmO11/mh/Hn+hohH/SVZp58=
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8 h1:mav2tSitA9BPJPLLahKgepHyYsMzwaTm4cvp0dcTMYw=
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.8/go.mod h1:qUYk2c9i/yqMGNj9/bQyXpS39BxNDSXYjVN1njnq0zY=
github.com/pulumi/pulumi-yaml v1.8.0 h1:bhmidiCMMuzsJao5FE0UR69iF3WVKPCFrRkzjotFNn4=
github.com/pulumi/pulumi-yaml v1.8.0/go.mod h1:pCfYHSRmdl+5dM/7eT2uDQS528YOhAhiqbn9pwRzW20=
github.com/pulumi/pulumi/pkg/v3 v3.121.0 h1:cLUQJYGJKfgCY0ubJo8dVwmsIm2WcgTprb9Orc/yiFg=
github.com/pulumi/pulumi/pkg/v3 v3.121.0/go.mod h1:aaRixfKOh4DhGtuDJcI56dTPkb7oJBgRgH1aMF1FzbU=
github.com/pulumi/pulumi/sdk/v3 v3.121.0 h1:UsnFKIVOtJN/hQKPkWHL9cZktewPVQRbNUXbXQY/qrk=
github.com/pulumi/pulumi/sdk/v3 v3.121.0/go.mod h1:p1U24en3zt51agx+WlNboSOV8eLlPWYAkxMzVEXKbnY=
github.com/pulumi/pulumi-yaml v1.9.1 h1:JPeI80M23SPactxgnCFS1casZlSr7ZhAXwSx4H55QQ4=
github.com/pulumi/pulumi-yaml v1.9.1/go.mod h1:OH0R34yJxA5u6zjYBN4JXcWoEvfkRoOVWi6viu8buoA=
github.com/pulumi/pulumi/pkg/v3 v3.124.0 h1:JgUePx6Ga9geBJ1dku6K8GXTrsBYzXMhKIsk+cxeKo8=
github.com/pulumi/pulumi/pkg/v3 v3.124.0/go.mod h1:/XUDPNoIikS3lcQe1HpGuKs73cO5HqBvOdxXFeC3UHM=
github.com/pulumi/pulumi/sdk/v3 v3.124.0 h1:f9Rb2AhLSaacKTaBPbKXPCfviHxTuhEXafhT4E095Y0=
github.com/pulumi/pulumi/sdk/v3 v3.124.0/go.mod h1:p1U24en3zt51agx+WlNboSOV8eLlPWYAkxMzVEXKbnY=
github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo=
github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k=
github.com/pulumi/terraform-diff-reader v0.0.2 h1:kTE4nEXU3/SYXESvAIem+wyHMI3abqkI3OhJ0G04LLI=
Expand Down
13 changes: 13 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
pfbridge "github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"

"github.com/pulumi/pulumi-dnsimple/provider/v3/pkg/version"
)
Expand Down Expand Up @@ -100,6 +101,18 @@ func Provider() tfbridge.ProviderInfo {

prov.MustComputeTokens(tfbridgetokens.SingleModule("dnsimple_", mainMod,
tfbridgetokens.MakeStandard(mainPkg)))

prov.P.ResourcesMap().Range(func(key string, value shim.Resource) bool {
if value.Schema().Get("id").Type() != shim.TypeString {
r := prov.Resources[key]
if r.Fields == nil {
r.Fields = make(map[string]*tfbridge.SchemaInfo, 1)
}
r.Fields["id"] = &tfbridge.SchemaInfo{Type: "string"}
}
return true
})

prov.MustApplyAutoAliases()

return prov
Expand Down

0 comments on commit c3ba50f

Please sign in to comment.