Record Args
data class RecordArgs(val allowOverwrite: Output<Boolean>? = null, val comment: Output<String>? = null, val content: Output<String>? = null, val data: Output<RecordDataArgs>? = null, val name: Output<String>? = null, val priority: Output<Int>? = null, val proxied: Output<Boolean>? = null, val tags: Output<List<String>>? = null, val ttl: Output<Int>? = null, val type: Output<String>? = null, val value: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<RecordArgs>
Provides a Cloudflare record resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
// Add a record to the domain
const example = new cloudflare.Record("example", {
zoneId: cloudflareZoneId,
name: "terraform",
content: "192.0.2.1",
type: "A",
ttl: 3600,
});
// Add a record requiring a data map
const _sipTls = new cloudflare.Record("_sip_tls", {
zoneId: cloudflareZoneId,
name: "_sip._tls",
type: "SRV",
data: {
service: "_sip",
proto: "_tls",
name: "terraform-srv",
priority: 0,
weight: 0,
port: 443,
target: "example.com",
},
});
Content copied to clipboard
import pulumi
import pulumi_cloudflare as cloudflare
# Add a record to the domain
example = cloudflare.Record("example",
zone_id=cloudflare_zone_id,
name="terraform",
content="192.0.2.1",
type="A",
ttl=3600)
# Add a record requiring a data map
_sip_tls = cloudflare.Record("_sip_tls",
zone_id=cloudflare_zone_id,
name="_sip._tls",
type="SRV",
data={
"service": "_sip",
"proto": "_tls",
"name": "terraform-srv",
"priority": 0,
"weight": 0,
"port": 443,
"target": "example.com",
})
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
// Add a record to the domain
var example = new Cloudflare.Record("example", new()
{
ZoneId = cloudflareZoneId,
Name = "terraform",
Content = "192.0.2.1",
Type = "A",
Ttl = 3600,
});
// Add a record requiring a data map
var _sipTls = new Cloudflare.Record("_sip_tls", new()
{
ZoneId = cloudflareZoneId,
Name = "_sip._tls",
Type = "SRV",
Data = new Cloudflare.Inputs.RecordDataArgs
{
Service = "_sip",
Proto = "_tls",
Name = "terraform-srv",
Priority = 0,
Weight = 0,
Port = 443,
Target = "example.com",
},
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a record to the domain
_, err := cloudflare.NewRecord(ctx, "example", &cloudflare.RecordArgs{
ZoneId: pulumi.Any(cloudflareZoneId),
Name: pulumi.String("terraform"),
Content: pulumi.String("192.0.2.1"),
Type: pulumi.String("A"),
Ttl: pulumi.Int(3600),
})
if err != nil {
return err
}
// Add a record requiring a data map
_, err = cloudflare.NewRecord(ctx, "_sip_tls", &cloudflare.RecordArgs{
ZoneId: pulumi.Any(cloudflareZoneId),
Name: pulumi.String("_sip._tls"),
Type: pulumi.String("SRV"),
Data: &cloudflare.RecordDataArgs{
Service: pulumi.String("_sip"),
Proto: pulumi.String("_tls"),
Name: pulumi.String("terraform-srv"),
Priority: pulumi.Int(0),
Weight: pulumi.Int(0),
Port: pulumi.Int(443),
Target: pulumi.String("example.com"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Record;
import com.pulumi.cloudflare.RecordArgs;
import com.pulumi.cloudflare.inputs.RecordDataArgs;
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 the domain
var example = new Record("example", RecordArgs.builder()
.zoneId(cloudflareZoneId)
.name("terraform")
.content("192.0.2.1")
.type("A")
.ttl(3600)
.build());
// Add a record requiring a data map
var _sipTls = new Record("_sipTls", RecordArgs.builder()
.zoneId(cloudflareZoneId)
.name("_sip._tls")
.type("SRV")
.data(RecordDataArgs.builder()
.service("_sip")
.proto("_tls")
.name("terraform-srv")
.priority(0)
.weight(0)
.port(443)
.target("example.com")
.build())
.build());
}
}
Content copied to clipboard
resources:
# Add a record to the domain
example:
type: cloudflare:Record
properties:
zoneId: ${cloudflareZoneId}
name: terraform
content: 192.0.2.1
type: A
ttl: 3600
# Add a record requiring a data map
_sipTls:
type: cloudflare:Record
name: _sip_tls
properties:
zoneId: ${cloudflareZoneId}
name: _sip._tls
type: SRV
data:
service: _sip
proto: _tls
name: terraform-srv
priority: 0
weight: 0
port: 443
target: example.com
Content copied to clipboard
Import
$ pulumi import cloudflare:index/record:Record example <zone_id>/<record_id>
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(allowOverwrite: Output<Boolean>? = null, comment: Output<String>? = null, content: Output<String>? = null, data: Output<RecordDataArgs>? = null, name: Output<String>? = null, priority: Output<Int>? = null, proxied: Output<Boolean>? = null, tags: Output<List<String>>? = null, ttl: Output<Int>? = null, type: Output<String>? = null, value: Output<String>? = null, zoneId: Output<String>? = null)