// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.certificatemanager;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.certificatemanager.DnsAuthorizationArgs;
import com.pulumi.gcp.certificatemanager.inputs.DnsAuthorizationState;
import com.pulumi.gcp.certificatemanager.outputs.DnsAuthorizationDnsResourceRecord;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * DnsAuthorization represents a HTTP-reachable backend for a DnsAuthorization.
 * 
 * ## Example Usage
 * ### Certificate Manager Dns Authorization Basic
 * ```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(&#34;default&#34;, DnsAuthorizationArgs.builder()        
 *             .description(&#34;The default dnss&#34;)
 *             .domain(&#34;subdomain.hashicorptest.com&#34;)
 *             .build());
 * 
 *         ctx.export(&#34;recordNameToInsert&#34;, default_.dnsResourceRecords().applyValue(dnsResourceRecords -&gt; dnsResourceRecords[0].name()));
 *         ctx.export(&#34;recordTypeToInsert&#34;, default_.dnsResourceRecords().applyValue(dnsResourceRecords -&gt; dnsResourceRecords[0].type()));
 *         ctx.export(&#34;recordDataToInsert&#34;, default_.dnsResourceRecords().applyValue(dnsResourceRecords -&gt; dnsResourceRecords[0].data()));
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * DnsAuthorization can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default projects/{{project}}/locations/global/dnsAuthorizations/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default {{project}}/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:certificatemanager/dnsAuthorization:DnsAuthorization default {{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:certificatemanager/dnsAuthorization:DnsAuthorization")
public class DnsAuthorization extends com.pulumi.resources.CustomResource {
    /**
     * A human-readable description of the resource.
     * 
     */
    @Export(name="description", type=String.class, parameters={})
    private Output</* @Nullable */ String> description;

    /**
     * @return A human-readable description of the resource.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * 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.
     * 
     */
    @Export(name="dnsResourceRecords", type=List.class, parameters={DnsAuthorizationDnsResourceRecord.class})
    private Output<List<DnsAuthorizationDnsResourceRecord>> dnsResourceRecords;

    /**
     * @return 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 Output<List<DnsAuthorizationDnsResourceRecord>> dnsResourceRecords() {
        return this.dnsResourceRecords;
    }
    /**
     * A domain which is being authorized. A DnsAuthorization resource covers a
     * single domain and its wildcard, e.g. authorization for &#34;example.com&#34; can
     * be used to issue certificates for &#34;example.com&#34; and &#34;*.example.com&#34;.
     * 
     */
    @Export(name="domain", type=String.class, parameters={})
    private Output<String> domain;

    /**
     * @return A domain which is being authorized. A DnsAuthorization resource covers a
     * single domain and its wildcard, e.g. authorization for &#34;example.com&#34; can
     * be used to issue certificates for &#34;example.com&#34; and &#34;*.example.com&#34;.
     * 
     */
    public Output<String> domain() {
        return this.domain;
    }
    /**
     * Set of label tags associated with the DNS Authorization resource.
     * 
     */
    @Export(name="labels", type=Map.class, parameters={String.class, String.class})
    private Output</* @Nullable */ Map<String,String>> labels;

    /**
     * @return Set of label tags associated with the DNS Authorization resource.
     * 
     */
    public Output<Optional<Map<String,String>>> labels() {
        return Codegen.optional(this.labels);
    }
    /**
     * Name of the resource; provided by the client when the resource is created.
     * The name must be 1-64 characters long, and match the regular expression [a-zA-Z][a-zA-Z0-9_-]* which means the first character must be a letter,
     * and all following characters must be a dash, underscore, letter or digit.
     * 
     * ***
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return Name of the resource; provided by the client when the resource is created.
     * The name must be 1-64 characters long, and match the regular expression [a-zA-Z][a-zA-Z0-9_-]* which means the first character must be a letter,
     * and all following characters must be a dash, underscore, letter or digit.
     * 
     * ***
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Export(name="project", type=String.class, parameters={})
    private Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Output<String> project() {
        return this.project;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public DnsAuthorization(String name) {
        this(name, DnsAuthorizationArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public DnsAuthorization(String name, DnsAuthorizationArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public DnsAuthorization(String name, DnsAuthorizationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:certificatemanager/dnsAuthorization:DnsAuthorization", name, args == null ? DnsAuthorizationArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private DnsAuthorization(String name, Output<String> id, @Nullable DnsAuthorizationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:certificatemanager/dnsAuthorization:DnsAuthorization", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static DnsAuthorization get(String name, Output<String> id, @Nullable DnsAuthorizationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new DnsAuthorization(name, id, state, options);
    }
}
