Files
pulumi-incus/sdk/nodejs/certificate.ts
2025-12-08 10:47:09 -05:00

193 lines
7.1 KiB
TypeScript
Generated

// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
/**
* ## # incus.Certificate
*
* Manages an Incus certificate.
*/
export 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.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CertificateState, opts?: pulumi.CustomResourceOptions): Certificate {
return new Certificate(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/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.
*/
public static isInstance(obj: any): obj is Certificate {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Certificate.__pulumiType;
}
/**
* **Required** - The certificate.
*/
declare public readonly certificate: pulumi.Output<string>;
/**
* *Optional* - Description of the certificate.
*/
declare public readonly description: pulumi.Output<string>;
/**
* The fingerprint of the certificate.
*/
declare public /*out*/ readonly fingerprint: pulumi.Output<string>;
/**
* **Required** - Name of the certificate.
*/
declare public readonly name: pulumi.Output<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
declare public readonly projects: pulumi.Output<string[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
declare public readonly remote: pulumi.Output<string | undefined>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
declare public readonly restricted: pulumi.Output<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
declare public readonly type: pulumi.Output<string>;
/**
* Create a Certificate resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: CertificateArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: CertificateArgs | CertificateState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as CertificateState | undefined;
resourceInputs["certificate"] = state?.certificate;
resourceInputs["description"] = state?.description;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["name"] = state?.name;
resourceInputs["projects"] = state?.projects;
resourceInputs["remote"] = state?.remote;
resourceInputs["restricted"] = state?.restricted;
resourceInputs["type"] = state?.type;
} else {
const args = argsOrState as CertificateArgs | undefined;
if (args?.certificate === undefined && !opts.urn) {
throw new Error("Missing required property 'certificate'");
}
if (args?.name === undefined && !opts.urn) {
throw new Error("Missing required property 'name'");
}
resourceInputs["certificate"] = args?.certificate;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["projects"] = args?.projects;
resourceInputs["remote"] = args?.remote;
resourceInputs["restricted"] = args?.restricted;
resourceInputs["type"] = args?.type;
resourceInputs["fingerprint"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Certificate.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Certificate resources.
*/
export interface CertificateState {
/**
* **Required** - The certificate.
*/
certificate?: pulumi.Input<string>;
/**
* *Optional* - Description of the certificate.
*/
description?: pulumi.Input<string>;
/**
* The fingerprint of the certificate.
*/
fingerprint?: pulumi.Input<string>;
/**
* **Required** - Name of the certificate.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
projects?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
restricted?: pulumi.Input<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Certificate resource.
*/
export interface CertificateArgs {
/**
* **Required** - The certificate.
*/
certificate: pulumi.Input<string>;
/**
* *Optional* - Description of the certificate.
*/
description?: pulumi.Input<string>;
/**
* **Required** - Name of the certificate.
*/
name: pulumi.Input<string>;
/**
* *Optional* - List of projects to restrict the certificate to.
*/
projects?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Restrict the certificate to one or more projects.
*/
restricted?: pulumi.Input<boolean>;
/**
* *Optional* - The type of certificate to create. Can be one of: client,
* or metrics. If no type is specified, a client certificate is created.
*/
type?: pulumi.Input<string>;
}