"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Attestor = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An attestor that attests to container image artifacts.
 *
 * To get more information about Attestor, see:
 *
 * * [API documentation](https://cloud.google.com/binary-authorization/docs/reference/rest/)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/binary-authorization/)
 *
 * ## Example Usage
 *
 * ### Binary Authorization Attestor Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const note = new gcp.containeranalysis.Note("note", {
 *     name: "test-attestor-note",
 *     attestationAuthority: {
 *         hint: {
 *             humanReadableName: "Attestor Note",
 *         },
 *     },
 * });
 * const attestor = new gcp.binaryauthorization.Attestor("attestor", {
 *     name: "test-attestor",
 *     attestationAuthorityNote: {
 *         noteReference: note.name,
 *         publicKeys: [{
 *             asciiArmoredPgpPublicKey: `mQENBFtP0doBCADF+joTiXWKVuP8kJt3fgpBSjT9h8ezMfKA4aXZctYLx5wslWQl
 * bB7Iu2ezkECNzoEeU7WxUe8a61pMCh9cisS9H5mB2K2uM4Jnf8tgFeXn3akJDVo0
 * oR1IC+Dp9mXbRSK3MAvKkOwWlG99sx3uEdvmeBRHBOO+grchLx24EThXFOyP9Fk6
 * V39j6xMjw4aggLD15B4V0v9JqBDdJiIYFzszZDL6pJwZrzcP0z8JO4rTZd+f64bD
 * Mpj52j/pQfA8lZHOaAgb1OrthLdMrBAjoDjArV4Ek7vSbrcgYWcI6BhsQrFoxKdX
 * 83TZKai55ZCfCLIskwUIzA1NLVwyzCS+fSN/ABEBAAG0KCJUZXN0IEF0dGVzdG9y
 * IiA8ZGFuYWhvZmZtYW5AZ29vZ2xlLmNvbT6JAU4EEwEIADgWIQRfWkqHt6hpTA1L
 * uY060eeM4dc66AUCW0/R2gIbLwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRA6
 * 0eeM4dc66HdpCAC4ot3b0OyxPb0Ip+WT2U0PbpTBPJklesuwpIrM4Lh0N+1nVRLC
 * 51WSmVbM8BiAFhLbN9LpdHhds1kUrHF7+wWAjdR8sqAj9otc6HGRM/3qfa2qgh+U
 * WTEk/3us/rYSi7T7TkMuutRMIa1IkR13uKiW56csEMnbOQpn9rDqwIr5R8nlZP5h
 * MAU9vdm1DIv567meMqTaVZgR3w7bck2P49AO8lO5ERFpVkErtu/98y+rUy9d789l
 * +OPuS1NGnxI1YKsNaWJF4uJVuvQuZ1twrhCbGNtVorO2U12+cEq+YtUxj7kmdOC1
 * qoIRW6y0+UlAc+MbqfL0ziHDOAmcqz1GnROg
 * =6Bvm
 * `,
 *         }],
 *     },
 * });
 * ```
 * ### Binary Authorization Attestor Kms
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const keyring = new gcp.kms.KeyRing("keyring", {
 *     name: "test-attestor-key-ring",
 *     location: "global",
 * });
 * const crypto_key = new gcp.kms.CryptoKey("crypto-key", {
 *     name: "test-attestor-key",
 *     keyRing: keyring.id,
 *     purpose: "ASYMMETRIC_SIGN",
 *     versionTemplate: {
 *         algorithm: "RSA_SIGN_PKCS1_4096_SHA512",
 *     },
 * });
 * const version = gcp.kms.getKMSCryptoKeyVersionOutput({
 *     cryptoKey: crypto_key.id,
 * });
 * const note = new gcp.containeranalysis.Note("note", {
 *     name: "test-attestor-note",
 *     attestationAuthority: {
 *         hint: {
 *             humanReadableName: "Attestor Note",
 *         },
 *     },
 * });
 * const attestor = new gcp.binaryauthorization.Attestor("attestor", {
 *     name: "test-attestor",
 *     attestationAuthorityNote: {
 *         noteReference: note.name,
 *         publicKeys: [{
 *             id: version.apply(version => version.id),
 *             pkixPublicKey: {
 *                 publicKeyPem: version.apply(version => version.publicKeys?.[0]?.pem),
 *                 signatureAlgorithm: version.apply(version => version.publicKeys?.[0]?.algorithm),
 *             },
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Attestor can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/attestors/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Attestor can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:binaryauthorization/attestor:Attestor default projects/{{project}}/attestors/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:binaryauthorization/attestor:Attestor default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:binaryauthorization/attestor:Attestor default {{name}}
 * ```
 */
class Attestor extends pulumi.CustomResource {
    /**
     * Get an existing Attestor 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new Attestor(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Attestor.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Attestor.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["attestationAuthorityNote"] = state?.attestationAuthorityNote;
            resourceInputs["description"] = state?.description;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
        }
        else {
            const args = argsOrState;
            if (args?.attestationAuthorityNote === undefined && !opts.urn) {
                throw new Error("Missing required property 'attestationAuthorityNote'");
            }
            resourceInputs["attestationAuthorityNote"] = args?.attestationAuthorityNote;
            resourceInputs["description"] = args?.description;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Attestor.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Attestor = Attestor;
/** @internal */
Attestor.__pulumiType = 'gcp:binaryauthorization/attestor:Attestor';
//# sourceMappingURL=attestor.js.map