Skip to content

Commit 11f3098

Browse files
authored
Merge pull request #159 from pulumi/stack72/v1.16.0
2 parents 148d2d8 + c08e79c commit 11f3098

31 files changed

+3652
-113
lines changed

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

Lines changed: 282 additions & 1 deletion
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,6 +9,6 @@ require (
99
)
1010

1111
replace (
12-
github.com/cyrilgdn/terraform-provider-postgresql => github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20220405212505-5e79e19618e4
12+
github.com/cyrilgdn/terraform-provider-postgresql => github.com/pulumi/terraform-provider-postgresql v1.12.1-0.20220614121323-8cd3e85d4ab5
1313
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20211230170131-3a7c83bfab87
1414
)

provider/go.sum

Lines changed: 289 additions & 111 deletions
Large diffs are not rendered by default.

provider/resources.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ func Provider() tfbridge.ProviderInfo {
9797
"postgresql_schema": {Tok: makeResource(mainMod, "Schema")},
9898
"postgresql_physical_replication_slot": {Tok: makeResource(mainMod, "PhysicalReplicationSlot")},
9999
"postgresql_replication_slot": {Tok: makeResource(mainMod, "ReplicationSlot")},
100+
"postgresql_function": {Tok: makeResource(mainMod, "Function")},
101+
"postgresql_publication": {Tok: makeResource(mainMod, "Publication")},
100102
"postgresql_grant_role": {
101103
Tok: makeResource(mainMod, "GrantRole"),
102104
Fields: map[string]*tfbridge.SchemaInfo{

sdk/dotnet/Function.cs

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
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.Function`` resource creates and manages a function on a PostgreSQL
14+
/// server.
15+
///
16+
/// ## Usage
17+
///
18+
/// ```csharp
19+
/// using Pulumi;
20+
/// using PostgreSql = Pulumi.PostgreSql;
21+
///
22+
/// class MyStack : Stack
23+
/// {
24+
/// public MyStack()
25+
/// {
26+
/// var increment = new PostgreSql.Function("increment", new PostgreSql.FunctionArgs
27+
/// {
28+
/// Args =
29+
/// {
30+
/// new PostgreSql.Inputs.FunctionArgArgs
31+
/// {
32+
/// Name = "i",
33+
/// Type = "integer",
34+
/// },
35+
/// },
36+
/// Body = @" AS $
37+
/// BEGIN
38+
/// RETURN i + 1;
39+
/// END;
40+
/// $ LANGUAGE plpgsql;
41+
///
42+
/// ",
43+
/// Returns = "integer",
44+
/// });
45+
/// }
46+
///
47+
/// }
48+
/// ```
49+
/// </summary>
50+
[PostgreSqlResourceType("postgresql:index/function:Function")]
51+
public partial class Function : Pulumi.CustomResource
52+
{
53+
/// <summary>
54+
/// List of arguments for the function.
55+
/// </summary>
56+
[Output("args")]
57+
public Output<ImmutableArray<Outputs.FunctionArg>> Args { get; private set; } = null!;
58+
59+
/// <summary>
60+
/// Function body.
61+
/// This should be everything after the return type in the function definition.
62+
/// </summary>
63+
[Output("body")]
64+
public Output<string> Body { get; private set; } = null!;
65+
66+
/// <summary>
67+
/// True to automatically drop objects that depend on the function (such as
68+
/// operators or triggers), and in turn all objects that depend on those objects. Default is false.
69+
/// </summary>
70+
[Output("dropCascade")]
71+
public Output<bool?> DropCascade { get; private set; } = null!;
72+
73+
/// <summary>
74+
/// The name of the argument.
75+
/// </summary>
76+
[Output("name")]
77+
public Output<string> Name { get; private set; } = null!;
78+
79+
/// <summary>
80+
/// Type that the function returns.
81+
/// </summary>
82+
[Output("returns")]
83+
public Output<string?> Returns { get; private set; } = null!;
84+
85+
/// <summary>
86+
/// The schema where the function is located.
87+
/// If not specified, the function is created in the current schema.
88+
/// </summary>
89+
[Output("schema")]
90+
public Output<string> Schema { get; private set; } = null!;
91+
92+
93+
/// <summary>
94+
/// Create a Function resource with the given unique name, arguments, and options.
95+
/// </summary>
96+
///
97+
/// <param name="name">The unique name of the resource</param>
98+
/// <param name="args">The arguments used to populate this resource's properties</param>
99+
/// <param name="options">A bag of options that control this resource's behavior</param>
100+
public Function(string name, FunctionArgs args, CustomResourceOptions? options = null)
101+
: base("postgresql:index/function:Function", name, args ?? new FunctionArgs(), MakeResourceOptions(options, ""))
102+
{
103+
}
104+
105+
private Function(string name, Input<string> id, FunctionState? state = null, CustomResourceOptions? options = null)
106+
: base("postgresql:index/function:Function", name, state, MakeResourceOptions(options, id))
107+
{
108+
}
109+
110+
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
111+
{
112+
var defaultOptions = new CustomResourceOptions
113+
{
114+
Version = Utilities.Version,
115+
};
116+
var merged = CustomResourceOptions.Merge(defaultOptions, options);
117+
// Override the ID if one was specified for consistency with other language SDKs.
118+
merged.Id = id ?? merged.Id;
119+
return merged;
120+
}
121+
/// <summary>
122+
/// Get an existing Function resource's state with the given name, ID, and optional extra
123+
/// properties used to qualify the lookup.
124+
/// </summary>
125+
///
126+
/// <param name="name">The unique name of the resulting resource.</param>
127+
/// <param name="id">The unique provider ID of the resource to lookup.</param>
128+
/// <param name="state">Any extra arguments used during the lookup.</param>
129+
/// <param name="options">A bag of options that control this resource's behavior</param>
130+
public static Function Get(string name, Input<string> id, FunctionState? state = null, CustomResourceOptions? options = null)
131+
{
132+
return new Function(name, id, state, options);
133+
}
134+
}
135+
136+
public sealed class FunctionArgs : Pulumi.ResourceArgs
137+
{
138+
[Input("args")]
139+
private InputList<Inputs.FunctionArgArgs>? _args;
140+
141+
/// <summary>
142+
/// List of arguments for the function.
143+
/// </summary>
144+
public InputList<Inputs.FunctionArgArgs> Args
145+
{
146+
get => _args ?? (_args = new InputList<Inputs.FunctionArgArgs>());
147+
set => _args = value;
148+
}
149+
150+
/// <summary>
151+
/// Function body.
152+
/// This should be everything after the return type in the function definition.
153+
/// </summary>
154+
[Input("body", required: true)]
155+
public Input<string> Body { get; set; } = null!;
156+
157+
/// <summary>
158+
/// True to automatically drop objects that depend on the function (such as
159+
/// operators or triggers), and in turn all objects that depend on those objects. Default is false.
160+
/// </summary>
161+
[Input("dropCascade")]
162+
public Input<bool>? DropCascade { get; set; }
163+
164+
/// <summary>
165+
/// The name of the argument.
166+
/// </summary>
167+
[Input("name")]
168+
public Input<string>? Name { get; set; }
169+
170+
/// <summary>
171+
/// Type that the function returns.
172+
/// </summary>
173+
[Input("returns")]
174+
public Input<string>? Returns { get; set; }
175+
176+
/// <summary>
177+
/// The schema where the function is located.
178+
/// If not specified, the function is created in the current schema.
179+
/// </summary>
180+
[Input("schema")]
181+
public Input<string>? Schema { get; set; }
182+
183+
public FunctionArgs()
184+
{
185+
}
186+
}
187+
188+
public sealed class FunctionState : Pulumi.ResourceArgs
189+
{
190+
[Input("args")]
191+
private InputList<Inputs.FunctionArgGetArgs>? _args;
192+
193+
/// <summary>
194+
/// List of arguments for the function.
195+
/// </summary>
196+
public InputList<Inputs.FunctionArgGetArgs> Args
197+
{
198+
get => _args ?? (_args = new InputList<Inputs.FunctionArgGetArgs>());
199+
set => _args = value;
200+
}
201+
202+
/// <summary>
203+
/// Function body.
204+
/// This should be everything after the return type in the function definition.
205+
/// </summary>
206+
[Input("body")]
207+
public Input<string>? Body { get; set; }
208+
209+
/// <summary>
210+
/// True to automatically drop objects that depend on the function (such as
211+
/// operators or triggers), and in turn all objects that depend on those objects. Default is false.
212+
/// </summary>
213+
[Input("dropCascade")]
214+
public Input<bool>? DropCascade { get; set; }
215+
216+
/// <summary>
217+
/// The name of the argument.
218+
/// </summary>
219+
[Input("name")]
220+
public Input<string>? Name { get; set; }
221+
222+
/// <summary>
223+
/// Type that the function returns.
224+
/// </summary>
225+
[Input("returns")]
226+
public Input<string>? Returns { get; set; }
227+
228+
/// <summary>
229+
/// The schema where the function is located.
230+
/// If not specified, the function is created in the current schema.
231+
/// </summary>
232+
[Input("schema")]
233+
public Input<string>? Schema { get; set; }
234+
235+
public FunctionState()
236+
{
237+
}
238+
}
239+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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.Inputs
11+
{
12+
13+
public sealed class FunctionArgArgs : Pulumi.ResourceArgs
14+
{
15+
/// <summary>
16+
/// An expression to be used as default value if the parameter is not specified.
17+
/// </summary>
18+
[Input("default")]
19+
public Input<string>? Default { get; set; }
20+
21+
/// <summary>
22+
/// Can be one of IN, INOUT, OUT, or VARIADIC. Default is IN.
23+
/// </summary>
24+
[Input("mode")]
25+
public Input<string>? Mode { get; set; }
26+
27+
/// <summary>
28+
/// The name of the argument.
29+
/// </summary>
30+
[Input("name")]
31+
public Input<string>? Name { get; set; }
32+
33+
/// <summary>
34+
/// The type of the argument.
35+
/// </summary>
36+
[Input("type", required: true)]
37+
public Input<string> Type { get; set; } = null!;
38+
39+
public FunctionArgArgs()
40+
{
41+
}
42+
}
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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.Inputs
11+
{
12+
13+
public sealed class FunctionArgGetArgs : Pulumi.ResourceArgs
14+
{
15+
/// <summary>
16+
/// An expression to be used as default value if the parameter is not specified.
17+
/// </summary>
18+
[Input("default")]
19+
public Input<string>? Default { get; set; }
20+
21+
/// <summary>
22+
/// Can be one of IN, INOUT, OUT, or VARIADIC. Default is IN.
23+
/// </summary>
24+
[Input("mode")]
25+
public Input<string>? Mode { get; set; }
26+
27+
/// <summary>
28+
/// The name of the argument.
29+
/// </summary>
30+
[Input("name")]
31+
public Input<string>? Name { get; set; }
32+
33+
/// <summary>
34+
/// The type of the argument.
35+
/// </summary>
36+
[Input("type", required: true)]
37+
public Input<string> Type { get; set; } = null!;
38+
39+
public FunctionArgGetArgs()
40+
{
41+
}
42+
}
43+
}

sdk/dotnet/Outputs/FunctionArg.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.Outputs
11+
{
12+
13+
[OutputType]
14+
public sealed class FunctionArg
15+
{
16+
/// <summary>
17+
/// An expression to be used as default value if the parameter is not specified.
18+
/// </summary>
19+
public readonly string? Default;
20+
/// <summary>
21+
/// Can be one of IN, INOUT, OUT, or VARIADIC. Default is IN.
22+
/// </summary>
23+
public readonly string? Mode;
24+
/// <summary>
25+
/// The name of the argument.
26+
/// </summary>
27+
public readonly string? Name;
28+
/// <summary>
29+
/// The type of the argument.
30+
/// </summary>
31+
public readonly string Type;
32+
33+
[OutputConstructor]
34+
private FunctionArg(
35+
string? @default,
36+
37+
string? mode,
38+
39+
string? name,
40+
41+
string type)
42+
{
43+
Default = @default;
44+
Mode = mode;
45+
Name = name;
46+
Type = type;
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)