1. Packages
  2. OVH
  3. API Docs
  4. Domain
  5. ZoneImport
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

ovh.Domain.ZoneImport

Explore with Pulumi AI

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

    Handle a whole DNS zone using a zone file.

    WARNING This resource and resource ovh.Domain.ZoneRecord should not be used together as ovh.Domain.ZoneImport controls the whole DNS zone at once.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const _import = new ovh.domain.ZoneImport("import", {
        zoneName: "mysite.ovh",
        zoneFile: fs.readFileSync("./example.zone", "utf8"),
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    import_ = ovh.domain.ZoneImport("import",
        zone_name="mysite.ovh",
        zone_file=(lambda path: open(path).read())("./example.zone"))
    
    package main
    
    import (
    	"os"
    
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Domain"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Domain.NewZoneImport(ctx, "import", &Domain.ZoneImportArgs{
    			ZoneName: pulumi.String("mysite.ovh"),
    			ZoneFile: pulumi.String(readFileOrPanic("./example.zone")),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var import = new Ovh.Domain.ZoneImport("import", new()
        {
            ZoneName = "mysite.ovh",
            ZoneFile = File.ReadAllText("./example.zone"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Domain.ZoneImport;
    import com.pulumi.ovh.Domain.ZoneImportArgs;
    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) {
            var import_ = new ZoneImport("import", ZoneImportArgs.builder()
                .zoneName("mysite.ovh")
                .zoneFile(Files.readString(Paths.get("./example.zone")))
                .build());
    
        }
    }
    
    resources:
      import:
        type: ovh:Domain:ZoneImport
        properties:
          zoneName: mysite.ovh
          zoneFile:
            fn::readFile: ./example.zone
    

    Create ZoneImport Resource

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

    Constructor syntax

    new ZoneImport(name: string, args: ZoneImportArgs, opts?: CustomResourceOptions);
    @overload
    def ZoneImport(resource_name: str,
                   args: ZoneImportArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ZoneImport(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   zone_file: Optional[str] = None,
                   zone_name: Optional[str] = None)
    func NewZoneImport(ctx *Context, name string, args ZoneImportArgs, opts ...ResourceOption) (*ZoneImport, error)
    public ZoneImport(string name, ZoneImportArgs args, CustomResourceOptions? opts = null)
    public ZoneImport(String name, ZoneImportArgs args)
    public ZoneImport(String name, ZoneImportArgs args, CustomResourceOptions options)
    
    type: ovh:Domain:ZoneImport
    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 ZoneImportArgs
    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 ZoneImportArgs
    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 ZoneImportArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ZoneImportArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ZoneImportArgs
    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 zoneImportResource = new Ovh.Domain.ZoneImport("zoneImportResource", new()
    {
        ZoneFile = "string",
        ZoneName = "string",
    });
    
    example, err := Domain.NewZoneImport(ctx, "zoneImportResource", &Domain.ZoneImportArgs{
    	ZoneFile: pulumi.String("string"),
    	ZoneName: pulumi.String("string"),
    })
    
    var zoneImportResource = new ZoneImport("zoneImportResource", ZoneImportArgs.builder()
        .zoneFile("string")
        .zoneName("string")
        .build());
    
    zone_import_resource = ovh.domain.ZoneImport("zoneImportResource",
        zone_file="string",
        zone_name="string")
    
    const zoneImportResource = new ovh.domain.ZoneImport("zoneImportResource", {
        zoneFile: "string",
        zoneName: "string",
    });
    
    type: ovh:Domain:ZoneImport
    properties:
        zoneFile: string
        zoneName: string
    

    ZoneImport Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ZoneImport resource accepts the following input properties:

    ZoneFile string
    Content of the zone file to import
    ZoneName string
    The name of the domain zone
    ZoneFile string
    Content of the zone file to import
    ZoneName string
    The name of the domain zone
    zoneFile String
    Content of the zone file to import
    zoneName String
    The name of the domain zone
    zoneFile string
    Content of the zone file to import
    zoneName string
    The name of the domain zone
    zone_file str
    Content of the zone file to import
    zone_name str
    The name of the domain zone
    zoneFile String
    Content of the zone file to import
    zoneName String
    The name of the domain zone

    Outputs

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

    ExportedContent string
    Zone file exported from the API
    Id string
    The provider-assigned unique ID for this managed resource.
    ExportedContent string
    Zone file exported from the API
    Id string
    The provider-assigned unique ID for this managed resource.
    exportedContent String
    Zone file exported from the API
    id String
    The provider-assigned unique ID for this managed resource.
    exportedContent string
    Zone file exported from the API
    id string
    The provider-assigned unique ID for this managed resource.
    exported_content str
    Zone file exported from the API
    id str
    The provider-assigned unique ID for this managed resource.
    exportedContent String
    Zone file exported from the API
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ZoneImport Resource

    Get an existing ZoneImport 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?: ZoneImportState, opts?: CustomResourceOptions): ZoneImport
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            exported_content: Optional[str] = None,
            zone_file: Optional[str] = None,
            zone_name: Optional[str] = None) -> ZoneImport
    func GetZoneImport(ctx *Context, name string, id IDInput, state *ZoneImportState, opts ...ResourceOption) (*ZoneImport, error)
    public static ZoneImport Get(string name, Input<string> id, ZoneImportState? state, CustomResourceOptions? opts = null)
    public static ZoneImport get(String name, Output<String> id, ZoneImportState 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:
    ExportedContent string
    Zone file exported from the API
    ZoneFile string
    Content of the zone file to import
    ZoneName string
    The name of the domain zone
    ExportedContent string
    Zone file exported from the API
    ZoneFile string
    Content of the zone file to import
    ZoneName string
    The name of the domain zone
    exportedContent String
    Zone file exported from the API
    zoneFile String
    Content of the zone file to import
    zoneName String
    The name of the domain zone
    exportedContent string
    Zone file exported from the API
    zoneFile string
    Content of the zone file to import
    zoneName string
    The name of the domain zone
    exported_content str
    Zone file exported from the API
    zone_file str
    Content of the zone file to import
    zone_name str
    The name of the domain zone
    exportedContent String
    Zone file exported from the API
    zoneFile String
    Content of the zone file to import
    zoneName String
    The name of the domain zone

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud