Skip to content

Instance

This class encapsulates and extends the ROS resource type ALIYUN::MONGODB::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,
  audit_policy_options: typing.Union[IResolvable, AuditPolicyOptionsProperty] = None,
  auto_renew: typing.Union[bool, IResolvable] = None,
  backup_id: typing.Union[str, IResolvable] = None,
  backup_policy_options: typing.Union[IResolvable, BackupPolicyOptionsProperty] = None,
  business_info: typing.Union[str, IResolvable] = None,
  charge_type: typing.Union[str, IResolvable] = None,
  cluster_id: 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,
  db_instance_release_protection: typing.Union[bool, IResolvable] = None,
  encrypted: typing.Union[bool, IResolvable] = None,
  encryption_key: typing.Union[str, IResolvable] = None,
  engine_version: typing.Union[str, IResolvable] = None,
  hidden_zone_id: typing.Union[str, IResolvable] = None,
  period: typing.Union[typing.Union[int, float], IResolvable] = None,
  private_connections: typing.Union[IResolvable, PrivateConnectionsProperty] = None,
  provisioned_iops: 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,
  restore_type: typing.Union[typing.Union[int, float], 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,
  src_region: typing.Union[str, IResolvable] = None,
  ssl_options: typing.Union[IResolvable, SSLOptionsProperty] = 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.
audit_policy_options typing.Union[ros_cdk_core.IResolvable, AuditPolicyOptionsProperty] Property auditPolicyOptions: Audit policy options.
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.
backup_policy_options typing.Union[ros_cdk_core.IResolvable, BackupPolicyOptionsProperty] Property backupPolicyOptions: Backup policy options.
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.
cluster_id typing.Union[str, ros_cdk_core.IResolvable] Property clusterId: The dedicated cluster ID.
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.
db_instance_release_protection typing.Union[bool, ros_cdk_core.IResolvable] Property dbInstanceReleaseProtection: Enables instance release protection.
encrypted typing.Union[bool, ros_cdk_core.IResolvable] Property encrypted: Whether to enable cloud disk encryption.
encryption_key typing.Union[str, ros_cdk_core.IResolvable] Property encryptionKey: Custom key ID.
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.
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.
private_connections typing.Union[ros_cdk_core.IResolvable, PrivateConnectionsProperty] Property privateConnections: Connection configs of private connection.
provisioned_iops typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property provisionedIops: Provisioned IOPS.
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.
restore_type typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property restoreType: Backup recovery instance.
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.
src_region typing.Union[str, ros_cdk_core.IResolvable] Property srcRegion: The source instance region.
ssl_options typing.Union[ros_cdk_core.IResolvable, SSLOptionsProperty] Property sslOptions: SSL options.
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.


audit_policy_optionsOptional

Property auditPolicyOptions: Audit policy options.


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.


backup_policy_optionsOptional

Property backupPolicyOptions: Backup policy options.


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.


cluster_idOptional

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

Property clusterId: The dedicated cluster ID.


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.


db_instance_release_protectionOptional

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

Property dbInstanceReleaseProtection: Enables instance release protection.

Values:

  • true: Enabled.
  • false: Not enabled.

encryptedOptional

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

Property encrypted: Whether to enable cloud disk encryption.


encryption_keyOptional

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

Property encryptionKey: Custom key ID.


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.


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.


private_connectionsOptional

Property privateConnections: Connection configs of private connection.


provisioned_iopsOptional

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

Property provisionedIops: Provisioned IOPS.

The value range is 0 to 50000.


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.


restore_typeOptional

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

Property restoreType: Backup recovery instance.

  • 0: Restore instance to specified backup set
  • 1: Restore instance to specified point in time
  • 2: Restore released instance to specified backup set
  • 3: Restore instance to specified backup set

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.

Update to this property will cover the current security ips.


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.


src_regionOptional

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

Property srcRegion: The source instance region.

  • When the backup recovery type is 2 or 3, this parameter is required.

ssl_optionsOptional

Property sslOptions: SSL options.


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.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc No description.
get_att No description.
set_metadata No description.
grant_full_access Grant an RAM principal (Role/Group/User) full control over this MongoDB instance.
grant_list Grant an RAM principal (Role/Group/User) permission to list resources for this MongoDB instance.
grant_read Grant an RAM principal (Role/Group/User) permission to list and get resources for this MongoDB instance.
grant_read_write Grant an RAM principal (Role/Group/User) permission to create, update and delete resources for this MongoDB instance.

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

fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

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

grant_full_access

def grant_full_access(
  identity: IPrincipal
) -> ManagedPolicy

Grant an RAM principal (Role/Group/User) full control over this MongoDB instance.

identityRequired

  • Type: ros_cdk_ram.IPrincipal

The principal.


grant_list

def grant_list(
  identity: IPrincipal
) -> ManagedPolicy

Grant an RAM principal (Role/Group/User) permission to list resources for this MongoDB instance.

identityRequired

  • Type: ros_cdk_ram.IPrincipal

The principal.


grant_read

def grant_read(
  identity: IPrincipal
) -> ManagedPolicy

Grant an RAM principal (Role/Group/User) permission to list and get resources for this MongoDB instance.

identityRequired

  • Type: ros_cdk_ram.IPrincipal

The principal.


grant_read_write

def grant_read_write(
  identity: IPrincipal
) -> ManagedPolicy

Grant an RAM principal (Role/Group/User) permission to create, update and delete resources for this MongoDB instance.

identityRequired

  • Type: ros_cdk_ram.IPrincipal

The principal.


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.
env ros_cdk_core.IResourceEnvironment The environment this resource belongs to.
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_arn typing.Union[str, ros_cdk_core.IResolvable] Attribute Arn: The Alibaba Cloud Resource Name (ARN).
attr_connection_uri typing.Union[str, ros_cdk_core.IResolvable] Attribute ConnectionURI: Connection uri.
attr_db_instance_id typing.Union[str, ros_cdk_core.IResolvable] Attribute DBInstanceId: The instance id of created mongodb instance.
attr_db_instance_status typing.Union[str, ros_cdk_core.IResolvable] Attribute DBInstanceStatus: Status of mongodb instance.
attr_order_id typing.Union[str, ros_cdk_core.IResolvable] Attribute OrderId: Order Id of created instance.
attr_replica_set_name typing.Union[str, ros_cdk_core.IResolvable] Attribute ReplicaSetName: Name of replica set.
props InstanceProps No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


envRequired

env: IResourceEnvironment
  • Type: ros_cdk_core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


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_arnRequired

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

Attribute Arn: The Alibaba Cloud Resource Name (ARN).


attr_connection_uriRequired

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

Attribute ConnectionURI: Connection uri.


attr_db_instance_idRequired

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

Attribute DBInstanceId: The instance id of created mongodb instance.


attr_db_instance_statusRequired

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

Attribute DBInstanceStatus: Status of mongodb instance.


attr_order_idRequired

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

Attribute OrderId: Order Id of created instance.


attr_replica_set_nameRequired

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

Attribute ReplicaSetName: Name of replica set.


propsRequired

props: InstanceProps