com.pulumi.cloudflare.kotlin.RecordArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.RecordArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.RecordDataArgs
import com.pulumi.cloudflare.kotlin.inputs.RecordDataArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a Cloudflare record resource.
* ## Example Usage
*
* ```typescript
* 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",
* },
* });
* ```
* ```python
* 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",
* })
* ```
* ```csharp
* 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",
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/record:Record example /
* ```
* @property allowOverwrite
* @property comment Comments or notes about the DNS record. This field has no effect on DNS responses.
* @property content The content of the record. Must provide only one of `data`, `content`, `value`.
* @property data Map of attributes that constitute the record value. Must provide only one of `data`, `content`, `value`.
* @property name The name of the record. **Modifying this attribute will force creation of a new resource.**
* @property priority The priority of the record.
* @property proxied Whether the record gets Cloudflare's origin protection.
* @property tags Custom tags for the DNS record.
* @property ttl The TTL of the record.
* @property type The type of the record. Available values: `A`, `AAAA`, `CAA`, `CNAME`, `TXT`, `SRV`, `LOC`, `MX`, `NS`, `SPF`, `CERT`, `DNSKEY`, `DS`, `NAPTR`, `SMIMEA`, `SSHFP`, `TLSA`, `URI`, `PTR`, `HTTPS`, `SVCB`. **Modifying this attribute will force creation of a new resource.**
* @property value The value of the record. Must provide only one of `data`, `content`, `value`.
* @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public data class RecordArgs(
public val allowOverwrite: Output? = null,
public val comment: Output? = null,
public val content: Output? = null,
public val `data`: Output? = null,
public val name: Output? = null,
public val priority: Output? = null,
public val proxied: Output? = null,
public val tags: Output>? = null,
public val ttl: Output? = null,
public val type: Output? = null,
@Deprecated(
message = """
`value` is deprecated in favour of `content` and will be removed in the next major release.
""",
)
public val `value`: Output? = null,
public val zoneId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.RecordArgs =
com.pulumi.cloudflare.RecordArgs.builder()
.allowOverwrite(allowOverwrite?.applyValue({ args0 -> args0 }))
.comment(comment?.applyValue({ args0 -> args0 }))
.content(content?.applyValue({ args0 -> args0 }))
.`data`(`data`?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name?.applyValue({ args0 -> args0 }))
.priority(priority?.applyValue({ args0 -> args0 }))
.proxied(proxied?.applyValue({ args0 -> args0 }))
.tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.ttl(ttl?.applyValue({ args0 -> args0 }))
.type(type?.applyValue({ args0 -> args0 }))
.`value`(`value`?.applyValue({ args0 -> args0 }))
.zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [RecordArgs].
*/
@PulumiTagMarker
public class RecordArgsBuilder internal constructor() {
private var allowOverwrite: Output? = null
private var comment: Output? = null
private var content: Output? = null
private var `data`: Output? = null
private var name: Output? = null
private var priority: Output? = null
private var proxied: Output? = null
private var tags: Output>? = null
private var ttl: Output? = null
private var type: Output? = null
private var `value`: Output? = null
private var zoneId: Output? = null
/**
* @param value
*/
@JvmName("yjyyxkheamoswrql")
public suspend fun allowOverwrite(`value`: Output) {
this.allowOverwrite = value
}
/**
* @param value Comments or notes about the DNS record. This field has no effect on DNS responses.
*/
@JvmName("hfhgdfvlxonbwmbv")
public suspend fun comment(`value`: Output) {
this.comment = value
}
/**
* @param value The content of the record. Must provide only one of `data`, `content`, `value`.
*/
@JvmName("fxomtivjsoddaybb")
public suspend fun content(`value`: Output) {
this.content = value
}
/**
* @param value Map of attributes that constitute the record value. Must provide only one of `data`, `content`, `value`.
*/
@JvmName("lfdtbnbvwmvgdsip")
public suspend fun `data`(`value`: Output) {
this.`data` = value
}
/**
* @param value The name of the record. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("gejobgugurltqjad")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The priority of the record.
*/
@JvmName("ojjsgdfluhpptjnx")
public suspend fun priority(`value`: Output) {
this.priority = value
}
/**
* @param value Whether the record gets Cloudflare's origin protection.
*/
@JvmName("hiychgakpjrsuqch")
public suspend fun proxied(`value`: Output) {
this.proxied = value
}
/**
* @param value Custom tags for the DNS record.
*/
@JvmName("tuiydoojgopcvmes")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
@JvmName("pgqnjkunsaphdvfe")
public suspend fun tags(vararg values: Output) {
this.tags = Output.all(values.asList())
}
/**
* @param values Custom tags for the DNS record.
*/
@JvmName("drupuqbxlwrugrcf")
public suspend fun tags(values: List