com.pulumi.digitalocean.kotlin.DomainArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.digitalocean.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.DomainArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a DigitalOcean domain resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
* // Create a new domain
* const _default = new digitalocean.Domain("default", {
* name: "example.com",
* ipAddress: foo.ipv4Address,
* });
* ```
* ```python
* import pulumi
* import pulumi_digitalocean as digitalocean
* # Create a new domain
* default = digitalocean.Domain("default",
* name="example.com",
* ip_address=foo["ipv4Address"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using DigitalOcean = Pulumi.DigitalOcean;
* return await Deployment.RunAsync(() =>
* {
* // Create a new domain
* var @default = new DigitalOcean.Domain("default", new()
* {
* Name = "example.com",
* IpAddress = foo.Ipv4Address,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // Create a new domain
* _, err := digitalocean.NewDomain(ctx, "default", &digitalocean.DomainArgs{
* Name: pulumi.String("example.com"),
* IpAddress: pulumi.Any(foo.Ipv4Address),
* })
* 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.digitalocean.Domain;
* import com.pulumi.digitalocean.DomainArgs;
* 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 new domain
* var default_ = new Domain("default", DomainArgs.builder()
* .name("example.com")
* .ipAddress(foo.ipv4Address())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Create a new domain
* default:
* type: digitalocean:Domain
* properties:
* name: example.com
* ipAddress: ${foo.ipv4Address}
* ```
*
* ## Import
* Domains can be imported using the `domain name`, e.g.
* ```sh
* $ pulumi import digitalocean:index/domain:Domain mydomain mytestdomain.com
* ```
* @property ipAddress The IP address of the domain. If specified, this IP
* is used to created an initial A record for the domain.
* @property name The name of the domain
*/
public data class DomainArgs(
public val ipAddress: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.digitalocean.DomainArgs =
com.pulumi.digitalocean.DomainArgs.builder()
.ipAddress(ipAddress?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [DomainArgs].
*/
@PulumiTagMarker
public class DomainArgsBuilder internal constructor() {
private var ipAddress: Output? = null
private var name: Output? = null
/**
* @param value The IP address of the domain. If specified, this IP
* is used to created an initial A record for the domain.
*/
@JvmName("qsheiyemgdqprdlt")
public suspend fun ipAddress(`value`: Output) {
this.ipAddress = value
}
/**
* @param value The name of the domain
*/
@JvmName("kycvtxqniobxtsdh")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The IP address of the domain. If specified, this IP
* is used to created an initial A record for the domain.
*/
@JvmName("diuhtijonxtwanxl")
public suspend fun ipAddress(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipAddress = mapped
}
/**
* @param value The name of the domain
*/
@JvmName("bwagxvyvfbqksden")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): DomainArgs = DomainArgs(
ipAddress = ipAddress,
name = name,
)
}