Skip to content

Commit 2e46f66

Browse files
authored
Merge pull request #125 from pulumi/stack72/v1.14.0
Upgrade to v1.14.0 of the Postgresql Terraform Provider
2 parents 8c46d58 + 3f716d6 commit 2e46f66

30 files changed

+1819
-76
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## HEAD (Unreleased)
2-
_(none)_
2+
* Upgrade to v1.14.0 Postgresql Terraform Provider
33

44
---
55

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

Lines changed: 129 additions & 12 deletions
Large diffs are not rendered by default.

provider/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ require (
1010
github.com/pulumi/pulumi/sdk/v3 v3.0.0
1111
)
1212

13-
replace github.com/cyrilgdn/terraform-provider-postgresql => github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210521144903-50145d01c91a
13+
replace github.com/cyrilgdn/terraform-provider-postgresql => github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210901153353-a48f7e688aca

provider/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210427104043-992355c
717717
github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210427104043-992355c7085a/go.mod h1:AkUW9q5G+E3/IWW2gxKbmN1y9L2AKw1LvPGFG8rtmko=
718718
github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210521144903-50145d01c91a h1:4gWyO/dRvNybvzYnQpd20OK7fR3YNMj/yedTc6ancDQ=
719719
github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210521144903-50145d01c91a/go.mod h1:AkUW9q5G+E3/IWW2gxKbmN1y9L2AKw1LvPGFG8rtmko=
720+
github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210901153353-a48f7e688aca h1:TM7WIoXxN75bKIJJZzDFhHou/jWUXMTGOffUKDvUttA=
721+
github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20210901153353-a48f7e688aca/go.mod h1:AkUW9q5G+E3/IWW2gxKbmN1y9L2AKw1LvPGFG8rtmko=
720722
github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=
721723
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
722724
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=

