### Install Project Dependencies Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ecs/deploy-SVN-by-using-svnserve/python/README.md Install all required project dependencies listed in the requirements.txt file after activating the virtual environment. This command is essential for setting up the project. ```bash $ pip install -r requirements.txt ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ros/deploy-2048/python/README.md Install all required Python dependencies listed in requirements.txt. This should be run after activating the virtual environment. ```bash pip install -r requirements.txt ``` -------------------------------- ### Initialize New CDK Project Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Scaffolds a new CDK project for the specified programming language. Generates entry-point files, stack classes, and test setups. ```bash ros-cdk init app --language typescript ``` ```bash ros-cdk init app --language python ``` ```bash ros-cdk init app --language java ``` ```bash ros-cdk init app --language csharp ``` ```bash ros-cdk init app --language go ``` -------------------------------- ### Define CDK Application Root in Go Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt This Go example illustrates the basic structure of a CDK application using the `App` construct. It initializes the app, defines a stack, and synthesizes the ROS templates. ```go // Go: main.go package main import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore" func main() { app := alicloudroscdkcore.NewApp(nil) NewMyStack(app, "MyStack", nil) app.Synth(nil) } ``` -------------------------------- ### Import and Use ROS CDK CXAPI Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcxapi/README.md Demonstrates how to import the @alicloud/ros-cdk-cxapi package and prepare for API usage. This is a basic setup for interacting with ROS CDK functionalities. ```javascript const rosCxapi = require('@alicloud/ros-cdk-cxapi'); // TODO: DEMONSTRATE API ``` -------------------------------- ### Create and Configure OSS Bucket with ROS CDK Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt This example shows how to create an OSS bucket with specific configurations like access control, redundancy type, storage class, and versioning. It also includes a lifecycle rule for expiring old objects. ```typescript import * as ros from '@alicloud/ros-cdk-core'; import * as oss from '@alicloud/ros-cdk-oss'; export class OssStack extends ros.Stack { constructor(scope: ros.Construct, id: string, props?: ros.StackProps) { super(scope, id, props); // Create a private OSS bucket const bucket = new oss.Bucket(this, 'MyBucket', { bucketName: 'my-app-data-bucket', accessControl: 'private', redundancyType: 'ZRS', storageClass: 'Standard', versioning: 'Enabled', lifecycleConfiguration: { rules: [{ id: 'expire-old-objects', status: 'Enabled', expiration: { days: 90 }, }], }, }); // L2 grant functions (added in v1.8.0+) // bucket.grantRead('acs:ram::123456789:role/reader'); // bucket.grantReadWrite('acs:ram::123456789:role/writer'); new ros.RosOutput(this, 'BucketName', { value: bucket.ref }); new ros.RosOutput(this, 'BucketDomain', { value: bucket.attrDomainName }); } } ``` -------------------------------- ### Deploy ECS Resources with ROS CDK Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt This example demonstrates creating a VPC, VSwitch, Security Group, and an ECS instance using the `ros-cdk-ecs` package. It also shows how to configure inbound SSH access and run a post-creation script. ```typescript import * as ros from '@alicloud/ros-cdk-core'; import * as ecs from '@alicloud/ros-cdk-ecs'; export class EcsStack extends ros.Stack { constructor(scope: ros.Construct, id: string, props?: ros.StackProps) { super(scope, id, props); const vpc = new ecs.Vpc(this, 'Vpc', { cidrBlock: '10.0.0.0/8', vpcName: 'my-vpc', }); const vsw = new ecs.VSwitch(this, 'VSw', { vpcId: vpc.ref, cidrBlock: '10.0.1.0/24', zoneId: 'cn-hangzhou-i', vSwitchName: 'my-vsw', }); const sg = new ecs.SecurityGroup(this, 'SG', { vpcId: vpc.ref, securityGroupName: 'my-sg', }); // Allow SSH inbound new ecs.SecurityGroupIngress(this, 'SshIngress', { securityGroupId: sg.ref, ipProtocol: 'tcp', portRange: '22/22', sourceCidrIp: '0.0.0.0/0', nicType: 'intranet', }); const instance = new ecs.Instance(this, 'Instance', { instanceName: 'my-ecs', instanceType: 'ecs.c6.large', imageId: 'centos_7_9_x64_20G_alibase', vpcId: vpc.ref, vSwitchId: vsw.ref, securityGroupId: sg.ref, instanceChargeType: 'PayAsYouGo', internetMaxBandwidthOut: 5, }); // Run a shell script on the instance after creation new ecs.RunCommand(this, 'InstallNginx', { instanceIds: [instance.attrInstanceId], type: 'RunShellScript', sync: true, timeout: 300, commandContent: [ 'yum install -y nginx', 'systemctl start nginx', 'systemctl enable nginx', ].join('\n'), }); new ros.RosOutput(this, 'PublicIp', { value: instance.attrPublicIp, description: 'The public IP of the ECS instance', }); } } ``` -------------------------------- ### Define CDK Application Root in Python Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt This Python example demonstrates creating a CDK application using the `App` construct. It initializes the app, defines a stack, and synthesizes the ROS templates. ```python # Python: app.py import ros_cdk_core as core from my_stack import MyStack app = core.App() MyStack(app, "MyStack") app.synth() ``` -------------------------------- ### Deploy SVN on ECS using ROS CDK (Python) Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt This Python script defines a ROS CDK stack to provision network resources (VPC, VSwitch, SecurityGroup) and an ECS instance. It configures security rules to allow SVN traffic and uses RunCommand to install and start the SVN service. Ensure necessary ROS CDK packages are installed. ```python import ros_cdk_core as core import ros_cdk_ecs as ecs class EcsSvnStack(core.Stack): def __init__(self, scope: core.Construct, id: str, **kwargs): super().__init__(scope, id, **kwargs) core.RosInfo(self, core.RosInfo.description, "Deploy SVN on ECS using ROS CDK.") # Parameters zone_id = core.RosParameter(self, "ZoneId", type=core.RosParameterType.STRING, association_property="ALIYUN::ECS::Instance::ZoneId") ecs_password = core.RosParameter(self, "ECSPassword", type=core.RosParameterType.STRING, no_echo=True, association_property="ALIYUN::ECS::Instance::Password") instance_type = core.RosParameter(self, "InstanceType", type=core.RosParameterType.STRING, default_value="ecs.c6.large", association_property="ALIYUN::ECS::Instance::InstanceType") # Network vpc = ecs.Vpc(self, "VPC", ecs.VPCProps( cidr_block="10.0.0.0/8", vpc_name="svn-vpc")) vsw = ecs.VSwitch(self, "VSwitch", ecs.VSwitchProps( vpc_id=vpc.resource.ref, cidr_block="10.0.0.0/16", zone_id=zone_id)) sg = ecs.SecurityGroup(self, "SG", ecs.SecurityGroupProps( vpc_id=vpc.resource.ref)) # Allow SVN port 3690, SSH, HTTP, HTTPS for port in ["22", "80", "443", "3690"]: ecs.SecurityGroupIngress(self, f"Ingress_{port}", ecs.SecurityGroupIngressProps( security_group_id=sg.resource.ref, source_cidr_ip="0.0.0.0/0", ip_protocol="tcp", nic_type="intranet", port_range=f"{port}/{port}")) # ECS Instance instance = ecs.Instance(self, "ECS", ecs.InstanceProps( instance_name="ecs-svn", vpc_id=vpc.resource.ref, v_switch_id=vsw.resource.ref, security_group_id=sg.resource.ref, image_id="centos_7_04_64_20G_alibase_201701015.vhd", instance_type=instance_type, instance_charge_type="PayAsYouGo", password=ecs_password)) # Install & configure SVN via RunCommand ecs.RunCommand(self, "InstallSvn", ecs.RunCommandProps( instance_ids=[instance.attr_instance_id], type="RunShellScript", sync=True, timeout=600, command_content=( "sudo yum install -y subversion\n" "sudo mkdir -p /var/svn\n" "sudo svnadmin create /var/svn/repo\n" "sudo svnserve -d -r /var/svn/repo/\n" ))) # Output core.RosOutput(self, "SvnUrl", value=core.FnJoin("", ["svn://", instance.attr_public_ip])) # app.py app = core.App() EcsSvnStack(app, "EcsSvnStack") app.synth() ``` -------------------------------- ### Import HDR Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkhdr/README.md Import the Aliyun ROS HDR construct library for use in your Go project. Ensure the package is correctly installed. ```go import * as HDR from '@alicloud/ros-cdk-hdr'; ``` -------------------------------- ### Import ADBLAKE Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkadblake/README.md Import the ADBLAKE module for use in your Go ROS CDK project. This is the initial setup required to utilize ADBLAKE constructs. ```go import * as ADBLAKE from '@alicloud/ros-cdk-adblake'; ``` -------------------------------- ### Import and Initialize ROS CDK Template Diff Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-template-diff-1.12.0/README.md Demonstrates how to import the ros-cdk-template-diff module and prepare for API usage. This is a basic setup for using the module's functionalities. ```javascript const rosTemplateDiff = require('@alicloud/ros-cdk-template-diff'); // TODO: DEMONSTRATE API ``` -------------------------------- ### Import ROS CDK CXAPI Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/python/ros-cdk-cxapi-1.12.0/README.md Import the ROS CDK CXAPI library for use in your project. Ensure the package is installed. ```javascript const rosCxapi = require('@alicloud/ros-cdk-cxapi'); ``` -------------------------------- ### Create Python Virtual Environment Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-cli-1.12.0/lib/init-templates/app/python/README.template.md Use this command to manually create a Python virtual environment if the automatic initialization fails. Ensure you have Python 3 and the venv package installed. ```bash $ %python-executable% -m venv .venv ``` -------------------------------- ### Import PAIDSWAPI Module Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-paidswapi-1.12.0/README.md Import the PAIDSWAPI module for use in your ROS CDK project. Ensure you have the correct version installed. ```typescript import * as PAIDSWAPI from '@alicloud/ros-cdk-paidswapi'; ``` -------------------------------- ### Import EventBridge Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkeventbridge/README.md Import the EventBridge module for use in your Go ROS CDK project. This is a common setup step. ```go import * as EVENTBRIDGE from '@alicloud/ros-cdk-eventbridge'; ``` -------------------------------- ### Import Aliyun ROS MOBI Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkmobi/README.md Import the MOBI module from the Aliyun ROS CDK library. This is typically the first step before using any MOBI constructs. ```go import * as MOBI from '@alicloud/ros-cdk-mobi'; ``` -------------------------------- ### Import KMS Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkkms/README.md Import the KMS module for use in your Go ROS CDK project. Ensure you have the necessary package installed. ```go import * as KMS from '@alicloud/ros-cdk-kms'; ``` -------------------------------- ### Import FNF Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkfnf/README.md Import the FNF module for use in your Go ROS CDK project. Ensure you have the necessary package installed. ```go import * as FNF from "@alicloud/ros-cdk-fnf"; ``` -------------------------------- ### Import BSS Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkbss/README.md Import the BSS module for use in your Go ROS CDK project. Ensure you have the necessary package installed. ```go import * as BSS from '@alicloud/ros-cdk-bss'; ``` -------------------------------- ### Import Aliyun ROS ESA Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkesa/README.md Import the necessary ESA module from the AliCloud ROS CDK for use in your project. ```go import * as ESA from '@alicloud/ros-cdk-esa'; ``` -------------------------------- ### Import CEN Module in TypeScript Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/packages/@alicloud/services/ros-cdk-cen/README.md Import the CEN module from the ROS CDK library for use in your TypeScript project. Ensure the '@alicloud/ros-cdk-cen' package is installed. ```typescript import * as CEN from '@alicloud/ros-cdk-cen'; ``` -------------------------------- ### Import Marketplace Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkmarketplace/README.md Import the Aliyun ROS Marketplace construct library for use in your Go project. This is typically the first step before utilizing any Marketplace constructs. ```go import * as MARKETPLACE from '@alicloud/ros-cdk-marketplace'; ``` -------------------------------- ### Import SERVERLESSDEV Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkserverlessdev/README.md Import the SERVERLESSDEV module from the AliCloud ROS CDK project. This is typically the first step when using the library in your Go project. ```go import * as SERVERLESSDEV from '@alicloud/ros-cdk-serverlessdev'; ``` -------------------------------- ### Import ENS Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkens/README.md Import the ENS construct library for use in your Go ROS CDK project. Ensure you have the necessary package installed. ```go import * as ENS from '@alicloud/ros-cdk-ens'; ``` -------------------------------- ### Import ROS CDK Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcdt/README.md Import the necessary construct library for use in your project. ```go import * as CDT from '@alicloud/ros-cdk-cdt'; ``` -------------------------------- ### Import ROS VS Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkvs/README.md Import the necessary VS module from the Aliyun ROS CDK for use in your project. ```go import * as VS from '@alicloud/ros-cdk-vs'; ``` -------------------------------- ### Import ROS SAE Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdksae/README.md Import the necessary SAE module from the AliCloud ROS CDK for Go. ```go import * as SAE from '@alicloud/ros-cdk-sae'; ``` -------------------------------- ### Import ACM Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkacm/README.md Import the ACM module for use in your Go ROS CDK project. This is the initial setup required to utilize ACM constructs. ```go import * as ACM from '@alicloud/ros-cdk-acm'; ``` -------------------------------- ### Import ALIGREEN Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkaligreen/README.md Import the ALIGREEN construct library to use its functionalities in your ROS CDK application. This is a prerequisite for utilizing any ALIGREEN resources. ```go import * as ALIGREEN from '@alicloud/ros-cdk-aligreen'; ``` -------------------------------- ### Import BastionHost Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkbastionhost/README.md Import the BastionHost module for use in your Go project. This is typically the first step when utilizing the library. ```go import * as BASTIONHOST from '@alicloud/ros-cdk-bastionhost'; ``` -------------------------------- ### Import PAIPLUGIN Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkpaiplugin/README.md Import the PAIPLUGIN module for use in your Go project. This is typically the first step when integrating the library. ```go import * as PAIPLUGIN from '@alicloud/ros-cdk-paiplugin'; ``` -------------------------------- ### Configure Alibaba Cloud Credentials (Interactive) Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Interactively sets endpoint, region, and authentication method for credential configuration. Writes to account.config.json. ```bash ros-cdk config ``` ```bash ros-cdk config -g ``` -------------------------------- ### Get Stack Outputs using `ros-cdk output` Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk output` to retrieve the output values of a deployed stack. The command displays the output key, value, and description for each output. ```bash ros-cdk output MyStack ``` -------------------------------- ### ROS CDK Useful Commands Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ros/deploy-2048/python/README.md A list of common commands for interacting with ROS CDK, including deploying stacks, listing resources, and performing diffs. ```bash ros-cdk list-stacks ``` ```bash ros-cdk list ``` ```bash ros-cdk deploy ``` ```bash ros-cdk event ``` ```bash ros-cdk output ``` ```bash ros-cdk resource ``` ```bash ros-cdk diff ``` ```bash ros-cdk synth ``` ```bash ros-cdk destroy ``` ```bash python -m unittest -v ``` -------------------------------- ### Generate Stack Info File using `ros-cdk generate-stack-file` Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk generate-stack-file` to scan your account for stacks matching the project and create a local `stack.info.json` tracking file. This can be filtered by resource group ID. ```bash ros-cdk generate-stack-file ``` ```bash ros-cdk generate-stack-file --resource-group-id rg-xxxxxxxx ``` -------------------------------- ### Import EDSUSER Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkedsuser/README.md Import the EDSUSER construct library for use in your Go project. This is typically the first step when using the library. ```go import * as EDSUSER from '@alicloud/ros-cdk-edsuser'; ``` -------------------------------- ### Define CDK Application Root in TypeScript Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt The `App` construct is the root of a CDK application. This TypeScript example shows how to instantiate an `App`, define a stack with environment configuration, and synthesize the ROS templates. ```typescript // TypeScript: bin/app.ts import * as ros from '@alicloud/ros-cdk-core'; import { MyStack } from '../lib/my-stack'; const app = new ros.App({ outdir: './cdk.out' }); new MyStack(app, 'MyStack', { description: 'My production stack', env: { region: 'cn-hangzhou' }, }); app.synth(); // emits ROS templates to outdir ``` -------------------------------- ### Get Stack Resource Events using `ros-cdk event` Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk event` to retrieve resource events for a deployed stack, which is helpful for debugging. You can specify a logical resource ID and paginate the results. ```bash ros-cdk event MyStack ``` ```bash ros-cdk event MyStack --logical-resource-id MyVpc ``` ```bash ros-cdk event MyStack --page-size 20 --page-number 1 ``` -------------------------------- ### Import NAS Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdknas/README.md Import the NAS construct library for use in your ROS CDK application. ```go import * as NAS from '@alicloud/ros-cdk-nas'; ``` -------------------------------- ### Import AMQP Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkamqp/README.md Import the AMQP construct library for use in your ROS CDK project. This is typically the first step when working with AMQP resources. ```go import * as AMQP from '@alicloud/ros-cdk-amqp'; ``` -------------------------------- ### Import RocketMQ Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkrocketmq/README.md Import the RocketMQ construct library for use in your ROS CDK application. ```go import * as ROCKETMQ from '@alicloud/ros-cdk-rocketmq'; ``` -------------------------------- ### Import Cloud Firewall Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcloudfw/README.md Import the Cloud Firewall construct library for use in your ROS CDK application. ```go import * as CLOUDFW from '@alicloud/ros-cdk-cloudfw'; ``` -------------------------------- ### Import and Initialize Assert Module Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-assert-1.12.0/README.md Import the assert module from the @alicloud/ros-cdk-assert package. This is the initial step before using its assertion functionalities. ```javascript const assert = require('@alicloud/ros-cdk-assert'); ``` -------------------------------- ### Import ROS CDK ROS Module Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkros/README.md Import the necessary ROS module from the AliCloud ROS CDK project. ```go import * as ROS from '@alicloud/ros-cdk-ros'; ``` -------------------------------- ### Import MAXCOMPUTE Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkmaxcompute/README.md Import the MAXCOMPUTE construct library for use in your ROS CDK project. This is typically the first step when utilizing MaxCompute resources. ```go import * as MAXCOMPUTE from '@alicloud/ros-cdk-maxcompute'; ``` -------------------------------- ### Import RocketMQ5 Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkrocketmq5/README.md Import the necessary RocketMQ5 construct library for use in your ROS CDK application. ```go import * as ROCKETMQ5 from '@alicloud/ros-cdk-rocketmq5'; ``` -------------------------------- ### Import SELECTDB Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkselectdb/README.md Import the SELECTDB module for use in your Go project within the AliCloud ROS CDK. ```go import * as SELECTDB from '@alicloud/ros-cdk-selectdb'; ``` -------------------------------- ### List ROS CDK Stacks using `ros-cdk list` and `ros-cdk list-stacks` Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk list` to see local stacks and `ros-cdk list-stacks` to view deployed stacks. Options include listing all stacks, specifying a region, pagination, and filtering by resource group. ```bash ros-cdk list ``` ```bash ros-cdk list-stacks ``` ```bash ros-cdk list-stacks --all ``` ```bash ros-cdk list-stacks --region cn-beijing ``` ```bash ros-cdk list-stacks --page-number 2 --page-size 20 ``` ```bash ros-cdk list-stacks --resource-group-id rg-xxxxxxxx ``` -------------------------------- ### Import Computenest Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcomputenest/README.md Import the Computenest module for use in your Go project. This is typically the first step when utilizing the library. ```go import * as COMPUTENEST from '@alicloud/ros-cdk-computenest'; ``` -------------------------------- ### Import VOD Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkvod/README.md Import the VOD module from the Alicloud ROS CDK project for use in your Go application. ```go import * as VOD from '@alicloud/ros-cdk-vod'; ``` -------------------------------- ### Import RAM Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkram/README.md Import the RAM construct library for use in your Go ROS CDK project. This is typically the first step before defining any RAM resources. ```go import * as RAM from '@alicloud/ros-cdk-ram'; ``` -------------------------------- ### Import KAFKA Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkkafka/README.md Import the KAFKA module from the AliCloud ROS CDK project for use in your Go applications. ```go import * as KAFKA from '@alicloud/ros-cdk-kafka'; ``` -------------------------------- ### Import ROS Redis Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkredis/README.md Import the necessary REDIS module from the ROS CDK for use in your project. ```go import * as REDIS from '@alicloud/ros-cdk-redis'; ``` -------------------------------- ### Deploy and View ROS CDK Outputs Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Commands to deploy the ROS CDK stack and view its outputs. Ensure you have configured your ROS CDK region and provided necessary parameters like ZoneId and InstanceType. ```bash # Deploy ros-cdk config --region cn-hangzhou ros-cdk deploy --sync --parameters ZoneId=cn-hangzhou-i --parameters InstanceType=ecs.c6.large # View outputs ros-cdk output EcsSvnStack ``` -------------------------------- ### Import WAF3 Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkwaf3/README.md Import the WAF3 module for use in your Go project. This is typically the first step when utilizing the WAF3 construct library. ```go import * as WAF3 from '@alicloud/ros-cdk-waf3'; ``` -------------------------------- ### Import ROS CS Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcs/README.md Import the necessary module for using ROS CS constructs in your Go project. ```go import * as CS from '@alicloud/ros-cdk-cs'; ``` -------------------------------- ### Activate Virtual Environment (Unix/MacOS) Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ros/deploy-2048/python/README.md Activate the created virtual environment to manage project dependencies. This command must be run in the project's root directory. ```bash source .venv/bin/activate ``` -------------------------------- ### Import ClickHouse Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkclickhouse/README.md Import the Aliyun ROS ClickHouse module for use in your Go project. This is typically the first step when utilizing the construct library. ```go import * as CLICKHOUSE from '@alicloud/ros-cdk-clickhouse'; ``` -------------------------------- ### Import ROS CR Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcr/README.md Import the necessary module for using Alibaba Cloud ROS CR constructs in your Go project. ```go import * as CR from '@alicloud/ros-cdk-cr'; ``` -------------------------------- ### Import GREEN Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkgreen/README.md Import the GREEN construct library for use in your ROS CDK project. This is typically the first step before defining any GREEN-related resources. ```go import * as GREEN from '@alicloud/ros-cdk-green'; ``` -------------------------------- ### Core Constructs and Utilities Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/java/ros-cdk-core/src/main/java/com/aliyun/ros/cdk/core/$Module.txt Key constructs and utility classes for building ROS applications. ```APIDOC ## Core Constructs and Utilities This section covers essential constructs and utility classes for developing with ROS CDK. ### GitIgnoreStrategy Strategy for ignoring files based on Git patterns. ### GlobIgnoreStrategy Strategy for ignoring files based on glob patterns. ### IgnoreMode Specifies the mode for ignoring files. ### IgnoreStrategy Base class for ignore strategies. ### Intrinsic Represents an intrinsic function call. ### Lazy Utility for creating lazy-evaluated values. ### LazyAnyValueOptions Options for lazy evaluation of any type. ### LazyListValueOptions Options for lazy evaluation of lists. ### LazyStringValueOptions Options for lazy evaluation of strings. ### NestedStack Represents a nested stack in ROS. ### NestedStackProps Properties for creating a NestedStack. ### RamRoles Utilities for managing RAM roles. ### Reference Represents a reference to another resource or attribute. ### RemovalPolicy Specifies the policy for resource removal. ### RemovalPolicyOptions Options for resource removal policies. ### ResolveOptions Options for resolving values. ### Resource Base class for all ROS resources. ### ResourceProps Properties for creating a ROS resource. ### RosCondition Represents a ROS condition. ### RosConditionProps Properties for creating a RosCondition. ### RosDeletionPolicy Specifies the deletion policy for ROS resources. ### RosElement Base class for ROS elements. ### RosInfo Provides information about the ROS template. ### RosMapping Represents a ROS mapping. ``` -------------------------------- ### Import ASM Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkasm/README.md Import the Aliyun ROS CDK ASM module for use in your Go project. This is typically the first step before utilizing any ASM constructs. ```go import * as ASM from '@alicloud/ros-cdk-asm'; ``` -------------------------------- ### Import ADB Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkadb/README.md Import the ADB module for use in your Go project. This is typically the first step when working with ADB constructs. ```go import * as ADB from '@alicloud/ros-cdk-adb'; ``` -------------------------------- ### Import HOLOGRAM Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkhologram/README.md Import the HOLOGRAM module for use in your Go project. This is typically the first step when utilizing the library. ```go import * as HOLOGRAM from '@alicloud/ros-cdk-hologram'; ``` -------------------------------- ### Import Cloud Storage Gateway Module Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcloudstoragegateway/README.md Import the Cloud Storage Gateway module for use in your ROS CDK project. ```go import * as CLOUDSTORAGEGATEWAY from '@alicloud/ros-cdk-cloudstoragegateway'; ``` -------------------------------- ### Import CEN Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcen/README.md Import the necessary CEN construct library for use in your ROS CDK project. ```go import * as CEN from '@alicloud/ros-cdk-cen'; ``` -------------------------------- ### Import WAF Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkwaf/README.md Import the WAF module for use in your Go ROS CDK project. This is typically the first step before defining WAF resources. ```go import * as WAF from '@alicloud/ros-cdk-waf'; ``` -------------------------------- ### Create Virtual Environment (Unix/MacOS) Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ros/deploy-2048/python/README.md Manually create a Python virtual environment named .venv. Ensure python3 is in your PATH. ```bash python3 -m venv .venv ``` -------------------------------- ### OTS Instance Constructs Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/java/ros-cdk-ots/src/main/java/com/aliyun/ros/cdk/ots/$Module.txt Provides constructs for creating and managing OTS instances. ```APIDOC ## Instance ### Description Represents an OTS instance. ### Class Signature `new Instance(scope: Construct, id: string, props?: InstanceProps)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (InstanceProps, optional) - Properties for the instance. ## InstanceV2 ### Description Represents an OTS instance (V2). ### Class Signature `new InstanceV2(scope: Construct, id: string, props?: InstanceV2Props)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (InstanceV2Props, optional) - Properties for the instance. ## RosInstance ### Description Represents a ROS resource for an OTS instance. ### Class Signature `new RosInstance(scope: Construct, id: string, props: RosInstanceProps)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (RosInstanceProps) - Properties for the ROS instance. ## RosInstanceV2 ### Description Represents a ROS resource for an OTS instance (V2). ### Class Signature `new RosInstanceV2(scope: Construct, id: string, props: RosInstanceV2Props)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (RosInstanceV2Props) - Properties for the ROS instance (V2). ``` -------------------------------- ### Import ROS CDK Core Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-core-1.12.0/README.md Import the necessary core module from the @alicloud/ros-cdk-core library. ```javascript const core = require('@alicloud/ros-cdk-core'); ``` -------------------------------- ### Import Memcache Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkmemcache/README.md Import the necessary Memcache construct library for use in your Go project. This import statement is required to utilize the library's functionalities. ```go import * as MEMCACHE from '@alicloud/ros-cdk-memcache'; ``` -------------------------------- ### Deploy ROS CDK Stack with Options Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk deploy` to deploy a stack. Options include specifying a resource group, skipping deployment if no changes are detected, disabling rollback on failure, and showing detailed error logs. ```bash ros-cdk deploy MyStack --resource-group-id rg-xxxxxxxx ``` ```bash ros-cdk deploy MyStack --skip-if-no-changes ``` ```bash ros-cdk deploy MyStack --disable-rollback ``` ```bash ros-cdk deploy MyStack --sync --detail-log ``` -------------------------------- ### Import CONFIG Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkconfig/README.md Import the CONFIG module for use in your Go project. This is typically the first step when utilizing the library. ```go import * as CONFIG from '@alicloud/ros-cdk-config'; ``` -------------------------------- ### Import SLS Construct Library in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdksls/README.md Import the necessary SLS module for use in your Go ROS CDK project. ```go import * as SLS from '@alicloud/ros-cdk-sls'; ``` -------------------------------- ### ROS CDK Useful Commands Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ecs/deploy-SVN-by-using-svnserve/python/README.md A collection of essential ROS CDK commands for managing your cloud development kit projects, including listing stacks, deploying resources, and inspecting stack status. ```bash ros-cdk list-stacks ``` ```bash ros-cdk list ``` ```bash ros-cdk deploy ``` ```bash ros-cdk event ``` ```bash ros-cdk output ``` ```bash ros-cdk resource ``` ```bash ros-cdk diff ``` ```bash ros-cdk synth ``` ```bash ros-cdk destroy ``` -------------------------------- ### Import ActionTrail Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkactiontrail/README.md Import the ActionTrail module for use in your Go project. This is typically the first step when utilizing the library. ```go import * as ACTIONTRAIL from '@alicloud/ros-cdk-actiontrail'; ``` -------------------------------- ### Deploy ROS Stack Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Creates or updates an ROS stack in Alibaba Cloud. Supports asynchronous deployment, synchronous mode, output capture, parameters, tags, and resource groups. ```bash ros-cdk deploy ``` ```bash ros-cdk deploy MyStack --sync ``` ```bash ros-cdk deploy MyStack --parameters InstanceType=ecs.c6.large --parameters ZoneId=cn-hangzhou-i ``` ```bash ros-cdk deploy MyStack --region-id cn-beijing ``` ```bash ros-cdk deploy MyStack --timeout 30 ``` ```bash ros-cdk deploy MyStack --outputs-file --sync ``` -------------------------------- ### OTS VCU Instance Constructs Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/java/ros-cdk-ots/src/main/java/com/aliyun/ros/cdk/ots/$Module.txt Provides constructs for creating and managing OTS VCU instances. ```APIDOC ## VCUInstance ### Description Represents an OTS VCU instance. ### Class Signature `new VCUInstance(scope: Construct, id: string, props: VCUInstanceProps)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (VCUInstanceProps) - Properties for the VCU instance. ## RosVCUInstance ### Description Represents a ROS resource for an OTS VCU instance. ### Class Signature `new RosVCUInstance(scope: Construct, id: string, props: RosVCUInstanceProps)` ### Parameters * `scope` (Construct) - The scope in which to define this construct. * `id` (string) - The unique ID of the construct. * `props` (RosVCUInstanceProps) - Properties for the ROS VCU instance. ``` -------------------------------- ### Import POLARDB Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkpolardb/README.md Import the POLARDB construct library for use in your ROS CDK application. ```go import * as POLARDB from '@alicloud/ros-cdk-polardb'; ``` -------------------------------- ### Import ALB Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkalb/README.md Import the ALB construct library for use in your ROS CDK application. This is typically the first step when defining ALB resources. ```go import * as ALB from '@alicloud/ros-cdk-alb'; ``` -------------------------------- ### Import and Use ros-cdk-spec Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/js/alicloud-ros-cdk-spec-1.12.0/README.md Demonstrates how to import and use the ros-cdk-spec package in a Node.js project. ```javascript const rosSpec = require('@alicloud/ros-cdk-spec'); // TODO: DEMONSTRATE API ``` -------------------------------- ### Import GA Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkga/README.md Import the Global Accelerator (GA) module from the Alicloud ROS CDK project for use in your Go application. ```go import * as GA from '@alicloud/ros-cdk-ga'; ``` -------------------------------- ### Import IOT Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkiot/README.md Import the IOT module from the Alicloud ROS CDK for use in your Go project. This is typically the first step before defining IOT resources. ```go import * as IOT from '@alicloud/ros-cdk-iot'; ``` -------------------------------- ### Activate Virtual Environment (Windows) Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/examples/documents/ros/deploy-2048/python/README.md Activate the created virtual environment on Windows using the batch script. This command must be run in the project's root directory. ```batch % .venv\Scripts\activate.bat ``` -------------------------------- ### Import Aliyun ROS PAIDATASETACC Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkpaidatasetacc/README.md Import the PAIDATASETACC construct library for use in your ROS CDK project. This is typically the first step when defining resources. ```go import * as PAIDATASETACC from '@alicloud/ros-cdk-paidatasetacc'; ``` -------------------------------- ### Import CDDC Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkcddc/README.md Import the CDDC module for use in your Go project. This is the initial step required to leverage the Aliyun ROS CDDC Construct Library. ```go import * as CDDC from '@alicloud/ros-cdk-cddc'; ``` -------------------------------- ### Import Aliyun ROS OOS Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkoos/README.md Import the necessary OOS module for use in your Go project. This is typically the first step before utilizing any OOS constructs. ```go import * as OOS from '@alicloud/ros-cdk-oos'; ``` -------------------------------- ### Import DDOSPRO Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkddospro/README.md Import the DDOSPRO module for use in your Go project. This is typically the first step when utilizing the DDOSPRO construct library. ```go import * as DDOSPRO from '@alicloud/ros-cdk-ddospro'; ``` -------------------------------- ### Import ECI Construct Library Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkeci/README.md Import the ECI construct library for use in your ROS CDK project. This is typically the first step when utilizing ECI resources. ```go import * as ECI from '@alicloud/ros-cdk-eci'; ``` -------------------------------- ### Import ICE Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkice/README.md Import the ICE module for use in your Go project with the Aliyun ROS CDK. ```go import * as ICE from '@alicloud/ros-cdk-ice'; ``` -------------------------------- ### List Stack Resources using `ros-cdk resource` Source: https://context7.com/aliyun/resource-orchestration-service-cloud-development-kit/llms.txt Use `ros-cdk resource` to list all resources within a deployed stack. It shows the resource type, logical and physical resource IDs, and their status. ```bash ros-cdk resource MyStack ``` -------------------------------- ### Import DATAHUB Module in Go Source: https://github.com/aliyun/resource-orchestration-service-cloud-development-kit/blob/master/multiple-languages/go/alicloudroscdkdatahub/README.md Import the DATAHUB module for use in your Go project. This is typically the first step before utilizing any DATAHUB constructs. ```go import * as DATAHUB from '@alicloud/ros-cdk-datahub'; ```