@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
87 lines • 3.96 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.LoginPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const test = new huaweicloud.Iam.LoginPolicy("test", {
* accountValidityPeriod: 20,
* customInfoForLogin: "hello Terraform",
* lockoutDuration: 30,
* loginFailedTimes: 10,
* periodWithLoginFailures: 30,
* sessionTimeout: 120,
* showRecentLoginInfo: true,
* });
* ```
*
* ## Import
*
* Identity login policy can be imported using the account ID or domain ID, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/loginPolicy:LoginPolicy example <your account ID>
* ```
*/
class LoginPolicy extends pulumi.CustomResource {
/**
* Get an existing LoginPolicy 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 LoginPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LoginPolicy. 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'] === LoginPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountValidityPeriod"] = state ? state.accountValidityPeriod : undefined;
resourceInputs["customInfoForLogin"] = state ? state.customInfoForLogin : undefined;
resourceInputs["lockoutDuration"] = state ? state.lockoutDuration : undefined;
resourceInputs["loginFailedTimes"] = state ? state.loginFailedTimes : undefined;
resourceInputs["periodWithLoginFailures"] = state ? state.periodWithLoginFailures : undefined;
resourceInputs["sessionTimeout"] = state ? state.sessionTimeout : undefined;
resourceInputs["showRecentLoginInfo"] = state ? state.showRecentLoginInfo : undefined;
}
else {
const args = argsOrState;
resourceInputs["accountValidityPeriod"] = args ? args.accountValidityPeriod : undefined;
resourceInputs["customInfoForLogin"] = args ? args.customInfoForLogin : undefined;
resourceInputs["lockoutDuration"] = args ? args.lockoutDuration : undefined;
resourceInputs["loginFailedTimes"] = args ? args.loginFailedTimes : undefined;
resourceInputs["periodWithLoginFailures"] = args ? args.periodWithLoginFailures : undefined;
resourceInputs["sessionTimeout"] = args ? args.sessionTimeout : undefined;
resourceInputs["showRecentLoginInfo"] = args ? args.showRecentLoginInfo : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LoginPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.LoginPolicy = LoginPolicy;
/** @internal */
LoginPolicy.__pulumiType = 'huaweicloud:Iam/loginPolicy:LoginPolicy';
//# sourceMappingURL=loginPolicy.js.map