@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
134 lines • 6.15 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.Certificate = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Creates and manages Scaleway Load Balancer certificates.
*
* For more information, see the [main documentation](https://www.scaleway.com/en/docs/load-balancer/how-to/add-certificate/) or [API documentation](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/#path-certificate).
*
* ## Example Usage
*
* ### Custom Certificate
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const cert01 = new scaleway.loadbalancers.Certificate("cert01", {
* lbId: lb01.id,
* name: "custom-cert",
* customCertificate: {
* certificateChain: "CERTIFICATE_CHAIN_CONTENTS\n",
* },
* });
* ```
*
* ## Additional notes
*
* - Ensure that all domain names used in the configuration are pointing to the Load Balancer IP.
* You can achieve this by creating a DNS record through Terraform pointing to the `ipAddress` property of the `lbBeta` entity.
* - If there are any issues with the certificate, you will receive a `400` error from the `apply` operation.
* Use `export TF_LOG=DEBUG` to view the exact problem returned by the API.
* - Wildcards are not yet supported with Let's Encrypt.
* - Use `lifecycle` instruction with `createBeforeDestroy = true` to permit correct certificate replacement and prevent a `400` error from the `apply` operation.
*
* ## Import
*
* Load Balancer certificates can be imported using the `{zone}/{id}`, e.g.
*
* ```sh
* $ pulumi import scaleway:loadbalancers/certificate:Certificate cert01 fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
class Certificate extends pulumi.CustomResource {
/**
* Get an existing Certificate 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 Certificate(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:loadbalancers/certificate:Certificate';
/**
* Returns true if the given object is an instance of Certificate. 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'] === Certificate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["commonName"] = state?.commonName;
resourceInputs["customCertificate"] = state?.customCertificate;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["lbId"] = state?.lbId;
resourceInputs["letsencrypt"] = state?.letsencrypt;
resourceInputs["name"] = state?.name;
resourceInputs["notValidAfter"] = state?.notValidAfter;
resourceInputs["notValidBefore"] = state?.notValidBefore;
resourceInputs["status"] = state?.status;
resourceInputs["subjectAlternativeNames"] = state?.subjectAlternativeNames;
}
else {
const args = argsOrState;
if (args?.lbId === undefined && !opts.urn) {
throw new Error("Missing required property 'lbId'");
}
resourceInputs["customCertificate"] = args?.customCertificate;
resourceInputs["lbId"] = args?.lbId;
resourceInputs["letsencrypt"] = args?.letsencrypt;
resourceInputs["name"] = args?.name;
resourceInputs["commonName"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["notValidAfter"] = undefined /*out*/;
resourceInputs["notValidBefore"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["subjectAlternativeNames"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/loadbalancerCertificate:LoadbalancerCertificate" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(Certificate.__pulumiType, name, resourceInputs, opts);
}
}
exports.Certificate = Certificate;
//# sourceMappingURL=certificate.js.map