Skip to content

Commit 6b0972f

Browse files
committed
refactor: remove C4A machine examples and logic
Signed-off-by: rluisr <[email protected]>
1 parent ff476ac commit 6b0972f

File tree

7 files changed

+22
-152
lines changed

7 files changed

+22
-152
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This Terraform module deploys various resources to run Atlantis on Google Comput
4343

4444
- **Separate Persistent Data Disk** - The VM instance has a separate attached persistent data disk attached to it to ensure that Atlantis data is persisted and not lost if the VM is deleted or terminated.
4545

46-
- **Hyperdisk auto-detection** - Hyperdisk-only machine families (C4A, C4D, H4D, X4, M4, A4X, A4, A3 Ultra, A3 Mega) are detected automatically so both boot and persistent disks default to Hyperdisk-balanced while still allowing explicit Hyperdisk overrides.
46+
- **Hyperdisk auto-detection** - Hyperdisk-only machine families (C4D, H4D, X4, M4, A3 Ultra, A3 Mega) are detected automatically so both boot and persistent disks default to Hyperdisk-balanced while still allowing explicit Hyperdisk overrides.
4747

4848
- **Shielded VM** - A Shielded VM is a VM that's hardened by a set of security controls that help defend against rootkits and bootkits. Using a Shielded VM helps protect enterprise workloads from threats like remote attacks, privilege escalation, and malicious insiders.
4949

@@ -53,11 +53,11 @@ This Terraform module deploys various resources to run Atlantis on Google Comput
5353

5454
## Hyperdisk Support
5555

56-
Hyperdisk storage is required for the following machine series: **C4A, C4D, H4D, X4, M4, A4X, A4, A3 Ultra, and A3 Mega**. The module automatically detects these machine types and switches both the boot disk and persistent data disk to `hyperdisk-balanced` when no override is provided, so Hyperdisk-only workloads work out of the box.
56+
Hyperdisk storage is required for the following machine series: **C4D, H4D, X4, M4, A3 Ultra, and A3 Mega**. The module automatically detects these machine types and switches both the boot disk and persistent data disk to `hyperdisk-balanced` when no override is provided, so Hyperdisk-only workloads work out of the box.
5757

5858
To force a different Hyperdisk flavor you can set `persistent_disk_type` or the new `boot_disk_type` variable to values such as `hyperdisk-extreme`. The `persistent_disk_type` validation prevents `pd-*` disks from being combined with the Hyperdisk-only families, which helps catch mistakes early.
5959

60-
See [`examples/c4a-machine`](examples/c4a-machine) for a complete configuration using the `c4a-standard-4` machine type along with guidance on optional overrides.
60+
**Note:** ARM64 machine types (C4A, A4X, A4, T2A, T2D) are **not supported** because Atlantis does not run on ARM64 architecture. Please use x86-64 machine types instead.
6161

6262
## Prerequisites
6363