provider/resources.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ func Provider() tfbridge.ProviderInfo {
9191
},
9292
PreConfigureCallback: preConfigureCallback,
9393
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")},
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")},
99101
"postgresql_grant_role": {
100102
Tok: makeResource(mainMod, "GrantRole"),
101103
Fields: map[string]*tfbridge.SchemaInfo{
@@ -131,8 +133,7 @@ func Provider() tfbridge.ProviderInfo {
131133
},
132134
CSharp: &tfbridge.CSharpInfo{
133135
PackageReferences: map[string]string{
134-
"Pulumi": "3.*",
135-
"System.Collections.Immutable": "1.6.0",
136+
"Pulumi": "3.*",
136137
},
137138
Namespaces: map[string]string{
138139
mainPkg: "PostgreSql",

sdk/dotnet/DefaultPrivileges.cs

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

6565
/// <summary>
66-
/// The list of privileges to apply as default privileges.
66+
/// The list of privileges to apply as default privileges. An empty list could be provided to revoke all default privileges for this role.
6767
/// </summary>
6868
[Output("privileges")]
6969
public Output<ImmutableArray<string>> Privileges { get; private set; } = null!;
@@ -158,7 +158,7 @@ public sealed class DefaultPrivilegesArgs : Pulumi.ResourceArgs
158158
private InputList<string>? _privileges;
159159

160160
/// <summary>
161-
/// The list of privileges to apply as default privileges.
161+
/// The list of privileges to apply as default privileges. An empty list could be provided to revoke all default privileges for this role.
162162
/// </summary>
163163
public InputList<string> Privileges
164164
{
@@ -213,7 +213,7 @@ public sealed class DefaultPrivilegesState : Pulumi.ResourceArgs
213213
private InputList<string>? _privileges;
214214

215215
/// <summary>
216-
/// The list of privileges to apply as default privileges.
216+
/// The list of privileges to apply as default privileges. An empty list could be provided to revoke all default privileges for this role.
217217
/// </summary>
218218
public InputList<string> Privileges
219219
{

sdk/dotnet/Extension.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ namespace Pulumi.PostgreSql
3434
[PostgreSqlResourceType("postgresql:index/extension:Extension")]
3535
public partial class Extension : Pulumi.CustomResource
3636
{
37+
/// <summary>
38+
/// When true, will also create any extensions that this extension depends on that are not already installed. (Default: false)
39+
/// </summary>
40+
[Output("createCascade")]
41+
public Output<bool?> CreateCascade { get; private set; } = null!;
42+
3743
/// <summary>
3844
/// Which database to create the extension on. Defaults to provider database.
3945
/// </summary>
@@ -110,6 +116,12 @@ public static Extension Get(string name, Input<string> id, ExtensionState? state
110116

111117
public sealed class ExtensionArgs : Pulumi.ResourceArgs
112118
{
119+
/// <summary>
120+
/// When true, will also create any extensions that this extension depends on that are not already installed. (Default: false)
121+
/// </summary>
122+
[Input("createCascade")]
123+
public Input<bool>? CreateCascade { get; set; }
124+
113125
/// <summary>
114126
/// Which database to create the extension on. Defaults to provider database.
115127
/// </summary>
@@ -147,6 +159,12 @@ public ExtensionArgs()
147159

148160
public sealed class ExtensionState : Pulumi.ResourceArgs
149161
{
162+
/// <summary>
163+
/// When true, will also create any extensions that this extension depends on that are not already installed. (Default: false)
164+
/// </summary>
165+
[Input("createCascade")]
166+
public Input<bool>? CreateCascade { get; set; }
167+
150168
/// <summary>
151169
/// Which database to create the extension on. Defaults to provider database.
152170
/// </summary>

sdk/dotnet/Grant.cs

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ namespace Pulumi.PostgreSql
3030
/// {
3131
/// Database = "test_db",
3232
/// ObjectType = "table",
33+
/// Objects =
34+
/// {
35+
/// "table1",
36+
/// "table2",
37+
/// },
3338
/// Privileges =
3439
/// {
3540
/// "SELECT",
@@ -77,11 +82,17 @@ public partial class Grant : Pulumi.CustomResource
7782
public Output<string> Database { get; private set; } = null!;
7883

7984
/// <summary>
80-
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
85+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence, function, foreign_data_wrapper, foreign_server).
8186
/// </summary>
8287
[Output("objectType")]
8388
public Output<string> ObjectType { get; private set; } = null!;
8489

90+
/// <summary>
91+
/// The objects upon which to grant the privileges. An empty list (the default) means to grant permissions on *all* objects of the specified type. You cannot specify this option if the `object_type` is `database` or `schema`.
92+
/// </summary>
93+
[Output("objects")]
94+
public Output<ImmutableArray<string>> Objects { get; private set; } = null!;
95+
8596
/// <summary>
8697
/// The list of privileges to grant. There are different kinds of privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE. An empty list could be provided to revoke all privileges for this role.
8798
/// </summary>
@@ -101,7 +112,7 @@ public partial class Grant : Pulumi.CustomResource
101112
public Output<string?> Schema { get; private set; } = null!;
102113

103114
/// <summary>
104-
/// Permit the grant recipient to grant it to others
115+
/// Whether the recipient of these privileges can grant the same privileges to others. Defaults to false.
105116
/// </summary>
106117
[Output("withGrantOption")]
107118
public Output<bool?> WithGrantOption { get; private set; } = null!;
@@ -159,11 +170,23 @@ public sealed class GrantArgs : Pulumi.ResourceArgs
159170
public Input<string> Database { get; set; } = null!;
160171

161172
/// <summary>
162-
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
173+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence, function, foreign_data_wrapper, foreign_server).
163174
/// </summary>
164175
[Input("objectType", required: true)]
165176
public Input<string> ObjectType { get; set; } = null!;
166177

178+
[Input("objects")]
179+
private InputList<string>? _objects;
180+
181+
/// <summary>
182+
/// The objects upon which to grant the privileges. An empty list (the default) means to grant permissions on *all* objects of the specified type. You cannot specify this option if the `object_type` is `database` or `schema`.
183+
/// </summary>
184+
public InputList<string> Objects
185+
{
186+
get => _objects ?? (_objects = new InputList<string>());
187+
set => _objects = value;
188+
}
189+
167190
[Input("privileges", required: true)]
168191
private InputList<string>? _privileges;
169192

@@ -189,7 +212,7 @@ public InputList<string> Privileges
189212
public Input<string>? Schema { get; set; }
190213

191214
/// <summary>
192-
/// Permit the grant recipient to grant it to others
215+
/// Whether the recipient of these privileges can grant the same privileges to others. Defaults to false.
193216
/// </summary>
194217
[Input("withGrantOption")]
195218
public Input<bool>? WithGrantOption { get; set; }
@@ -208,11 +231,23 @@ public sealed class GrantState : Pulumi.ResourceArgs
208231
public Input<string>? Database { get; set; }
209232

210233
/// <summary>
211-
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
234+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence, function, foreign_data_wrapper, foreign_server).
212235
/// </summary>
213236
[Input("objectType")]
214237
public Input<string>? ObjectType { get; set; }
215238

239+
[Input("objects")]
240+
private InputList<string>? _objects;
241+
242+
/// <summary>
243+
/// The objects upon which to grant the privileges. An empty list (the default) means to grant permissions on *all* objects of the specified type. You cannot specify this option if the `object_type` is `database` or `schema`.
244+
/// </summary>
245+
public InputList<string> Objects
246+
{
247+
get => _objects ?? (_objects = new InputList<string>());
248+
set => _objects = value;
249+
}
250+
216251
[Input("privileges")]
217252
private InputList<string>? _privileges;
218253

@@ -238,7 +273,7 @@ public InputList<string> Privileges
238273
public Input<string>? Schema { get; set; }
239274

240275
/// <summary>
241-
/// Permit the grant recipient to grant it to others
276+
/// Whether the recipient of these privileges can grant the same privileges to others. Defaults to false.
242277
/// </summary>
243278
[Input("withGrantOption")]
244279
public Input<bool>? WithGrantOption { get; set; }
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
2+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Collections.Immutable;
7+
using System.Threading.Tasks;
8+
using Pulumi.Serialization;
9+
10+
namespace Pulumi.PostgreSql
11+
{
12+
/// <summary>
13+
/// The ``postgresql.PhysicalReplicationSlot`` resource creates and manages a physical replication slot on a PostgreSQL
14+
/// server. This is useful to setup a cross datacenter replication, with Patroni for example, or permit
15+
/// any stand-by cluster to replicate physically data.
16+
/// </summary>
17+
[PostgreSqlResourceType("postgresql:index/physicalReplicationSlot:PhysicalReplicationSlot")]
18+
public partial class PhysicalReplicationSlot : Pulumi.CustomResource
19+
{
20+
/// <summary>
21+
/// The name of the replication slot.
22+
/// </summary>
23+
[Output("name")]
24+
public Output<string> Name { get; private set; } = null!;
25+
26+
27+
/// <summary>
28+
/// Create a PhysicalReplicationSlot resource with the given unique name, arguments, and options.
29+
/// </summary>
30+
///
31+
/// <param name="name">The unique name of the resource</param>
32+
/// <param name="args">The arguments used to populate this resource's properties</param>
33+
/// <param name="options">A bag of options that control this resource's behavior</param>
34+
public PhysicalReplicationSlot(string name, PhysicalReplicationSlotArgs? args = null, CustomResourceOptions? options = null)
35+
: base("postgresql:index/physicalReplicationSlot:PhysicalReplicationSlot", name, args ?? new PhysicalReplicationSlotArgs(), MakeResourceOptions(options, ""))
36+
{
37+
}
38+
39+
private PhysicalReplicationSlot(string name, Input<string> id, PhysicalReplicationSlotState? state = null, CustomResourceOptions? options = null)
40+
: base("postgresql:index/physicalReplicationSlot:PhysicalReplicationSlot", name, state, MakeResourceOptions(options, id))
41+
{
42+
}
43+
44+
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
45+
{
46+
var defaultOptions = new CustomResourceOptions
47+
{
48+
Version = Utilities.Version,
49+
};
50+
var merged = CustomResourceOptions.Merge(defaultOptions, options);
51+
// Override the ID if one was specified for consistency with other language SDKs.
52+
merged.Id = id ?? merged.Id;
53+
return merged;
54+
}
55+
/// <summary>
56+
/// Get an existing PhysicalReplicationSlot resource's state with the given name, ID, and optional extra
57+
/// properties used to qualify the lookup.
58+
/// </summary>
59+
///
60+
/// <param name="name">The unique name of the resulting resource.</param>
61+
/// <param name="id">The unique provider ID of the resource to lookup.</param>
62+
/// <param name="state">Any extra arguments used during the lookup.</param>
63+
/// <param name="options">A bag of options that control this resource's behavior</param>
64+
public static PhysicalReplicationSlot Get(string name, Input<string> id, PhysicalReplicationSlotState? state = null, CustomResourceOptions? options = null)
65+
{
66+
return new PhysicalReplicationSlot(name, id, state, options);
67+
}
68+
}
69+
70+
public sealed class PhysicalReplicationSlotArgs : Pulumi.ResourceArgs
71+
{
72+
/// <summary>
73+
/// The name of the replication slot.
74+
/// </summary>
75+
[Input("name")]
76+
public Input<string>? Name { get; set; }
77+
78+
public PhysicalReplicationSlotArgs()
79+
{
80+
}
81+
}
82+
83+
public sealed class PhysicalReplicationSlotState : Pulumi.ResourceArgs
84+
{
85+
/// <summary>
86+
/// The name of the replication slot.
87+
/// </summary>
88+
[Input("name")]
89+
public Input<string>? Name { get; set; }
90+
91+
public PhysicalReplicationSlotState()
92+
{
93+
}
94+
}
95+
}

sdk/dotnet/Pulumi.PostgreSql.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
<ItemGroup>
3838
<PackageReference Include="Pulumi" Version="3.*" />
39-
<PackageReference Include="System.Collections.Immutable" Version="1.6.0" />
4039
</ItemGroup>
4140

4241
<ItemGroup>

0 commit comments

Comments
 (0)