com.pulumi.cloudflare.kotlin.PagesDomain.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.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 [PagesDomain].
*/
@PulumiTagMarker
public class PagesDomainResourceBuilder internal constructor() {
public var name: String? = null
public var args: PagesDomainArgs = PagesDomainArgs()
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 PagesDomainArgsBuilder.() -> Unit) {
val builder = PagesDomainArgsBuilder()
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(): PagesDomain {
val builtJavaResource = com.pulumi.cloudflare.PagesDomain(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return PagesDomain(builtJavaResource)
}
}
/**
* Provides a resource for managing Cloudflare Pages domains.
* > A DNS record for the domain is not automatically created. You need to create
* a `cloudflare.Record` resource for the domain you want to use.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const my_domain = new cloudflare.PagesDomain("my-domain", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* projectName: "my-example-project",
* domain: "example.com",
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* my_domain = cloudflare.PagesDomain("my-domain",
* account_id="f037e56e89293a057740de681ac9abbe",
* project_name="my-example-project",
* domain="example.com")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var my_domain = new Cloudflare.PagesDomain("my-domain", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* ProjectName = "my-example-project",
* Domain = "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 {
* _, err := cloudflare.NewPagesDomain(ctx, "my-domain", &cloudflare.PagesDomainArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* ProjectName: pulumi.String("my-example-project"),
* Domain: 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.PagesDomain;
* import com.pulumi.cloudflare.PagesDomainArgs;
* 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 my_domain = new PagesDomain("my-domain", PagesDomainArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .projectName("my-example-project")
* .domain("example.com")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* my-domain:
* type: cloudflare:PagesDomain
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* projectName: my-example-project
* domain: example.com
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/pagesDomain:PagesDomain example //
* ```
*/
public class PagesDomain internal constructor(
override val javaResource: com.pulumi.cloudflare.PagesDomain,
) : KotlinCustomResource(javaResource, PagesDomainMapper) {
/**
* The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public val accountId: Output
get() = javaResource.accountId().applyValue({ args0 -> args0 })
/**
* Custom domain. **Modifying this attribute will force creation of a new resource.**
*/
public val domain: Output
get() = javaResource.domain().applyValue({ args0 -> args0 })
/**
* Name of the Pages Project. **Modifying this attribute will force creation of a new resource.**
*/
public val projectName: Output
get() = javaResource.projectName().applyValue({ args0 -> args0 })
/**
* Status of the custom domain.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
}
public object PagesDomainMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.PagesDomain::class == javaResource::class
override fun map(javaResource: Resource): PagesDomain = PagesDomain(
javaResource as
com.pulumi.cloudflare.PagesDomain,
)
}
/**
* @see [PagesDomain].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [PagesDomain].
*/
public suspend fun pagesDomain(name: String, block: suspend PagesDomainResourceBuilder.() -> Unit): PagesDomain {
val builder = PagesDomainResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [PagesDomain].
* @param name The _unique_ name of the resulting resource.
*/
public fun pagesDomain(name: String): PagesDomain {
val builder = PagesDomainResourceBuilder()
builder.name(name)
return builder.build()
}