@@ -77,7 +77,6 @@ Here are some examples to choose from. Look at the prerequisites above to find o
7777
- [Complete](https://github.com/runatlantis/terraform-gce-atlantis/tree/master/examples/complete)
7878
- [Secure Environment Variables](https://github.com/runatlantis/terraform-gce-atlantis/tree/master/examples/secure-env-vars)
7979
- [Cloud Armor](https://github.com/runatlantis/terraform-gce-atlantis/tree/master/examples/cloud-armor)
80-
- [C4A Hyperdisk](https://github.com/runatlantis/terraform-gce-atlantis/tree/master/examples/c4a-machine)
8180
- [Shared VPC](https://github.com/runatlantis/terraform-gce-atlantis/tree/master/examples/shared-vpc)
8281

8382
```hcl
@@ -181,7 +180,9 @@ resource "google_iap_web_iam_member" "member" {
181180

182181
### Which machine types require Hyperdisk?
183182

184-
Google currently requires Hyperdisk storage for C4A, C4D, H4D, X4, M4, A4X, A4, A3 Ultra, and A3 Mega machine types. This module detects those families automatically so the boot and persistent disks default to `hyperdisk-balanced`. You can still set `persistent_disk_type` or `boot_disk_type` to another Hyperdisk flavor (for example `hyperdisk-extreme`) when you need higher throughput.
183+
Google currently requires Hyperdisk storage for C4D, H4D, X4, M4, A3 Ultra, and A3 Mega machine types. This module detects those families automatically so the boot and persistent disks default to `hyperdisk-balanced`. You can still set `persistent_disk_type` or `boot_disk_type` to another Hyperdisk flavor (for example `hyperdisk-extreme`) when you need higher throughput.
184+
185+
**Note:** ARM64 machine types (C4A, A4X, A4, T2A, T2D) are not supported.
185186

186187
### When sending an HTTP request, I'm receiving an ERR_EMPTY_RESPONSE error
187188

TESTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ The disk-selection logic lives in `locals` and can be evaluated without contacti
1616

1717
```sh
1818
# Hyperdisk-only machine (auto-selection should be hyperdisk-balanced)
19-
terraform console -var 'machine_type=c4a-standard-4' <<< 'local.calculated_persistent_disk_type'
19+
terraform console -var 'machine_type=c4d-standard-4' <<< 'local.calculated_persistent_disk_type'
2020

2121
# Standard machine (should remain pd-ssd)
2222
terraform console -var 'machine_type=n2-standard-2' <<< 'local.calculated_persistent_disk_type'
2323

2424
# Explicit Hyperdisk override for both boot + persistent disks
25-
terraform console -var 'machine_type=c4a-standard-4' -var 'persistent_disk_type=hyperdisk-extreme' -var 'boot_disk_type=hyperdisk-extreme' <<< 'local.calculated_boot_disk_type'
25+
terraform console -var 'machine_type=c4d-standard-4' -var 'persistent_disk_type=hyperdisk-extreme' -var 'boot_disk_type=hyperdisk-extreme' <<< 'local.calculated_boot_disk_type'
2626

2727
# Loop through all Hyperdisk-only families if you need extra confidence
28-
for t in c4a-standard-4 c4d-standard-4 h4d-standard-4 x4-standard-4 m4-standard-4 a4x-standard-4 a4-standard-4 a3-ultragpu-8g a3-megagpu-16g; do
28+
for t in c4d-standard-4 h4d-standard-4 x4-standard-4 m4-standard-4 a3-ultragpu-8g a3-megagpu-16g; do
2929
terraform console -var "machine_type=$t" <<< 'local.calculated_persistent_disk_type'
3030
done
3131
```
@@ -36,10 +36,13 @@ The `persistent_disk_type` variable prevents pairing Hyperdisk-only machine type
3636

3737
```sh
3838
# Should fail: pd-ssd on a Hyperdisk machine
39-
terraform plan -var 'machine_type=c4a-standard-4' -var 'persistent_disk_type=pd-ssd'
39+
terraform plan -var 'machine_type=c4d-standard-4' -var 'persistent_disk_type=pd-ssd'
4040

4141
# Should pass: Hyperdisk override
42-
terraform plan -var 'machine_type=c4a-standard-4' -var 'persistent_disk_type=hyperdisk-extreme'
42+
terraform plan -var 'machine_type=c4d-standard-4' -var 'persistent_disk_type=hyperdisk-extreme'
43+
44+
# Should fail: ARM64 machine type
45+
terraform plan -var 'machine_type=c4a-standard-4'
4346
```
4447

4548
Running these steps after any related change ensures the Hyperdisk detection, overrides, and validation logic continue working until a formal automated suite is added.

examples/c4a-machine/README.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/c4a-machine/main.tf

Lines changed: 0 additions & 76 deletions
This file was deleted.

examples/c4a-machine/server-atlantis.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

main.tf

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ locals {
2121
)
2222
) > 0
2323

24-
# Detect ARM64 machine types (c4a, a4x, a4, t2a, t2d)
25-
is_arm64_machine = length(
26-
regexall(
27-
"^(c4a-|a4x-|a4-|t2a-|t2d-)",
28-
lower(var.machine_type)
29-
)
30-
) > 0
31-
3224
normalized_persistent_disk_type = trimspace(coalesce(var.persistent_disk_type, " "))
3325
has_user_persistent_disk_override = local.normalized_persistent_disk_type != "" && lower(local.normalized_persistent_disk_type) != "pd-ssd"
3426

@@ -54,11 +46,6 @@ data "google_compute_image" "cos" {
5446
project = "cos-cloud"
5547
}
5648

57-
data "google_compute_image" "cos_arm64" {
58-
family = "cos-arm64-stable"
59-
project = "cos-cloud"
60-
}
61-
6249
data "google_netblock_ip_ranges" "this" {
6350
for_each = toset([
6451
"health-checkers",
@@ -185,9 +172,7 @@ resource "google_compute_instance_template" "default" {
185172

186173
# Ephemeral OS boot disk
187174
disk {
188-
source_image = var.machine_image != null ? var.machine_image : (
189-
local.is_arm64_machine ? data.google_compute_image.cos_arm64.self_link : data.google_compute_image.cos.self_link
190-
)
175+
source_image = var.machine_image != null ? var.machine_image : data.google_compute_image.cos.self_link
191176
auto_delete = true
192177
boot = true
193178
disk_type = local.calculated_boot_disk_type

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ variable "machine_type" {
3333
type = string
3434
description = "The machine type to run Atlantis on. Hyperdisk-only families (C4A, C4D, H4D, X4, M4, A4X, A4, A3 Ultra, A3 Mega) require Hyperdisk storage and will trigger automatic Hyperdisk disk selection."
3535
default = "n2-standard-2"
36+
37+
validation {
38+
condition = (
39+
length(regexall("^(c4a-|a4x-|a4-|t2a-|t2d-)", lower(var.machine_type))) == 0
40+
)
41+
error_message = "ARM64 machine types (C4A, A4X, A4, T2A, T2D) are not supported because Atlantis does not run on ARM64 architecture. Please use an x86-64 machine type instead."
42+
}
3643
}
3744

3845
variable "boot_disk_type" {

0 commit comments

Comments
 (0)