Aliyun icon

Aliyun

Manage Aliyun cloud resource

Overview

This n8n node allows you to interact with Alibaba Cloud's Elastic Compute Service (ECS) by querying details of one or more ECS instances. It is particularly useful for automating cloud resource management, monitoring instance status, or integrating ECS data into broader workflows. For example, you can use this node to:

  • List all ECS instances in a specific region.
  • Filter instances by status, type, tags, or network attributes.
  • Retrieve paginated results for large deployments.
  • Integrate ECS inventory data with other systems (e.g., asset management, reporting).

Properties

Name Type Meaning
Region ID string The region ID where the ECS instances are located. Required.
Additional Fields collection Optional parameters to refine your query. See below for available options.

Additional Fields Options:

Name Type Meaning
InstanceChargeType options Billing method for the instance ("PrePaid" for subscription, "PostPaid" for pay-as-you-go).
InstanceIds string Comma-separated list or JSON array of instance IDs to filter. Supports up to 100 IDs.
InstanceName string Name of the instance. Supports wildcards (*) for fuzzy search.
InstanceType string Specific instance type to filter (e.g., ecs.g6.large).
InstanceTypeFamily string Family of instance types to filter.
KeyPairName string Name of the SSH key pair associated with the instance.
PageNumber number Page number for paginated results. Starts at 1. Default is 1.
PageSize number Number of results per page. Maximum is 100. Default is 10.
PrivateIpAddresses string JSON array of private IP addresses to filter. Only applicable for VPC network type.
PublicIpAddresses string JSON array of public IP addresses to filter.
SecurityGroupId string Security group ID to filter instances.
Status options Status of the instance ("Pending", "Running", "Starting", "Stopped", "Stopping").
Tag string JSON array of tag objects to filter, e.g., [{"Key": "TagKey", "Value": "TagValue"}].
VpcId string VPC ID to filter instances.
VSwitchId string Virtual switch ID to filter instances.
ZoneId string Availability zone ID to filter instances.

Output

The node outputs an array of objects, each representing an ECS instance. Each output item has the following structure:

{
  "json": {
    // All properties returned by the Aliyun ECS DescribeInstances API for a single instance,
    // such as InstanceId, InstanceName, Status, ZoneId, VpcId, etc.
  }
}
  • The exact fields inside json depend on the ECS API response and may include identifiers, names, status, network info, tags, and more.

Dependencies

  • External Services: Requires access to Alibaba Cloud ECS API.
  • Credentials: You must configure Aliyun API credentials (accessKeyId, accessKeySecret) in n8n under the credential type aliyunApi.
  • Environment: No special environment variables required beyond n8n credential configuration.
  • NPM Packages: Uses @alicloud/ecs20140526, @alicloud/openapi-client, and @alicloud/tea-util.

Troubleshooting

Common Issues

  • Invalid Credentials: If your Access Key or Secret is incorrect, authentication will fail.
  • Region Mismatch: Specifying a region that does not match your resources will result in empty results or errors.
  • Malformed Input: Some fields require JSON arrays (e.g., InstanceIds, PrivateIpAddresses, PublicIpAddresses, Tag). Supplying invalid JSON will cause errors.
  • API Limits: Exceeding allowed page size or number of instance IDs may result in API errors.

Error Messages

  • "Invalid instance IDs format"
    The value provided for "InstanceIds" is not valid JSON or not an array.
    Resolution: Ensure you enter a valid JSON array, e.g., ["i-abc123", "i-def456"].

  • "Invalid private IP addresses format"
    The value for "PrivateIpAddresses" is not a valid JSON array.
    Resolution: Enter a valid JSON array, e.g., ["192.168.0.1"].

  • "Invalid public IP addresses format"
    The value for "PublicIpAddresses" is not a valid JSON array.
    Resolution: Enter a valid JSON array, e.g., ["47.XX.XX.XX"].

  • "Invalid tags format"
    The value for "Tag" is not a valid JSON array of objects.
    Resolution: Enter a valid JSON array, e.g., [{"Key": "env", "Value": "prod"}].

  • Other API Errors:
    Any error message from the Aliyun ECS API will be passed through. Check the message for details and consult the ECS API documentation.

Links and References

Discussion