Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

Instance using Alicloud ECS

Basic example of an ecs instance

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set alicloud-ts-ecs
cd pulumi-examples/alicloud-ts-ecs

This example deploys a simple Alicloud ECS instance.

Prerequisites#

  1. Install Pulumi
  2. Configure Alicloud credentials
  3. Install Node.js

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init
  2. Set the Alicloud region to deploy into:

    Terminal window
    pulumi config set alicloud:region us-east-1
  3. Install dependencies:

    Terminal window
    npm install
  4. Deploy the stack, which will also boot up your Python web server on port 80:

    Terminal window
    pulumi up
  5. After a couple of minutes, your VM will be ready, and one stack output is printed:

    Terminal window
    pulumi stack output
    Current stack outputs (1):
    OUTPUT VALUE
    publicIp 47.90.136.113

From there, feel free to experiment. Simply making edits and running pulumi up will incrementally update your VM.

Cleaning up#

Once you’re finished experimenting, you can destroy your stack and remove it to avoid incurring any additional cost:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.