// *** 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.kms;

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.kms.KeyRingImportJobArgs;
import com.pulumi.gcp.kms.inputs.KeyRingImportJobState;
import com.pulumi.gcp.kms.outputs.KeyRingImportJobAttestation;
import com.pulumi.gcp.kms.outputs.KeyRingImportJobPublicKey;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;

/**
 * A `KeyRingImportJob` can be used to create `CryptoKeys` and `CryptoKeyVersions` using pre-existing
 * key material, generated outside of Cloud KMS. A `KeyRingImportJob` expires 3 days after it is created.
 * Once expired, Cloud KMS will no longer be able to import or unwrap any key material that
 * was wrapped with the `KeyRingImportJob`&#39;s public key.
 * 
 * &gt; **Note:** KeyRingImportJobs cannot be deleted from Google Cloud Platform.
 * Destroying a provider-managed KeyRingImportJob will remove it from state but
 * *will not delete the resource from the project.*
 * 
 * To get more information about KeyRingImportJob, see:
 * 
 * * [API documentation](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.importJobs)
 * * How-to Guides
 *     * [Importing a key](https://cloud.google.com/kms/docs/importing-a-key)
 * 
 * ## Example Usage
 * 
 * ## Import
 * 
 * KeyRingImportJob can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:kms/keyRingImportJob:KeyRingImportJob default {{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:kms/keyRingImportJob:KeyRingImportJob")
public class KeyRingImportJob extends com.pulumi.resources.CustomResource {
    /**
     * Statement that was generated and signed by the key creator (for example, an HSM) at key creation time.
     * Use this statement to verify attributes of the key as stored on the HSM, independently of Google.
     * Only present if the chosen ImportMethod is one with a protection level of HSM.
     * Structure is documented below.
     * 
     */
    @Export(name="attestations", type=List.class, parameters={KeyRingImportJobAttestation.class})
    private Output<List<KeyRingImportJobAttestation>> attestations;

    /**
     * @return Statement that was generated and signed by the key creator (for example, an HSM) at key creation time.
     * Use this statement to verify attributes of the key as stored on the HSM, independently of Google.
     * Only present if the chosen ImportMethod is one with a protection level of HSM.
     * Structure is documented below.
     * 
     */
    public Output<List<KeyRingImportJobAttestation>> attestations() {
        return this.attestations;
    }
    /**
     * The time at which this resource is scheduled for expiration and can no longer be used.
     * This is in RFC3339 text format.
     * 
     */
    @Export(name="expireTime", type=String.class, parameters={})
    private Output<String> expireTime;

    /**
     * @return The time at which this resource is scheduled for expiration and can no longer be used.
     * This is in RFC3339 text format.
     * 
     */
    public Output<String> expireTime() {
        return this.expireTime;
    }
    /**
     * It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]{1,63}
     * 
     * ***
     * 
     */
    @Export(name="importJobId", type=String.class, parameters={})
    private Output<String> importJobId;

    /**
     * @return It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]{1,63}
     * 
     * ***
     * 
     */
    public Output<String> importJobId() {
        return this.importJobId;
    }
    /**
     * The wrapping method to be used for incoming key material.
     * Possible values are: `RSA_OAEP_3072_SHA1_AES_256`, `RSA_OAEP_4096_SHA1_AES_256`.
     * 
     */
    @Export(name="importMethod", type=String.class, parameters={})
    private Output<String> importMethod;

    /**
     * @return The wrapping method to be used for incoming key material.
     * Possible values are: `RSA_OAEP_3072_SHA1_AES_256`, `RSA_OAEP_4096_SHA1_AES_256`.
     * 
     */
    public Output<String> importMethod() {
        return this.importMethod;
    }
    /**
     * The KeyRing that this import job belongs to.
     * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
     * 
     */
    @Export(name="keyRing", type=String.class, parameters={})
    private Output<String> keyRing;

    /**
     * @return The KeyRing that this import job belongs to.
     * Format: `&#39;projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}&#39;`.
     * 
     */
    public Output<String> keyRing() {
        return this.keyRing;
    }
    /**
     * The resource name for this ImportJob in the format projects/*{@literal /}locations/*{@literal /}keyRings/*{@literal /}importJobs/*.
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return The resource name for this ImportJob in the format projects/*{@literal /}locations/*{@literal /}keyRings/*{@literal /}importJobs/*.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The protection level of the ImportJob. This must match the protectionLevel of the
     * versionTemplate on the CryptoKey you attempt to import into.
     * Possible values are: `SOFTWARE`, `HSM`, `EXTERNAL`.
     * 
     */
    @Export(name="protectionLevel", type=String.class, parameters={})
    private Output<String> protectionLevel;

    /**
     * @return The protection level of the ImportJob. This must match the protectionLevel of the
     * versionTemplate on the CryptoKey you attempt to import into.
     * Possible values are: `SOFTWARE`, `HSM`, `EXTERNAL`.
     * 
     */
    public Output<String> protectionLevel() {
        return this.protectionLevel;
    }
    /**
     * The public key with which to wrap key material prior to import. Only returned if state is `ACTIVE`.
     * Structure is documented below.
     * 
     */
    @Export(name="publicKeys", type=List.class, parameters={KeyRingImportJobPublicKey.class})
    private Output<List<KeyRingImportJobPublicKey>> publicKeys;

    /**
     * @return The public key with which to wrap key material prior to import. Only returned if state is `ACTIVE`.
     * Structure is documented below.
     * 
     */
    public Output<List<KeyRingImportJobPublicKey>> publicKeys() {
        return this.publicKeys;
    }
    /**
     * The current state of the ImportJob, indicating if it can be used.
     * 
     */
    @Export(name="state", type=String.class, parameters={})
    private Output<String> state;

    /**
     * @return The current state of the ImportJob, indicating if it can be used.
     * 
     */
    public Output<String> state() {
        return this.state;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public KeyRingImportJob(String name) {
        this(name, KeyRingImportJobArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public KeyRingImportJob(String name, KeyRingImportJobArgs 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 KeyRingImportJob(String name, KeyRingImportJobArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:kms/keyRingImportJob:KeyRingImportJob", name, args == null ? KeyRingImportJobArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private KeyRingImportJob(String name, Output<String> id, @Nullable KeyRingImportJobState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:kms/keyRingImportJob:KeyRingImportJob", 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 KeyRingImportJob get(String name, Output<String> id, @Nullable KeyRingImportJobState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new KeyRingImportJob(name, id, state, options);
    }
}
