UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

246 lines (245 loc) 10.1 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages RDS PostgreSQL database resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const instanceId = config.requireObject("instanceId"); * const test = new huaweicloud.rds.PgDatabase("test", {instanceId: instanceId}); * ``` * * ## Import * * The RDS postgresql database can be imported using the `instance_id` and `name` separated by a slash, e.g. bash * * ```sh * $ pulumi import huaweicloud:Rds/pgDatabase:PgDatabase test <instance_id>/<name> * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`template`, `is_revoke_public_privilege` `lc_ctype`. It is generally recommended running `terraform plan` after importing the RDS PostgreSQL database. You can then decide if changes should be applied to the RDS PostgreSQL database, or the resource definition should be updated to align with the RDS PostgreSQL database. Also you can ignore changes as below. hcl resource "huaweicloud_rds_pg_database" "account_1" { * * ... * * lifecycle { * * ignore_changes = [ * * template, is_revoke_public_privilege, lc_ctype, * * ] * * } } */ export declare class PgDatabase extends pulumi.CustomResource { /** * Get an existing PgDatabase resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PgDatabaseState, opts?: pulumi.CustomResourceOptions): PgDatabase; /** * Returns true if the given object is an instance of PgDatabase. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PgDatabase; /** * Specifies the database character set. * For details, see [documentation](https://www.postgresql.org/docs/16/infoschema-character-sets.html). * Defaults to **UTF8**. */ readonly characterSet: pulumi.Output<string>; /** * Specifies the database description. The value contains 0 to 512 characters. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the ID of the RDS PostgreSQL instance. */ readonly instanceId: pulumi.Output<string>; /** * Specifies whether to revoke the PUBLIC CREATE permission of * the public schema. * + **true**: indicates that the permission will be revoked. * + **false**: indicates that the permission will not be revoked. */ readonly isRevokePublicPrivilege: pulumi.Output<boolean>; /** * Specifies the database collocation. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to **en_US.UTF-8**. */ readonly lcCollate: pulumi.Output<string>; /** * Specifies the database classification. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to: **en_US.UTF-8**. */ readonly lcCtype: pulumi.Output<string>; /** * Specifies the database name. The value contains 1 to 63 characters, including * letters, digits, and underscores (_). It cannot start with pg or a digit, and must be different from RDS for * PostgreSQL template library names. RDS for PostgreSQL template libraries include **postgres**, **template0**, and * **template1**. */ readonly name: pulumi.Output<string>; /** * Specifies the database user. The value must be an existing username and must be different * from system usernames. Defaults to **root**. */ readonly owner: pulumi.Output<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * Indicates the database size, in bytes. */ readonly size: pulumi.Output<number>; /** * Specifies the name of the database template. Value options: **template0**, * **template1**. Defaults to **template1**. */ readonly template: pulumi.Output<string>; /** * Create a PgDatabase resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: PgDatabaseArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PgDatabase resources. */ export interface PgDatabaseState { /** * Specifies the database character set. * For details, see [documentation](https://www.postgresql.org/docs/16/infoschema-character-sets.html). * Defaults to **UTF8**. */ characterSet?: pulumi.Input<string>; /** * Specifies the database description. The value contains 0 to 512 characters. */ description?: pulumi.Input<string>; /** * Specifies the ID of the RDS PostgreSQL instance. */ instanceId?: pulumi.Input<string>; /** * Specifies whether to revoke the PUBLIC CREATE permission of * the public schema. * + **true**: indicates that the permission will be revoked. * + **false**: indicates that the permission will not be revoked. */ isRevokePublicPrivilege?: pulumi.Input<boolean>; /** * Specifies the database collocation. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to **en_US.UTF-8**. */ lcCollate?: pulumi.Input<string>; /** * Specifies the database classification. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to: **en_US.UTF-8**. */ lcCtype?: pulumi.Input<string>; /** * Specifies the database name. The value contains 1 to 63 characters, including * letters, digits, and underscores (_). It cannot start with pg or a digit, and must be different from RDS for * PostgreSQL template library names. RDS for PostgreSQL template libraries include **postgres**, **template0**, and * **template1**. */ name?: pulumi.Input<string>; /** * Specifies the database user. The value must be an existing username and must be different * from system usernames. Defaults to **root**. */ owner?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Indicates the database size, in bytes. */ size?: pulumi.Input<number>; /** * Specifies the name of the database template. Value options: **template0**, * **template1**. Defaults to **template1**. */ template?: pulumi.Input<string>; } /** * The set of arguments for constructing a PgDatabase resource. */ export interface PgDatabaseArgs { /** * Specifies the database character set. * For details, see [documentation](https://www.postgresql.org/docs/16/infoschema-character-sets.html). * Defaults to **UTF8**. */ characterSet?: pulumi.Input<string>; /** * Specifies the database description. The value contains 0 to 512 characters. */ description?: pulumi.Input<string>; /** * Specifies the ID of the RDS PostgreSQL instance. */ instanceId: pulumi.Input<string>; /** * Specifies whether to revoke the PUBLIC CREATE permission of * the public schema. * + **true**: indicates that the permission will be revoked. * + **false**: indicates that the permission will not be revoked. */ isRevokePublicPrivilege?: pulumi.Input<boolean>; /** * Specifies the database collocation. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to **en_US.UTF-8**. */ lcCollate?: pulumi.Input<string>; /** * Specifies the database classification. * For details, see [documentation](https://support.huaweicloud.com/intl/en-us/bestpractice-rds/rds_pg_0017.html). * Defaults to: **en_US.UTF-8**. */ lcCtype?: pulumi.Input<string>; /** * Specifies the database name. The value contains 1 to 63 characters, including * letters, digits, and underscores (_). It cannot start with pg or a digit, and must be different from RDS for * PostgreSQL template library names. RDS for PostgreSQL template libraries include **postgres**, **template0**, and * **template1**. */ name?: pulumi.Input<string>; /** * Specifies the database user. The value must be an existing username and must be different * from system usernames. Defaults to **root**. */ owner?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the name of the database template. Value options: **template0**, * **template1**. Defaults to **template1**. */ template?: pulumi.Input<string>; }