Select Image, Instance Type and Zone from Verified Capacity
An ECS instance is a single-zone object, and the vSwitch chooses the zone. Once vswitch_id is set, the availability_zone argument is ignored, so the network file answers the placement question and the compute file only consumes the answer.
Capacity is a fact about a zone on a particular day. The alicloud_zones data source filtered by instance type and disk category returns the zones that had stock when it was read, and alicloud_instance_types narrows the shape inside one zone.
A filter that passes is not a reservation. Data source results are a plan-time snapshot; stock and quota move between plan and apply, and a shortage appears as an API error part-way through the rollout. Record the query date beside the chosen type, and treat a second zone as the mitigation rather than a detail.
Architecture is a dependency between two resources, not a preference. An Arm image cannot boot an x86 instance family, and the image records its architecture as i386, x86_64 or arm64. Choosing the family after the image build means rebuilding the image, not editing an argument.
An image is regional, so a second region is a second build. The image copy resource records the source region and the source image, which turns the dependency into a reviewable object; without it, a configuration in the new region names an image that does not exist there.
The system disk has a floor set by the image. Size must be at least 20 GiB and at least the image size, and the platform defaults to the larger of 40 GiB and the image. A 60 GiB image quietly raises every disk in the fleet.
Disk category is a zone fact as well. ESSD, ESSD AutoPL and the entry-level categories are not offered everywhere, and a category missing from a zone turns a valid configuration into a launch failure rather than a plan error. Filter zones by disk category before the configuration is written.
Burstable shapes are a price decision with a performance ceiling. A t-series instance earns CPU credits at its baseline and throttles once they are spent, and the configuration's credit specification decides whether it may burst above that. Size a steady workload on a shape that does not depend on credits.
| Assumption | Verified by | Failure when unverified |
|---|---|---|
| Architecture matches the family | image architecture and instance type documentation | the instance never boots |
| The zone stocks the type today | zones filtered by instance type | apply fails mid-rollout |
| The zone offers the disk category | zones filtered by disk category | configuration exists, launch fails |
| The image fits the system disk | image size against the disk size | launch rejected or disk silently enlarged |
| Outbound bandwidth is not needed | bandwidth setting on the configuration | every member carries a changing public address |
Bandwidth is a separate decision with its own meter. A private member should carry zero outbound bandwidth and reach the internet through NAT, while the balancer owns the public side. Setting public bandwidth on a scaled member gives every instance an address that changes at replacement.
Quota is approved, not applied. vCPU and instance quotas belong to the account and the region and are raised by request, so a zone with stock inside an account without quota behaves exactly like a zone with no stock. Put the approved ceiling in the review beside the chosen type.
Cost follows the shape, the disk and the address rather than the count alone. Subscription and pay-as-you-go instances price differently, ESSD performance levels price differently at the same capacity, and a retained disk or an unassociated EIP keeps billing after the fleet is gone. Put those three assumptions in the review next to the hourly instance price.
Figure 1 follows one decision from the image recipe to the group that will launch members from it.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
SRC["Service repository
image recipe and bootstrap"] --> IMG["Custom image
architecture pinned"]
IMG --> FILT["Instance type query
vCPU and memory per zone"]
FILT --> STOCK{"Stock and disk category
available in the zone?"}
STOCK -->|"yes"| VSW["vSwitch
zone is inherited"]
STOCK -->|"no"| X1["Apply fails mid-rollout"]
VSW --> CFG["Scaling configuration
image, type, disk, bootstrap"]
CFG --> GRP["Scaling group
vswitch_ids and size bounds"]
IMG -.->|"Arm image, x86 family"| X2["Instance never boots"]
CFG -.->|"disk smaller than the image"| X3["Launch rejected or disk enlarged"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class SRC,GRP primary;
class IMG,FILT,VSW,CFG secondary;
class STOCK warn;
class X1,X2,X3 danger;
The image is the only artifact that must exist before the type is chosen. Configuration, group and balancer all reference it, so a rebuild that changes architecture invalidates the family choice rather than just the disk contents.
Figure 2 draws the same decision as boundaries: the build produces an artifact, the account inventory answers placement, and the runtime only points at both.
A scaling group is not zone-balanced by default. It launches into the vSwitches it is given and follows its multi-zone policy when stock runs short, so naming one vSwitch per zone is what makes the availability claim true rather than the group resource itself.
Keep Image Build and Application Bootstrap Separately Versioned
Three versions move independently: the image, the bootstrap and the artifact. Terraform holds the image reference and the bootstrap text, and should hold the artifact only as a version string rendered into that text.
The image is produced outside Terraform and consumed by reference. The image resource can be created from an instance or a snapshot, which makes building inside the same apply tempting; that couples an image build to the state of a live server and hides the build behind a plan that shows only one new resource.
A pinned image ID is reviewable; a name is not. A scaling configuration accepts an image name as well as an ID, and a name that a pipeline republishes resolves to whatever build is newest at launch. The plan cannot show which build that is, and two members of one group can boot different ones.
Snapshots and images accumulate faster than configurations do. Every build leaves an image and most builds leave snapshots, and deleting an image that an active configuration still names breaks the next launch rather than the current one. Retain the last few by tag and delete the rest on a schedule.
User data is configuration, not a vault. The bootstrap script is stored in state, served by the instance metadata service and copied into cloud-init's logs, so anyone who can describe the instance can read it. The ECS documentation says plainly not to pass plaintext passwords or private keys, and that is a design constraint rather than advice.
Instance RAM role is how a bootstrap gets a credential without a secret. The configuration attaches a role by name, the instance fetches a short-lived STS token from the metadata service, and the script reads an OSS object or a parameter. No key file is written and nothing sensitive enters the plan.
The 32 KB ceiling hides design problems. Raw user data must stay under 32 KB before Base64 encoding, which is enough for an agent install and a service start and not enough to be a deployment system. A script that fits is not proof that it belongs there.
A first-boot script should run once and then get out of the way. Script user data runs at first start, so a script that tries to converge state on every boot hides drift until the next replacement. Anything that must keep converging belongs in an agent with an endpoint the balancer can read.
A bootstrap that fetches "latest" defeats the versioning. If the script resolves the artifact at boot, two instances launched an hour apart from one image can run different code. Render the version into the text so the plan shows which build a new member will run.
| Layer | Produced by | Terraform holds | Rollback unit |
|---|---|---|---|
| Image | image pipeline | the exact image ID | the previous image |
| Bootstrap | service repository, rendered | the script text | the previous configuration |
| Artifact | CI build, published to OSS | a version string in the text | the previous version |
| Instance | ESS launch | nothing; it is not in state | the removal policy |
Bootstrap edits are configuration versions, not instance edits. Changing the text produces a new scaling configuration and affects only members launched after activation, so the edit is a release with the same evidence as an image change.
A rotation that touches no plan is the sign of a correct boundary. Changing a credential in the managed secret store leaves the image, the configuration and the group untouched. A rotation that produces a diff means the secret was stored in the wrong layer.
Logs are the only place the bootstrap explains itself. A cloud-init failure is invisible in the balancer's view and appears as a member that is running, counted by the group, and never admitted. Keep the first-boot log and read it before rebooting anything.
A bootstrap that fails loudly is better than one that half-succeeds. Emit a final marker and make the check wait for it, otherwise a script that installs the agent and then fails to start the unit leaves a port open and a member admitted to traffic it cannot serve.
Figure 3 follows the four versions into one launch, with the branches where they diverge.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
S["Source commit"] --> B["Image build
outside Terraform"]
B --> I["Custom image
ID published"]
A["Artifact build"] --> O["OSS object
version string"]
I --> C["Scaling configuration
image ID and user data"]
O -->|"version rendered into the text"| C
C --> E["ESS instance
role attached by name"]
E --> H["Balancer health check
answers on the app port"]
C -.->|"password in user data"| X1["Secret in state and in logs"]
C -.->|"image name instead of ID"| X2["Members boot different builds"]
E -.->|"bootstrap pulls latest"| X3["Image and code disagree"]
E -.->|"user data over 32 KB"| X4["Script truncated or skipped"]
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class S,I,E primary;
class B,A,O,C secondary;
class H ok;
class X1,X2,X3,X4 danger;
The image can be rebuilt without touching the bootstrap, and the reverse is also true. That independence is the point of the split: a runtime patch is a new image ID in a new configuration, an install-script fix is a new script in a new configuration, and neither one forces the other to move.
Connect ECS, Scaling and the Selected Balancer Family
ESS decides how many members exist; the balancer decides which of them receive traffic. A member can be running, counted by the group, and receiving nothing, and that state is normal during admission rather than a fault to chase.
Three balancer families join the group in three different ways. CLB attaches by instance through the group's balancer list, ALB attaches through a server group with its own port and weight, and NLB attaches at the server group rather than through the group's list. The join decides who owns registration when a member is replaced.
Choose the family from the protocol and the traffic shape, not from the product name. CLB covers simple layer 4 and layer 7 forwarding and has the longest history, ALB is the HTTP, HTTPS and gRPC balancer with host and path rules, and NLB is the layer 4 option built for high throughput and stable addresses. The choice changes which resource owns the health check and how a member is registered.
| Family | Terraform shape | How ESS registers members | What to check |
|---|---|---|---|
| CLB | load balancer, listener, server group | the group's balancer list | the listener must use the default server group |
| ALB | load balancer, server group, listener | server group block, or the attachment resource with port and weight | server group health check config is required |
| NLB | load balancer, server group, listener | server group attachment, not the group's list | registration is not driven by ESS in this provider version |
CLB registration goes to the default server group. The group attaches members there, so a listener bound only to a custom server group will show a healthy group and send no traffic to the new members. Bind the listener to the group ESS writes to, or attach explicitly and own the reconciliation.
CLB checks and forwarding use a reserved range that security groups do not filter. Probes and traffic arrive from 100.64.0.0/10, and ECS inbound rules do not restrict that range, so a security group cannot lock the balancer out. iptables and host firewalls can, and a hardened host that blocks the range marks every backend unhealthy while the console shows a running fleet.
ALB is a VPC resource with at least two zones and an explicit server group. Its availability comes from its zone mappings rather than from one vSwitch, and the server group requires a health check configuration, which removes the silent "checks disabled" failure. Budget two vSwitches in different zones before the balancer enters the plan.
The check port is not always the service port. Both families let the probe use a port different from the listener's backend port, and ALB defaults the check to the backend port when it is unset. Point it at an endpoint that proves the process can serve and is cheap enough to answer every few seconds.
Draining is off until you turn it on. The ALB server group carries a drain switch and a 300-second timeout that applies only when the switch is enabled, so the default removes a member together with its in-flight requests. Enable it above your slowest request and read it beside the check thresholds.
A health check is not a certificate for the listener. An HTTPS listener can be healthy at the backend and still fail at the front end through an expired certificate or a security policy the client refuses, and that failure never appears in the backend health count.
health_check_type decides whether the balancer can retire an instance. Left at the ECS default, the group replaces a member that fails the platform status check and ignores the balancer's verdict; set to the balancer, a backend the balancer drained is replaced. That difference is why a healthy group can hold a member that receives no traffic.
Session persistence moves the risk from admission to eviction. With stickiness on, draining a member does not move its sessions, so a replacement mid-session loses that user's state unless the application keeps it elsewhere. Decide stickiness before the first rollout, not after the first complaint.
Weight zero drains a member without detaching it. Both server group models accept a weight, and zero stops new traffic while the member stays registered; a Layer 4 CLB check may then report the backend as abnormal. Use it for a manual drain, and remember that it is not a replacement.
Two balancers in front of one group double the registration work. Each family keeps its own membership, and the group's balancer list covers CLB only, so a mixed front end needs both paths reconciled after every replacement.
The group does not wait for admission before it counts a member. Desired capacity is met when the instance exists, and the check runs afterwards, so a group that jumps to its maximum in one step can meet its size target with half the members unadmitted.
Defaults assume a five-minute boot. The group cooldown and the target-tracking warm-up both default to 300 seconds, which is how long a metric rule ignores a new member. An application that takes longer produces a second scale-out before the first batch is useful.
| Signal | Owner | Default | A wrong value looks like |
|---|---|---|---|
| healthy threshold | CLB listener | 3 consecutive passes | members admitted before the app is warm |
| unhealthy threshold | CLB listener | 3 consecutive failures | a flapping backend that stays in rotation |
| check interval and timeout | CLB listener | 2s and 5s | a timeout below the interval is replaced by the interval |
| connection draining | ALB server group | disabled, 300s when enabled | in-flight requests dropped at removal |
| cooldown | ESS group | 300s | repeated scale-out during boot |
| warm-up | ESS scaling rule | 300s | metrics that describe a booting instance |
A threshold of three at two-second intervals is not a readiness test. It admits a port that answers, which is correct for a process and wrong for an application that needs its cache warm. Either give the check a real endpoint or move the wait into the bootstrap.
The release order is balancer first, capacity second. A listener and server group that exist before the first member do nothing harmful, while a member created before its probe path is ready looks like a failed boot. Draw the dependency so registration exists before the group scales.
Figure 4 places the two health decisions beside the request path.
Two numbers describe one fleet and they rarely match. The group's instance count and the balancer's healthy backend count differ by exactly the members in flight, and reading either alone turns a rollout into a guess.
Plan Capacity and Replacement Around Health
On a standalone instance, an image change is a disk swap unless you ask for a replacement. By default the provider stops the instance, replaces the system disk from the new image and starts it again, keeping the ID, the private IP and the data disks.
Asking for replacement is a different change with a different cost. Setting replace_on_image_update turns the same edit into a destroy and create, which returns a new ID, a new private address and no data disks. Read that flag as part of the change rather than as a preference.
The default is still destructive where it matters. The system disk is rebuilt either way, so a local cache, an uploaded file or a session store on it is gone while the instance ID looks unchanged. Only separately attached data disks survive.
Changing the shape is a reboot; changing the image is a disk swap. Both keep the instance ID by default, and both are service interruptions that a plan describes only as an update. Schedule them as one change with one evidence trail, not as two quiet edits.
In a scaling group, the release unit is the scaling configuration. A configuration carries the image, the type, the disks and the bootstrap, and the group launches new members from whichever configuration is active. Editing the image on the active configuration is not a rollout.
Existing members keep the old image until they are removed. Activation changes what the next launch uses, not what is already running, so an image release is a replacement exercise that needs capacity headroom before it starts.
Deactivating a configuration can name its successor. The substitute argument lets the configuration being retired point at the new one, so the group never sits between two applies without an active configuration to launch from.
Scale-in is the replacement mechanism you already have. Removal policies choose the victim by age or by configuration, and the oldest-configuration policy retires members built from the earliest configuration first. That is exactly the order an image change wants, and it is a single policy value.
| Change | Plan shows | Member effect | Evidence to collect |
|---|---|---|---|
| new image, default behaviour | update in place | system disk replaced, ID and IP kept | boot log naming the new build |
| new image, replacement enabled | forces replacement | new ID, new private address, no data disks | balancer membership timeline |
| new scaling configuration | create | none until members are replaced | active configuration ID |
| activate the new configuration | update | new members only | image ID reported per member |
| lower the maximum size | update | members removed by policy | healthy count against the floor |
| data disk detached from the template | destroy then create | disk detached or deleted | disk inventory by tag |
A rollout is a capacity manoeuvre, not a single apply. Raise the maximum by the surge, let the group add members from the new configuration, verify admission, remove old members in batches, then restore the maximum. A group already at its maximum can only replace by removing first.
The multi-zone policy decides where the surge lands. A priority policy fills the first vSwitch before the second, a balance policy spreads members, and a cost-optimised policy trades stability for price. A rollout inherits that choice, so a zone with no stock stalls the batch rather than the plan.
Batch size should be a count while the fleet is small. A percentage of three members rounds to a number nobody chose, while a fixed count of one is slower and more predictable. Move to percentages when the fleet is large enough for them to mean something.
Batch by healthy count, not by elapsed time. A fixed five-minute wait between batches is too short for a slow boot and wastefully long for a fast one. Wait until the new member is admitted and the healthy count is back at the floor.
Quota has a lead time, and it is not in the plan. vCPU and instance quotas are raised by request, so a surge approved for tomorrow needs the request today. The apply reports the ceiling as an API error after the first batch has already passed.
The floor counts instances, not healthy backends. A batch that leaves the group at its minimum while the balancer has drained two members has satisfied the group and broken the service. Measure the healthy count against the floor rather than the instance count.
Storage survives by argument. Inline data disks are immutable after creation and default to deletion with the instance, while a separately managed disk defaults to surviving it. The second default is how a teardown leaves a billed disk behind.
Addresses should belong to the edge, not to a member. Keep member bandwidth at zero, send outbound traffic through NAT and terminate inbound at the balancer. An address assigned with an instance disappears with it, while a detached EIP keeps billing.
A rollback is the previous configuration plus replacement. Re-activating the previous configuration moves no running member, so the rollback is real only once the members built from the bad configuration are gone. Keep the previous image until that has happened.
Figure 5 compares the staged replacement with the two ways it stalls.
A failed batch is cheaper than a failed release. Stopping after the first new member is admitted and the floor is still met costs one rollback; discovering that the image is wrong after the fleet is replaced costs a second rollout with no old image left to serve from.
Measure One Change and Inspect Disks and Addresses
Measure membership, not the apply. Apply returns when the API accepts the configuration, while the release is the interval in which the balancer's healthy backend count held above the floor.
Two inventories have to agree. The group lists members and the configuration each launched from; the balancer lists backends and their health. A member in the first list and not the second is a registration problem rather than a boot problem, and the fix is different.
Boot evidence answers a different question than health. A TCP check passes on any listening process, so the build that actually booted is read from the member's image ID or its first-boot log, not from a green check.
Teardown is where the leftovers appear. Group, balancer, listener and configuration are the visible objects; detached disks, unassociated EIPs, snapshots behind an image and images still named by a retired configuration are the ones that keep billing.
Deletion order is a dependency, not a preference. The listener references the server group, the group references the configuration, and the configuration references the image, so a destroy in the wrong order fails on a reference or leaves an orphan behind.
A one-page release record is the deliverable. Image ID, configuration ID, activation state, start and end, lowest healthy count and the configuration to roll back to. Every missing field is ten minutes of the next incident.
Alert on admitted backends, not on group size. The only number that describes the service is the healthy backend count, and a group-size alarm stays green through a complete admission failure.
Timestamps are the only join between the two systems. Group activity and balancer health are separate logs, and a record that stores both with times can answer whether the floor was ever crossed without replaying a console session.
A manual fix is temporary by construction. A change made over SSH is not in the image, the bootstrap or the artifact, so the next member is built without it. Treat the next replacement as the test of whether the fix reached a versioned layer.
A rollback does not restore what the replacement deleted. The previous image returns, the previous configuration returns, and the system disk of every replaced member stays gone. Anything that had to survive was a data disk or an external store, and the rollback is not the moment to discover which.
Measure One Change and Inspect Disks and Addresses
Status: design-only. No Alibaba Cloud account or credential was used to produce this article, and these steps were not executed here. Versions: Terraform CLI 1.17.1, aliyun/alicloud 2.2.0, verified 6 November 2026.
Prerequisites. A sandbox account with a VPC, one vSwitch in each of two zones of one region, a security group that allows the application port, one CLB with an HTTP listener or one ALB with a server group, quota for two extra instances, and a budget alert on the account.
Minimal setup. One custom image recorded by ID, one scaling group with a floor of two, one active scaling configuration, one balancer whose health check points at the application port, and a request loop that closes each connection.
| Object | Lab value |
|---|---|
| Image | custom image, ID and architecture recorded before the change |
| Scaling configuration | small shared-core type, one system disk, role attached |
| Scaling group | two vSwitches in two zones, floor of two, ceiling of four |
| Removal policy | oldest configuration first |
| Health check | application port, 2s interval, 3 passes |
| Balancer | CLB default server group, or ALB server group with an explicit port |
- Baseline. Record the group size, the healthy backend count and the error rate over five minutes. Change nothing until that baseline is boring.
- Record the rollback target. Write down the active configuration ID, its image ID and the previous image ID before anything else moves.
- Publish the image out of band. Build it, record the ID and the build reference, and confirm the artifact version the bootstrap will request exists.
- Create the new configuration. Apply it inactive, with the same type, disks and bootstrap, and expect a create with no effect on running members.
- Activate it. Set the old configuration inactive and name the new one as its substitute; expect an update and no member replacement yet.
- Add the surge. Raise the maximum by one and watch a member launch from the new configuration. Compare the image ID it reports with the one you recorded.
- Read admission. Follow the backend through unhealthy, healthy and receiving. A member that stays unhealthy points at the probe path or at the bootstrap, not at the group.
- Retire the old members. Lower the maximum one member at a time, confirm the removal policy chose a member from the old configuration, and keep the healthy count beside the group size.
- Test the rollback on one member. Reactivate the previous configuration, replace one member and confirm the build it reports is the previous image, then resume the rollout from the new configuration.
- Tear down and inventory. Destroy with a reviewed plan, then list surviving disks, detached EIPs, snapshots behind images and configurations still naming an image.
Expected observation. A sequence rather than a duration: configuration created, configuration activated, first new member launched, first new member admitted, floor held, last old member removed, rollback returned the previous image. Capture timestamps from the group's activity and the balancer's health so the two can be joined afterwards.
Failure checks. A member that never passes health points at the probe path, a host firewall blocking the reserved range, or a bootstrap that failed. A healthy count below the floor points at a ceiling with no headroom. A disk that disappeared points at the inline default rather than at the image change. A plan that creates a second group points at a name that changed.
Cost dimensions. Instance hours including surge capacity, system and data disks per GiB-month including retained ones, balancer instance and capacity units, and outbound data transfer. The lab is small, but a detached disk and an unassociated EIP bill until they are deleted.
Cleanup. Delete the listener before its server group, detach members before deleting the configuration, release EIPs explicitly, and check for disks whose delete-with-instance flag kept them alive. Keep state out of Git and delete saved plans.
References (verified 6 November 2026):
alicloud_ess_scaling_group: https://registry.terraform.io/providers/aliyun/alicloud/2.2.0/docs/resources/ess_scaling_groupalicloud_ess_scaling_configuration: https://registry.terraform.io/providers/aliyun/alicloud/2.2.0/docs/resources/ess_scaling_configurationalicloud_instance: https://registry.terraform.io/providers/aliyun/alicloud/2.2.0/docs/resources/instancealicloud_alb_server_group: https://registry.terraform.io/providers/aliyun/alicloud/2.2.0/docs/resources/alb_server_groupalicloud_slb_listener: https://registry.terraform.io/providers/aliyun/alicloud/2.2.0/docs/resources/slb_listener- Instance user data: https://www.alibabacloud.com/help/en/ecs/user-guide/customize-the-initialization-configuration-for-an-instance
- CLB health checks: https://www.alibabacloud.com/help/en/slb/classic-load-balancer/user-guide/health-check-overview/
Next in the Series
In OSS with Terraform: Access Policies, Encryption and Data Retention, we'll explore Separate bucket configuration, application object workflows and backend state protection.