com.pulumi.aws.lightsail.kotlin.Domain.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.lightsail.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [Domain].
*/
@PulumiTagMarker
public class DomainResourceBuilder internal constructor() {
public var name: String? = null
public var args: DomainArgs = DomainArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend DomainArgsBuilder.() -> Unit) {
val builder = DomainArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Domain {
val builtJavaResource = com.pulumi.aws.lightsail.Domain(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Domain(builtJavaResource)
}
}
/**
* Creates a domain resource for the specified domain (e.g., example.com).
* You cannot register a new domain name using Lightsail. You must register
* a domain name using Amazon Route 53 or another domain name registrar.
* If you have already registered your domain, you can enter its name in
* this parameter to manage the DNS records for that domain.
* > **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const domainTest = new aws.lightsail.Domain("domain_test", {domainName: "mydomain.com"});
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* domain_test = aws.lightsail.Domain("domain_test", domain_name="mydomain.com")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var domainTest = new Aws.LightSail.Domain("domain_test", new()
* {
* DomainName = "mydomain.com",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := lightsail.NewDomain(ctx, "domain_test", &lightsail.DomainArgs{
* DomainName: pulumi.String("mydomain.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.aws.lightsail.Domain;
* import com.pulumi.aws.lightsail.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) {
* var domainTest = new Domain("domainTest", DomainArgs.builder()
* .domainName("mydomain.com")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* domainTest:
* type: aws:lightsail:Domain
* name: domain_test
* properties:
* domainName: mydomain.com
* ```
*
*/
public class Domain internal constructor(
override val javaResource: com.pulumi.aws.lightsail.Domain,
) : KotlinCustomResource(javaResource, DomainMapper) {
/**
* The ARN of the Lightsail domain
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The name of the Lightsail domain to manage
*/
public val domainName: Output
get() = javaResource.domainName().applyValue({ args0 -> args0 })
}
public object DomainMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.lightsail.Domain::class == javaResource::class
override fun map(javaResource: Resource): Domain = Domain(
javaResource as
com.pulumi.aws.lightsail.Domain,
)
}
/**
* @see [Domain].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Domain].
*/
public suspend fun domain(name: String, block: suspend DomainResourceBuilder.() -> Unit): Domain {
val builder = DomainResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Domain].
* @param name The _unique_ name of the resulting resource.
*/
public fun domain(name: String): Domain {
val builder = DomainResourceBuilder()
builder.name(name)
return builder.build()
}