ovh.Domain.ZoneRecord
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
// Add a record to a sub-domain
const test = new ovh.domain.ZoneRecord("test", {
fieldtype: "A",
subdomain: "test",
target: "0.0.0.0",
ttl: 3600,
zone: "testdemo.ovh",
});
import pulumi
import pulumi_ovh as ovh
# Add a record to a sub-domain
test = ovh.domain.ZoneRecord("test",
fieldtype="A",
subdomain="test",
target="0.0.0.0",
ttl=3600,
zone="testdemo.ovh")
package main
import (
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Domain"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a record to a sub-domain
_, err := Domain.NewZoneRecord(ctx, "test", &Domain.ZoneRecordArgs{
Fieldtype: pulumi.String("A"),
Subdomain: pulumi.String("test"),
Target: pulumi.String("0.0.0.0"),
Ttl: pulumi.Int(3600),
Zone: pulumi.String("testdemo.ovh"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
// Add a record to a sub-domain
var test = new Ovh.Domain.ZoneRecord("test", new()
{
Fieldtype = "A",
Subdomain = "test",
Target = "0.0.0.0",
Ttl = 3600,
Zone = "testdemo.ovh",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Domain.ZoneRecord;
import com.pulumi.ovh.Domain.ZoneRecordArgs;
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) {
// Add a record to a sub-domain
var test = new ZoneRecord("test", ZoneRecordArgs.builder()
.fieldtype("A")
.subdomain("test")
.target("0.0.0.0")
.ttl(3600)
.zone("testdemo.ovh")
.build());
}
}
resources:
# Add a record to a sub-domain
test:
type: ovh:Domain:ZoneRecord
properties:
fieldtype: A
subdomain: test
target: 0.0.0.0
ttl: 3600
zone: testdemo.ovh
Create ZoneRecord Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ZoneRecord(name: string, args: ZoneRecordArgs, opts?: CustomResourceOptions);
@overload
def ZoneRecord(resource_name: str,
args: ZoneRecordArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ZoneRecord(resource_name: str,
opts: Optional[ResourceOptions] = None,
fieldtype: Optional[str] = None,
target: Optional[str] = None,
zone: Optional[str] = None,
subdomain: Optional[str] = None,
ttl: Optional[int] = None)
func NewZoneRecord(ctx *Context, name string, args ZoneRecordArgs, opts ...ResourceOption) (*ZoneRecord, error)
public ZoneRecord(string name, ZoneRecordArgs args, CustomResourceOptions? opts = null)
public ZoneRecord(String name, ZoneRecordArgs args)
public ZoneRecord(String name, ZoneRecordArgs args, CustomResourceOptions options)
type: ovh:Domain:ZoneRecord
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 ZoneRecordArgs
- 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 ZoneRecordArgs
- 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 ZoneRecordArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneRecordArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneRecordArgs
- 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 zoneRecordResource = new Ovh.Domain.ZoneRecord("zoneRecordResource", new()
{
Fieldtype = "string",
Target = "string",
Zone = "string",
Subdomain = "string",
Ttl = 0,
});
example, err := Domain.NewZoneRecord(ctx, "zoneRecordResource", &Domain.ZoneRecordArgs{
Fieldtype: pulumi.String("string"),
Target: pulumi.String("string"),
Zone: pulumi.String("string"),
Subdomain: pulumi.String("string"),
Ttl: pulumi.Int(0),
})
var zoneRecordResource = new ZoneRecord("zoneRecordResource", ZoneRecordArgs.builder()
.fieldtype("string")
.target("string")
.zone("string")
.subdomain("string")
.ttl(0)
.build());
zone_record_resource = ovh.domain.ZoneRecord("zoneRecordResource",
fieldtype="string",
target="string",
zone="string",
subdomain="string",
ttl=0)
const zoneRecordResource = new ovh.domain.ZoneRecord("zoneRecordResource", {
fieldtype: "string",
target: "string",
zone: "string",
subdomain: "string",
ttl: 0,
});
type: ovh:Domain:ZoneRecord
properties:
fieldtype: string
subdomain: string
target: string
ttl: 0
zone: string
ZoneRecord 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 ZoneRecord resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ZoneRecord resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ZoneRecord Resource
Get an existing ZoneRecord 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?: ZoneRecordState, opts?: CustomResourceOptions): ZoneRecord
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
fieldtype: Optional[str] = None,
subdomain: Optional[str] = None,
target: Optional[str] = None,
ttl: Optional[int] = None,
zone: Optional[str] = None) -> ZoneRecord
func GetZoneRecord(ctx *Context, name string, id IDInput, state *ZoneRecordState, opts ...ResourceOption) (*ZoneRecord, error)
public static ZoneRecord Get(string name, Input<string> id, ZoneRecordState? state, CustomResourceOptions? opts = null)
public static ZoneRecord get(String name, Output<String> id, ZoneRecordState 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.
Import
OVHcloud domain zone record can be imported using the id
, which can be retrieved by using OVH API portal, and the zone
, separated by “.” E.g.,
bash
$ pulumi import ovh:Domain/zoneRecord:ZoneRecord test id.zone
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.