@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
187 lines • 7.91 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccessApprovalSettings = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Access Approval enables you to require your explicit approval whenever Google support and engineering need to access your customer content.
*
* To get more information about OrganizationSettings, see:
*
* * [API documentation](https://cloud.google.com/access-approval/docs/reference/rest/v1/organizations)
*
* ## Example Usage
*
* ### Organization Access Approval Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const organizationAccessApproval = new gcp.organizations.AccessApprovalSettings("organization_access_approval", {
* organizationId: "123456789",
* notificationEmails: [
* "testuser@example.com",
* "example.user@example.com",
* ],
* enrolledServices: [
* {
* cloudProduct: "appengine.googleapis.com",
* },
* {
* cloudProduct: "dataflow.googleapis.com",
* enrollmentLevel: "BLOCK_ALL",
* },
* ],
* });
* ```
* ### Organization Access Approval Active Key Version
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const myProject = new gcp.organizations.Project("my_project", {
* name: "My Project",
* projectId: "your-project-id",
* orgId: "123456789",
* deletionPolicy: "DELETE",
* });
* const keyRing = new gcp.kms.KeyRing("key_ring", {
* name: "key-ring",
* location: "global",
* project: myProject.projectId,
* });
* const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
* name: "crypto-key",
* keyRing: keyRing.id,
* purpose: "ASYMMETRIC_SIGN",
* versionTemplate: {
* algorithm: "EC_SIGN_P384_SHA384",
* },
* });
* const serviceAccount = gcp.accessapproval.getOrganizationServiceAccount({
* organizationId: "123456789",
* });
* const iam = new gcp.kms.CryptoKeyIAMMember("iam", {
* cryptoKeyId: cryptoKey.id,
* role: "roles/cloudkms.signerVerifier",
* member: serviceAccount.then(serviceAccount => `serviceAccount:${serviceAccount.accountEmail}`),
* });
* const cryptoKeyVersion = gcp.kms.getKMSCryptoKeyVersionOutput({
* cryptoKey: cryptoKey.id,
* });
* const organizationAccessApproval = new gcp.organizations.AccessApprovalSettings("organization_access_approval", {
* organizationId: "123456789",
* activeKeyVersion: cryptoKeyVersion.apply(cryptoKeyVersion => cryptoKeyVersion.name),
* enrolledServices: [{
* cloudProduct: "all",
* }],
* }, {
* dependsOn: [iam],
* });
* ```
*
* ## Import
*
* OrganizationSettings can be imported using any of these accepted formats:
*
* * `organizations/{{organization_id}}/accessApprovalSettings`
* * `{{organization_id}}`
*
* When using the `pulumi import` command, OrganizationSettings can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:organizations/accessApprovalSettings:AccessApprovalSettings default organizations/{{organization_id}}/accessApprovalSettings
* $ pulumi import gcp:organizations/accessApprovalSettings:AccessApprovalSettings default {{organization_id}}
* ```
*/
class AccessApprovalSettings extends pulumi.CustomResource {
/**
* Get an existing AccessApprovalSettings 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 AccessApprovalSettings(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:organizations/accessApprovalSettings:AccessApprovalSettings';
/**
* Returns true if the given object is an instance of AccessApprovalSettings. 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'] === AccessApprovalSettings.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activeKeyVersion"] = state?.activeKeyVersion;
resourceInputs["ancestorHasActiveKeyVersion"] = state?.ancestorHasActiveKeyVersion;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["enrolledAncestor"] = state?.enrolledAncestor;
resourceInputs["enrolledServices"] = state?.enrolledServices;
resourceInputs["invalidKeyVersion"] = state?.invalidKeyVersion;
resourceInputs["name"] = state?.name;
resourceInputs["notificationEmails"] = state?.notificationEmails;
resourceInputs["organizationId"] = state?.organizationId;
}
else {
const args = argsOrState;
if (args?.enrolledServices === undefined && !opts.urn) {
throw new Error("Missing required property 'enrolledServices'");
}
if (args?.organizationId === undefined && !opts.urn) {
throw new Error("Missing required property 'organizationId'");
}
resourceInputs["activeKeyVersion"] = args?.activeKeyVersion;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["enrolledServices"] = args?.enrolledServices;
resourceInputs["notificationEmails"] = args?.notificationEmails;
resourceInputs["organizationId"] = args?.organizationId;
resourceInputs["ancestorHasActiveKeyVersion"] = undefined /*out*/;
resourceInputs["enrolledAncestor"] = undefined /*out*/;
resourceInputs["invalidKeyVersion"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AccessApprovalSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.AccessApprovalSettings = AccessApprovalSettings;
//# sourceMappingURL=accessApprovalSettings.js.map