Skip to content

Commit ffaf199

Browse files
authored
Merge pull request #194 from pulumi/upgrade-terraform-provider-postgresql-to-v1.18.0
Upgrade terraform-provider-postgresql to v1.18.0
2 parents a9cbdc4 + b68c518 commit ffaf199

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+6535
-86
lines changed

provider/cmd/pulumi-resource-postgresql/schema.json

Lines changed: 326 additions & 6 deletions
Large diffs are not rendered by default.

provider/resources.go

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"github.com/cyrilgdn/terraform-provider-postgresql/postgresql"
2323
"github.com/pulumi/pulumi-postgresql/provider/v3/pkg/version"
2424
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
25-
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
25+
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/x"
2626
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
27-
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
2827
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
28+
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
2929
)
3030

3131
// all of the token components used below.
@@ -54,14 +54,6 @@ func makeResource(mod string, res string) tokens.Type {
5454
return makeType(mod+"/"+fn, res)
5555
}
5656

57-
// preConfigureCallback is called before the providerConfigure function of the underlying provider.
58-
// It should validate that the provider can be configured, and provide actionable errors in the case
59-
// it cannot be. Configuration variables can be read from `vars` using the `stringValue` function -
60-
// for example `stringValue(vars, "accessKey")`.
61-
func preConfigureCallback(vars resource.PropertyMap, c shim.ResourceConfig) error {
62-
return nil
63-
}
64-
6557
// Provider returns additional overlaid schema and metadata associated with the provider..
6658
func Provider() tfbridge.ProviderInfo {
6759
p := shimv2.NewProvider(postgresql.Provider())
@@ -89,17 +81,7 @@ func Provider() tfbridge.ProviderInfo {
8981
},
9082
},
9183
},
92-
PreConfigureCallback: preConfigureCallback,
9384
Resources: map[string]*tfbridge.ResourceInfo{
94-
"postgresql_database": {Tok: makeResource(mainMod, "Database")},
95-
"postgresql_extension": {Tok: makeResource(mainMod, "Extension")},
96-
"postgresql_grant": {Tok: makeResource(mainMod, "Grant")},
97-
"postgresql_role": {Tok: makeResource(mainMod, "Role")},
98-
"postgresql_schema": {Tok: makeResource(mainMod, "Schema")},
99-
"postgresql_physical_replication_slot": {Tok: makeResource(mainMod, "PhysicalReplicationSlot")},
100-
"postgresql_replication_slot": {Tok: makeResource(mainMod, "ReplicationSlot")},
101-
"postgresql_function": {Tok: makeResource(mainMod, "Function")},
102-
"postgresql_publication": {Tok: makeResource(mainMod, "Publication")},
10385
"postgresql_grant_role": {
10486
Tok: makeResource(mainMod, "GrantRole"),
10587
Fields: map[string]*tfbridge.SchemaInfo{
@@ -109,7 +91,6 @@ func Provider() tfbridge.ProviderInfo {
10991
},
11092
},
11193
},
112-
DataSources: map[string]*tfbridge.DataSourceInfo{},
11394
JavaScript: &tfbridge.JavaScriptInfo{
11495
Dependencies: map[string]string{
11596
"@pulumi/pulumi": "^3.0.0",
@@ -150,6 +131,9 @@ func Provider() tfbridge.ProviderInfo {
150131
},
151132
})
152133

134+
err := x.ComputeDefaults(&prov, x.TokensSingleModule("postgresql_", mainMod, x.MakeStandardToken(mainPkg)))
135+
contract.AssertNoErrorf(err, "Failed to map tokens")
136+
153137
prov.SetAutonaming(255, "-")
154138

155139
return prov

sdk/dotnet/Config/Config.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ public static string? AwsRdsIamProfile
5353
set => _awsRdsIamProfile.Set(value);
5454
}
5555

