@@ -28,6 +28,7 @@ import (
28
28
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
29
29
tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
30
30
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
31
+ "github.com/pulumi/pulumi/sdk/v3/go/common/resource"
31
32
32
33
"github.com/pulumi/pulumi-cloudflare/provider/v5/pkg/version"
33
34
)
@@ -51,6 +52,11 @@ func Provider() tfbridge.ProviderInfo {
51
52
provShim .PFProvider (),
52
53
)
53
54
55
+ delegateID := func (pulumiField string ) tfbridge.ComputeID {
56
+ return tfbridge .DelegateIDField (resource .PropertyKey (pulumiField ),
57
+ "cloudflare" , "https://github.com/pulumi/pulumi-cloudflare" )
58
+ }
59
+
54
60
// Create a Pulumi provider mapping
55
61
prov := tfbridge.ProviderInfo {
56
62
P : p ,
@@ -115,6 +121,25 @@ func Provider() tfbridge.ProviderInfo {
115
121
// resource will conflict with the old one. To avoid this, we set
116
122
// `DeleteBeforeReplace: true`.
117
123
"cloudflare_record" : {DeleteBeforeReplace : true },
124
+
125
+ "cloudflare_risk_behavior" : {ComputeID : delegateID ("accountId" )},
126
+ // cloudflare_access_mutual_tls_hostname_settings has no
127
+ "cloudflare_access_mutual_tls_hostname_settings" : {
128
+ ComputeID : func (_ context.Context , state resource.PropertyMap ) (resource.ID , error ) {
129
+ account , hasAccount := state ["accountId" ]
130
+ zone , hasZone := state ["zoneId" ]
131
+ switch {
132
+ case hasAccount && hasZone :
133
+ return resource .ID (account .StringValue () + "__" + zone .StringValue ()), nil
134
+ case hasAccount :
135
+ return resource .ID (account .StringValue ()), nil
136
+ case hasZone :
137
+ return resource .ID (zone .StringValue ()), nil
138
+ default :
139
+ return "id" , nil
140
+ }
141
+ },
142
+ },
118
143
},
119
144
JavaScript : & tfbridge.JavaScriptInfo {
120
145
Dependencies : map [string ]string {
0 commit comments