dns

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion added in v0.0.2

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package. If a version cannot be determined, v1 will be assumed. The second return value is always nil.

Types

type Ptrrecord

type Ptrrecord struct {
	pulumi.CustomResourceState

	// The address of the FloatingIP/EIP.
	Address pulumi.StringOutput `pulumi:"address"`
	// Specifies the description of the PTR record.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	// The enterprise project id of the PTR record. Changing this
	// creates a new PTR record.
	EnterpriseProjectId pulumi.StringOutput `pulumi:"enterpriseProjectId"`
	// Specifies the ID of the FloatingIP/EIP.
	// Changing this creates a new PTR record.
	FloatingipId pulumi.StringOutput `pulumi:"floatingipId"`
	// Specifies the domain name of the PTR record. A domain name is case-insensitive.
	// Uppercase letters will also be converted into lowercase letters.
	Name pulumi.StringOutput `pulumi:"name"`
	// Specifies the region in which to create the PTR record. If omitted,
	// the `region` argument of the provider will be used. Changing this creates a new PTR record.
	Region pulumi.StringOutput `pulumi:"region"`
	// Tags key/value pairs to associate with the PTR record.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 300–2147483647. The default value is 300.
	Ttl pulumi.IntPtrOutput `pulumi:"ttl"`
}

Manages a DNS PTR record in the HuaweiCloud DNS Service.