56+
private static readonly __Value<string?> _awsRdsIamRegion = new __Value<string?>(() => __config.Get("awsRdsIamRegion"));
57+
/// <summary>
58+
/// AWS region to use for IAM auth
59+
/// </summary>
60+
public static string? AwsRdsIamRegion
61+
{
62+
get => _awsRdsIamRegion.Get();
63+
set => _awsRdsIamRegion.Set(value);
64+
}
65+
5666
private static readonly __Value<Pulumi.PostgreSql.Config.Types.Clientcert?> _clientcert = new __Value<Pulumi.PostgreSql.Config.Types.Clientcert?>(() => __config.GetObject<Pulumi.PostgreSql.Config.Types.Clientcert>("clientcert"));
5767
/// <summary>
5868
/// SSL client certificate if required by the database.

sdk/dotnet/DefaultPrivileg.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public partial class DefaultPrivileg : global::Pulumi.CustomResource
7373
public Output<string> Database { get; private set; } = null!;
7474

7575
/// <summary>
76-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
76+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
7777
/// </summary>
7878
[Output("objectType")]
7979
public Output<string> ObjectType { get; private set; } = null!;
@@ -161,7 +161,7 @@ public sealed class DefaultPrivilegArgs : global::Pulumi.ResourceArgs
161161
public Input<string> Database { get; set; } = null!;
162162

163163
/// <summary>
164-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
164+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
165165
/// </summary>
166166
[Input("objectType", required: true)]
167167
public Input<string> ObjectType { get; set; } = null!;
@@ -217,7 +217,7 @@ public sealed class DefaultPrivilegState : global::Pulumi.ResourceArgs
217217
public Input<string>? Database { get; set; }
218218

219219
/// <summary>
220-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
220+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
221221
/// </summary>
222222
[Input("objectType")]
223223
public Input<string>? ObjectType { get; set; }

sdk/dotnet/DefaultPrivileges.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public partial class DefaultPrivileges : global::Pulumi.CustomResource
7272
public Output<string> Database { get; private set; } = null!;
7373

7474
/// <summary>
75-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
75+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
7676
/// </summary>
7777
[Output("objectType")]
7878
public Output<string> ObjectType { get; private set; } = null!;
@@ -164,7 +164,7 @@ public sealed class DefaultPrivilegesArgs : global::Pulumi.ResourceArgs
164164
public Input<string> Database { get; set; } = null!;
165165

166166
/// <summary>
167-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
167+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
168168
/// </summary>
169169
[Input("objectType", required: true)]
170170
public Input<string> ObjectType { get; set; } = null!;
@@ -220,7 +220,7 @@ public sealed class DefaultPrivilegesState : global::Pulumi.ResourceArgs
220220
public Input<string>? Database { get; set; }
221221

222222
/// <summary>
223-
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
223+
/// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type, schema).
224224
/// </summary>
225225
[Input("objectType")]
226226
public Input<string>? ObjectType { get; set; }

sdk/dotnet/Provider.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public partial class Provider : global::Pulumi.ProviderResource
2424
[Output("awsRdsIamProfile")]
2525
public Output<string?> AwsRdsIamProfile { get; private set; } = null!;
2626

27+
/// <summary>
28+
/// AWS region to use for IAM auth
29+
/// </summary>
30+
[Output("awsRdsIamRegion")]
31+
public Output<string?> AwsRdsIamRegion { get; private set; } = null!;
32+
2733
/// <summary>
2834
/// The name of the database to connect to in order to conenct to (defaults to `postgres`).
2935
/// </summary>
@@ -124,6 +130,12 @@ public sealed class ProviderArgs : global::Pulumi.ResourceArgs
124130
[Input("awsRdsIamProfile")]
125131
public Input<string>? AwsRdsIamProfile { get; set; }
126132

133+
/// <summary>
134+
/// AWS region to use for IAM auth
135+
/// </summary>
136+
[Input("awsRdsIamRegion")]
137+
public Input<string>? AwsRdsIamRegion { get; set; }
138+
127139
/// <summary>
128140
/// SSL client certificate if required by the database.
129141
/// </summary>

0 commit comments

Comments
 (0)