UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

287 lines (286 loc) 10.7 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a DNS record set resource within HuaweiCloud. * * ## Example Usage * ### Record Set with Public Zone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const publicZoneId = config.requireObject("publicZoneId"); * const publicRecordsetName = config.requireObject("publicRecordsetName"); * const description = config.requireObject("description"); * const test = new huaweicloud.dns.Recordset("test", { * zoneId: publicZoneId, * type: "A", * description: description, * status: "ENABLE", * ttl: 300, * records: ["10.1.0.0"], * lineId: "Dianxin_Shanxi", * weight: 3, * tags: { * key1: "value1", * key2: "value2", * }, * }); * ``` * ### Record Set with Private Zone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const privateZoneId = config.requireObject("privateZoneId"); * const privateRecordsetName = config.requireObject("privateRecordsetName"); * const description = config.requireObject("description"); * const test = new huaweicloud.dns.Recordset("test", { * zoneId: privateZoneId, * description: description, * ttl: 3000, * type: "A", * records: ["10.0.0.1"], * }); * ``` * * ## Import * * The DNS recordset can be imported using `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Dns/recordset:Recordset test <id> * ``` */ export declare class Recordset extends pulumi.CustomResource { /** * Get an existing Recordset 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?: RecordsetState, opts?: pulumi.CustomResourceOptions): Recordset; /** * Returns true if the given object is an instance of Recordset. 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 Recordset; /** * Specifies the description of the record set. */ readonly description: pulumi.Output<string>; /** * Specifies the resolution line ID. * Changing this parameter will create a new resource. */ readonly lineId: pulumi.Output<string>; /** * Specifies the name of the record set. * The name suffixed with a zone name, which is a complete host name ended with a dot. */ readonly name: pulumi.Output<string>; /** * Specifies the list of the records of the record set. * The value depends on the `type` parameter, you can refer to this [document](https://support.huaweicloud.com/intl/en-us/usermanual-dns/dns_usermanual_0601.html#dns_usermanual_0601__table936244914119). */ readonly records: 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>; /** * Specifies the status of the record set, defaults to **ENABLE**. * The valid values are as follows: * + **ENABLE** * + **DISABLE** */ readonly status: pulumi.Output<string | undefined>; /** * Specifies the key/value pairs to associate with the DNS record set. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Specifies the time to live (TTL) of the record set (in seconds). * The valid value is range from `1` to `2,147,483,647`. The default value is `300`. */ readonly ttl: pulumi.Output<number | undefined>; /** * Specifies the type of the record set. * + For the public record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV** and **CAA**. * + For the private record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT** and **SRV**. */ readonly type: pulumi.Output<string>; /** * Specifies the weight of the record set. * Only public zone support. The valid value is range from `1` to `1,000`. */ readonly weight: pulumi.Output<number>; /** * Specifies the ID of the zone to which the record set belongs. * Changing this parameter will create a new resource. */ readonly zoneId: pulumi.Output<string>; /** * The name of the zone to which the record set belongs. */ readonly zoneName: pulumi.Output<string>; /** * The type of the zone to which the record set belongs. * + **public** * + **private** */ readonly zoneType: pulumi.Output<string>; /** * Create a Recordset 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: RecordsetArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Recordset resources. */ export interface RecordsetState { /** * Specifies the description of the record set. */ description?: pulumi.Input<string>; /** * Specifies the resolution line ID. * Changing this parameter will create a new resource. */ lineId?: pulumi.Input<string>; /** * Specifies the name of the record set. * The name suffixed with a zone name, which is a complete host name ended with a dot. */ name?: pulumi.Input<string>; /** * Specifies the list of the records of the record set. * The value depends on the `type` parameter, you can refer to this [document](https://support.huaweicloud.com/intl/en-us/usermanual-dns/dns_usermanual_0601.html#dns_usermanual_0601__table936244914119). */ records?: pulumi.Input<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 status of the record set, defaults to **ENABLE**. * The valid values are as follows: * + **ENABLE** * + **DISABLE** */ status?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the DNS record set. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the time to live (TTL) of the record set (in seconds). * The valid value is range from `1` to `2,147,483,647`. The default value is `300`. */ ttl?: pulumi.Input<number>; /** * Specifies the type of the record set. * + For the public record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV** and **CAA**. * + For the private record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT** and **SRV**. */ type?: pulumi.Input<string>; /** * Specifies the weight of the record set. * Only public zone support. The valid value is range from `1` to `1,000`. */ weight?: pulumi.Input<number>; /** * Specifies the ID of the zone to which the record set belongs. * Changing this parameter will create a new resource. */ zoneId?: pulumi.Input<string>; /** * The name of the zone to which the record set belongs. */ zoneName?: pulumi.Input<string>; /** * The type of the zone to which the record set belongs. * + **public** * + **private** */ zoneType?: pulumi.Input<string>; } /** * The set of arguments for constructing a Recordset resource. */ export interface RecordsetArgs { /** * Specifies the description of the record set. */ description?: pulumi.Input<string>; /** * Specifies the resolution line ID. * Changing this parameter will create a new resource. */ lineId?: pulumi.Input<string>; /** * Specifies the name of the record set. * The name suffixed with a zone name, which is a complete host name ended with a dot. */ name?: pulumi.Input<string>; /** * Specifies the list of the records of the record set. * The value depends on the `type` parameter, you can refer to this [document](https://support.huaweicloud.com/intl/en-us/usermanual-dns/dns_usermanual_0601.html#dns_usermanual_0601__table936244914119). */ records: pulumi.Input<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 status of the record set, defaults to **ENABLE**. * The valid values are as follows: * + **ENABLE** * + **DISABLE** */ status?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the DNS record set. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the time to live (TTL) of the record set (in seconds). * The valid value is range from `1` to `2,147,483,647`. The default value is `300`. */ ttl?: pulumi.Input<number>; /** * Specifies the type of the record set. * + For the public record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV** and **CAA**. * + For the private record set, the valid values are **A**, **AAAA**, **MX**, **CNAME**, **TXT** and **SRV**. */ type: pulumi.Input<string>; /** * Specifies the weight of the record set. * Only public zone support. The valid value is range from `1` to `1,000`. */ weight?: pulumi.Input<number>; /** * Specifies the ID of the zone to which the record set belongs. * Changing this parameter will create a new resource. */ zoneId: pulumi.Input<string>; }