You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/guide/getting_started/terraform.mdx
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
+
title: Terraform Provider
1
2
---
2
-
title: Terraform
3
-
---
4
3
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.
6
7
7
8
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.
8
9
@@ -21,6 +22,8 @@ Before using the Terraform Provider, ensure you have:
21
22
22
23
***[Terraform](https://developer.hashicorp.com/terraform/install)** - Version 1.0 or later
23
24
***[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.
24
27
***[kubectl](https://kubernetes.io/docs/tasks/tools/)** - For cluster operations and component management
25
28
***CloudPilot AI API Key** - See [Get API Keys](/guide/getting_started/get_apikeys) for setup instructions
26
29
@@ -53,7 +56,8 @@ The following examples demonstrate different use cases for the Terraform Provide
53
56
terraform {
54
57
required_providers {
55
58
cloudpilotai = {
56
-
source = "cloudpilot-ai/cloudpilotai"
59
+
source = "cloudpilot-ai/cloudpilotai"
60
+
version = "~> 0.0.2"
57
61
}
58
62
}
59
63
}
@@ -80,8 +84,27 @@ The following examples demonstrate different use cases for the Terraform Provide
80
84
terraform apply
81
85
```
82
86
87
+
If you're upgrading from v0.0.1, run `terraform init -upgrade` once to download v0.0.2 before planning.
88
+
83
89
Refer to the [example configurations](#example-configurations) above for complete working examples.
84
90
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
+
85
108
## Additional Resources
86
109
87
110
-[Terraform Provider Registry](https://registry.terraform.io/providers/cloudpilot-ai/cloudpilotai/latest) - Full provider documentation
0 commit comments