Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Create Postgres Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Postgres(name: string, args: PostgresArgs, opts?: ComponentResourceOptions);@overload
def Postgres(resource_name: str,
args: PostgresArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Postgres(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_name: Optional[str] = None,
aws: Optional[_aws.SharedInfraArgs] = None,
deploy: Optional[_compose.DeployConfigArgs] = None,
environment: Optional[Mapping[str, str]] = None,
image: Optional[str] = None,
postgres: Optional[_compose.PostgresConfigArgs] = None)func NewPostgres(ctx *Context, name string, args PostgresArgs, opts ...ResourceOption) (*Postgres, error)public Postgres(string name, PostgresArgs args, ComponentResourceOptions? opts = null)
public Postgres(String name, PostgresArgs args)
public Postgres(String name, PostgresArgs args, ComponentResourceOptions options)
type: defang-aws:Postgres
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "defang-aws_postgres" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PostgresArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args PostgresArgs
- 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 PostgresArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PostgresArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PostgresArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var postgresResource = new DefangAws.Postgres("postgresResource", new()
{
ProjectName = "string",
Aws = new DefangAws.Aws.Inputs.SharedInfraArgs
{
VpcID = "string",
ClusterArn = "string",
ExecutionRoleArn = "string",
LogGroupName = "string",
PrivateSgID = "string",
PrivateSubnetIDs = new[]
{
"string",
},
PrivateZoneID = "string",
PublicSubnetIDs = new[]
{
"string",
},
},
Deploy = new DefangAws.Compose.Inputs.DeployConfigArgs
{
Replicas = 0,
Resources = new DefangAws.Compose.Inputs.ResourcesArgs
{
Reservations = new DefangAws.Compose.Inputs.ResourceConfigArgs
{
Cpus = 0,
Memory = "string",
},
},
},
Environment =
{
{ "string", "string" },
},
Image = "string",
Postgres = new DefangAws.Compose.Inputs.PostgresConfigArgs
{
AllowDowntime = false,
FromSnapshot = "string",
},
});
example, err := defangaws.NewPostgres(ctx, "postgresResource", &defangaws.PostgresArgs{
ProjectName: "string",
Aws: &aws.SharedInfraArgs{
VpcID: pulumi.String("string"),
ClusterArn: pulumi.String("string"),
ExecutionRoleArn: pulumi.String("string"),
LogGroupName: pulumi.String("string"),
PrivateSgID: pulumi.String("string"),
PrivateSubnetIDs: pulumi.StringArray{
pulumi.String("string"),
},
PrivateZoneID: pulumi.String("string"),
PublicSubnetIDs: pulumi.StringArray{
pulumi.String("string"),
},
},
Deploy: &compose.DeployConfigArgs{
Replicas: pulumi.Int(0),
Resources: &compose.ResourcesArgs{
Reservations: &compose.ResourceConfigArgs{
Cpus: pulumi.Float64(0),
Memory: pulumi.String("string"),
},
},
},
Environment: pulumi.StringMap{
"string": pulumi.String("string"),
},
Image: "string",
Postgres: &compose.PostgresConfigArgs{
AllowDowntime: pulumi.Bool(false),
FromSnapshot: pulumi.String("string"),
},
})
resource "defang-aws_postgres" "postgresResource" {
project_name = "string"
aws = {
vpc_id = "string"
cluster_arn = "string"
execution_role_arn = "string"
log_group_name = "string"
private_sg_id = "string"
private_subnet_i_ds = ["string"]
private_zone_id = "string"
public_subnet_i_ds = ["string"]
}
deploy = {
replicas = 0
resources = {
reservations = {
cpus = 0
memory = "string"
}
}
}
environment = {
"string" = "string"
}
image = "string"
postgres = {
allow_downtime = false
from_snapshot = "string"
}
}
var postgresResource = new Postgres("postgresResource", PostgresArgs.builder()
.projectName("string")
.aws(SharedInfraArgs.builder()
.vpcID("string")
.clusterArn("string")
.executionRoleArn("string")
.logGroupName("string")
.privateSgID("string")
.privateSubnetIDs("string")
.privateZoneID("string")
.publicSubnetIDs("string")
.build())
.deploy(DeployConfigArgs.builder()
.replicas(0)
.resources(ResourcesArgs.builder()
.reservations(ResourceConfigArgs.builder()
.cpus(0.0)
.memory("string")
.build())
.build())
.build())
.environment(Map.of("string", "string"))
.image("string")
.postgres(PostgresConfigArgs.builder()
.allowDowntime(false)
.fromSnapshot("string")
.build())
.build());
postgres_resource = defang_aws.Postgres("postgresResource",
project_name="string",
aws={
"vpc_id": "string",
"cluster_arn": "string",
"execution_role_arn": "string",
"log_group_name": "string",
"private_sg_id": "string",
"private_subnet_ids": ["string"],
"private_zone_id": "string",
"public_subnet_ids": ["string"],
},
deploy={
"replicas": 0,
"resources": {
"reservations": {
"cpus": float(0),
"memory": "string",
},
},
},
environment={
"string": "string",
},
image="string",
postgres={
"allow_downtime": False,
"from_snapshot": "string",
})
const postgresResource = new defang_aws.Postgres("postgresResource", {
projectName: "string",
aws: {
vpcID: "string",
clusterArn: "string",
executionRoleArn: "string",
logGroupName: "string",
privateSgID: "string",
privateSubnetIDs: ["string"],
privateZoneID: "string",
publicSubnetIDs: ["string"],
},
deploy: {
replicas: 0,
resources: {
reservations: {
cpus: 0,
memory: "string",
},
},
},
environment: {
string: "string",
},
image: "string",
postgres: {
allowDowntime: false,
fromSnapshot: "string",
},
});
type: defang-aws:Postgres
properties:
aws:
clusterArn: string
executionRoleArn: string
logGroupName: string
privateSgID: string
privateSubnetIDs:
- string
privateZoneID: string
publicSubnetIDs:
- string
vpcID: string
deploy:
replicas: 0
resources:
reservations:
cpus: 0
memory: string
environment:
string: string
image: string
postgres:
allowDowntime: false
fromSnapshot: string
projectName: string
Postgres Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Postgres resource accepts the following input properties:
- Project
Name string - Aws
Shared
Infra Args - Deploy
Deploy
Config Args - Environment map[string]string
- Image string
- Postgres
Postgres
Config Args
- project_
name string - aws object
- deploy object
- environment map(string)
- image string
- postgres object
- project
Name String - aws
Shared
Infra - deploy
Deploy
Config - environment Map<String,String>
- image String
- postgres
Postgres
Config
- project
Name string - aws
aws
Shared Infra - deploy
compose
Deploy Config - environment {[key: string]: string}
- image string
- postgres
compose
Postgres Config
- project_
name str - aws
aws.
Shared Infra Args - deploy
compose.
Deploy Config Args - environment Mapping[str, str]
- image str
- postgres
compose.
Postgres Config Args
- project
Name String - aws Property Map
- deploy Property Map
- environment Map<String>
- image String
- postgres Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Postgres resource produces the following output properties:
- Endpoint string
- Instance
Identifier string
- Endpoint string
- Instance
Identifier string
- endpoint string
- instance_
identifier string
- endpoint String
- instance
Identifier String
- endpoint string
- instance
Identifier string
- endpoint str
- instance_
identifier str
- endpoint String
- instance
Identifier String
Supporting Types
DeployConfig, DeployConfigArgs
- replicas Number
- resources Property Map
PostgresConfig, PostgresConfigArgs
- Allow
Downtime bool - From
Snapshot string
- Allow
Downtime bool - From
Snapshot string
- allow_
downtime bool - from_
snapshot string
- allow
Downtime Boolean - from
Snapshot String
- allow
Downtime boolean - from
Snapshot string
- allow_
downtime bool - from_
snapshot str
- allow
Downtime Boolean - from
Snapshot String
ResourceConfig, ResourceConfigArgs
Resources, ResourcesArgs
SharedInfra, SharedInfraArgs
- Vpc
ID string - Cluster
Arn string - Execution
Role stringArn - Log
Group stringName - Private
Sg stringID - Private
Subnet List<string>IDs - Private
Zone stringID - Public
Subnet List<string>IDs
- Vpc
ID string - Cluster
Arn string - Execution
Role stringArn - Log
Group stringName - Private
Sg stringID - Private
Subnet []stringIDs - Private
Zone stringID - Public
Subnet []stringIDs
- vpc_
id string - cluster_
arn string - execution_
role_ stringarn - log_
group_ stringname - private_
sg_ stringid - private_
subnet_ list(string)i_ ds - private_
zone_ stringid - public_
subnet_ list(string)i_ ds
- vpc
ID String - cluster
Arn String - execution
Role StringArn - log
Group StringName - private
Sg StringID - private
Subnet List<String>IDs - private
Zone StringID - public
Subnet List<String>IDs
- vpc
ID string - cluster
Arn string - execution
Role stringArn - log
Group stringName - private
Sg stringID - private
Subnet string[]IDs - private
Zone stringID - public
Subnet string[]IDs
- vpc_
id str - cluster_
arn str - execution_
role_ strarn - log_
group_ strname - private_
sg_ strid - private_
subnet_ Sequence[str]ids - private_
zone_ strid - public_
subnet_ Sequence[str]ids
- vpc
ID String - cluster
Arn String - execution
Role StringArn - log
Group StringName - private
Sg StringID - private
Subnet List<String>IDs - private
Zone StringID - public
Subnet List<String>IDs
Package Details
- Repository
- defang-aws DefangLabs/pulumi-defang
- License
- Apache-2.0
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang