@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
189 lines (188 loc) • 6.34 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage mongodb account
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* vpcId: fooVpc.id,
* });
* const fooInstance = new volcengine.mongodb.Instance("fooInstance", {
* zoneIds: [fooZones.then(fooZones => fooZones.zones?.[0]?.id)],
* dbEngineVersion: "MongoDB_4_0",
* instanceType: "ReplicaSet",
* nodeSpec: "mongo.2c4g",
* storageSpaceGb: 20,
* subnetId: fooSubnet.id,
* instanceName: "acc-test-mongodb-replica",
* chargeType: "PostPaid",
* superAccountPassword: "93f0cb0614Aab12",
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooAccount = new volcengine.mongodb.Account("fooAccount", {
* instanceId: fooInstance.id,
* accountName: "acc-test-mongodb-account",
* authDb: "admin",
* accountPassword: "93f0cb0614Aab12",
* accountDesc: "acc-test",
* accountPrivileges: [
* {
* dbName: "admin",
* roleNames: [
* "userAdmin",
* "clusterMonitor",
* ],
* },
* {
* dbName: "config",
* roleNames: ["read"],
* },
* {
* dbName: "local",
* roleNames: ["read"],
* },
* ],
* });
* ```
*
* ## Import
*
* MongodbAccount can be imported using the instance_id:account_name, e.g.
*
* ```sh
* $ pulumi import volcengine:mongodb/account:Account default resource_id
* ```
*/
export declare class Account extends pulumi.CustomResource {
/**
* Get an existing Account 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: string, id: pulumi.Input<pulumi.ID>, state?: AccountState, opts?: pulumi.CustomResourceOptions): Account;
/**
* Returns true if the given object is an instance of Account. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Account;
/**
* The description of the mongodb account.
*/
readonly accountDesc: pulumi.Output<string | undefined>;
/**
* The name of the mongodb account.
*/
readonly accountName: pulumi.Output<string>;
/**
* The password of the mongodb account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields.
*/
readonly accountPassword: pulumi.Output<string>;
/**
* The privilege information of account.
*/
readonly accountPrivileges: pulumi.Output<outputs.mongodb.AccountAccountPrivilege[] | undefined>;
/**
* The type of the account.
*/
readonly accountType: pulumi.Output<string>;
/**
* The database of the mongodb account.
*/
readonly authDb: pulumi.Output<string>;
/**
* The id of the mongodb instance.
*/
readonly instanceId: pulumi.Output<string>;
/**
* Create a Account 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: AccountArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Account resources.
*/
export interface AccountState {
/**
* The description of the mongodb account.
*/
accountDesc?: pulumi.Input<string>;
/**
* The name of the mongodb account.
*/
accountName?: pulumi.Input<string>;
/**
* The password of the mongodb account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields.
*/
accountPassword?: pulumi.Input<string>;
/**
* The privilege information of account.
*/
accountPrivileges?: pulumi.Input<pulumi.Input<inputs.mongodb.AccountAccountPrivilege>[]>;
/**
* The type of the account.
*/
accountType?: pulumi.Input<string>;
/**
* The database of the mongodb account.
*/
authDb?: pulumi.Input<string>;
/**
* The id of the mongodb instance.
*/
instanceId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Account resource.
*/
export interface AccountArgs {
/**
* The description of the mongodb account.
*/
accountDesc?: pulumi.Input<string>;
/**
* The name of the mongodb account.
*/
accountName: pulumi.Input<string>;
/**
* The password of the mongodb account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields.
*/
accountPassword: pulumi.Input<string>;
/**
* The privilege information of account.
*/
accountPrivileges?: pulumi.Input<pulumi.Input<inputs.mongodb.AccountAccountPrivilege>[]>;
/**
* The database of the mongodb account.
*/
authDb?: pulumi.Input<string>;
/**
* The id of the mongodb instance.
*/
instanceId: pulumi.Input<string>;
}