Skip to content

Commit b16a7c7

Browse files
committed
docs: update Terraform Provider guide for v0.0.2 changes and upgrade controls
Signed-off-by: helen frank <[email protected]>
1 parent dc7c7af commit b16a7c7

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

src/content/guide/getting_started/terraform.mdx

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
title: Terraform Provider
12
---
2-
title: Terraform
3-
---
43

5-
# Terraform
4+
# Terraform Provider
5+
6+
> **Important (v0.0.2):** Provider v0.0.2 changes component-upgrade defaults and improves kubeconfig handling. If you previously installed v0.0.1, run `terraform init -upgrade` before your next apply to pull in the new release.
67
78
This guide explains how to use the CloudPilot AI Terraform Provider to manage Amazon EKS clusters with automated cost optimization. The provider enables seamless integration of CloudPilot AI's optimization components into your infrastructure-as-code workflow.
89

@@ -21,6 +22,8 @@ Before using the Terraform Provider, ensure you have:
2122

2223
* **[Terraform](https://developer.hashicorp.com/terraform/install)** - Version 1.0 or later
2324
* **[AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)** - Configured with credentials that have EKS cluster management permissions
25+
- **Important:** Even if you supply a `kubeconfig_path`, the provider still uses AWS CLI credentials for all `kubectl` calls; make sure the CLI can authenticate to the target cluster account.
26+
- **Multi-account setups:** Switch to the profile that matches your EKS cluster (for example `AWS_PROFILE=prod-account`) before running Terraform commands.
2427
* **[kubectl](https://kubernetes.io/docs/tasks/tools/)** - For cluster operations and component management
2528
* **CloudPilot AI API Key** - See [Get API Keys](/guide/getting_started/get_apikeys) for setup instructions
2629

@@ -53,7 +56,8 @@ The following examples demonstrate different use cases for the Terraform Provide
5356
terraform {
5457
required_providers {
5558
cloudpilotai = {
56-
source = "cloudpilot-ai/cloudpilotai"
59+
source = "cloudpilot-ai/cloudpilotai"
60+
version = "~> 0.0.2"
5761
}
5862
}
5963
}
@@ -80,8 +84,27 @@ The following examples demonstrate different use cases for the Terraform Provide
8084
terraform apply
8185
```
8286

87+
If you're upgrading from v0.0.1, run `terraform init -upgrade` once to download v0.0.2 before planning.
88+
8389
Refer to the [example configurations](#example-configurations) above for complete working examples.
8490

91+
## Component Upgrade Controls
92+
93+
Starting with provider v0.0.2, CloudPilot AI components no longer upgrade automatically. Both `enable_upgrade_agent` and `enable_upgrade_rebalance_component` default to `false` so that running `terraform apply` does not unexpectedly roll out new controller versions.
94+
95+
Set these flags to `true` when you intentionally want Terraform to upgrade the in-cluster components:
96+
97+
```hcl
98+
resource "cloudpilotai_eks_cluster" "example" {
99+
# ... core settings ...
100+
101+
enable_upgrade_agent = true
102+
enable_upgrade_rebalance_component = true
103+
}
104+
```
105+
106+
This behavior matches the recommendations in PR [#2](https://github.com/cloudpilot-ai/terraform-provider-cloudpilotai/pull/2) and ensures you control when controller updates happen.
107+
85108
## Additional Resources
86109

87110
- [Terraform Provider Registry](https://registry.terraform.io/providers/cloudpilot-ai/cloudpilotai/latest) - Full provider documentation

0 commit comments

Comments
 (0)