|
| 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.Server`` resource creates and manages a foreign server on a PostgreSQL server. |
| 14 | + /// |
| 15 | + /// ## Usage |
| 16 | + /// |
| 17 | + /// ```csharp |
| 18 | + /// using System.Collections.Generic; |
| 19 | + /// using Pulumi; |
| 20 | + /// using PostgreSql = Pulumi.PostgreSql; |
| 21 | + /// |
| 22 | + /// return await Deployment.RunAsync(() => |
| 23 | + /// { |
| 24 | + /// var extPostgresFdw = new PostgreSql.Extension("extPostgresFdw"); |
| 25 | + /// |
| 26 | + /// var myserverPostgres = new PostgreSql.Server("myserverPostgres", new() |
| 27 | + /// { |
| 28 | + /// ServerName = "myserver_postgres", |
| 29 | + /// FdwName = "postgres_fdw", |
| 30 | + /// Options = |
| 31 | + /// { |
| 32 | + /// { "host", "foo" }, |
| 33 | + /// { "dbname", "foodb" }, |
| 34 | + /// { "port", "5432" }, |
| 35 | + /// }, |
| 36 | + /// }, new CustomResourceOptions |
| 37 | + /// { |
| 38 | + /// DependsOn = new[] |
| 39 | + /// { |
| 40 | + /// extPostgresFdw, |
| 41 | + /// }, |
| 42 | + /// }); |
| 43 | + /// |
| 44 | + /// }); |
| 45 | + /// ``` |
| 46 | + /// |
| 47 | + /// ```csharp |
| 48 | + /// using System.Collections.Generic; |
| 49 | + /// using Pulumi; |
| 50 | + /// using PostgreSql = Pulumi.PostgreSql; |
| 51 | + /// |
| 52 | + /// return await Deployment.RunAsync(() => |
| 53 | + /// { |
| 54 | + /// var extFileFdw = new PostgreSql.Extension("extFileFdw"); |
| 55 | + /// |
| 56 | + /// var myserverFile = new PostgreSql.Server("myserverFile", new() |
| 57 | + /// { |
| 58 | + /// ServerName = "myserver_file", |
| 59 | + /// FdwName = "file_fdw", |
| 60 | + /// }, new CustomResourceOptions |
| 61 | + /// { |
| 62 | + /// DependsOn = new[] |
| 63 | + /// { |
| 64 | + /// extFileFdw, |
| 65 | + /// }, |
| 66 | + /// }); |
| 67 | + /// |
| 68 | + /// }); |
| 69 | + /// ``` |
| 70 | + /// </summary> |
| 71 | + [PostgreSqlResourceType("postgresql:index/server:Server")] |
| 72 | + public partial class Server : global::Pulumi.CustomResource |
| 73 | + { |
| 74 | + /// <summary> |
| 75 | + /// When true, will drop objects that depend on the server (such as user mappings), and in turn all objects that depend on those objects . (Default: false) |
| 76 | + /// </summary> |
| 77 | + [Output("dropCascade")] |
| 78 | + public Output<bool?> DropCascade { get; private set; } = null!; |
| 79 | + |
| 80 | + /// <summary> |
| 81 | + /// The name of the foreign-data wrapper that manages the server. |
| 82 | + /// Changing this value |
| 83 | + /// will force the creation of a new resource as this value can only be set |
| 84 | + /// when the foreign server is created. |
| 85 | + /// </summary> |
| 86 | + [Output("fdwName")] |
| 87 | + public Output<string> FdwName { get; private set; } = null!; |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// This clause specifies the options for the server. The options typically define the connection details of the server, but the actual names and values are dependent on the server's foreign-data wrapper. |
| 91 | + /// </summary> |
| 92 | + [Output("options")] |
| 93 | + public Output<ImmutableDictionary<string, string>?> Options { get; private set; } = null!; |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// The name of the foreign server to be created. |
| 97 | + /// </summary> |
| 98 | + [Output("serverName")] |
| 99 | + public Output<string> ServerName { get; private set; } = null!; |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server. |
| 103 | + /// </summary> |
| 104 | + [Output("serverOwner")] |
| 105 | + public Output<string> ServerOwner { get; private set; } = null!; |
| 106 | + |
| 107 | + /// <summary> |
| 108 | + /// Optional server type, potentially useful to foreign-data wrappers. |
| 109 | + /// Changing this value |
| 110 | + /// will force the creation of a new resource as this value can only be set |
| 111 | + /// when the foreign server is created. |
| 112 | + /// </summary> |
| 113 | + [Output("serverType")] |
| 114 | + public Output<string?> ServerType { get; private set; } = null!; |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Optional server version, potentially useful to foreign-data wrappers. |
| 118 | + /// </summary> |
| 119 | + [Output("serverVersion")] |
| 120 | + public Output<string?> ServerVersion { get; private set; } = null!; |
| 121 | + |
| 122 | + |
| 123 | + /// <summary> |
| 124 | + /// Create a Server resource with the given unique name, arguments, and options. |
| 125 | + /// </summary> |
| 126 | + /// |
| 127 | + /// <param name="name">The unique name of the resource</param> |
| 128 | + /// <param name="args">The arguments used to populate this resource's properties</param> |
| 129 | + /// <param name="options">A bag of options that control this resource's behavior</param> |
| 130 | + public Server(string name, ServerArgs args, CustomResourceOptions? options = null) |
| 131 | + : base("postgresql:index/server:Server", name, args ?? new ServerArgs(), MakeResourceOptions(options, "")) |
| 132 | + { |
| 133 | + } |
| 134 | + |
| 135 | + private Server(string name, Input<string> id, ServerState? state = null, CustomResourceOptions? options = null) |
| 136 | + : base("postgresql:index/server:Server", name, state, MakeResourceOptions(options, id)) |
| 137 | + { |
| 138 | + } |
| 139 | + |
| 140 | + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) |
| 141 | + { |
| 142 | + var defaultOptions = new CustomResourceOptions |
| 143 | + { |
| 144 | + Version = Utilities.Version, |
| 145 | + }; |
| 146 | + var merged = CustomResourceOptions.Merge(defaultOptions, options); |
| 147 | + // Override the ID if one was specified for consistency with other language SDKs. |
| 148 | + merged.Id = id ?? merged.Id; |
| 149 | + return merged; |
| 150 | + } |
| 151 | + /// <summary> |
| 152 | + /// Get an existing Server resource's state with the given name, ID, and optional extra |
| 153 | + /// properties used to qualify the lookup. |
| 154 | + /// </summary> |
| 155 | + /// |
| 156 | + /// <param name="name">The unique name of the resulting resource.</param> |
| 157 | + /// <param name="id">The unique provider ID of the resource to lookup.</param> |
| 158 | + /// <param name="state">Any extra arguments used during the lookup.</param> |
| 159 | + /// <param name="options">A bag of options that control this resource's behavior</param> |
| 160 | + public static Server Get(string name, Input<string> id, ServerState? state = null, CustomResourceOptions? options = null) |
| 161 | + { |
| 162 | + return new Server(name, id, state, options); |
| 163 | + } |
| 164 | + } |
| 165 | + |
| 166 | + public sealed class ServerArgs : global::Pulumi.ResourceArgs |
| 167 | + { |
| 168 | + /// <summary> |
| 169 | + /// When true, will drop objects that depend on the server (such as user mappings), and in turn all objects that depend on those objects . (Default: false) |
| 170 | + /// </summary> |
| 171 | + [Input("dropCascade")] |
| 172 | + public Input<bool>? DropCascade { get; set; } |
| 173 | + |
| 174 | + /// <summary> |
| 175 | + /// The name of the foreign-data wrapper that manages the server. |
| 176 | + /// Changing this value |
| 177 | + /// will force the creation of a new resource as this value can only be set |
| 178 | + /// when the foreign server is created. |
| 179 | + /// </summary> |
| 180 | + [Input("fdwName", required: true)] |
| 181 | + public Input<string> FdwName { get; set; } = null!; |
| 182 | + |
| 183 | + [Input("options")] |
| 184 | + private InputMap<string>? _options; |
| 185 | + |
| 186 | + /// <summary> |
| 187 | + /// This clause specifies the options for the server. The options typically define the connection details of the server, but the actual names and values are dependent on the server's foreign-data wrapper. |
| 188 | + /// </summary> |
| 189 | + public InputMap<string> Options |
| 190 | + { |
| 191 | + get => _options ?? (_options = new InputMap<string>()); |
| 192 | + set => _options = value; |
| 193 | + } |
| 194 | + |
| 195 | + /// <summary> |
| 196 | + /// The name of the foreign server to be created. |
| 197 | + /// </summary> |
| 198 | + [Input("serverName", required: true)] |
| 199 | + public Input<string> ServerName { get; set; } = null!; |
| 200 | + |
| 201 | + /// <summary> |
| 202 | + /// By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server. |
| 203 | + /// </summary> |
| 204 | + [Input("serverOwner")] |
| 205 | + public Input<string>? ServerOwner { get; set; } |
| 206 | + |
| 207 | + /// <summary> |
| 208 | + /// Optional server type, potentially useful to foreign-data wrappers. |
| 209 | + /// Changing this value |
| 210 | + /// will force the creation of a new resource as this value can only be set |
| 211 | + /// when the foreign server is created. |
| 212 | + /// </summary> |
| 213 | + [Input("serverType")] |
| 214 | + public Input<string>? ServerType { get; set; } |
| 215 | + |
| 216 | + /// <summary> |
| 217 | + /// Optional server version, potentially useful to foreign-data wrappers. |
| 218 | + /// </summary> |
| 219 | + [Input("serverVersion")] |
| 220 | + public Input<string>? ServerVersion { get; set; } |
| 221 | + |
| 222 | + public ServerArgs() |
| 223 | + { |
| 224 | + } |
| 225 | + public static new ServerArgs Empty => new ServerArgs(); |
| 226 | + } |
| 227 | + |
| 228 | + public sealed class ServerState : global::Pulumi.ResourceArgs |
| 229 | + { |
| 230 | + /// <summary> |
| 231 | + /// When true, will drop objects that depend on the server (such as user mappings), and in turn all objects that depend on those objects . (Default: false) |
| 232 | + /// </summary> |
| 233 | + [Input("dropCascade")] |
| 234 | + public Input<bool>? DropCascade { get; set; } |
| 235 | + |
| 236 | + /// <summary> |
| 237 | + /// The name of the foreign-data wrapper that manages the server. |
| 238 | + /// Changing this value |
| 239 | + /// will force the creation of a new resource as this value can only be set |
| 240 | + /// when the foreign server is created. |
| 241 | + /// </summary> |
| 242 | + [Input("fdwName")] |
| 243 | + public Input<string>? FdwName { get; set; } |
| 244 | + |
| 245 | + [Input("options")] |
| 246 | + private InputMap<string>? _options; |
| 247 | + |
| 248 | + /// <summary> |
| 249 | + /// This clause specifies the options for the server. The options typically define the connection details of the server, but the actual names and values are dependent on the server's foreign-data wrapper. |
| 250 | + /// </summary> |
| 251 | + public InputMap<string> Options |
| 252 | + { |
| 253 | + get => _options ?? (_options = new InputMap<string>()); |
| 254 | + set => _options = value; |
| 255 | + } |
| 256 | + |
| 257 | + /// <summary> |
| 258 | + /// The name of the foreign server to be created. |
| 259 | + /// </summary> |
| 260 | + [Input("serverName")] |
| 261 | + public Input<string>? ServerName { get; set; } |
| 262 | + |
| 263 | + /// <summary> |
| 264 | + /// By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server. |
| 265 | + /// </summary> |
| 266 | + [Input("serverOwner")] |
| 267 | + public Input<string>? ServerOwner { get; set; } |
| 268 | + |
| 269 | + /// <summary> |
| 270 | + /// Optional server type, potentially useful to foreign-data wrappers. |
| 271 | + /// Changing this value |
| 272 | + /// will force the creation of a new resource as this value can only be set |
| 273 | + /// when the foreign server is created. |
| 274 | + /// </summary> |
| 275 | + [Input("serverType")] |
| 276 | + public Input<string>? ServerType { get; set; } |
| 277 | + |
| 278 | + /// <summary> |
| 279 | + /// Optional server version, potentially useful to foreign-data wrappers. |
| 280 | + /// </summary> |
| 281 | + [Input("serverVersion")] |
| 282 | + public Input<string>? ServerVersion { get; set; } |
| 283 | + |
| 284 | + public ServerState() |
| 285 | + { |
| 286 | + } |
| 287 | + public static new ServerState Empty => new ServerState(); |
| 288 | + } |
| 289 | +} |
0 commit comments