@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
139 lines • 6.28 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.KeyManagerKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Scaleway Key Manager Key resource.\
* This resource allows you to create and manage cryptographic keys in Scaleway Key Manager (KMS).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.KeyManagerKey("main", {
* name: "my-kms-key",
* region: "fr-par",
* projectId: "your-project-id",
* usage: "symmetric_encryption",
* description: "Key for encrypting secrets",
* tags: [
* "env:prod",
* "kms",
* ],
* unprotected: true,
* rotationPolicy: {
* rotationPeriod: "720h",
* },
* });
* ```
*
* ## Notes
*
* - **Protection**: By default, keys are protected and cannot be deleted. To allow deletion, set `unprotected = true` when creating the key.
* - **Rotation Policy**: The `rotationPolicy` block allows you to set automatic rotation for your key.
* - **Origin**: The `origin` argument is optional and defaults to `scalewayKms`. Use `external` if you want to import an external key (see Scaleway documentation for details).
* - **Project and Region**: If not specified, `projectId` and `region` will default to the provider configuration.
*
* ## Example: Asymmetric Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const asym = new scaleway.KeyManagerKey("asym", {
* name: "asymmetric-key",
* region: "fr-par",
* usage: "asymmetric_signing",
* description: "Key for signing documents",
* unprotected: true,
* });
* ```
*
* ## Import
*
* You can import a key using its ID and region:
*
* ```sh
* $ pulumi import scaleway:index/keyManagerKey:KeyManagerKey main fr-par/11111111-2222-3333-4444-555555555555
* ```
*/
class KeyManagerKey extends pulumi.CustomResource {
/**
* Get an existing KeyManagerKey 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 KeyManagerKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of KeyManagerKey. 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'] === KeyManagerKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["locked"] = state ? state.locked : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["origin"] = state ? state.origin : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["protected"] = state ? state.protected : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["rotatedAt"] = state ? state.rotatedAt : undefined;
resourceInputs["rotationCount"] = state ? state.rotationCount : undefined;
resourceInputs["rotationPolicy"] = state ? state.rotationPolicy : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["unprotected"] = state ? state.unprotected : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
resourceInputs["usage"] = state ? state.usage : undefined;
}
else {
const args = argsOrState;
if ((!args || args.usage === undefined) && !opts.urn) {
throw new Error("Missing required property 'usage'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["origin"] = args ? args.origin : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["rotationPolicy"] = args ? args.rotationPolicy : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["unprotected"] = args ? args.unprotected : undefined;
resourceInputs["usage"] = args ? args.usage : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["locked"] = undefined /*out*/;
resourceInputs["protected"] = undefined /*out*/;
resourceInputs["rotatedAt"] = undefined /*out*/;
resourceInputs["rotationCount"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(KeyManagerKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.KeyManagerKey = KeyManagerKey;
/** @internal */
KeyManagerKey.__pulumiType = 'scaleway:index/keyManagerKey:KeyManagerKey';
//# sourceMappingURL=keyManagerKey.js.map