@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
106 lines • 4.03 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.ProviderConversion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manage the conversion rules of identity provider within HuaweiCloud IAM service.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const providerId = config.requireObject("providerId");
* const conversion = new huaweicloud.iam.ProviderConversion("conversion", {
* providerId: providerId,
* conversionRules: [
* {
* locals: [{
* username: "Tom",
* }],
* remotes: [{
* attribute: "Tom",
* }],
* },
* {
* locals: [{
* username: "FederationUser",
* }],
* remotes: [{
* attribute: "username",
* condition: "any_one_of",
* values: [
* "Tom",
* "Jerry",
* ],
* }],
* },
* ],
* });
* ```
*
* <!--markdownlint-disable MD033-->
*
* ## Import
*
* Identity provider conversion rules are imported using the `provider_id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/providerConversion:ProviderConversion conversion example_com_provider_oidc
* ```
*/
class ProviderConversion extends pulumi.CustomResource {
/**
* Get an existing ProviderConversion 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 ProviderConversion(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ProviderConversion. 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'] === ProviderConversion.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["conversionRules"] = state ? state.conversionRules : undefined;
resourceInputs["providerId"] = state ? state.providerId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.conversionRules === undefined) && !opts.urn) {
throw new Error("Missing required property 'conversionRules'");
}
if ((!args || args.providerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'providerId'");
}
resourceInputs["conversionRules"] = args ? args.conversionRules : undefined;
resourceInputs["providerId"] = args ? args.providerId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProviderConversion.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProviderConversion = ProviderConversion;
/** @internal */
ProviderConversion.__pulumiType = 'huaweicloud:Iam/providerConversion:ProviderConversion';
//# sourceMappingURL=providerConversion.js.map