1. Packages
  2. Dnsimple Provider
  3. API Docs
  4. Zone
DNSimple v4.1.2 published on Tuesday, Sep 24, 2024 by Pulumi

dnsimple.Zone

Explore with Pulumi AI

dnsimple logo
DNSimple v4.1.2 published on Tuesday, Sep 24, 2024 by Pulumi

    Provides a DNSimple zone resource.

    Currently the resource creation acts as an import, so the zone must already exist in DNSimple. The only attribute that will be modified during resource creation is the active state of the zone. This is because our API does not allow for the creation of zones. Creation of zones happens through the purchase or creation of domains. We expect this behavior to change in the future.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dnsimple from "@pulumi/dnsimple";
    
    // Create a zone
    const foobar = new dnsimple.Zone("foobar", {name: dnsimple.zone});
    
    import pulumi
    import pulumi_dnsimple as dnsimple
    
    # Create a zone
    foobar = dnsimple.Zone("foobar", name=dnsimple["zone"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dnsimple/sdk/v4/go/dnsimple"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a zone
    		_, err := dnsimple.NewZone(ctx, "foobar", &dnsimple.ZoneArgs{
    			Name: pulumi.Any(dnsimple.Zone),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DNSimple = Pulumi.DNSimple;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a zone
        var foobar = new DNSimple.Zone("foobar", new()
        {
            Name = dnsimple.Zone,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dnsimple.Zone;
    import com.pulumi.dnsimple.ZoneArgs;
    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) {
            // Create a zone
            var foobar = new Zone("foobar", ZoneArgs.builder()
                .name(dnsimple.zone())
                .build());
    
        }
    }
    
    resources:
      # Create a zone
      foobar:
        type: dnsimple:Zone
        properties:
          name: ${dnsimple.zone}
    

    Create Zone Resource

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

    Constructor syntax

    new Zone(name: string, args: ZoneArgs, opts?: CustomResourceOptions);
    @overload
    def Zone(resource_name: str,
             args: ZoneArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Zone(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             name: Optional[str] = None,
             active: Optional[bool] = None)
    func NewZone(ctx *Context, name string, args ZoneArgs, opts ...ResourceOption) (*Zone, error)
    public Zone(string name, ZoneArgs args, CustomResourceOptions? opts = null)
    public Zone(String name, ZoneArgs args)
    public Zone(String name, ZoneArgs args, CustomResourceOptions options)
    
    type: dnsimple:Zone
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var zoneResource = new DNSimple.Zone("zoneResource", new()
    {
        Name = "string",
        Active = false,
    });
    
    example, err := dnsimple.NewZone(ctx, "zoneResource", &dnsimple.ZoneArgs{
    	Name:   pulumi.String("string"),
    	Active: pulumi.Bool(false),
    })
    
    var zoneResource = new Zone("zoneResource", ZoneArgs.builder()
        .name("string")
        .active(false)
        .build());
    
    zone_resource = dnsimple.Zone("zoneResource",
        name="string",
        active=False)
    
    const zoneResource = new dnsimple.Zone("zoneResource", {
        name: "string",
        active: false,
    });
    
    type: dnsimple:Zone
    properties:
        active: false
        name: string
    

    Zone Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Zone resource accepts the following input properties:

    Name string
    The zone name

    Attributes Reference

    Active bool
    Whether the zone is active.
    Name string
    The zone name

    Attributes Reference

    Active bool
    Whether the zone is active.
    name String
    The zone name

    Attributes Reference

    active Boolean
    Whether the zone is active.
    name string
    The zone name

    Attributes Reference

    active boolean
    Whether the zone is active.
    name str
    The zone name

    Attributes Reference

    active bool
    Whether the zone is active.
    name String
    The zone name

    Attributes Reference

    active Boolean
    Whether the zone is active.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Zone resource produces the following output properties:

    AccountId int
    The account ID for the zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    Reverse bool
    Whether the zone is a reverse zone.
    Secondary bool
    Whether the zone is a secondary zone.
    AccountId int
    The account ID for the zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    Reverse bool
    Whether the zone is a reverse zone.
    Secondary bool
    Whether the zone is a secondary zone.
    accountId Integer
    The account ID for the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    lastTransferredAt String
    The last time the zone was transferred only applicable for secondary zones.
    reverse Boolean
    Whether the zone is a reverse zone.
    secondary Boolean
    Whether the zone is a secondary zone.
    accountId number
    The account ID for the zone.
    id string
    The provider-assigned unique ID for this managed resource.
    lastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    reverse boolean
    Whether the zone is a reverse zone.
    secondary boolean
    Whether the zone is a secondary zone.
    account_id int
    The account ID for the zone.
    id str
    The provider-assigned unique ID for this managed resource.
    last_transferred_at str
    The last time the zone was transferred only applicable for secondary zones.
    reverse bool
    Whether the zone is a reverse zone.
    secondary bool
    Whether the zone is a secondary zone.
    accountId Number
    The account ID for the zone.
    id String
    The provider-assigned unique ID for this managed resource.
    lastTransferredAt String
    The last time the zone was transferred only applicable for secondary zones.
    reverse Boolean
    Whether the zone is a reverse zone.
    secondary Boolean
    Whether the zone is a secondary zone.

    Look up Existing Zone Resource

    Get an existing Zone 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?: ZoneState, opts?: CustomResourceOptions): Zone
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[int] = None,
            active: Optional[bool] = None,
            last_transferred_at: Optional[str] = None,
            name: Optional[str] = None,
            reverse: Optional[bool] = None,
            secondary: Optional[bool] = None) -> Zone
    func GetZone(ctx *Context, name string, id IDInput, state *ZoneState, opts ...ResourceOption) (*Zone, error)
    public static Zone Get(string name, Input<string> id, ZoneState? state, CustomResourceOptions? opts = null)
    public static Zone get(String name, Output<String> id, ZoneState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    AccountId int
    The account ID for the zone.
    Active bool
    Whether the zone is active.
    LastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    Name string
    The zone name

    Attributes Reference

    Reverse bool
    Whether the zone is a reverse zone.
    Secondary bool
    Whether the zone is a secondary zone.
    AccountId int
    The account ID for the zone.
    Active bool
    Whether the zone is active.
    LastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    Name string
    The zone name

    Attributes Reference

    Reverse bool
    Whether the zone is a reverse zone.
    Secondary bool
    Whether the zone is a secondary zone.
    accountId Integer
    The account ID for the zone.
    active Boolean
    Whether the zone is active.
    lastTransferredAt String
    The last time the zone was transferred only applicable for secondary zones.
    name String
    The zone name

    Attributes Reference

    reverse Boolean
    Whether the zone is a reverse zone.
    secondary Boolean
    Whether the zone is a secondary zone.
    accountId number
    The account ID for the zone.
    active boolean
    Whether the zone is active.
    lastTransferredAt string
    The last time the zone was transferred only applicable for secondary zones.
    name string
    The zone name

    Attributes Reference

    reverse boolean
    Whether the zone is a reverse zone.
    secondary boolean
    Whether the zone is a secondary zone.
    account_id int
    The account ID for the zone.
    active bool
    Whether the zone is active.
    last_transferred_at str
    The last time the zone was transferred only applicable for secondary zones.
    name str
    The zone name

    Attributes Reference

    reverse bool
    Whether the zone is a reverse zone.
    secondary bool
    Whether the zone is a secondary zone.
    accountId Number
    The account ID for the zone.
    active Boolean
    Whether the zone is active.
    lastTransferredAt String
    The last time the zone was transferred only applicable for secondary zones.
    name String
    The zone name

    Attributes Reference

    reverse Boolean
    Whether the zone is a reverse zone.
    secondary Boolean
    Whether the zone is a secondary zone.

    Import

    DNSimple zones can be imported using their numeric record ID or the zone name.

    bash

    $ pulumi import dnsimple:index/zone:Zone resource_name foo.com
    

    The zone ID can be found within DNSimple Zones API. Check out Authentication in API Overview for available options.

    bash

    curl -H ‘Authorization: Bearer <ACCESS_TOKEN>’ https://api.dnsimple.com/v2/1234/zones/example.com | jq

    {

    “data”: {

    "id": 1,
    
    "account_id": 1234,
    
    "name": "example.com",
    
    "reverse": false,
    
    "secondary": false,
    
    "last_transferred_at": null,
    
    "active": true,
    
    "created_at": "2023-04-18T04:58:01Z",
    
    "updated_at": "2024-01-16T15:53:18Z"
    

    }

    }

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

    Package Details

    Repository
    DNSimple pulumi/pulumi-dnsimple
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dnsimple Terraform Provider.
    dnsimple logo
    DNSimple v4.1.2 published on Tuesday, Sep 24, 2024 by Pulumi