postgresql.Server
Explore with Pulumi AI
The postgresql.Server
resource creates and manages a foreign server on a PostgreSQL server.
Usage
import * as pulumi from "@pulumi/pulumi";
import * as postgresql from "@pulumi/postgresql";
const extPostgresFdw = new postgresql.Extension("extPostgresFdw", {});
const myserverPostgres = new postgresql.Server("myserverPostgres", {
serverName: "myserver_postgres",
fdwName: "postgres_fdw",
options: {
host: "foo",
dbname: "foodb",
port: "5432",
},
}, {
dependsOn: [extPostgresFdw],
});
import pulumi
import pulumi_postgresql as postgresql
ext_postgres_fdw = postgresql.Extension("extPostgresFdw")
myserver_postgres = postgresql.Server("myserverPostgres",
server_name="myserver_postgres",
fdw_name="postgres_fdw",
options={
"host": "foo",
"dbname": "foodb",
"port": "5432",
},
opts=pulumi.ResourceOptions(depends_on=[ext_postgres_fdw]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using PostgreSql = Pulumi.PostgreSql;
return await Deployment.RunAsync(() =>
{
var extPostgresFdw = new PostgreSql.Extension("extPostgresFdw");
var myserverPostgres = new PostgreSql.Server("myserverPostgres", new()
{
ServerName = "myserver_postgres",
FdwName = "postgres_fdw",
Options =
{
{ "host", "foo" },
{ "dbname", "foodb" },
{ "port", "5432" },
},
}, new CustomResourceOptions
{
DependsOn = new[]
{
extPostgresFdw,
},
});
});
package main
import (
"github.com/pulumi/pulumi-postgresql/sdk/v3/go/postgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
extPostgresFdw, err := postgresql.NewExtension(ctx, "extPostgresFdw", nil)
if err != nil {
return err
}
_, err = postgresql.NewServer(ctx, "myserverPostgres", &postgresql.ServerArgs{
ServerName: pulumi.String("myserver_postgres"),
FdwName: pulumi.String("postgres_fdw"),
Options: pulumi.StringMap{
"host": pulumi.String("foo"),
"dbname": pulumi.String("foodb"),
"port": pulumi.String("5432"),
},
}, pulumi.DependsOn([]pulumi.Resource{
extPostgresFdw,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.postgresql.Extension;
import com.pulumi.postgresql.Server;
import com.pulumi.postgresql.ServerArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var extPostgresFdw = new Extension("extPostgresFdw");
var myserverPostgres = new Server("myserverPostgres", ServerArgs.builder()
.serverName("myserver_postgres")
.fdwName("postgres_fdw")
.options(Map.ofEntries(
Map.entry("host", "foo"),
Map.entry("dbname", "foodb"),
Map.entry("port", "5432")
))
.build(), CustomResourceOptions.builder()
.dependsOn(extPostgresFdw)
.build());
}
}
resources:
extPostgresFdw:
type: postgresql:Extension
myserverPostgres:
type: postgresql:Server
properties:
serverName: myserver_postgres
fdwName: postgres_fdw
options:
host: foo
dbname: foodb
port: '5432'
options:
dependson:
- ${extPostgresFdw}
import * as pulumi from "@pulumi/pulumi";
import * as postgresql from "@pulumi/postgresql";
const extFileFdw = new postgresql.Extension("extFileFdw", {});
const myserverFile = new postgresql.Server("myserverFile", {
serverName: "myserver_file",
fdwName: "file_fdw",
}, {
dependsOn: [extFileFdw],
});
import pulumi
import pulumi_postgresql as postgresql
ext_file_fdw = postgresql.Extension("extFileFdw")
myserver_file = postgresql.Server("myserverFile",
server_name="myserver_file",
fdw_name="file_fdw",
opts=pulumi.ResourceOptions(depends_on=[ext_file_fdw]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using PostgreSql = Pulumi.PostgreSql;
return await Deployment.RunAsync(() =>
{
var extFileFdw = new PostgreSql.Extension("extFileFdw");
var myserverFile = new PostgreSql.Server("myserverFile", new()
{
ServerName = "myserver_file",
FdwName = "file_fdw",
}, new CustomResourceOptions
{
DependsOn = new[]
{
extFileFdw,
},
});
});
package main
import (
"github.com/pulumi/pulumi-postgresql/sdk/v3/go/postgresql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
extFileFdw, err := postgresql.NewExtension(ctx, "extFileFdw", nil)
if err != nil {
return err
}
_, err = postgresql.NewServer(ctx, "myserverFile", &postgresql.ServerArgs{
ServerName: pulumi.String("myserver_file"),
FdwName: pulumi.String("file_fdw"),
}, pulumi.DependsOn([]pulumi.Resource{
extFileFdw,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.postgresql.Extension;
import com.pulumi.postgresql.Server;
import com.pulumi.postgresql.ServerArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var extFileFdw = new Extension("extFileFdw");
var myserverFile = new Server("myserverFile", ServerArgs.builder()
.serverName("myserver_file")
.fdwName("file_fdw")
.build(), CustomResourceOptions.builder()
.dependsOn(extFileFdw)
.build());
}
}
resources:
extFileFdw:
type: postgresql:Extension
myserverFile:
type: postgresql:Server
properties:
serverName: myserver_file
fdwName: file_fdw
options:
dependson:
- ${extFileFdw}
Create Server Resource
new Server(name: string, args: ServerArgs, opts?: CustomResourceOptions);
@overload
def Server(resource_name: str,
opts: Optional[ResourceOptions] = None,
drop_cascade: Optional[bool] = None,
fdw_name: Optional[str] = None,
options: Optional[Mapping[str, str]] = None,
server_name: Optional[str] = None,
server_owner: Optional[str] = None,
server_type: Optional[str] = None,
server_version: Optional[str] = None)
@overload
def Server(resource_name: str,
args: ServerArgs,
opts: Optional[ResourceOptions] = None)
func NewServer(ctx *Context, name string, args ServerArgs, opts ...ResourceOption) (*Server, error)
public Server(string name, ServerArgs args, CustomResourceOptions? opts = null)
public Server(String name, ServerArgs args)
public Server(String name, ServerArgs args, CustomResourceOptions options)
type: postgresql:Server
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Server Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Server resource accepts the following input properties:
- Fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Name string The name of the foreign server to be created.
- Drop
Cascade bool 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)
- Options Dictionary<string, string>
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.
- Server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- Server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Version string Optional server version, potentially useful to foreign-data wrappers.
- Fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Name string The name of the foreign server to be created.
- Drop
Cascade bool 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)
- Options map[string]string
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.
- Server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- Server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Version string Optional server version, potentially useful to foreign-data wrappers.
- fdw
Name String The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Name String The name of the foreign server to be created.
- drop
Cascade Boolean 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)
- options Map<String,String>
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.
- server
Owner String By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type String Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version String Optional server version, potentially useful to foreign-data wrappers.
- fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Name string The name of the foreign server to be created.
- drop
Cascade boolean 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)
- options {[key: string]: string}
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.
- server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version string Optional server version, potentially useful to foreign-data wrappers.
- fdw_
name str The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server_
name str The name of the foreign server to be created.
- drop_
cascade bool 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)
- options Mapping[str, str]
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.
- server_
owner str By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server_
type str Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server_
version str Optional server version, potentially useful to foreign-data wrappers.
- fdw
Name String The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Name String The name of the foreign server to be created.
- drop
Cascade Boolean 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)
- options Map<String>
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.
- server
Owner String By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type String Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version String Optional server version, potentially useful to foreign-data wrappers.
Outputs
All input properties are implicitly available as output properties. Additionally, the Server resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Server Resource
Get an existing Server resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ServerState, opts?: CustomResourceOptions): Server
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
drop_cascade: Optional[bool] = None,
fdw_name: Optional[str] = None,
options: Optional[Mapping[str, str]] = None,
server_name: Optional[str] = None,
server_owner: Optional[str] = None,
server_type: Optional[str] = None,
server_version: Optional[str] = None) -> Server
func GetServer(ctx *Context, name string, id IDInput, state *ServerState, opts ...ResourceOption) (*Server, error)
public static Server Get(string name, Input<string> id, ServerState? state, CustomResourceOptions? opts = null)
public static Server get(String name, Output<String> id, ServerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Drop
Cascade bool 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)
- Fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Options Dictionary<string, string>
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.
- Server
Name string The name of the foreign server to be created.
- Server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- Server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Version string Optional server version, potentially useful to foreign-data wrappers.
- Drop
Cascade bool 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)
- Fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Options map[string]string
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.
- Server
Name string The name of the foreign server to be created.
- Server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- Server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- Server
Version string Optional server version, potentially useful to foreign-data wrappers.
- drop
Cascade Boolean 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)
- fdw
Name String The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- options Map<String,String>
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.
- server
Name String The name of the foreign server to be created.
- server
Owner String By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type String Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version String Optional server version, potentially useful to foreign-data wrappers.
- drop
Cascade boolean 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)
- fdw
Name string The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- options {[key: string]: string}
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.
- server
Name string The name of the foreign server to be created.
- server
Owner string By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type string Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version string Optional server version, potentially useful to foreign-data wrappers.
- drop_
cascade bool 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)
- fdw_
name str The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- options Mapping[str, str]
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.
- server_
name str The name of the foreign server to be created.
- server_
owner str By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server_
type str Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server_
version str Optional server version, potentially useful to foreign-data wrappers.
- drop
Cascade Boolean 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)
- fdw
Name String The name of the foreign-data wrapper that manages the server. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- options Map<String>
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.
- server
Name String The name of the foreign server to be created.
- server
Owner String By default, the user who defines the server becomes its owner. Set this value to configure the new owner of the foreign server.
- server
Type String Optional server type, potentially useful to foreign-data wrappers. Changing this value will force the creation of a new resource as this value can only be set when the foreign server is created.
- server
Version String Optional server version, potentially useful to foreign-data wrappers.
Package Details
- Repository
- PostgreSQL pulumi/pulumi-postgresql
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
postgresql
Terraform Provider.