Documentation ¶
Overview ¶
A Pulumi package for creating and managing Hetzner cloud DNS resources.
Index ¶
- func PkgVersion() (semver.Version, error)
- type LookupZoneArgs
- type LookupZoneOutputArgs
- type LookupZoneResult
- type LookupZoneResultOutput
- func (LookupZoneResultOutput) ElementType() reflect.Type
- func (o LookupZoneResultOutput) Id() pulumi.StringOutput
- func (o LookupZoneResultOutput) Name() pulumi.StringOutput
- func (o LookupZoneResultOutput) ToLookupZoneResultOutput() LookupZoneResultOutput
- func (o LookupZoneResultOutput) ToLookupZoneResultOutputWithContext(ctx context.Context) LookupZoneResultOutput
- func (o LookupZoneResultOutput) Ttl() pulumi.IntOutput
- type Provider
- type ProviderArgs
- type ProviderInput
- type ProviderOutput
- type Record
- type RecordArgs
- type RecordArray
- type RecordArrayInput
- type RecordArrayOutput
- type RecordInput
- type RecordMap
- type RecordMapInput
- type RecordMapOutput
- type RecordOutput
- func (RecordOutput) ElementType() reflect.Type
- func (o RecordOutput) Name() pulumi.StringOutput
- func (o RecordOutput) ToRecordOutput() RecordOutput
- func (o RecordOutput) ToRecordOutputWithContext(ctx context.Context) RecordOutput
- func (o RecordOutput) Ttl() pulumi.IntPtrOutput
- func (o RecordOutput) Type() pulumi.StringOutput
- func (o RecordOutput) Value() pulumi.StringOutput
- func (o RecordOutput) ZoneId() pulumi.StringOutput
- type RecordState
- type Zone
- type ZoneArgs
- type ZoneArray
- type ZoneArrayInput
- type ZoneArrayOutput
- type ZoneInput
- type ZoneMap
- type ZoneMapInput
- type ZoneMapOutput
- type ZoneOutput
- type ZoneState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PkgVersion ¶
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 LookupZoneArgs ¶
type LookupZoneArgs struct { // Name of the DNS zone to get data from. Name string `pulumi:"name"` }
A collection of arguments for invoking getZone.
type LookupZoneOutputArgs ¶
type LookupZoneOutputArgs struct { // Name of the DNS zone to get data from. Name pulumi.StringInput `pulumi:"name"` }
A collection of arguments for invoking getZone.
func (LookupZoneOutputArgs) ElementType ¶
func (LookupZoneOutputArgs) ElementType() reflect.Type
type LookupZoneResult ¶
type LookupZoneResult struct { // The provider-assigned unique ID for this managed resource. Id string `pulumi:"id"` Name string `pulumi:"name"` Ttl int `pulumi:"ttl"` }
A collection of values returned by getZone.
func LookupZone ¶
func LookupZone(ctx *pulumi.Context, args *LookupZoneArgs, opts ...pulumi.InvokeOption) (*LookupZoneResult, error)
## # Zone Data Source
Provides details about a Hetzner DNS Zone.
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-hetznerdns/sdk/go/hetznerdns" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := hetznerdns.LookupZone(ctx, &GetZoneArgs{ Name: "zone1.online", }, nil) if err != nil { return err } return nil }) }
```
type LookupZoneResultOutput ¶
type LookupZoneResultOutput struct{ *pulumi.OutputState }
A collection of values returned by getZone.
func LookupZoneOutput ¶
func LookupZoneOutput(ctx *pulumi.Context, args LookupZoneOutputArgs, opts ...pulumi.InvokeOption) LookupZoneResultOutput
func (LookupZoneResultOutput) ElementType ¶
func (LookupZoneResultOutput) ElementType() reflect.Type
func (LookupZoneResultOutput) Id ¶
func (o LookupZoneResultOutput) Id() pulumi.StringOutput
The provider-assigned unique ID for this managed resource.
func (LookupZoneResultOutput) Name ¶
func (o LookupZoneResultOutput) Name() pulumi.StringOutput
func (LookupZoneResultOutput) ToLookupZoneResultOutput ¶
func (o LookupZoneResultOutput) ToLookupZoneResultOutput() LookupZoneResultOutput
func (LookupZoneResultOutput) ToLookupZoneResultOutputWithContext ¶
func (o LookupZoneResultOutput) ToLookupZoneResultOutputWithContext(ctx context.Context) LookupZoneResultOutput
func (LookupZoneResultOutput) Ttl ¶
func (o LookupZoneResultOutput) Ttl() pulumi.IntOutput
type Provider ¶
type Provider struct { pulumi.ProviderResourceState // The API access token to authenticate at Hetzner DNS API. Apitoken pulumi.StringOutput `pulumi:"apitoken"` }
The provider type for the hetznerdns package. By default, resources use package-wide configuration settings, however an explicit `Provider` instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
func NewProvider ¶
func NewProvider(ctx *pulumi.Context, name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error)
NewProvider registers a new resource with the given unique name, arguments, and options.
func (*Provider) ElementType ¶
func (*Provider) ToProviderOutput ¶
func (i *Provider) ToProviderOutput() ProviderOutput
func (*Provider) ToProviderOutputWithContext ¶
func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput
type ProviderArgs ¶
type ProviderArgs struct { // The API access token to authenticate at Hetzner DNS API. Apitoken pulumi.StringInput }
The set of arguments for constructing a Provider resource.
func (ProviderArgs) ElementType ¶
func (ProviderArgs) ElementType() reflect.Type
type ProviderInput ¶
type ProviderInput interface { pulumi.Input ToProviderOutput() ProviderOutput ToProviderOutputWithContext(ctx context.Context) ProviderOutput }
type ProviderOutput ¶
type ProviderOutput struct{ *pulumi.OutputState }
func (ProviderOutput) Apitoken ¶
func (o ProviderOutput) Apitoken() pulumi.StringOutput
The API access token to authenticate at Hetzner DNS API.
func (ProviderOutput) ElementType ¶
func (ProviderOutput) ElementType() reflect.Type
func (ProviderOutput) ToProviderOutput ¶
func (o ProviderOutput) ToProviderOutput() ProviderOutput
func (ProviderOutput) ToProviderOutputWithContext ¶
func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput
type Record ¶
type Record struct { pulumi.CustomResourceState // Name of the DNS record to create. Name pulumi.StringOutput `pulumi:"name"` // Time to live of this record. Ttl pulumi.IntPtrOutput `pulumi:"ttl"` // The type of the record. Type pulumi.StringOutput `pulumi:"type"` Value pulumi.StringOutput `pulumi:"value"` // Id of the DNS zone to create // the record in. ZoneId pulumi.StringOutput `pulumi:"zoneId"` }
## # Record Resource
Provides a Hetzner DNS Recrods resource to create, update and delete DNS Records.
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-hetznerdns/sdk/go/hetznerdns" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := hetznerdns.LookupZone(ctx, &GetZoneArgs{ Name: "zone1.online", }, nil) if err != nil { return err } _, err = hetznerdns.NewRecord(ctx, "www", &hetznerdns.RecordArgs{ ZoneId: pulumi.Any(hetznerdns_zone.Z1.Id), Value: pulumi.String("192.168.1.1"), Type: pulumi.String("A"), Ttl: pulumi.Int(60), }) if err != nil { return err } return nil }) }
```
## Import
A Record can be imported using its `id`. Use the API to get all records of a zone and then copy the id.
curl "https://dns.hetzner.com/api/v1/records" \
-H 'Auth-API-Token$HETZNER_DNS_API_TOKEN' | jq . {
"records"[ { "id""3d60921a49eb384b6335766a", "type""TXT", "name""google._domainkey", "value""\"anything:with:param\"", "zone_id""rMu2waTJPbHr4", "created""2020-08-18 19:11:02.237 +0000 UTC", "modified""2020-08-28 19:51:41.275 +0000 UTC" }, { "id""ed2416cb6bc8a8055b22222", "type""A", "name""www", "value""1.1.1.1", "zone_id""rMu2waTJPbHr4", "created""2020-08-27 20:55:38.745 +0000 UTC", "modified""2020-08-27 20:55:38.745 +0000 UTC" } ] } The command used above was copied from Hetzer DNS API docs. `jq` is used for formatting and is not required. Use the `id` to import a record.
```sh
$ pulumi import hetznerdns:index/record:Record dkim_1 ed2416cb6bc8a8055b22222
```
func GetRecord ¶
func GetRecord(ctx *pulumi.Context, name string, id pulumi.IDInput, state *RecordState, opts ...pulumi.ResourceOption) (*Record, error)
GetRecord gets an existing Record 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 NewRecord ¶
func NewRecord(ctx *pulumi.Context, name string, args *RecordArgs, opts ...pulumi.ResourceOption) (*Record, error)
NewRecord registers a new resource with the given unique name, arguments, and options.
func (*Record) ElementType ¶
func (*Record) ToRecordOutput ¶
func (i *Record) ToRecordOutput() RecordOutput
func (*Record) ToRecordOutputWithContext ¶
func (i *Record) ToRecordOutputWithContext(ctx context.Context) RecordOutput
type RecordArgs ¶
type RecordArgs struct { // Name of the DNS record to create. Name pulumi.StringPtrInput // Time to live of this record. Ttl pulumi.IntPtrInput // The type of the record. Type pulumi.StringInput Value pulumi.StringInput // Id of the DNS zone to create // the record in. ZoneId pulumi.StringInput }
The set of arguments for constructing a Record resource.
func (RecordArgs) ElementType ¶
func (RecordArgs) ElementType() reflect.Type
type RecordArray ¶
type RecordArray []RecordInput
func (RecordArray) ElementType ¶
func (RecordArray) ElementType() reflect.Type
func (RecordArray) ToRecordArrayOutput ¶
func (i RecordArray) ToRecordArrayOutput() RecordArrayOutput
func (RecordArray) ToRecordArrayOutputWithContext ¶
func (i RecordArray) ToRecordArrayOutputWithContext(ctx context.Context) RecordArrayOutput
type RecordArrayInput ¶
type RecordArrayInput interface { pulumi.Input ToRecordArrayOutput() RecordArrayOutput ToRecordArrayOutputWithContext(context.Context) RecordArrayOutput }
RecordArrayInput is an input type that accepts RecordArray and RecordArrayOutput values. You can construct a concrete instance of `RecordArrayInput` via:
RecordArray{ RecordArgs{...} }
type RecordArrayOutput ¶
type RecordArrayOutput struct{ *pulumi.OutputState }
func (RecordArrayOutput) ElementType ¶
func (RecordArrayOutput) ElementType() reflect.Type
func (RecordArrayOutput) Index ¶
func (o RecordArrayOutput) Index(i pulumi.IntInput) RecordOutput
func (RecordArrayOutput) ToRecordArrayOutput ¶
func (o RecordArrayOutput) ToRecordArrayOutput() RecordArrayOutput
func (RecordArrayOutput) ToRecordArrayOutputWithContext ¶
func (o RecordArrayOutput) ToRecordArrayOutputWithContext(ctx context.Context) RecordArrayOutput
type RecordInput ¶
type RecordInput interface { pulumi.Input ToRecordOutput() RecordOutput ToRecordOutputWithContext(ctx context.Context) RecordOutput }
type RecordMap ¶
type RecordMap map[string]RecordInput
func (RecordMap) ElementType ¶
func (RecordMap) ToRecordMapOutput ¶
func (i RecordMap) ToRecordMapOutput() RecordMapOutput
func (RecordMap) ToRecordMapOutputWithContext ¶
func (i RecordMap) ToRecordMapOutputWithContext(ctx context.Context) RecordMapOutput
type RecordMapInput ¶
type RecordMapInput interface { pulumi.Input ToRecordMapOutput() RecordMapOutput ToRecordMapOutputWithContext(context.Context) RecordMapOutput }
RecordMapInput is an input type that accepts RecordMap and RecordMapOutput values. You can construct a concrete instance of `RecordMapInput` via:
RecordMap{ "key": RecordArgs{...} }
type RecordMapOutput ¶
type RecordMapOutput struct{ *pulumi.OutputState }
func (RecordMapOutput) ElementType ¶
func (RecordMapOutput) ElementType() reflect.Type
func (RecordMapOutput) MapIndex ¶
func (o RecordMapOutput) MapIndex(k pulumi.StringInput) RecordOutput
func (RecordMapOutput) ToRecordMapOutput ¶
func (o RecordMapOutput) ToRecordMapOutput() RecordMapOutput
func (RecordMapOutput) ToRecordMapOutputWithContext ¶
func (o RecordMapOutput) ToRecordMapOutputWithContext(ctx context.Context) RecordMapOutput
type RecordOutput ¶
type RecordOutput struct{ *pulumi.OutputState }
func (RecordOutput) ElementType ¶
func (RecordOutput) ElementType() reflect.Type
func (RecordOutput) Name ¶
func (o RecordOutput) Name() pulumi.StringOutput
Name of the DNS record to create.
func (RecordOutput) ToRecordOutput ¶
func (o RecordOutput) ToRecordOutput() RecordOutput
func (RecordOutput) ToRecordOutputWithContext ¶
func (o RecordOutput) ToRecordOutputWithContext(ctx context.Context) RecordOutput
func (RecordOutput) Ttl ¶
func (o RecordOutput) Ttl() pulumi.IntPtrOutput
Time to live of this record.
func (RecordOutput) Value ¶
func (o RecordOutput) Value() pulumi.StringOutput
func (RecordOutput) ZoneId ¶
func (o RecordOutput) ZoneId() pulumi.StringOutput
Id of the DNS zone to create the record in.
type RecordState ¶
type RecordState struct { // Name of the DNS record to create. Name pulumi.StringPtrInput // Time to live of this record. Ttl pulumi.IntPtrInput // The type of the record. Type pulumi.StringPtrInput Value pulumi.StringPtrInput // Id of the DNS zone to create // the record in. ZoneId pulumi.StringPtrInput }
func (RecordState) ElementType ¶
func (RecordState) ElementType() reflect.Type
type Zone ¶
type Zone struct { pulumi.CustomResourceState // Name of the DNS zone to create. Must be a valid // domain with top level domain. Meaning `<domain>.de` or `<domain>.io`. Don't // include sub domains on this level. So, no `sub.<domain>.io`. The Hetzner API // rejects attempts to create a zone with a sub domain name. Use a record to // create the sub domain. Name pulumi.StringOutput `pulumi:"name"` // Time to live of this zone. Ttl pulumi.IntOutput `pulumi:"ttl"` }
## # Zone Resource
Provides a Hetzner DNS Zone resource to create, update and delete DNS Zones.
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-hetznerdns/sdk/go/hetznerdns" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := hetznerdns.NewZone(ctx, "zone1", &hetznerdns.ZoneArgs{ Ttl: pulumi.Int(3600), }) if err != nil { return err } return nil }) }
```
## Import
A Zone can be imported using its `id`. Log in to the Hetzner DNS web frontend, navigate to the zone you want to import, and copy the id from the URL in your browser.
```sh
$ pulumi import hetznerdns:index/zone:Zone zone1 rMu2waTJPbHr4
```
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) ToZoneOutput ¶
func (i *Zone) ToZoneOutput() ZoneOutput
func (*Zone) ToZoneOutputWithContext ¶
func (i *Zone) ToZoneOutputWithContext(ctx context.Context) ZoneOutput
type ZoneArgs ¶
type ZoneArgs struct { // Name of the DNS zone to create. Must be a valid // domain with top level domain. Meaning `<domain>.de` or `<domain>.io`. Don't // include sub domains on this level. So, no `sub.<domain>.io`. The Hetzner API // rejects attempts to create a zone with a sub domain name. Use a record to // create the sub domain. Name pulumi.StringPtrInput // Time to live of this zone. Ttl pulumi.IntInput }
The set of arguments for constructing a Zone resource.
func (ZoneArgs) ElementType ¶
type ZoneArray ¶
type ZoneArray []ZoneInput
func (ZoneArray) ElementType ¶
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 (o ZoneArrayOutput) Index(i pulumi.IntInput) ZoneOutput
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 ¶
func (ZoneMap) ElementType ¶
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 (o ZoneMapOutput) MapIndex(k pulumi.StringInput) ZoneOutput
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) ElementType ¶
func (ZoneOutput) ElementType() reflect.Type
func (ZoneOutput) Name ¶
func (o ZoneOutput) Name() pulumi.StringOutput
Name of the DNS zone to create. Must be a valid domain with top level domain. Meaning `<domain>.de` or `<domain>.io`. Don't include sub domains on this level. So, no `sub.<domain>.io`. The Hetzner API rejects attempts to create a zone with a sub domain name. Use a record to create the sub domain.
func (ZoneOutput) ToZoneOutput ¶
func (o ZoneOutput) ToZoneOutput() ZoneOutput
func (ZoneOutput) ToZoneOutputWithContext ¶
func (o ZoneOutput) ToZoneOutputWithContext(ctx context.Context) ZoneOutput
type ZoneState ¶
type ZoneState struct { // Name of the DNS zone to create. Must be a valid // domain with top level domain. Meaning `<domain>.de` or `<domain>.io`. Don't // include sub domains on this level. So, no `sub.<domain>.io`. The Hetzner API // rejects attempts to create a zone with a sub domain name. Use a record to // create the sub domain. Name pulumi.StringPtrInput // Time to live of this zone. Ttl pulumi.IntPtrInput }