1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. PostgresqlTimeWindow
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.PostgresqlTimeWindow

Explore with Pulumi AI

Provides a resource to create a postgres postgresql_time_window

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const postgresqlTimeWindow = new tencentcloud.PostgresqlTimeWindow("postgresqlTimeWindow", {
    dbInstanceId: "postgres-45b0vlmr",
    maintainDuration: 2,
    maintainStartTime: "04:00",
    maintainWeekDays: [
        "friday",
        "monday",
        "saturday",
        "sunday",
        "thursday",
        "tuesday",
        "wednesday",
    ],
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

postgresql_time_window = tencentcloud.PostgresqlTimeWindow("postgresqlTimeWindow",
    db_instance_id="postgres-45b0vlmr",
    maintain_duration=2,
    maintain_start_time="04:00",
    maintain_week_days=[
        "friday",
        "monday",
        "saturday",
        "sunday",
        "thursday",
        "tuesday",
        "wednesday",
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.NewPostgresqlTimeWindow(ctx, "postgresqlTimeWindow", &tencentcloud.PostgresqlTimeWindowArgs{
			DbInstanceId:      pulumi.String("postgres-45b0vlmr"),
			MaintainDuration:  pulumi.Float64(2),
			MaintainStartTime: pulumi.String("04:00"),
			MaintainWeekDays: pulumi.StringArray{
				pulumi.String("friday"),
				pulumi.String("monday"),
				pulumi.String("saturday"),
				pulumi.String("sunday"),
				pulumi.String("thursday"),
				pulumi.String("tuesday"),
				pulumi.String("wednesday"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var postgresqlTimeWindow = new Tencentcloud.PostgresqlTimeWindow("postgresqlTimeWindow", new()
    {
        DbInstanceId = "postgres-45b0vlmr",
        MaintainDuration = 2,
        MaintainStartTime = "04:00",
        MaintainWeekDays = new[]
        {
            "friday",
            "monday",
            "saturday",
            "sunday",
            "thursday",
            "tuesday",
            "wednesday",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.PostgresqlTimeWindow;
import com.pulumi.tencentcloud.PostgresqlTimeWindowArgs;
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 postgresqlTimeWindow = new PostgresqlTimeWindow("postgresqlTimeWindow", PostgresqlTimeWindowArgs.builder()
            .dbInstanceId("postgres-45b0vlmr")
            .maintainDuration(2)
            .maintainStartTime("04:00")
            .maintainWeekDays(            
                "friday",
                "monday",
                "saturday",
                "sunday",
                "thursday",
                "tuesday",
                "wednesday")
            .build());

    }
}
Copy
resources:
  postgresqlTimeWindow:
    type: tencentcloud:PostgresqlTimeWindow
    properties:
      dbInstanceId: postgres-45b0vlmr
      maintainDuration: 2
      maintainStartTime: 04:00
      maintainWeekDays:
        - friday
        - monday
        - saturday
        - sunday
        - thursday
        - tuesday
        - wednesday
Copy

Create PostgresqlTimeWindow Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new PostgresqlTimeWindow(name: string, args: PostgresqlTimeWindowArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlTimeWindow(resource_name: str,
                         args: PostgresqlTimeWindowArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def PostgresqlTimeWindow(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         db_instance_id: Optional[str] = None,
                         maintain_duration: Optional[float] = None,
                         maintain_start_time: Optional[str] = None,
                         maintain_week_days: Optional[Sequence[str]] = None,
                         postgresql_time_window_id: Optional[str] = None)
func NewPostgresqlTimeWindow(ctx *Context, name string, args PostgresqlTimeWindowArgs, opts ...ResourceOption) (*PostgresqlTimeWindow, error)
public PostgresqlTimeWindow(string name, PostgresqlTimeWindowArgs args, CustomResourceOptions? opts = null)
public PostgresqlTimeWindow(String name, PostgresqlTimeWindowArgs args)
public PostgresqlTimeWindow(String name, PostgresqlTimeWindowArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlTimeWindow
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PostgresqlTimeWindowArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PostgresqlTimeWindowArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PostgresqlTimeWindowArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PostgresqlTimeWindowArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PostgresqlTimeWindowArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

PostgresqlTimeWindow 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 PostgresqlTimeWindow resource accepts the following input properties:

DbInstanceId This property is required. string
Instance id.
MaintainDuration double
Maintenance duration, Unit: hours.
MaintainStartTime string
Maintenance start time. Time zone is UTC+8.
MaintainWeekDays List<string>
Maintenance cycle.
PostgresqlTimeWindowId string
ID of the resource.
DbInstanceId This property is required. string
Instance id.
MaintainDuration float64
Maintenance duration, Unit: hours.
MaintainStartTime string
Maintenance start time. Time zone is UTC+8.
MaintainWeekDays []string
Maintenance cycle.
PostgresqlTimeWindowId string
ID of the resource.
dbInstanceId This property is required. String
Instance id.
maintainDuration Double
Maintenance duration, Unit: hours.
maintainStartTime String
Maintenance start time. Time zone is UTC+8.
maintainWeekDays List<String>
Maintenance cycle.
postgresqlTimeWindowId String
ID of the resource.
dbInstanceId This property is required. string
Instance id.
maintainDuration number
Maintenance duration, Unit: hours.
maintainStartTime string
Maintenance start time. Time zone is UTC+8.
maintainWeekDays string[]
Maintenance cycle.
postgresqlTimeWindowId string
ID of the resource.
db_instance_id This property is required. str
Instance id.
maintain_duration float
Maintenance duration, Unit: hours.
maintain_start_time str
Maintenance start time. Time zone is UTC+8.
maintain_week_days Sequence[str]
Maintenance cycle.
postgresql_time_window_id str
ID of the resource.
dbInstanceId This property is required. String
Instance id.
maintainDuration Number
Maintenance duration, Unit: hours.
maintainStartTime String
Maintenance start time. Time zone is UTC+8.
maintainWeekDays List<String>
Maintenance cycle.
postgresqlTimeWindowId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the PostgresqlTimeWindow 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 PostgresqlTimeWindow Resource

Get an existing PostgresqlTimeWindow 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?: PostgresqlTimeWindowState, opts?: CustomResourceOptions): PostgresqlTimeWindow
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        db_instance_id: Optional[str] = None,
        maintain_duration: Optional[float] = None,
        maintain_start_time: Optional[str] = None,
        maintain_week_days: Optional[Sequence[str]] = None,
        postgresql_time_window_id: Optional[str] = None) -> PostgresqlTimeWindow
func GetPostgresqlTimeWindow(ctx *Context, name string, id IDInput, state *PostgresqlTimeWindowState, opts ...ResourceOption) (*PostgresqlTimeWindow, error)
public static PostgresqlTimeWindow Get(string name, Input<string> id, PostgresqlTimeWindowState? state, CustomResourceOptions? opts = null)
public static PostgresqlTimeWindow get(String name, Output<String> id, PostgresqlTimeWindowState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:PostgresqlTimeWindow    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
DbInstanceId string
Instance id.
MaintainDuration double
Maintenance duration, Unit: hours.
MaintainStartTime string
Maintenance start time. Time zone is UTC+8.
MaintainWeekDays List<string>
Maintenance cycle.
PostgresqlTimeWindowId string
ID of the resource.
DbInstanceId string
Instance id.
MaintainDuration float64
Maintenance duration, Unit: hours.
MaintainStartTime string
Maintenance start time. Time zone is UTC+8.
MaintainWeekDays []string
Maintenance cycle.
PostgresqlTimeWindowId string
ID of the resource.
dbInstanceId String
Instance id.
maintainDuration Double
Maintenance duration, Unit: hours.
maintainStartTime String
Maintenance start time. Time zone is UTC+8.
maintainWeekDays List<String>
Maintenance cycle.
postgresqlTimeWindowId String
ID of the resource.
dbInstanceId string
Instance id.
maintainDuration number
Maintenance duration, Unit: hours.
maintainStartTime string
Maintenance start time. Time zone is UTC+8.
maintainWeekDays string[]
Maintenance cycle.
postgresqlTimeWindowId string
ID of the resource.
db_instance_id str
Instance id.
maintain_duration float
Maintenance duration, Unit: hours.
maintain_start_time str
Maintenance start time. Time zone is UTC+8.
maintain_week_days Sequence[str]
Maintenance cycle.
postgresql_time_window_id str
ID of the resource.
dbInstanceId String
Instance id.
maintainDuration Number
Maintenance duration, Unit: hours.
maintainStartTime String
Maintenance start time. Time zone is UTC+8.
maintainWeekDays List<String>
Maintenance cycle.
postgresqlTimeWindowId String
ID of the resource.

Import

postgres postgresql_time_window can be imported using the id, e.g.

$ pulumi import tencentcloud:index/postgresqlTimeWindow:PostgresqlTimeWindow postgresql_time_window instance_id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.