Skip to content

Commit c198e8a

Browse files
authored
Merge pull request #102 from pulumi/stack72/v1.11.0
2 parents 2dd5b0a + beaffe7 commit c198e8a

File tree

34 files changed

+1190
-80
lines changed

34 files changed

+1190
-80
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.11.1 of the Postgresql Terraform Provider
33

44
---
55

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

Lines changed: 109 additions & 16 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
@@ -9,4 +9,4 @@ require (
99
github.com/terraform-providers/terraform-provider-postgresql v1.7.1
1010
)
1111

12-
replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.3+incompatible
12+
replace github.com/terraform-providers/terraform-provider-postgresql => github.com/cyrilgdn/terraform-provider-postgresql v1.11.1

provider/go.sum

Lines changed: 188 additions & 4 deletions
Large diffs are not rendered by default.

provider/resources.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ func Provider() tfbridge.ProviderInfo {
123123
"postgresql_grant": {Tok: makeResource(mainMod, "Grant")},
124124
"postgresql_role": {Tok: makeResource(mainMod, "Role")},
125125
"postgresql_schema": {Tok: makeResource(mainMod, "Schema")},
126+
"postgresql_grant_role": {
127+
Tok: makeResource(mainMod, "GrantRole"),
128+
Fields: map[string]*tfbridge.SchemaInfo{
129+
"grant_role": {
130+
CSharpName: "GrantRoleName",
131+
},
132+
},
133+
},
126134
},
127135
DataSources: map[string]*tfbridge.DataSourceInfo{},
128136
JavaScript: &tfbridge.JavaScriptInfo{

sdk/dotnet/Config/Config.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static class Config
5353
/// </summary>
5454
public static int? Port { get; set; } = __config.GetInt32("port") ?? Utilities.GetEnvInt32("PGPORT") ?? 5432;
5555

56+
public static string? Scheme { get; set; } = __config.Get("scheme");
57+
5658
public static string? SslMode { get; set; } = __config.Get("sslMode");
5759

5860
/// <summary>

sdk/dotnet/Extension.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public partial class Extension : Pulumi.CustomResource
4040
[Output("database")]
4141
public Output<string> Database { get; private set; } = null!;
4242

43+
/// <summary>
44+
/// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
45+
/// objects
46+
/// </summary>
47+
[Output("dropCascade")]
48+
public Output<bool?> DropCascade { get; private set; } = null!;
49+
4350
/// <summary>
4451
/// The name of the extension.
4552
/// </summary>
@@ -110,6 +117,13 @@ public sealed class ExtensionArgs : Pulumi.ResourceArgs
110117
[Input("database")]
111118
public Input<string>? Database { get; set; }
112119

120+
/// <summary>
121+
/// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
122+
/// objects
123+
/// </summary>
124+
[Input("dropCascade")]
125+
public Input<bool>? DropCascade { get; set; }
126+
113127
/// <summary>
114128
/// The name of the extension.
115129
/// </summary>
@@ -141,6 +155,13 @@ public sealed class ExtensionState : Pulumi.ResourceArgs
141155
[Input("database")]
142156
public Input<string>? Database { get; set; }
143157

158+
/// <summary>
159+
/// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
160+
/// objects
161+
/// </summary>
162+
[Input("dropCascade")]
163+
public Input<bool>? DropCascade { get; set; }
164+
144165
/// <summary>
145166
/// The name of the extension.
146167
/// </summary>

sdk/dotnet/Grant.cs

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,31 @@ namespace Pulumi.PostgreSql
4141
///
4242
/// }
4343
/// ```
44+
///
45+
/// ## Examples
46+
///
47+
/// Revoke default accesses for public schema:
48+
///
49+
/// ```csharp
50+
/// using Pulumi;
51+
/// using PostgreSql = Pulumi.PostgreSql;
52+
///
53+
/// class MyStack : Stack
54+
/// {
55+
/// public MyStack()
56+
/// {
57+
/// var revokePublic = new PostgreSql.Grant("revokePublic", new PostgreSql.GrantArgs
58+
/// {
59+
/// Database = "test_db",
60+
/// ObjectType = "schema",
61+
/// Privileges = {},
62+
/// Role = "public",
63+
/// Schema = "public",
64+
/// });
65+
/// }
66+
///
67+
/// }
68+
/// ```
4469
/// </summary>
4570
[PostgreSqlResourceType("postgresql:index/grant:Grant")]
4671
public partial class Grant : Pulumi.CustomResource
@@ -52,25 +77,25 @@ public partial class Grant : Pulumi.CustomResource
5277
public Output<string> Database { get; private set; } = null!;
5378

5479
/// <summary>
55-
/// The PostgreSQL object type to grant the privileges on (one of: database, table, sequence,function).
80+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
5681
/// </summary>
5782
[Output("objectType")]
5883
public Output<string> ObjectType { get; private set; } = null!;
5984

6085
/// <summary>
61-
/// 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.
86+
/// 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.
6287
/// </summary>
6388
[Output("privileges")]
6489
public Output<ImmutableArray<string>> Privileges { get; private set; } = null!;
6590

6691
/// <summary>
67-
/// The name of the role to grant privileges on.
92+
/// The name of the role to grant privileges on, Set it to "public" for all roles.
6893
/// </summary>
6994
[Output("role")]
7095
public Output<string> Role { get; private set; } = null!;
7196

7297
/// <summary>
73-
/// The database schema to grant privileges on for this role.
98+
/// The database schema to grant privileges on for this role (Required except if object_type is "database")
7499
/// </summary>
75100
[Output("schema")]
76101
public Output<string?> Schema { get; private set; } = null!;
@@ -134,7 +159,7 @@ public sealed class GrantArgs : Pulumi.ResourceArgs
134159
public Input<string> Database { get; set; } = null!;
135160

136161
/// <summary>
137-
/// The PostgreSQL object type to grant the privileges on (one of: database, table, sequence,function).
162+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
138163
/// </summary>
139164
[Input("objectType", required: true)]
140165
public Input<string> ObjectType { get; set; } = null!;
@@ -143,7 +168,7 @@ public sealed class GrantArgs : Pulumi.ResourceArgs
143168
private InputList<string>? _privileges;
144169

145170
/// <summary>
146-
/// 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.
171+
/// 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.
147172
/// </summary>
148173
public InputList<string> Privileges
149174
{
@@ -152,13 +177,13 @@ public InputList<string> Privileges
152177
}
153178

154179
/// <summary>
155-
/// The name of the role to grant privileges on.
180+
/// The name of the role to grant privileges on, Set it to "public" for all roles.
156181
/// </summary>
157182
[Input("role", required: true)]
158183
public Input<string> Role { get; set; } = null!;
159184

160185
/// <summary>
161-
/// The database schema to grant privileges on for this role.
186+
/// The database schema to grant privileges on for this role (Required except if object_type is "database")
162187
/// </summary>
163188
[Input("schema")]
164189
public Input<string>? Schema { get; set; }
@@ -183,7 +208,7 @@ public sealed class GrantState : Pulumi.ResourceArgs
183208
public Input<string>? Database { get; set; }
184209

185210
/// <summary>
186-
/// The PostgreSQL object type to grant the privileges on (one of: database, table, sequence,function).
211+
/// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
187212
/// </summary>
188213
[Input("objectType")]
189214
public Input<string>? ObjectType { get; set; }
@@ -192,7 +217,7 @@ public sealed class GrantState : Pulumi.ResourceArgs
192217
private InputList<string>? _privileges;
193218

194219
/// <summary>
195-
/// 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.
220+
/// 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.
196221
/// </summary>
197222
public InputList<string> Privileges
198223
{
@@ -201,13 +226,13 @@ public InputList<string> Privileges
201226
}
202227

203228
/// <summary>
204-
/// The name of the role to grant privileges on.
229+
/// The name of the role to grant privileges on, Set it to "public" for all roles.
205230
/// </summary>
206231
[Input("role")]
207232
public Input<string>? Role { get; set; }
208233

209234
/// <summary>
210-
/// The database schema to grant privileges on for this role.
235+
/// The database schema to grant privileges on for this role (Required except if object_type is "database")
211236
/// </summary>
212237
[Input("schema")]
213238
public Input<string>? Schema { get; set; }

sdk/dotnet/GrantRole.cs

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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.GrantRole`` resource creates and manages membership in a role to one or more other roles in a non-authoritative way.
14+
///
15+
/// When using ``postgresql.GrantRole`` resource it is likely because the PostgreSQL role you are modifying was created outside of this provider.
16+
///
17+
/// &gt; **Note:** This resource needs PostgreSQL version 9 or above.
18+
///
19+
/// &gt; **Note:** `postgresql.GrantRole` **cannot** be used in conjunction with `postgresql.Role` or they will fight over what your role grants should be.
20+
///
21+
/// ## Usage
22+
///
23+
/// ```csharp
24+
/// using Pulumi;
25+
/// using PostgreSql = Pulumi.PostgreSql;
26+
///
27+
/// class MyStack : Stack
28+
/// {
29+
/// public MyStack()
30+
/// {
31+
/// var grantRoot = new PostgreSql.GrantRole("grantRoot", new PostgreSql.GrantRoleArgs
32+
/// {
33+
/// GrantRole = "application",
34+
/// Role = "root",
35+
/// WithAdminOption = true,
36+
/// });
37+
/// }
38+
///
39+
/// }
40+
/// ```
41+
/// </summary>
42+
[PostgreSqlResourceType("postgresql:index/grantRole:GrantRole")]
43+
public partial class GrantRole : Pulumi.CustomResource
44+
{
45+
/// <summary>
46+
/// The name of the role that is added to `role`.
47+
/// </summary>
48+
[Output("grantRole")]
49+
public Output<string> GrantRoleName { get; private set; } = null!;
50+
51+
/// <summary>
52+
/// The name of the role that is granted a new membership.
53+
/// </summary>
54+
[Output("role")]
55+
public Output<string> Role { get; private set; } = null!;
56+
57+
/// <summary>
58+
/// Giving ability to grant membership to others or not for `role`. (Default: false)
59+
/// </summary>
60+
[Output("withAdminOption")]
61+
public Output<bool?> WithAdminOption { get; private set; } = null!;
62+
63+
64+
/// <summary>
65+
/// Create a GrantRole resource with the given unique name, arguments, and options.
66+
/// </summary>
67+
///
68+
/// <param name="name">The unique name of the resource</param>
69+
/// <param name="args">The arguments used to populate this resource's properties</param>
70+
/// <param name="options">A bag of options that control this resource's behavior</param>
71+
public GrantRole(string name, GrantRoleArgs args, CustomResourceOptions? options = null)
72+
: base("postgresql:index/grantRole:GrantRole", name, args ?? new GrantRoleArgs(), MakeResourceOptions(options, ""))
73+
{
74+
}
75+
76+
private GrantRole(string name, Input<string> id, GrantRoleState? state = null, CustomResourceOptions? options = null)
77+
: base("postgresql:index/grantRole:GrantRole", name, state, MakeResourceOptions(options, id))
78+
{
79+
}
80+
81+
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
82+
{
83+
var defaultOptions = new CustomResourceOptions
84+
{
85+
Version = Utilities.Version,
86+
};
87+
var merged = CustomResourceOptions.Merge(defaultOptions, options);
88+
// Override the ID if one was specified for consistency with other language SDKs.
89+
merged.Id = id ?? merged.Id;
90+
return merged;
91+
}
92+
/// <summary>
93+
/// Get an existing GrantRole resource's state with the given name, ID, and optional extra
94+
/// properties used to qualify the lookup.
95+
/// </summary>
96+
///
97+
/// <param name="name">The unique name of the resulting resource.</param>
98+
/// <param name="id">The unique provider ID of the resource to lookup.</param>
99+
/// <param name="state">Any extra arguments used during the lookup.</param>
100+
/// <param name="options">A bag of options that control this resource's behavior</param>
101+
public static GrantRole Get(string name, Input<string> id, GrantRoleState? state = null, CustomResourceOptions? options = null)
102+
{
103+
return new GrantRole(name, id, state, options);
104+
}
105+
}
106+
107+
public sealed class GrantRoleArgs : Pulumi.ResourceArgs
108+
{
109+
/// <summary>
110+
/// The name of the role that is added to `role`.
111+
/// </summary>
112+
[Input("grantRole", required: true)]
113+
public Input<string> GrantRoleName { get; set; } = null!;
114+
115+
/// <summary>
116+
/// The name of the role that is granted a new membership.
117+
/// </summary>
118+
[Input("role", required: true)]
119+
public Input<string> Role { get; set; } = null!;
120+
121+
/// <summary>
122+
/// Giving ability to grant membership to others or not for `role`. (Default: false)
123+
/// </summary>
124+
[Input("withAdminOption")]
125+
public Input<bool>? WithAdminOption { get; set; }
126+
127+
public GrantRoleArgs()
128+
{
129+
}
130+
}
131+
132+
public sealed class GrantRoleState : Pulumi.ResourceArgs
133+
{
134+
/// <summary>
135+
/// The name of the role that is added to `role`.
136+
/// </summary>
137+
[Input("grantRole")]
138+
public Input<string>? GrantRoleName { get; set; }
139+
140+
/// <summary>
141+
/// The name of the role that is granted a new membership.
142+
/// </summary>
143+
[Input("role")]
144+
public Input<string>? Role { get; set; }
145+
146+
/// <summary>
147+
/// Giving ability to grant membership to others or not for `role`. (Default: false)
148+
/// </summary>
149+
[Input("withAdminOption")]
150+
public Input<bool>? WithAdminOption { get; set; }
151+
152+
public GrantRoleState()
153+
{
154+
}
155+
}
156+
}

sdk/dotnet/Provider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ public sealed class ProviderArgs : Pulumi.ResourceArgs
9999
[Input("port", json: true)]
100100
public Input<int>? Port { get; set; }
101101

102+
[Input("scheme")]
103+
public Input<string>? Scheme { get; set; }
104+
102105
[Input("sslMode")]
103106
public Input<string>? SslMode { get; set; }
104107

0 commit comments

Comments
 (0)