com.pulumi.gcp.certificatemanager.kotlin.DnsAuthorization.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.certificatemanager.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.certificatemanager.kotlin.outputs.DnsAuthorizationDnsResourceRecord
import com.pulumi.gcp.certificatemanager.kotlin.outputs.DnsAuthorizationDnsResourceRecord.Companion.toKotlin
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
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [DnsAuthorization].
*/
@PulumiTagMarker
public class DnsAuthorizationResourceBuilder internal constructor() {
public var name: String? = null
public var args: DnsAuthorizationArgs = DnsAuthorizationArgs()
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 DnsAuthorizationArgsBuilder.() -> Unit) {
val builder = DnsAuthorizationArgsBuilder()
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(): DnsAuthorization {
val builtJavaResource =
com.pulumi.gcp.certificatemanager.DnsAuthorization(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DnsAuthorization(builtJavaResource)
}
}
/**
* DnsAuthorization represents a HTTP-reachable backend for a DnsAuthorization.
* ## Example Usage
* ### Certificate Manager Dns Authorization Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.certificatemanager.DnsAuthorization("default", {
* name: "dns-auth",
* location: "global",
* description: "The default dns",
* domain: "subdomain.hashicorptest.com",
* });
* export const recordNameToInsert = _default.dnsResourceRecords.apply(dnsResourceRecords => dnsResourceRecords[0].name);
* export const recordTypeToInsert = _default.dnsResourceRecords.apply(dnsResourceRecords => dnsResourceRecords[0].type);
* export const recordDataToInsert = _default.dnsResourceRecords.apply(dnsResourceRecords => dnsResourceRecords[0].data);
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.certificatemanager.DnsAuthorization("default",
* name="dns-auth",
* location="global",
* description="The default dns",
* domain="subdomain.hashicorptest.com")
* pulumi.export("recordNameToInsert", default.dns_resource_records[0].name)
* pulumi.export("recordTypeToInsert", default.dns_resource_records[0].type)
* pulumi.export("recordDataToInsert", default.dns_resource_records[0].data)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.CertificateManager.DnsAuthorization("default", new()
* {
* Name = "dns-auth",
* Location = "global",
* Description = "The default dns",
* Domain = "subdomain.hashicorptest.com",
* });
* return new Dictionary
* {
* ["recordNameToInsert"] = @default.DnsResourceRecords.Apply(dnsResourceRecords => dnsResourceRecords[0].Name),
* ["recordTypeToInsert"] = @default.DnsResourceRecords.Apply(dnsResourceRecords => dnsResourceRecords[0].Type),
* ["recordDataToInsert"] = @default.DnsResourceRecords.Apply(dnsResourceRecords => dnsResourceRecords[0].Data),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/certificatemanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := certificatemanager.NewDnsAuthorization(ctx, "default", &certificatemanager.DnsAuthorizationArgs{
* Name: pulumi.String("dns-auth"),
* Location: pulumi.String("global"),
* Description: pulumi.String("The default dns"),
* Domain: pulumi.String("subdomain.hashicorptest.com"),
* })
* if err != nil {
* return err
* }
* ctx.Export("recordNameToInsert", _default.DnsResourceRecords.ApplyT(func(dnsResourceRecords []certificatemanager.DnsAuthorizationDnsResourceRecord) (*string, error) {
* return &dnsResourceRecords[0].Name, nil
* }).(pulumi.StringPtrOutput))
* ctx.Export("recordTypeToInsert", _default.DnsResourceRecords.ApplyT(func(dnsResourceRecords []certificatemanager.DnsAuthorizationDnsResourceRecord) (*string, error) {
* return &dnsResourceRecords[0].Type, nil
* }).(pulumi.StringPtrOutput))
* ctx.Export("recordDataToInsert", _default.DnsResourceRecords.ApplyT(func(dnsResourceRecords []certificatemanager.DnsAuthorizationDnsResourceRecord) (*string, error) {
* return &dnsResourceRecords[0].Data, nil
* }).(pulumi.StringPtrOutput))
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.certificatemanager.DnsAuthorization;
* import com.pulumi.gcp.certificatemanager.DnsAuthorizationArgs;
* 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 default_ = new DnsAuthorization("default", DnsAuthorizationArgs.builder()
* .name("dns-auth")
* .location("global")
* .description("The default dns")
* .domain("subdomain.hashicorptest.com")
* .build());
* ctx.export("recordNameToInsert", default_.dnsResourceRecords().applyValue(dnsResourceRecords -> dnsResourceRecords[0].name()));
* ctx.export("recordTypeToInsert", default_.dnsResourceRecords().applyValue(dnsResourceRecords -> dnsResourceRecords[0].type()));
* ctx.export("recordDataToInsert", default_.dnsResourceRecords().applyValue(dnsResourceRecords -> dnsResourceRecords[0].data()));
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:certificatemanager:DnsAuthorization
* properties:
* name: dns-auth
* location: global
* description: The default dns
* domain: subdomain.hashicorptest.com
* outputs:
* recordNameToInsert: ${default.dnsResourceRecords[0].name}
* recordTypeToInsert: ${default.dnsResourceRecords[0].type}
* recordDataToInsert: ${default.dnsResourceRecords[0].data}
* ```
*
* ### Certificate Manager Dns Authorization Regional
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.certificatemanager.DnsAuthorization("default", {
* name: "dns-auth",
* location: "us-central1",
* description: "reginal dns",
* type: "PER_PROJECT_RECORD",
* domain: "subdomain.hashicorptest.com",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.certificatemanager.DnsAuthorization("default",
* name="dns-auth",
* location="us-central1",
* description="reginal dns",
* type="PER_PROJECT_RECORD",
* domain="subdomain.hashicorptest.com")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.CertificateManager.DnsAuthorization("default", new()
* {
* Name = "dns-auth",
* Location = "us-central1",
* Description = "reginal dns",
* Type = "PER_PROJECT_RECORD",
* Domain = "subdomain.hashicorptest.com",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/certificatemanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := certificatemanager.NewDnsAuthorization(ctx, "default", &certificatemanager.DnsAuthorizationArgs{
* Name: pulumi.String("dns-auth"),
* Location: pulumi.String("us-central1"),
* Description: pulumi.String("reginal dns"),
* Type: pulumi.String("PER_PROJECT_RECORD"),
* Domain: pulumi.String("subdomain.hashicorptest.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.gcp.certificatemanager.DnsAuthorization;
* import com.pulumi.gcp.certificatemanager.DnsAuthorizationArgs;
* 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 default_ = new DnsAuthorization("default", DnsAuthorizationArgs.builder()
* .name("dns-auth")
* .location("us-central1")
* .description("reginal dns")
* .type("PER_PROJECT_RECORD")
* .domain("subdomain.hashicorptest.com")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:certificatemanager:DnsAuthorization
* properties:
* name: dns-auth
* location: us-central1
* description: reginal dns
* type: PER_PROJECT_RECORD
* domain: subdomain.hashicorptest.com
* ```
*
* ## Import
* DnsAuthorization can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/dnsAuthorizations/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
* When using the `pulumi import` command, DnsAuthorization can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default projects/{{project}}/locations/{{location}}/dnsAuthorizations/{{name}}
* ```
* ```sh
* $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default {{project}}/{{location}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default {{location}}/{{name}}
* ```
*/
public class DnsAuthorization internal constructor(
override val javaResource: com.pulumi.gcp.certificatemanager.DnsAuthorization,
) : KotlinCustomResource(javaResource, DnsAuthorizationMapper) {
/**
* A human-readable description of the resource.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The structure describing the DNS Resource Record that needs to be added
* to DNS configuration for the authorization to be usable by
* certificate.
* Structure is documented below.
*/
public val dnsResourceRecords: Output>
get() = javaResource.dnsResourceRecords().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
})
/**
* A domain which is being authorized. A DnsAuthorization resource covers a
* single domain and its wildcard, e.g. authorization for "example.com" can
* be used to issue certificates for "example.com" and "*.example.com".
*/
public val domain: Output
get() = javaResource.domain().applyValue({ args0 -> args0 })
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy