@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
175 lines • 6.46 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContainerV1 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V1 Barbican container resource within OpenStack.
*
* ## Example Usage
*
* ### Simple container
*
* A container with the TLS certificates.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
* import * as std from "@pulumi/std";
*
* const certificate1 = new openstack.keymanager.SecretV1("certificate_1", {
* name: "certificate",
* payload: std.file({
* input: "cert.pem",
* }).then(invoke => invoke.result),
* secretType: "certificate",
* payloadContentType: "text/plain",
* });
* const privateKey1 = new openstack.keymanager.SecretV1("private_key_1", {
* name: "private_key",
* payload: std.file({
* input: "cert-key.pem",
* }).then(invoke => invoke.result),
* secretType: "private",
* payloadContentType: "text/plain",
* });
* const intermediate1 = new openstack.keymanager.SecretV1("intermediate_1", {
* name: "intermediate",
* payload: std.file({
* input: "intermediate-ca.pem",
* }).then(invoke => invoke.result),
* secretType: "certificate",
* payloadContentType: "text/plain",
* });
* const tls1 = new openstack.keymanager.ContainerV1("tls_1", {
* name: "tls",
* type: "certificate",
* secretRefs: [
* {
* name: "certificate",
* secretRef: certificate1.secretRef,
* },
* {
* name: "private_key",
* secretRef: privateKey1.secretRef,
* },
* {
* name: "intermediates",
* secretRef: intermediate1.secretRef,
* },
* ],
* });
* ```
*
* ### Container with the ACL
*
* > **Note** Only read ACLs are supported
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const tls1 = new openstack.keymanager.ContainerV1("tls_1", {
* name: "tls",
* type: "certificate",
* secretRefs: [
* {
* name: "certificate",
* secretRef: certificate1.secretRef,
* },
* {
* name: "private_key",
* secretRef: privateKey1.secretRef,
* },
* {
* name: "intermediates",
* secretRef: intermediate1.secretRef,
* },
* ],
* acl: {
* read: {
* projectAccess: false,
* users: [
* "userid1",
* "userid2",
* ],
* },
* },
* });
* ```
*
* ## Import
*
* Containers can be imported using the container id (the last part of the container reference), e.g.:
*
* ```sh
* $ pulumi import openstack:keymanager/containerV1:ContainerV1 container_1 0c6cd26a-c012-4d7b-8034-057c0f1c2953
* ```
*/
class ContainerV1 extends pulumi.CustomResource {
/**
* Get an existing ContainerV1 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 ContainerV1(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ContainerV1. 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'] === ContainerV1.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["acl"] = state ? state.acl : undefined;
resourceInputs["consumers"] = state ? state.consumers : undefined;
resourceInputs["containerRef"] = state ? state.containerRef : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["creatorId"] = state ? state.creatorId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["secretRefs"] = state ? state.secretRefs : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["acl"] = args ? args.acl : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["secretRefs"] = args ? args.secretRefs : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["consumers"] = undefined /*out*/;
resourceInputs["containerRef"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["creatorId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ContainerV1.__pulumiType, name, resourceInputs, opts);
}
}
exports.ContainerV1 = ContainerV1;
/** @internal */
ContainerV1.__pulumiType = 'openstack:keymanager/containerV1:ContainerV1';
//# sourceMappingURL=containerV1.js.map