Skip to content

Commit a9cbdc4

Browse files
author
Alex Qiu
authored
Use patch instead of fork
2 parents 40cb78a + a2955fe commit a9cbdc4

Some content is hidden

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

41 files changed

+1632
-468
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "upstream"]
2+
path = upstream
3+
url = https://github.com/cyrilgdn/terraform-provider-postgresql.git
4+
ignore = dirty

patches/0001-fork.patch

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
diff --git b/.idea/.gitignore a/.idea/.gitignore
2+
new file mode 100644
3+
index 0000000..13566b8
4+
--- /dev/null
5+
+++ a/.idea/.gitignore
6+
@@ -0,0 +1,8 @@
7+
+# Default ignored files
8+
+/shelf/
9+
+/workspace.xml
10+
+# Editor-based HTTP Client requests
11+
+/httpRequests/
12+
+# Datasource local storage ignored files
13+
+/dataSources/
14+
+/dataSources.local.xml
15+
diff --git b/.idea/modules.xml a/.idea/modules.xml
16+
new file mode 100644
17+
index 0000000..c671309
18+
--- /dev/null
19+
+++ a/.idea/modules.xml
20+
@@ -0,0 +1,8 @@
21+
+<?xml version="1.0" encoding="UTF-8"?>
22+
+<project version="4">
23+
+ <component name="ProjectModuleManager">
24+
+ <modules>
25+
+ <module fileurl="file://$PROJECT_DIR$/.idea/terraform-provider-postgresql.iml" filepath="$PROJECT_DIR$/.idea/terraform-provider-postgresql.iml" />
26+
+ </modules>
27+
+ </component>
28+
+</project>
29+
\ No newline at end of file
30+
diff --git b/.idea/terraform-provider-postgresql.iml a/.idea/terraform-provider-postgresql.iml
31+
new file mode 100644
32+
index 0000000..5e764c4
33+
--- /dev/null
34+
+++ a/.idea/terraform-provider-postgresql.iml
35+
@@ -0,0 +1,9 @@
36+
+<?xml version="1.0" encoding="UTF-8"?>
37+
+<module type="WEB_MODULE" version="4">
38+
+ <component name="Go" enabled="true" />
39+
+ <component name="NewModuleRootManager">
40+
+ <content url="file://$MODULE_DIR$" />
41+
+ <orderEntry type="inheritedJdk" />
42+
+ <orderEntry type="sourceFolder" forTests="false" />
43+
+ </component>
44+
+</module>
45+
\ No newline at end of file
46+
diff --git b/.idea/vcs.xml a/.idea/vcs.xml
47+
new file mode 100644
48+
index 0000000..94a25f7
49+
--- /dev/null
50+
+++ a/.idea/vcs.xml
51+
@@ -0,0 +1,6 @@
52+
+<?xml version="1.0" encoding="UTF-8"?>
53+
+<project version="4">
54+
+ <component name="VcsDirectoryMappings">
55+
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
56+
+ </component>
57+
+</project>
58+
\ No newline at end of file
59+
diff --git b/go.mod a/go.mod
60+
index ee3e530..a12d9af 100644
61+
--- b/go.mod
62+
+++ a/go.mod
63+
@@ -1,4 +1,4 @@
64+
-module github.com/terraform-providers/terraform-provider-postgresql
65+
+module github.com/cyrilgdn/terraform-provider-postgresql
66+
67+
go 1.17
68+
69+
diff --git b/main.go a/main.go
70+
index 7125ff2..d9f1406 100644
71+
--- b/main.go
72+
+++ a/main.go
73+
@@ -1,8 +1,8 @@
74+
package main
75+
76+
import (
77+
+ "github.com/cyrilgdn/terraform-provider-postgresql/postgresql"
78+
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
79+
- "github.com/terraform-providers/terraform-provider-postgresql/postgresql"
80+
)
81+
82+
func main() {

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

Lines changed: 21 additions & 15 deletions
Large diffs are not rendered by default.

provider/go.mod

Lines changed: 80 additions & 68 deletions
Large diffs are not rendered by default.

provider/go.sum

Lines changed: 1242 additions & 293 deletions
Large diffs are not rendered by default.

provider/resources.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ func Provider() tfbridge.ProviderInfo {
6767
p := shimv2.NewProvider(postgresql.Provider())
6868

6969
prov := tfbridge.ProviderInfo{
70-
P: p,
71-
Name: "postgresql",
72-
Description: "A Pulumi package for creating and managing postgresql cloud resources.",
73-
Keywords: []string{"pulumi", "postgresql"},
74-
License: "Apache-2.0",
75-
Homepage: "https://pulumi.io",
76-
Repository: "https://github.com/pulumi/pulumi-postgresql",
77-
GitHubOrg: "cyrilgdn",
70+
P: p,
71+
Name: "postgresql",
72+
Description: "A Pulumi package for creating and managing postgresql cloud resources.",
73+
Keywords: []string{"pulumi", "postgresql"},
74+
License: "Apache-2.0",
75+
Homepage: "https://pulumi.io",
76+
Repository: "https://github.com/pulumi/pulumi-postgresql",
77+
GitHubOrg: "cyrilgdn",
78+
UpstreamRepoPath: "./upstream",
7879
Config: map[string]*tfbridge.SchemaInfo{
7980
"sslmode": {
8081
Default: &tfbridge.DefaultInfo{

sdk/dotnet/Config/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void Set(T value)
3030
}
3131
}
3232

33-
private static readonly Pulumi.Config __config = new Pulumi.Config("postgresql");
33+
private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("postgresql");
3434

3535
private static readonly __Value<bool?> _awsRdsIamAuth = new __Value<bool?>(() => __config.GetBoolean("awsRdsIamAuth"));
3636
/// <summary>

sdk/dotnet/Provider.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
9797
var defaultOptions = new CustomResourceOptions
9898
{
9999
Version = Utilities.Version,
100+
AdditionalSecretOutputs =
101+
{
102+
"password",
103+
},
100104
};
101105
var merged = CustomResourceOptions.Merge(defaultOptions, options);
102106
// Override the ID if one was specified for consistency with other language SDKs.
@@ -162,11 +166,21 @@ public sealed class ProviderArgs : global::Pulumi.ResourceArgs
162166
[Input("maxConnections", json: true)]
163167
public Input<int>? MaxConnections { get; set; }
164168

169+
[Input("password")]
170+
private Input<string>? _password;
171+
165172
/// <summary>
166173
/// Password to be used if the PostgreSQL server demands password authentication
167174
/// </summary>
168-
[Input("password")]
169-
public Input<string>? Password { get; set; }
175+
public Input<string>? Password
176+
{
177+
get => _password;
178+
set
179+
{
180+
var emptySecret = Output.CreateSecret(0);
181+
_password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
182+
}
183+
}
170184

171185
/// <summary>
172186
/// The PostgreSQL port number to connect to at the server host, or socket file name extension for Unix-domain connections

sdk/dotnet/Pulumi.PostgreSql.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<RepositoryUrl>https://github.com/pulumi/pulumi-postgresql</RepositoryUrl>
1111
<PackageIcon>logo.png</PackageIcon>
1212

13-
<TargetFramework>netcoreapp3.1</TargetFramework>
13+
<TargetFramework>net6.0</TargetFramework>
1414
<Nullable>enable</Nullable>
1515
<UseSharedCompilation>false</UseSharedCompilation>
1616
</PropertyGroup>

sdk/dotnet/Role.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
190190
var defaultOptions = new CustomResourceOptions
191191
{
192192
Version = Utilities.Version,
193+
AdditionalSecretOutputs =
194+
{
195+
"password",
196+
},
193197
};
194198
var merged = CustomResourceOptions.Merge(defaultOptions, options);
195199
// Override the ID if one was specified for consistency with other language SDKs.
@@ -290,12 +294,22 @@ public sealed class RoleArgs : global::Pulumi.ResourceArgs
290294
[Input("name")]
291295
public Input<string>? Name { get; set; }
292296

297+
[Input("password")]
298+
private Input<string>? _password;
299+
293300
/// <summary>
294301
/// Sets the role's password. A password is only of use
295302
/// for roles having the `login` attribute set to true.
296303
/// </summary>
297-
[Input("password")]
298-
public Input<string>? Password { get; set; }
304+
public Input<string>? Password
305+
{
306+
get => _password;
307+
set
308+
{
309+
var emptySecret = Output.CreateSecret(0);
310+
_password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
311+
}
312+
}
299313

300314
/// <summary>
301315
/// Defines whether a role is allowed to initiate
@@ -465,12 +479,22 @@ public sealed class RoleState : global::Pulumi.ResourceArgs
465479
[Input("name")]
466480
public Input<string>? Name { get; set; }
467481

482+
[Input("password")]
483+
private Input<string>? _password;
484+
468485
/// <summary>
469486
/// Sets the role's password. A password is only of use
470487
/// for roles having the `login` attribute set to true.
471488
/// </summary>
472-
[Input("password")]
473-
public Input<string>? Password { get; set; }
489+
public Input<string>? Password
490+
{
491+
get => _password;
492+
set
493+
{
494+
var emptySecret = Output.CreateSecret(0);
495+
_password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
496+
}
497+
}
474498

475499
/// <summary>
476500
/// Defines whether a role is allowed to initiate

0 commit comments

Comments
 (0)