@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
125 lines • 5.09 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Provider = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages the identity providers within HuaweiCloud IAM service.
*
* > **NOTE:** 1. You *must* have admin privileges to use this resource.
* <br/>2. You can create up to 10 identity providers.
*
* ## Example Usage
* ### Create a SAML protocol provider
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fs from "fs";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const provider1 = new huaweicloud.iam.Provider("provider1", {
* protocol: "saml",
* metadata: fs.readFileSync("/usr/local/data/files/metadata.txt"),
* });
* ```
* ### Create a OpenID Connect protocol provider
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const provider2 = new huaweicloud.iam.Provider("provider2", {
* protocol: "oidc",
* accessConfig: {
* accessType: "program_console",
* providerUrl: "https://accounts.example.com",
* clientId: "your_client_id",
* authorizationEndpoint: "https://accounts.example.com/o/oauth2/v2/auth",
* scopes: ["openid"],
* signingKey: JSON.stringify({
* keys: [{
* alg: "RS256",
* e: "AQAB",
* kid: "...",
* kty: "RSA",
* n: "...",
* use: "sig",
* }],
* }),
* },
* });
* ```
*
* <!--markdownlint-disable MD033-->
*
* ## Import
*
* Identity provider can be imported using the `name`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/provider:Provider provider_1 example_com_provider_saml
* ```
*/
class Provider extends pulumi.CustomResource {
/**
* Get an existing Provider 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 Provider(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Provider. 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'] === Provider.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessConfig"] = state ? state.accessConfig : undefined;
resourceInputs["conversionRules"] = state ? state.conversionRules : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["loginLink"] = state ? state.loginLink : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["ssoType"] = state ? state.ssoType : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["accessConfig"] = args ? args.accessConfig : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["ssoType"] = args ? args.ssoType : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["conversionRules"] = undefined /*out*/;
resourceInputs["loginLink"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Provider.__pulumiType, name, resourceInputs, opts);
}
}
exports.Provider = Provider;
/** @internal */
Provider.__pulumiType = 'huaweicloud:Iam/provider:Provider';
//# sourceMappingURL=provider.js.map