Skip to content

Instance

This class encapsulates and extends the ROS resource type ALIYUN::MONGODB::Instance, which is used to create or clone an ApsaraDB for MongoDB replica set instance.

Initializers

import ros_cdk_mongodb
ros_cdk_mongodb.Instance(
  scope: Construct,
  id: str,
  db_instance_class: typing.Union[str, IResolvable],
  db_instance_storage: typing.Union[typing.Union[int, float], IResolvable],
  account_password: typing.Union[str, IResolvable] = None,
  auto_renew: typing.Union[bool, IResolvable] = None,
  backup_id: typing.Union[str, IResolvable] = None,
  business_info: typing.Union[str, IResolvable] = None,
  charge_type: typing.Union[str, IResolvable] = None,
  coupon_no: typing.Union[str, IResolvable] = None,
  database_names: typing.Union[str, IResolvable] = None,
  db_instance_description: typing.Union[str, IResolvable] = None,
  engine_version: typing.Union[str, IResolvable] = None,
  hidden_zone_id: typing.Union[str, IResolvable] = None,
  network_type: typing.Union[str, IResolvable] = None,
  period: typing.Union[typing.Union[int, float], IResolvable] = None,
  readonly_replicas: typing.Union[typing.Union[int, float], IResolvable] = None,
  replication_factor: typing.Union[typing.Union[int, float], IResolvable] = None,
  resource_group_id: typing.Union[str, IResolvable] = None,
  restore_time: typing.Union[str, IResolvable] = None,
  secondary_zone_id: typing.Union[str, IResolvable] = None,
  security_group_id: typing.Union[str, IResolvable] = None,
  security_ip_array: typing.Union[str, IResolvable] = None,
  src_db_instance_id: typing.Union[str, IResolvable] = None,
  storage_engine: typing.Union[str, IResolvable] = None,
  storage_type: typing.Union[str, IResolvable] = None,
  tags: typing.List[TagsProperty] = None,
  tde_status: typing.Union[bool, IResolvable] = None,
  vpc_id: typing.Union[str, IResolvable] = None,
  vpc_password_free: typing.Union[bool, IResolvable] = None,
  v_switch_id: typing.Union[str, IResolvable] = None,
  zone_id: typing.Union[str, IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
db_instance_class typing.Union[str, ros_cdk_core.IResolvable] Property dbInstanceClass: MongoDB instance supported instance type, make sure it should be correct.
db_instance_storage typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property dbInstanceStorage: Database instance storage size.
account_password typing.Union[str, ros_cdk_core.IResolvable] Property accountPassword: Root account password, can contain the letters, numbers or underscores the composition, length of 6~32 bit.
auto_renew typing.Union[bool, ros_cdk_core.IResolvable] Property autoRenew: Indicates whether automatic renewal is enabled for the instance.
backup_id typing.Union[str, ros_cdk_core.IResolvable] Property backupId: Specific backup set Id.
business_info typing.Union[str, ros_cdk_core.IResolvable] Property businessInfo: The business information.
charge_type typing.Union[str, ros_cdk_core.IResolvable] Property chargeType: The billing method of the instance.values:PostPaid: Pay-As-You-Go.PrePaid: Subscription.Default value: PostPaid.
coupon_no typing.Union[str, ros_cdk_core.IResolvable] Property couponNo: The coupon code.
database_names typing.Union[str, ros_cdk_core.IResolvable] Property databaseNames: The name of the database.
db_instance_description typing.Union[str, ros_cdk_core.IResolvable] Property dbInstanceDescription: Description of created database instance.
engine_version typing.Union[str, ros_cdk_core.IResolvable] Property engineVersion: Database instance version.
hidden_zone_id typing.Union[str, ros_cdk_core.IResolvable] Property hiddenZoneId: Configure the zone where the hidden node resides to implement multi-availability zone deployment.
network_type typing.Union[str, ros_cdk_core.IResolvable] Property networkType: The instance network type.
period typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property period: The subscription period of the instance.Default Unit: Month.Valid values: [1~9], 12, 24, 36. Default to 1.
readonly_replicas typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property readonlyReplicas: Number of read-only nodes, in the range of 1-5.
replication_factor typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property replicationFactor: The number of nodes in the replica set.
resource_group_id typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupId: The ID of the resource group.
restore_time typing.Union[str, ros_cdk_core.IResolvable] Property restoreTime: The time to restore the cloned instance to.
secondary_zone_id typing.Union[str, ros_cdk_core.IResolvable] Property secondaryZoneId: Configure the zone where the secondary node resides to implement multi-availability zone deployment.
security_group_id typing.Union[str, ros_cdk_core.IResolvable] Property securityGroupId: The ID of the ECS security group.
security_ip_array typing.Union[str, ros_cdk_core.IResolvable] Property securityIpArray: Security ips to add or remove.
src_db_instance_id typing.Union[str, ros_cdk_core.IResolvable] Property srcDbInstanceId: Create an instance of the backup set based on an instance.
storage_engine typing.Union[str, ros_cdk_core.IResolvable] Property storageEngine: Database storage engine.Support WiredTiger, RocksDB, TerarkDB.
storage_type typing.Union[str, ros_cdk_core.IResolvable] Property storageType: The storage type of the instance.
tags typing.List[TagsProperty] Property tags: Tags to attach to instance.
tde_status typing.Union[bool, ros_cdk_core.IResolvable] Property tdeStatus: Specifies whether to enable Transparent Data Encryption (TDE).
vpc_id typing.Union[str, ros_cdk_core.IResolvable] Property vpcId: The VPC id to create mongodb instance.
vpc_password_free typing.Union[bool, ros_cdk_core.IResolvable] Property vpcPasswordFree: Specifies whether to enable password free for access within the VPC.
v_switch_id typing.Union[str, ros_cdk_core.IResolvable] Property vSwitchId: The vSwitch Id to create mongodb instance.
zone_id typing.Union[str, ros_cdk_core.IResolvable] Property zoneId: On which zone to create the instance.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

db_instance_classRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property dbInstanceClass: MongoDB instance supported instance type, make sure it should be correct.


db_instance_storageRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property dbInstanceStorage: Database instance storage size.

MongoDB is [5,3000], increased every 10 GB, Unit in GB


account_passwordOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property accountPassword: Root account password, can contain the letters, numbers or underscores the composition, length of 6~32 bit.


auto_renewOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property autoRenew: Indicates whether automatic renewal is enabled for the instance.

Valid values:true: Automatic renewal is enabled.false: Automatic renewal is not enabled. You must renew the instance manually.Default value: false.


backup_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property backupId: Specific backup set Id.


business_infoOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property businessInfo: The business information.

It is an additional parameter.


charge_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property chargeType: The billing method of the instance.values:PostPaid: Pay-As-You-Go.PrePaid: Subscription.Default value: PostPaid.


coupon_noOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property couponNo: The coupon code.

Default value:youhuiquan_promotion_option_id_for_blank.


database_namesOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property databaseNames: The name of the database.


db_instance_descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property dbInstanceDescription: Description of created database instance.


engine_versionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property engineVersion: Database instance version.


hidden_zone_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property hiddenZoneId: Configure the zone where the hidden node resides to implement multi-availability zone deployment.

When the value of the EngineVersion is 4.4 and later, this parameter is available and required. The value of this parameter cannot be the same as that of ZoneId and SecondaryZoneId.


network_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property networkType: The instance network type.

Support 'CLASSIC' and 'VPC' only, default is 'CLASSIC'.


periodOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property period: The subscription period of the instance.Default Unit: Month.Valid values: [1~9], 12, 24, 36. Default to 1.


readonly_replicasOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property readonlyReplicas: Number of read-only nodes, in the range of 1-5.


replication_factorOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property replicationFactor: The number of nodes in the replica set.

Allowed values: [3, 5, 7], default to 3.


resource_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resourceGroupId: The ID of the resource group.


restore_timeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property restoreTime: The time to restore the cloned instance to.

The format is yyyy-MM-ddTHH:mm:ssZ.This parameter can only be specified when this operation is called to clone instances.You must also specify theSrcDBInstanceIdparameter and theBackupIdparameter.You can clone instances to any restore time in the past seven days.


secondary_zone_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property secondaryZoneId: Configure the zone where the secondary node resides to implement multi-availability zone deployment.

When the value of the EngineVersion is 4.4 and later, this parameter is available and required.The value of this parameter cannot be the same as that of ZoneId and HiddenZoneId.


security_group_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property securityGroupId: The ID of the ECS security group.

Each ApsaraDB for MongoDB instance can be added in up to 10 security group. You can call the ECS DescribeSecurityGroup to describe the ID of the security group in the target region.


security_ip_arrayOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property securityIpArray: Security ips to add or remove.


src_db_instance_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property srcDbInstanceId: Create an instance of the backup set based on an instance.


storage_engineOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property storageEngine: Database storage engine.Support WiredTiger, RocksDB, TerarkDB.


storage_typeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property storageType: The storage type of the instance.

Instances of MongoDB 4.4 and later only support cloud disks. cloud_essd1 is selected if you leave this parameter empty. Instances of MongoDB 4.2 and earlier support only local disks. local_ssd is selected if you leave this parameter empty.


tagsOptional

Property tags: Tags to attach to instance.

Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.


tde_statusOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property tdeStatus: Specifies whether to enable Transparent Data Encryption (TDE).

Valid values: true: enable TDE false: disable TDE (default) Note: You cannot disable TDE after it is enabled.


vpc_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property vpcId: The VPC id to create mongodb instance.


vpc_password_freeOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property vpcPasswordFree: Specifies whether to enable password free for access within the VPC.

If set to:

  • true: enables password free.
  • false: disables password free.

v_switch_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property vSwitchId: The vSwitch Id to create mongodb instance.


zone_idOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property zoneId: On which zone to create the instance.

If VpcId and VSwitchId is specified, ZoneId is required and VSwitch should be in same zone.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_mongodb
ros_cdk_mongodb.Instance.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_connection_uri ros_cdk_core.IResolvable Attribute ConnectionURI: Connection uri.
attr_db_instance_id ros_cdk_core.IResolvable Attribute DBInstanceId: The instance id of created mongodb instance.
attr_db_instance_status ros_cdk_core.IResolvable Attribute DBInstanceStatus: Status of mongodb instance.
attr_order_id ros_cdk_core.IResolvable Attribute OrderId: Order Id of created instance.
attr_replica_set_name ros_cdk_core.IResolvable Attribute ReplicaSetName: Name of replica set.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_connection_uriRequired

attr_connection_uri: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ConnectionURI: Connection uri.


attr_db_instance_idRequired

attr_db_instance_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute DBInstanceId: The instance id of created mongodb instance.


attr_db_instance_statusRequired

attr_db_instance_status: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute DBInstanceStatus: Status of mongodb instance.


attr_order_idRequired

attr_order_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute OrderId: Order Id of created instance.


attr_replica_set_nameRequired

attr_replica_set_name: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ReplicaSetName: Name of replica set.