## Example Usage

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		eip1, err := Vpc.NewEip(ctx, "eip1", &Vpc.EipArgs{
			Publicip: &vpc.EipPublicipArgs{
				Type: pulumi.String("5_bgp"),
			},
			Bandwidth: &vpc.EipBandwidthArgs{
				Name:       pulumi.String("test"),
				Size:       pulumi.Int(5),
				ShareType:  pulumi.String("PER"),
				ChargeMode: pulumi.String("traffic"),
			},
		})
		if err != nil {
			return err
		}
		_, err = Dns.NewPtrrecord(ctx, "ptr1", &Dns.PtrrecordArgs{
			Description:  pulumi.String("An example PTR record"),
			FloatingipId: eip1.ID(),
			Ttl:          pulumi.Int(3000),
			Tags: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

PTR records can be imported using region and floatingip/eip ID, separated by a colon(:), e.g.

```sh

$ pulumi import huaweicloud:Dns/ptrrecord:Ptrrecord ptr_1 cn-north-1:d90ce693-5ccf-4136-a0ed-152ce412b6b9

```

func GetPtrrecord

func GetPtrrecord(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *PtrrecordState, opts ...pulumi.ResourceOption) (*Ptrrecord, error)

GetPtrrecord gets an existing Ptrrecord resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewPtrrecord

func NewPtrrecord(ctx *pulumi.Context,
	name string, args *PtrrecordArgs, opts ...pulumi.ResourceOption) (*Ptrrecord, error)

NewPtrrecord registers a new resource with the given unique name, arguments, and options.

func (*Ptrrecord) ElementType

func (*Ptrrecord) ElementType() reflect.Type

func (*Ptrrecord) ToPtrrecordOutput

func (i *Ptrrecord) ToPtrrecordOutput() PtrrecordOutput

func (*Ptrrecord) ToPtrrecordOutputWithContext

func (i *Ptrrecord) ToPtrrecordOutputWithContext(ctx context.Context) PtrrecordOutput

type PtrrecordArgs

type PtrrecordArgs struct {
	// Specifies the description of the PTR record.
	Description pulumi.StringPtrInput
	// The enterprise project id of the PTR record. Changing this
	// creates a new PTR record.
	EnterpriseProjectId pulumi.StringPtrInput
	// Specifies the ID of the FloatingIP/EIP.
	// Changing this creates a new PTR record.
	FloatingipId pulumi.StringInput
	// Specifies the domain name of the PTR record. A domain name is case-insensitive.
	// Uppercase letters will also be converted into lowercase letters.
	Name pulumi.StringPtrInput
	// Specifies the region in which to create the PTR record. If omitted,
	// the `region` argument of the provider will be used. Changing this creates a new PTR record.
	Region pulumi.StringPtrInput
	// Tags key/value pairs to associate with the PTR record.
	Tags pulumi.StringMapInput
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 300–2147483647. The default value is 300.
	Ttl pulumi.IntPtrInput
}

The set of arguments for constructing a Ptrrecord resource.

func (PtrrecordArgs) ElementType

func (PtrrecordArgs) ElementType() reflect.Type

type PtrrecordArray

type PtrrecordArray []PtrrecordInput

func (PtrrecordArray) ElementType

func (PtrrecordArray) ElementType() reflect.Type

func (PtrrecordArray) ToPtrrecordArrayOutput

func (i PtrrecordArray) ToPtrrecordArrayOutput() PtrrecordArrayOutput

func (PtrrecordArray) ToPtrrecordArrayOutputWithContext

func (i PtrrecordArray) ToPtrrecordArrayOutputWithContext(ctx context.Context) PtrrecordArrayOutput

type PtrrecordArrayInput

type PtrrecordArrayInput interface {
	pulumi.Input

	ToPtrrecordArrayOutput() PtrrecordArrayOutput
	ToPtrrecordArrayOutputWithContext(context.Context) PtrrecordArrayOutput
}

PtrrecordArrayInput is an input type that accepts PtrrecordArray and PtrrecordArrayOutput values. You can construct a concrete instance of `PtrrecordArrayInput` via:

PtrrecordArray{ PtrrecordArgs{...} }

type PtrrecordArrayOutput

type PtrrecordArrayOutput struct{ *pulumi.OutputState }

func (PtrrecordArrayOutput) ElementType

func (PtrrecordArrayOutput) ElementType() reflect.Type

func (PtrrecordArrayOutput) Index

func (PtrrecordArrayOutput) ToPtrrecordArrayOutput

func (o PtrrecordArrayOutput) ToPtrrecordArrayOutput() PtrrecordArrayOutput

func (PtrrecordArrayOutput) ToPtrrecordArrayOutputWithContext

func (o PtrrecordArrayOutput) ToPtrrecordArrayOutputWithContext(ctx context.Context) PtrrecordArrayOutput

type PtrrecordInput

type PtrrecordInput interface {
	pulumi.Input

	ToPtrrecordOutput() PtrrecordOutput
	ToPtrrecordOutputWithContext(ctx context.Context) PtrrecordOutput
}

type PtrrecordMap

type PtrrecordMap map[string]PtrrecordInput

func (PtrrecordMap) ElementType

func (PtrrecordMap) ElementType() reflect.Type

func (PtrrecordMap) ToPtrrecordMapOutput

func (i PtrrecordMap) ToPtrrecordMapOutput() PtrrecordMapOutput

func (PtrrecordMap) ToPtrrecordMapOutputWithContext

func (i PtrrecordMap) ToPtrrecordMapOutputWithContext(ctx context.Context) PtrrecordMapOutput

type PtrrecordMapInput

type PtrrecordMapInput interface {
	pulumi.Input

	ToPtrrecordMapOutput() PtrrecordMapOutput
	ToPtrrecordMapOutputWithContext(context.Context) PtrrecordMapOutput
}

PtrrecordMapInput is an input type that accepts PtrrecordMap and PtrrecordMapOutput values. You can construct a concrete instance of `PtrrecordMapInput` via:

PtrrecordMap{ "key": PtrrecordArgs{...} }

type PtrrecordMapOutput

type PtrrecordMapOutput struct{ *pulumi.OutputState }

func (PtrrecordMapOutput) ElementType

func (PtrrecordMapOutput) ElementType() reflect.Type

func (PtrrecordMapOutput) MapIndex

func (PtrrecordMapOutput) ToPtrrecordMapOutput

func (o PtrrecordMapOutput) ToPtrrecordMapOutput() PtrrecordMapOutput

func (PtrrecordMapOutput) ToPtrrecordMapOutputWithContext

func (o PtrrecordMapOutput) ToPtrrecordMapOutputWithContext(ctx context.Context) PtrrecordMapOutput

type PtrrecordOutput

type PtrrecordOutput struct{ *pulumi.OutputState }

func (PtrrecordOutput) Address

func (o PtrrecordOutput) Address() pulumi.StringOutput

The address of the FloatingIP/EIP.

func (PtrrecordOutput) Description

func (o PtrrecordOutput) Description() pulumi.StringPtrOutput

Specifies the description of the PTR record.

func (PtrrecordOutput) ElementType

func (PtrrecordOutput) ElementType() reflect.Type

func (PtrrecordOutput) EnterpriseProjectId

func (o PtrrecordOutput) EnterpriseProjectId() pulumi.StringOutput

The enterprise project id of the PTR record. Changing this creates a new PTR record.

func (PtrrecordOutput) FloatingipId

func (o PtrrecordOutput) FloatingipId() pulumi.StringOutput

Specifies the ID of the FloatingIP/EIP. Changing this creates a new PTR record.

func (PtrrecordOutput) Name

Specifies the domain name of the PTR record. A domain name is case-insensitive. Uppercase letters will also be converted into lowercase letters.

func (PtrrecordOutput) Region

func (o PtrrecordOutput) Region() pulumi.StringOutput

Specifies the region in which to create the PTR record. If omitted, the `region` argument of the provider will be used. Changing this creates a new PTR record.

func (PtrrecordOutput) Tags

Tags key/value pairs to associate with the PTR record.

func (PtrrecordOutput) ToPtrrecordOutput

func (o PtrrecordOutput) ToPtrrecordOutput() PtrrecordOutput

func (PtrrecordOutput) ToPtrrecordOutputWithContext

func (o PtrrecordOutput) ToPtrrecordOutputWithContext(ctx context.Context) PtrrecordOutput

func (PtrrecordOutput) Ttl

Specifies the time to live (TTL) of the record set (in seconds). The value range is 300–2147483647. The default value is 300.

type PtrrecordState

type PtrrecordState struct {
	// The address of the FloatingIP/EIP.
	Address pulumi.StringPtrInput
	// Specifies the description of the PTR record.
	Description pulumi.StringPtrInput
	// The enterprise project id of the PTR record. Changing this
	// creates a new PTR record.
	EnterpriseProjectId pulumi.StringPtrInput
	// Specifies the ID of the FloatingIP/EIP.
	// Changing this creates a new PTR record.
	FloatingipId pulumi.StringPtrInput
	// Specifies the domain name of the PTR record. A domain name is case-insensitive.
	// Uppercase letters will also be converted into lowercase letters.
	Name pulumi.StringPtrInput
	// Specifies the region in which to create the PTR record. If omitted,
	// the `region` argument of the provider will be used. Changing this creates a new PTR record.
	Region pulumi.StringPtrInput
	// Tags key/value pairs to associate with the PTR record.
	Tags pulumi.StringMapInput
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 300–2147483647. The default value is 300.
	Ttl pulumi.IntPtrInput
}

func (PtrrecordState) ElementType

func (PtrrecordState) ElementType() reflect.Type

type Recordset

type Recordset struct {
	pulumi.CustomResourceState

	// Specifies the description of the record set.
	Description pulumi.StringOutput `pulumi:"description"`
	// Specifies the resolution line ID.
	// Changing this parameter will create a new resource.
	LineId pulumi.StringOutput `pulumi:"lineId"`
	// 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.StringOutput `pulumi:"name"`
	// Specifies an array of DNS records. The value rules vary depending on the record set type.
	Records pulumi.StringArrayOutput `pulumi:"records"`
	// 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.StringOutput `pulumi:"region"`
	// Specifies the status of the record set.
	// Value options: **ENABLE**, **DISABLE**. The default value is **ENABLE**.
	Status pulumi.StringPtrOutput `pulumi:"status"`
	// Specifies the key/value pairs to associate with the DNS recordset.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 1–2147483647. The default value is 300.
	Ttl pulumi.IntPtrOutput `pulumi:"ttl"`
	// Specifies the type of the record set.
	// Value options: **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV**, **CAA**.
	Type pulumi.StringOutput `pulumi:"type"`
	// Specifies the weight of the record set.
	// Only public zone support. The value range is 0–1000.
	Weight pulumi.IntOutput `pulumi:"weight"`
	// Specifies the zone ID.
	// Changing this parameter will create a new resource.
	ZoneId pulumi.StringOutput `pulumi:"zoneId"`
	// The zone name of the record set.
	ZoneName pulumi.StringOutput `pulumi:"zoneName"`
}

Manages a DNS record set resource within HuaweiCloud.

## Example Usage ### Record Set with Multi-line

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleZone, err := Dns.NewZone(ctx, "exampleZone", &Dns.ZoneArgs{
			Email:       pulumi.String("email2@example.com"),
			Description: pulumi.String("a zone"),
			Ttl:         pulumi.Int(6000),
			ZoneType:    pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		_, err = Dns.NewRecordset(ctx, "test", &Dns.RecordsetArgs{
			ZoneId:      exampleZone.ID(),
			Type:        pulumi.String("A"),
			Description: pulumi.String("a recordset description"),
			Status:      pulumi.String("ENABLE"),
			Ttl:         pulumi.Int(300),
			Records: pulumi.StringArray{
				pulumi.String("10.1.0.0"),
			},
			LineId: pulumi.String("Dianxin_Shanxi"),
			Weight: pulumi.Int(3),
			Tags: pulumi.StringMap{
				"key1": pulumi.String("value1"),
				"key2": pulumi.String("value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Record Set with Public Zone

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleZone, err := Dns.NewZone(ctx, "exampleZone", &Dns.ZoneArgs{
			Email:       pulumi.String("email2@example.com"),
			Description: pulumi.String("a public zone"),
			Ttl:         pulumi.Int(6000),
			ZoneType:    pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		_, err = Dns.NewRecordset(ctx, "test", &Dns.RecordsetArgs{
			ZoneId:      exampleZone.ID(),
			Description: pulumi.String("An example record set"),
			Ttl:         pulumi.Int(3000),
			Type:        pulumi.String("A"),
			Records: pulumi.StringArray{
				pulumi.String("10.0.0.1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Record Set with Private Zone

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleZone, err := Dns.NewZone(ctx, "exampleZone", &Dns.ZoneArgs{
			Email:       pulumi.String("email2@example.com"),
			Description: pulumi.String("a private zone"),
			Ttl:         pulumi.Int(6000),
			ZoneType:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = Dns.NewRecordset(ctx, "test", &Dns.RecordsetArgs{
			ZoneId:      exampleZone.ID(),
			Description: pulumi.String("An example record set"),
			Ttl:         pulumi.Int(3000),
			Type:        pulumi.String("A"),
			Records: pulumi.StringArray{
				pulumi.String("10.0.0.1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

The DNS recordset can be imported using `zone_id`, `recordset_id`, separated by slashes, e.g. bash

```sh

$ pulumi import huaweicloud:Dns/recordset:Recordset test <zone_id>/<recordset_id>

```

func GetRecordset

func GetRecordset(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RecordsetState, opts ...pulumi.ResourceOption) (*Recordset, error)

GetRecordset gets an existing Recordset resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRecordset

func NewRecordset(ctx *pulumi.Context,
	name string, args *RecordsetArgs, opts ...pulumi.ResourceOption) (*Recordset, error)

NewRecordset registers a new resource with the given unique name, arguments, and options.

func (*Recordset) ElementType

func (*Recordset) ElementType() reflect.Type

func (*Recordset) ToRecordsetOutput

func (i *Recordset) ToRecordsetOutput() RecordsetOutput

func (*Recordset) ToRecordsetOutputWithContext

func (i *Recordset) ToRecordsetOutputWithContext(ctx context.Context) RecordsetOutput

type RecordsetArgs

type RecordsetArgs struct {
	// Specifies the description of the record set.
	Description pulumi.StringPtrInput
	// Specifies the resolution line ID.
	// Changing this parameter will create a new resource.
	LineId pulumi.StringPtrInput
	// 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.StringPtrInput
	// Specifies an array of DNS records. The value rules vary depending on the record set type.
	Records pulumi.StringArrayInput
	// 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.StringPtrInput
	// Specifies the status of the record set.
	// Value options: **ENABLE**, **DISABLE**. The default value is **ENABLE**.
	Status pulumi.StringPtrInput
	// Specifies the key/value pairs to associate with the DNS recordset.
	Tags pulumi.StringMapInput
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 1–2147483647. The default value is 300.
	Ttl pulumi.IntPtrInput
	// Specifies the type of the record set.
	// Value options: **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV**, **CAA**.
	Type pulumi.StringInput
	// Specifies the weight of the record set.
	// Only public zone support. The value range is 0–1000.
	Weight pulumi.IntPtrInput
	// Specifies the zone ID.
	// Changing this parameter will create a new resource.
	ZoneId pulumi.StringInput
}

The set of arguments for constructing a Recordset resource.

func (RecordsetArgs) ElementType

func (RecordsetArgs) ElementType() reflect.Type

type RecordsetArray

type RecordsetArray []RecordsetInput

func (RecordsetArray) ElementType

func (RecordsetArray) ElementType() reflect.Type

func (RecordsetArray) ToRecordsetArrayOutput

func (i RecordsetArray) ToRecordsetArrayOutput() RecordsetArrayOutput

func (RecordsetArray) ToRecordsetArrayOutputWithContext

func (i RecordsetArray) ToRecordsetArrayOutputWithContext(ctx context.Context) RecordsetArrayOutput

type RecordsetArrayInput

type RecordsetArrayInput interface {
	pulumi.Input

	ToRecordsetArrayOutput() RecordsetArrayOutput
	ToRecordsetArrayOutputWithContext(context.Context) RecordsetArrayOutput
}

RecordsetArrayInput is an input type that accepts RecordsetArray and RecordsetArrayOutput values. You can construct a concrete instance of `RecordsetArrayInput` via:

RecordsetArray{ RecordsetArgs{...} }

type RecordsetArrayOutput

type RecordsetArrayOutput struct{ *pulumi.OutputState }

func (RecordsetArrayOutput) ElementType

func (RecordsetArrayOutput) ElementType() reflect.Type

func (RecordsetArrayOutput) Index

func (RecordsetArrayOutput) ToRecordsetArrayOutput

func (o RecordsetArrayOutput) ToRecordsetArrayOutput() RecordsetArrayOutput

func (RecordsetArrayOutput) ToRecordsetArrayOutputWithContext

func (o RecordsetArrayOutput) ToRecordsetArrayOutputWithContext(ctx context.Context) RecordsetArrayOutput

type RecordsetInput

type RecordsetInput interface {
	pulumi.Input

	ToRecordsetOutput() RecordsetOutput
	ToRecordsetOutputWithContext(ctx context.Context) RecordsetOutput
}

type RecordsetMap

type RecordsetMap map[string]RecordsetInput

func (RecordsetMap) ElementType

func (RecordsetMap) ElementType() reflect.Type

func (RecordsetMap) ToRecordsetMapOutput

func (i RecordsetMap) ToRecordsetMapOutput() RecordsetMapOutput

func (RecordsetMap) ToRecordsetMapOutputWithContext

func (i RecordsetMap) ToRecordsetMapOutputWithContext(ctx context.Context) RecordsetMapOutput

type RecordsetMapInput

type RecordsetMapInput interface {
	pulumi.Input

	ToRecordsetMapOutput() RecordsetMapOutput
	ToRecordsetMapOutputWithContext(context.Context) RecordsetMapOutput
}

RecordsetMapInput is an input type that accepts RecordsetMap and RecordsetMapOutput values. You can construct a concrete instance of `RecordsetMapInput` via:

RecordsetMap{ "key": RecordsetArgs{...} }

type RecordsetMapOutput

type RecordsetMapOutput struct{ *pulumi.OutputState }

func (RecordsetMapOutput) ElementType

func (RecordsetMapOutput) ElementType() reflect.Type

func (RecordsetMapOutput) MapIndex

func (RecordsetMapOutput) ToRecordsetMapOutput

func (o RecordsetMapOutput) ToRecordsetMapOutput() RecordsetMapOutput

func (RecordsetMapOutput) ToRecordsetMapOutputWithContext

func (o RecordsetMapOutput) ToRecordsetMapOutputWithContext(ctx context.Context) RecordsetMapOutput

type RecordsetOutput

type RecordsetOutput struct{ *pulumi.OutputState }

func (RecordsetOutput) Description

func (o RecordsetOutput) Description() pulumi.StringOutput

Specifies the description of the record set.

func (RecordsetOutput) ElementType

func (RecordsetOutput) ElementType() reflect.Type

func (RecordsetOutput) LineId added in v0.0.8

func (o RecordsetOutput) LineId() pulumi.StringOutput

Specifies the resolution line ID. Changing this parameter will create a new resource.

func (RecordsetOutput) Name

Specifies the name of the record set. The name suffixed with a zone name, which is a complete host name ended with a dot.

func (RecordsetOutput) Records

Specifies an array of DNS records. The value rules vary depending on the record set type.

func (RecordsetOutput) Region

func (o RecordsetOutput) Region() pulumi.StringOutput

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.

func (RecordsetOutput) Status added in v0.0.8

Specifies the status of the record set. Value options: **ENABLE**, **DISABLE**. The default value is **ENABLE**.

func (RecordsetOutput) Tags

Specifies the key/value pairs to associate with the DNS recordset.

func (RecordsetOutput) ToRecordsetOutput

func (o RecordsetOutput) ToRecordsetOutput() RecordsetOutput

func (RecordsetOutput) ToRecordsetOutputWithContext

func (o RecordsetOutput) ToRecordsetOutputWithContext(ctx context.Context) RecordsetOutput

func (RecordsetOutput) Ttl

Specifies the time to live (TTL) of the record set (in seconds). The value range is 1–2147483647. The default value is 300.

func (RecordsetOutput) Type

Specifies the type of the record set. Value options: **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV**, **CAA**.

func (RecordsetOutput) Weight added in v0.0.8

func (o RecordsetOutput) Weight() pulumi.IntOutput

Specifies the weight of the record set. Only public zone support. The value range is 0–1000.

func (RecordsetOutput) ZoneId

func (o RecordsetOutput) ZoneId() pulumi.StringOutput

Specifies the zone ID. Changing this parameter will create a new resource.

func (RecordsetOutput) ZoneName added in v0.0.8

func (o RecordsetOutput) ZoneName() pulumi.StringOutput

The zone name of the record set.

type RecordsetState

type RecordsetState struct {
	// Specifies the description of the record set.
	Description pulumi.StringPtrInput
	// Specifies the resolution line ID.
	// Changing this parameter will create a new resource.
	LineId pulumi.StringPtrInput
	// 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.StringPtrInput
	// Specifies an array of DNS records. The value rules vary depending on the record set type.
	Records pulumi.StringArrayInput
	// 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.StringPtrInput
	// Specifies the status of the record set.
	// Value options: **ENABLE**, **DISABLE**. The default value is **ENABLE**.
	Status pulumi.StringPtrInput
	// Specifies the key/value pairs to associate with the DNS recordset.
	Tags pulumi.StringMapInput
	// Specifies the time to live (TTL) of the record set (in seconds).
	// The value range is 1–2147483647. The default value is 300.
	Ttl pulumi.IntPtrInput
	// Specifies the type of the record set.
	// Value options: **A**, **AAAA**, **MX**, **CNAME**, **TXT**, **NS**, **SRV**, **CAA**.
	Type pulumi.StringPtrInput
	// Specifies the weight of the record set.
	// Only public zone support. The value range is 0–1000.
	Weight pulumi.IntPtrInput
	// Specifies the zone ID.
	// Changing this parameter will create a new resource.
	ZoneId pulumi.StringPtrInput
	// The zone name of the record set.
	ZoneName pulumi.StringPtrInput
}

func (RecordsetState) ElementType

func (RecordsetState) ElementType() reflect.Type

type Zone

type Zone struct {
	pulumi.CustomResourceState

	// A description of the zone.
	Description pulumi.StringPtrOutput `pulumi:"description"`
	// The email address of the administrator managing the zone.
	Email pulumi.StringOutput `pulumi:"email"`
	// The enterprise project id of the zone. Changing this creates a
	// new zone.
	EnterpriseProjectId pulumi.StringOutput `pulumi:"enterpriseProjectId"`
	// An array of master DNS servers.
	Masters pulumi.StringArrayOutput `pulumi:"masters"`
	// The name of the zone. Note the `.` at the end of the name. Changing this creates
	// a new DNS zone.
	Name pulumi.StringOutput `pulumi:"name"`
	// The region in which to create the DNS zone. If omitted, the `region` argument
	// of the provider will be used. Changing this creates a new DNS zone.
	Region pulumi.StringOutput `pulumi:"region"`
	// Router configuration block which is required if zoneType is private. The router
	// structure is documented below.
	Routers ZoneRouterArrayOutput `pulumi:"routers"`
	// The key/value pairs to associate with the zone.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// The time to live (TTL) of the zone.
	Ttl pulumi.IntPtrOutput `pulumi:"ttl"`
	// The type of zone. Can either be `public` or `private`. Changing this
	// creates a new DNS zone.
	ZoneType pulumi.StringPtrOutput `pulumi:"zoneType"`
}

Manages a DNS zone in the HuaweiCloud DNS Service.

## Example Usage ### Create a public DNS zone

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dns.NewZone(ctx, "myPublicZone", &Dns.ZoneArgs{
			Description: pulumi.String("An example zone"),
			Email:       pulumi.String("jdoe@example.com"),
			Ttl:         pulumi.Int(3000),
			ZoneType:    pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

``` ### Create a private DNS zone

```go package main

import (

"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Dns.NewZone(ctx, "myPrivateZone", &Dns.ZoneArgs{
			Description: pulumi.String("An example zone"),
			Email:       pulumi.String("jdoe@example.com"),
			Routers: dns.ZoneRouterArray{
				&dns.ZoneRouterArgs{
					RouterId: pulumi.String("2c1fe4bd-ebad-44ca-ae9d-e94e63847b75"),
				},
			},
			Ttl:      pulumi.Int(3000),
			ZoneType: pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Import

This resource can be imported by specifying the zone ID

```sh

$ pulumi import huaweicloud:Dns/zone:Zone zone_1 <zone_id>

```

func GetZone

func GetZone(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ZoneState, opts ...pulumi.ResourceOption) (*Zone, error)

GetZone gets an existing Zone resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewZone

func NewZone(ctx *pulumi.Context,
	name string, args *ZoneArgs, opts ...pulumi.ResourceOption) (*Zone, error)

NewZone registers a new resource with the given unique name, arguments, and options.

func (*Zone) ElementType

func (*Zone) ElementType() reflect.Type

func (*Zone) ToZoneOutput

func (i *Zone) ToZoneOutput() ZoneOutput

func (*Zone) ToZoneOutputWithContext

func (i *Zone) ToZoneOutputWithContext(ctx context.Context) ZoneOutput

type ZoneArgs

type ZoneArgs struct {
	// A description of the zone.
	Description pulumi.StringPtrInput
	// The email address of the administrator managing the zone.
	Email pulumi.StringPtrInput
	// The enterprise project id of the zone. Changing this creates a
	// new zone.
	EnterpriseProjectId pulumi.StringPtrInput
	// The name of the zone. Note the `.` at the end of the name. Changing this creates
	// a new DNS zone.
	Name pulumi.StringPtrInput
	// The region in which to create the DNS zone. If omitted, the `region` argument
	// of the provider will be used. Changing this creates a new DNS zone.
	Region pulumi.StringPtrInput
	// Router configuration block which is required if zoneType is private. The router
	// structure is documented below.
	Routers ZoneRouterArrayInput
	// The key/value pairs to associate with the zone.
	Tags pulumi.StringMapInput
	// The time to live (TTL) of the zone.
	Ttl pulumi.IntPtrInput
	// The type of zone. Can either be `public` or `private`. Changing this
	// creates a new DNS zone.
	ZoneType pulumi.StringPtrInput
}

The set of arguments for constructing a Zone resource.

func (ZoneArgs) ElementType

func (ZoneArgs) ElementType() reflect.Type

type ZoneArray

type ZoneArray []ZoneInput

func (ZoneArray) ElementType

func (ZoneArray) ElementType() reflect.Type

func (ZoneArray) ToZoneArrayOutput

func (i ZoneArray) ToZoneArrayOutput() ZoneArrayOutput

func (ZoneArray) ToZoneArrayOutputWithContext

func (i ZoneArray) ToZoneArrayOutputWithContext(ctx context.Context) ZoneArrayOutput

type ZoneArrayInput

type ZoneArrayInput interface {
	pulumi.Input

	ToZoneArrayOutput() ZoneArrayOutput
	ToZoneArrayOutputWithContext(context.Context) ZoneArrayOutput
}

ZoneArrayInput is an input type that accepts ZoneArray and ZoneArrayOutput values. You can construct a concrete instance of `ZoneArrayInput` via:

ZoneArray{ ZoneArgs{...} }

type ZoneArrayOutput

type ZoneArrayOutput struct{ *pulumi.OutputState }

func (ZoneArrayOutput) ElementType

func (ZoneArrayOutput) ElementType() reflect.Type

func (ZoneArrayOutput) Index

func (ZoneArrayOutput) ToZoneArrayOutput

func (o ZoneArrayOutput) ToZoneArrayOutput() ZoneArrayOutput

func (ZoneArrayOutput) ToZoneArrayOutputWithContext

func (o ZoneArrayOutput) ToZoneArrayOutputWithContext(ctx context.Context) ZoneArrayOutput

type ZoneInput

type ZoneInput interface {
	pulumi.Input

	ToZoneOutput() ZoneOutput
	ToZoneOutputWithContext(ctx context.Context) ZoneOutput
}

type ZoneMap

type ZoneMap map[string]ZoneInput

func (ZoneMap) ElementType

func (ZoneMap) ElementType() reflect.Type

func (ZoneMap) ToZoneMapOutput

func (i ZoneMap) ToZoneMapOutput() ZoneMapOutput

func (ZoneMap) ToZoneMapOutputWithContext

func (i ZoneMap) ToZoneMapOutputWithContext(ctx context.Context) ZoneMapOutput

type ZoneMapInput

type ZoneMapInput interface {
	pulumi.Input

	ToZoneMapOutput() ZoneMapOutput
	ToZoneMapOutputWithContext(context.Context) ZoneMapOutput
}

ZoneMapInput is an input type that accepts ZoneMap and ZoneMapOutput values. You can construct a concrete instance of `ZoneMapInput` via:

ZoneMap{ "key": ZoneArgs{...} }

type ZoneMapOutput

type ZoneMapOutput struct{ *pulumi.OutputState }

func (ZoneMapOutput) ElementType

func (ZoneMapOutput) ElementType() reflect.Type

func (ZoneMapOutput) MapIndex

func (ZoneMapOutput) ToZoneMapOutput

func (o ZoneMapOutput) ToZoneMapOutput() ZoneMapOutput

func (ZoneMapOutput) ToZoneMapOutputWithContext

func (o ZoneMapOutput) ToZoneMapOutputWithContext(ctx context.Context) ZoneMapOutput

type ZoneOutput

type ZoneOutput struct{ *pulumi.OutputState }

func (ZoneOutput) Description

func (o ZoneOutput) Description() pulumi.StringPtrOutput

A description of the zone.

func (ZoneOutput) ElementType

func (ZoneOutput) ElementType() reflect.Type

func (ZoneOutput) Email

func (o ZoneOutput) Email() pulumi.StringOutput

The email address of the administrator managing the zone.

func (ZoneOutput) EnterpriseProjectId

func (o ZoneOutput) EnterpriseProjectId() pulumi.StringOutput

The enterprise project id of the zone. Changing this creates a new zone.

func (ZoneOutput) Masters

func (o ZoneOutput) Masters() pulumi.StringArrayOutput

An array of master DNS servers.

func (ZoneOutput) Name

func (o ZoneOutput) Name() pulumi.StringOutput

The name of the zone. Note the `.` at the end of the name. Changing this creates a new DNS zone.

func (ZoneOutput) Region

func (o ZoneOutput) Region() pulumi.StringOutput

The region in which to create the DNS zone. If omitted, the `region` argument of the provider will be used. Changing this creates a new DNS zone.

func (ZoneOutput) Routers

func (o ZoneOutput) Routers() ZoneRouterArrayOutput

Router configuration block which is required if zoneType is private. The router structure is documented below.

func (ZoneOutput) Tags

The key/value pairs to associate with the zone.

func (ZoneOutput) ToZoneOutput

func (o ZoneOutput) ToZoneOutput() ZoneOutput

func (ZoneOutput) ToZoneOutputWithContext

func (o ZoneOutput) ToZoneOutputWithContext(ctx context.Context) ZoneOutput

func (ZoneOutput) Ttl

func (o ZoneOutput) Ttl() pulumi.IntPtrOutput

The time to live (TTL) of the zone.

func (ZoneOutput) ZoneType

func (o ZoneOutput) ZoneType() pulumi.StringPtrOutput

The type of zone. Can either be `public` or `private`. Changing this creates a new DNS zone.

type ZoneRouter

type ZoneRouter struct {
	// ID of the associated VPC.
	RouterId string `pulumi:"routerId"`
	// The region of the VPC.
	RouterRegion *string `pulumi:"routerRegion"`
}

type ZoneRouterArgs

type ZoneRouterArgs struct {
	// ID of the associated VPC.
	RouterId pulumi.StringInput `pulumi:"routerId"`
	// The region of the VPC.
	RouterRegion pulumi.StringPtrInput `pulumi:"routerRegion"`
}

func (ZoneRouterArgs) ElementType

func (ZoneRouterArgs) ElementType() reflect.Type

func (ZoneRouterArgs) ToZoneRouterOutput

func (i ZoneRouterArgs) ToZoneRouterOutput() ZoneRouterOutput

func (ZoneRouterArgs) ToZoneRouterOutputWithContext

func (i ZoneRouterArgs) ToZoneRouterOutputWithContext(ctx context.Context) ZoneRouterOutput

type ZoneRouterArray

type ZoneRouterArray []ZoneRouterInput

func (ZoneRouterArray) ElementType

func (ZoneRouterArray) ElementType() reflect.Type

func (ZoneRouterArray) ToZoneRouterArrayOutput

func (i ZoneRouterArray) ToZoneRouterArrayOutput() ZoneRouterArrayOutput

func (ZoneRouterArray) ToZoneRouterArrayOutputWithContext

func (i ZoneRouterArray) ToZoneRouterArrayOutputWithContext(ctx context.Context) ZoneRouterArrayOutput

type ZoneRouterArrayInput

type ZoneRouterArrayInput interface {
	pulumi.Input

	ToZoneRouterArrayOutput() ZoneRouterArrayOutput
	ToZoneRouterArrayOutputWithContext(context.Context) ZoneRouterArrayOutput
}

ZoneRouterArrayInput is an input type that accepts ZoneRouterArray and ZoneRouterArrayOutput values. You can construct a concrete instance of `ZoneRouterArrayInput` via:

ZoneRouterArray{ ZoneRouterArgs{...} }

type ZoneRouterArrayOutput

type ZoneRouterArrayOutput struct{ *pulumi.OutputState }

func (ZoneRouterArrayOutput) ElementType

func (ZoneRouterArrayOutput) ElementType() reflect.Type

func (ZoneRouterArrayOutput) Index

func (ZoneRouterArrayOutput) ToZoneRouterArrayOutput

func (o ZoneRouterArrayOutput) ToZoneRouterArrayOutput() ZoneRouterArrayOutput

func (ZoneRouterArrayOutput) ToZoneRouterArrayOutputWithContext

func (o ZoneRouterArrayOutput) ToZoneRouterArrayOutputWithContext(ctx context.Context) ZoneRouterArrayOutput

type ZoneRouterInput

type ZoneRouterInput interface {
	pulumi.Input

	ToZoneRouterOutput() ZoneRouterOutput
	ToZoneRouterOutputWithContext(context.Context) ZoneRouterOutput
}

ZoneRouterInput is an input type that accepts ZoneRouterArgs and ZoneRouterOutput values. You can construct a concrete instance of `ZoneRouterInput` via:

ZoneRouterArgs{...}

type ZoneRouterOutput

type ZoneRouterOutput struct{ *pulumi.OutputState }

func (ZoneRouterOutput) ElementType

func (ZoneRouterOutput) ElementType() reflect.Type

func (ZoneRouterOutput) RouterId

func (o ZoneRouterOutput) RouterId() pulumi.StringOutput

ID of the associated VPC.

func (ZoneRouterOutput) RouterRegion

func (o ZoneRouterOutput) RouterRegion() pulumi.StringPtrOutput

The region of the VPC.

func (ZoneRouterOutput) ToZoneRouterOutput

func (o ZoneRouterOutput) ToZoneRouterOutput() ZoneRouterOutput

func (ZoneRouterOutput) ToZoneRouterOutputWithContext

func (o ZoneRouterOutput) ToZoneRouterOutputWithContext(ctx context.Context) ZoneRouterOutput

type ZoneState

type ZoneState struct {
	// A description of the zone.
	Description pulumi.StringPtrInput
	// The email address of the administrator managing the zone.
	Email pulumi.StringPtrInput
	// The enterprise project id of the zone. Changing this creates a
	// new zone.
	EnterpriseProjectId pulumi.StringPtrInput
	// An array of master DNS servers.
	Masters pulumi.StringArrayInput
	// The name of the zone. Note the `.` at the end of the name. Changing this creates
	// a new DNS zone.
	Name pulumi.StringPtrInput
	// The region in which to create the DNS zone. If omitted, the `region` argument
	// of the provider will be used. Changing this creates a new DNS zone.
	Region pulumi.StringPtrInput
	// Router configuration block which is required if zoneType is private. The router
	// structure is documented below.
	Routers ZoneRouterArrayInput
	// The key/value pairs to associate with the zone.
	Tags pulumi.StringMapInput
	// The time to live (TTL) of the zone.
	Ttl pulumi.IntPtrInput
	// The type of zone. Can either be `public` or `private`. Changing this
	// creates a new DNS zone.
	ZoneType pulumi.StringPtrInput
}

func (ZoneState) ElementType

func (ZoneState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL