diff --git a/.github/workflows/end-to-end-tfc.yaml b/.github/workflows/end-to-end-tfc.yaml index 88d1d4e1..6239b79e 100644 --- a/.github/workflows/end-to-end-tfc.yaml +++ b/.github/workflows/end-to-end-tfc.yaml @@ -1,4 +1,5 @@ -name: E2E on Terraform Cloud +name: E2E on HCP Terraform Operator + on: schedule: diff --git a/.github/workflows/helm-end-to-end-tfc.yaml b/.github/workflows/helm-end-to-end-tfc.yaml index 681fe260..f97a811d 100644 --- a/.github/workflows/helm-end-to-end-tfc.yaml +++ b/.github/workflows/helm-end-to-end-tfc.yaml @@ -1,4 +1,4 @@ -name: E2E on Terraform Cloud [Helm] +name: E2E on HCP Terraform Operator [Helm] on: schedule: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0349a2c8..ef608582 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributor Guide -We appreciate your enthusiasm for participating in the development of the Terraform Cloud Operator. Your contributions are warmly welcomed. Here you will find instructions on how to contribute to the Terraform Cloud Operator. +We appreciate your enthusiasm for participating in the development of the HCP Terraform Operator. Your contributions are warmly welcomed. Here you will find instructions on how to contribute to the HCP Terraform Operator. If you're a newcomer to the realm of Kubernetes Operators and are eager to expand your knowledge, a great place to begin your journey is by exploring the [Kubebuilder Book](https://book.kubebuilder.io/). @@ -64,7 +64,7 @@ We value your desire to contribute by introducing new features or enhancing exis 1. Create an API token that you are going to use for development - We strongly advise creating a separate account, organization, and API token for development purposes. A free [Terraform Cloud](https://app.terraform.io/) account is more than enough for that purpose. Follow the steps in the [Usage guide](./docs/usage.md#prerequisites) to get more information on how to generate a token and keep it in the Kubernetes Secret. + We strongly advise creating a separate account, organization, and API token for development purposes. A free [HCP Terraform](https://app.terraform.io/) account is more than enough for that purpose. Follow the steps in the [Usage guide](./docs/usage.md#prerequisites) to get more information on how to generate a token and keep it in the Kubernetes Secret. 1. Install Go diff --git a/META.d/_summary.yaml b/META.d/_summary.yaml index 70acebd2..2164f080 100644 --- a/META.d/_summary.yaml +++ b/META.d/_summary.yaml @@ -10,6 +10,6 @@ partition: tf-ecosystem summary: owner: team-tf-hybrid-cloud description: | - The Kubernetes Operator allows managing Terraform Cloud / Enterprise resources via Kubernetes Custom Resources. + The Kubernetes Operator allows managing HCP Terraform / Enterprise resources via Kubernetes Custom Resources. visibility: external diff --git a/README.md b/README.md index d4c996fc..bd88fadd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ - Terraform logo + Terraform logo -# Terraform Cloud Operator v2 for Kubernetes +# HCP Terraform Operator for Kubernetes [![GitHub release (with filter)](https://img.shields.io/github/v/release/hashicorp/terraform-cloud-operator)](https://github.com/hashicorp/terraform-cloud-operator/releases) [![Docker Pulls](https://img.shields.io/docker/pulls/hashicorp/terraform-cloud-operator)](https://hub.docker.com/r/hashicorp/terraform-cloud-operator) @@ -15,25 +15,25 @@ Kubernetes Operator allows managing Terraform Cloud / Enterprise resources via K The Operator can manage the following types of resources: -- `AgentPool` manages [Terraform Cloud Agent Pools](https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools), [Terraform Cloud Agent Tokens](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#agent-api-tokens) and can perform TFC agent scaling +- `AgentPool` manages [HCP Terraform Agent Pools](https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools), [HCP Terraform Agent Tokens](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#agent-api-tokens) and can perform TFC agent scaling - `Module` implements [API-driven Run Workflows](https://developer.hashicorp.com/terraform/cloud-docs/run/api) -- `Project` manages [Terraform Cloud Projects](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects) -- `Workspace` manages [Terraform Cloud Workspaces](https://developer.hashicorp.com/terraform/cloud-docs/workspaces) +- `Project` manages [HCP Terraform Projects](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects) +- `Workspace` manages [HCP Terraform Workspaces](https://developer.hashicorp.com/terraform/cloud-docs/workspaces) ## Getting started To get started see our tutorials on the HashiCorp Developer Portal: -- [Terraform Cloud Operator for Kubernetes overview](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes) -- [Deploy infrastructure with the Terraform Cloud Kubernetes Operator v2](https://developer.hashicorp.com/terraform/tutorials/kubernetes/kubernetes-operator-v2) -- [Manage agent pools with the Terraform Cloud Kubernetes Operator v2](https://developer.hashicorp.com/terraform/tutorials/kubernetes/kubernetes-operator-v2-agentpool) -- [Terraform Cloud Kubernetes Operator v2 Migration Guide](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes/ops-v2-migration) +- [HCP Terraform Operator for Kubernetes overview](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes) +- [Deploy infrastructure with the HCP Terraform Operator for Kubernetes](https://developer.hashicorp.com/terraform/tutorials/kubernetes/kubernetes-operator-v2) +- [Manage agent pools with the HCP Terraform Operator for Kubernetes](https://developer.hashicorp.com/terraform/tutorials/kubernetes/kubernetes-operator-v2-agentpool) +- [HCP Terraform Operator for Kubernetes Migration Guide](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes/ops-v2-migration) ## Documentation ### Supported Features -The full list of supported Terraform Cloud features can be found on our [Developer portal](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes#supported-terraform-cloud-features). +The full list of supported HCP Terraform Operator features can be found on our [Developer portal](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes#supported-terraform-cloud-features). ### Installation @@ -60,7 +60,7 @@ Controllers usage guides: - [Project](./docs/project.md) - [Workspace](./docs/workspace.md) -Annotations and Labels used by Terraform Cloud Operator can be found [here](./docs/annotations-and-labels.md). +Annotations and Labels used by HCP Terraform Operator can be found [here](./docs/annotations-and-labels.md). ### Metrics @@ -128,7 +128,7 @@ If you believe you've found a bug and cannot find an existing issue, feel free t ## Contributing to the Operator -We appreciate your enthusiasm for participating in the development of the Terraform Cloud Operator. To contribute, please read the [contribution guidelines](./CONTRIBUTING.md). +We appreciate your enthusiasm for participating in the development of the HCP Terraform Operator. To contribute, please read the [contribution guidelines](./CONTRIBUTING.md). ## Security Reporting diff --git a/RELEASING.md b/RELEASING.md index 6bad7db0..34ed3f59 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,6 +1,6 @@ # Releasing -The purpose of this document is to outline the release process for the Terraform Cloud Operator. +The purpose of this document is to outline the release process for the HCP Terraform Operator. The Semantic Versioning agreement is being followed by this project. Further details can be found [here](https://semver.org/). During the alpha or beta stages, the pre-release versions are not separated by dots. For example, `2.0.0-alpha1` or `2.0.0-beta5`. diff --git a/api/v1alpha2/agentpool_types.go b/api/v1alpha2/agentpool_types.go index 9e12c812..8e225ea9 100644 --- a/api/v1alpha2/agentpool_types.go +++ b/api/v1alpha2/agentpool_types.go @@ -8,7 +8,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. +// Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. // In `spec` only the field `Name` is allowed, the rest are used in `status`. // More infromation: // - https://developer.hashicorp.com/terraform/cloud-docs/agents @@ -60,7 +60,7 @@ type AgentDeploymentAutoscaling struct { // MinReplicas is the minimum number of replicas for the Agent deployment. MinReplicas *int32 `json:"minReplicas"` - // TargetWorkspaces is a list of Terraform Cloud Workspaces which + // TargetWorkspaces is a list of HCP Terraform Workspaces which // the agent pool should scale up to meet demand. When this field // is ommited the autoscaler will target all workspaces that are // associated with the AgentPool. diff --git a/api/v1alpha2/project_types.go b/api/v1alpha2/project_types.go index eae2f22c..fed7f64b 100644 --- a/api/v1alpha2/project_types.go +++ b/api/v1alpha2/project_types.go @@ -96,7 +96,7 @@ type CustomProjectPermissions struct { Variables tfc.WorkspaceVariablesPermissionType `json:"variables,omitempty"` } -// Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, +// HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, // users must belong to a team that has been granted the appropriate permissions. // You can assign project-specific permissions to teams. // More information: @@ -140,7 +140,7 @@ type ProjectSpec struct { //+kubebuilder:validation:MinLength:=1 Name string `json:"name"` - // Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, + // HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, // users must belong to a team that has been granted the appropriate permissions. // You can assign project-specific permissions to teams. // More information: diff --git a/api/v1alpha2/workspace_types.go b/api/v1alpha2/workspace_types.go index abfa51b2..e4f488b6 100644 --- a/api/v1alpha2/workspace_types.go +++ b/api/v1alpha2/workspace_types.go @@ -9,7 +9,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// AgentPool allows Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. +// AgentPool allows HCP Terraform to communicate with isolated, private, or on-premises infrastructure. // Only one of the fields `ID` or `Name` is allowed. // At least one of the fields `ID` or `Name` is mandatory. // More information: @@ -48,7 +48,7 @@ type ConsumerWorkspace struct { } // RemoteStateSharing allows remote state access between workspaces. -// By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state. +// By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. // More information: // - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces type RemoteStateSharing struct { @@ -65,7 +65,7 @@ type RemoteStateSharing struct { Workspaces []*ConsumerWorkspace `json:"workspaces,omitempty"` } -// Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. +// Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. // Only one of the fields `ID` or `Name` is allowed. // At least one of the fields `ID` or `Name` is mandatory. // More information: @@ -120,7 +120,7 @@ type RunTrigger struct { Name string `json:"name,omitempty"` } -// Teams are groups of Terraform Cloud users within an organization. +// Teams are groups of HCP Terraform users within an organization. // If a user belongs to at least one team in an organization, they are considered a member of that organization. // Only one of the fields `ID` or `Name` is allowed. // At least one of the fields `ID` or `Name` is mandatory. @@ -190,7 +190,7 @@ type CustomPermissions struct { WorkspaceLocking bool `json:"workspaceLocking,omitempty"` } -// Terraform Cloud workspaces can only be accessed by users with the correct permissions. +// HCP Terraform workspaces can only be accessed by users with the correct permissions. // You can manage permissions for a workspace on a per-team basis. // When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, // with full admin permissions. These teams' access can't be removed from a workspace. @@ -376,7 +376,7 @@ type Notification struct { //+optional URL string `json:"url,omitempty"` // The list of email addresses that will receive notification emails. - // It is only available for Terraform Enterprise users. It is not available in Terraform Cloud. + // It is only available for Terraform Enterprise users. It is not available in HCP Terraform. // //+kubebuilder:validation:MinItems:=1 //+optional @@ -445,7 +445,7 @@ type WorkspaceSpec struct { //+kubebuilder:validation:MinLength:=1 //+optional Description string `json:"description,omitempty"` - // Terraform Cloud Agents allow Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. + // HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure. // More information: // - https://developer.hashicorp.com/terraform/cloud-docs/agents // @@ -461,7 +461,7 @@ type WorkspaceSpec struct { //+kubebuilder:default=remote //+optional ExecutionMode string `json:"executionMode,omitempty"` - // Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. + // Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. // More information: // - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks // @@ -474,7 +474,7 @@ type WorkspaceSpec struct { //+kubebuilder:validation:MinItems:=1 //+optional Tags []Tag `json:"tags,omitempty"` - // Terraform Cloud workspaces can only be accessed by users with the correct permissions. + // HCP Terraform workspaces can only be accessed by users with the correct permissions. // You can manage permissions for a workspace on a per-team basis. // When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, // with full admin permissions. These teams' access can't be removed from a workspace. @@ -519,7 +519,7 @@ type WorkspaceSpec struct { //+optional TerraformVariables []Variable `json:"terraformVariables,omitempty"` // Remote state access between workspaces. - // By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state. + // By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. // More information: // - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces // @@ -564,11 +564,11 @@ type WorkspaceSpec struct { } type PlanStatus struct { - // Latest plan-only/speculative plan Terraform Cloud run ID. + // Latest plan-only/speculative plan HCP Terraform run ID. // //+optional ID string `json:"id,omitempty"` - // Latest plan-only/speculative plan Terraform Cloud run status. + // Latest plan-only/speculative plan HCP Terraform run status. // //+optional Status string `json:"status,omitempty"` @@ -580,11 +580,11 @@ type PlanStatus struct { } type RunStatus struct { - // Current(both active and finished) Terraform Cloud run ID. + // Current(both active and finished) HCP Terraform run ID. // //+optional ID string `json:"id,omitempty"` - // Current(both active and finished) Terraform Cloud run status. + // Current(both active and finished) HCP Terraform run status. // //+optional Status string `json:"status,omitempty"` diff --git a/charts/terraform-cloud-operator/Chart.yaml b/charts/terraform-cloud-operator/Chart.yaml index 2b292649..994a465a 100644 --- a/charts/terraform-cloud-operator/Chart.yaml +++ b/charts/terraform-cloud-operator/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: terraform-cloud-operator -description: Official Helm chart for HashiCorp Terraform Cloud Kubernetes Operator. +description: Official Helm chart for HCP Terraform Operator for Kubernetes. type: application version: "2.3.0" appVersion: "2.3.0" diff --git a/charts/terraform-cloud-operator/README.md b/charts/terraform-cloud-operator/README.md index 2583caf5..a32aba6d 100644 --- a/charts/terraform-cloud-operator/README.md +++ b/charts/terraform-cloud-operator/README.md @@ -51,7 +51,7 @@ In the above example, the Operator will watch 3 namespaces in the Kubernetes clu ### Install to work with Terraform Enterprise -If targeting a Terraform Enterprise instance rather than Terraform Cloud, set the API endpoint URL using the `operator.tfeAddress` value: +If targeting a Terraform Enterprise instance rather than HCP Terraform, set the API endpoint URL using the `operator.tfeAddress` value: ```console $ helm install demo hashicorp/terraform-cloud-operator \ @@ -152,4 +152,4 @@ For a more detailed explanation, please refer to the [FAQ](../../docs/faq.md#gen | operator.syncPeriod | string | `"5m"` | The minimum frequency at which watched resources are reconciled. Format: `5s`, `1m`, etc. | | operator.tfeAddress | string | `""` | The API URL of a Terraform Enterprise instance. | | operator.watchedNamespaces | list | `[]` | List of namespaces the controllers should watch. | -| replicaCount | int | `2` | The number of Terraform Cloud Operator replicas. | +| replicaCount | int | `2` | The number of Operator replicas. | diff --git a/charts/terraform-cloud-operator/README.md.gotmpl b/charts/terraform-cloud-operator/README.md.gotmpl index 5ac0bdd6..1a9f0944 100644 --- a/charts/terraform-cloud-operator/README.md.gotmpl +++ b/charts/terraform-cloud-operator/README.md.gotmpl @@ -51,7 +51,7 @@ In the above example, the Operator will watch 3 namespaces in the Kubernetes clu ### Install to work with Terraform Enterprise -If targeting a Terraform Enterprise instance rather than Terraform Cloud, set the API endpoint URL using the `operator.tfeAddress` value: +If targeting a Terraform Enterprise instance rather than HCP Terraform, set the API endpoint URL using the `operator.tfeAddress` value: ```console $ helm install demo hashicorp/terraform-cloud-operator \ diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml index c89f2dd6..a3cd1224 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_agentpools.yaml @@ -7520,7 +7520,7 @@ spec: description: List of the agent tokens to generate. items: description: |- - Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. + Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. In `spec` only the field `Name` is allowed, the rest are used in `status`. More infromation: - https://developer.hashicorp.com/terraform/cloud-docs/agents @@ -7567,7 +7567,7 @@ spec: type: integer targetWorkspaces: description: |- - TargetWorkspaces is a list of Terraform Cloud Workspaces which + TargetWorkspaces is a list of HCP Terraform Workspaces which the agent pool should scale up to meet demand. When this field is ommited the autoscaler will target all workspaces that are associated with the AgentPool. @@ -7652,7 +7652,7 @@ spec: description: List of the agent tokens generated by the controller. items: description: |- - Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. + Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. In `spec` only the field `Name` is allowed, the rest are used in `status`. More infromation: - https://developer.hashicorp.com/terraform/cloud-docs/agents diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml index 641bb5e8..328d48d9 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_modules.yaml @@ -226,15 +226,15 @@ spec: description: The configuration version of this run. type: string id: - description: Current(both active and finished) Terraform Cloud - run ID. + description: Current(both active and finished) HCP Terraform run + ID. type: string outputRunID: description: Run ID of the latest run that could update the outputs. type: string status: - description: Current(both active and finished) Terraform Cloud - run status. + description: Current(both active and finished) HCP Terraform run + status. type: string type: object workspaceID: diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_projects.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_projects.yaml index e64ddcc9..6a2e88a3 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_projects.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_projects.yaml @@ -65,7 +65,7 @@ spec: type: string teamAccess: description: |- - Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, + HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, users must belong to a team that has been granted the appropriate permissions. You can assign project-specific permissions to teams. More information: @@ -73,7 +73,7 @@ spec: - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions items: description: |- - Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, + HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, users must belong to a team that has been granted the appropriate permissions. You can assign project-specific permissions to teams. More information: diff --git a/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml b/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml index 80386762..4918765f 100644 --- a/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml +++ b/charts/terraform-cloud-operator/crds/app.terraform.io_workspaces.yaml @@ -48,7 +48,7 @@ spec: properties: agentPool: description: |- - Terraform Cloud Agents allow Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. + HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure. More information: - https://developer.hashicorp.com/terraform/cloud-docs/agents properties: @@ -202,7 +202,7 @@ spec: emailAddresses: description: |- The list of email addresses that will receive notification emails. - It is only available for Terraform Enterprise users. It is not available in Terraform Cloud. + It is only available for Terraform Enterprise users. It is not available in HCP Terraform. items: type: string minItems: 1 @@ -303,7 +303,7 @@ spec: remoteStateSharing: description: |- Remote state access between workspaces. - By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state. + By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. More information: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces properties: @@ -340,12 +340,12 @@ spec: type: object runTasks: description: |- - Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. More information: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks items: description: |- - Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Only one of the fields `ID` or `Name` is allowed. At least one of the fields `ID` or `Name` is mandatory. More information: @@ -440,7 +440,7 @@ spec: type: array teamAccess: description: |- - Terraform Cloud workspaces can only be accessed by users with the correct permissions. + HCP Terraform workspaces can only be accessed by users with the correct permissions. You can manage permissions for a workspace on a per-team basis. When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, with full admin permissions. These teams' access can't be removed from a workspace. @@ -448,7 +448,7 @@ spec: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access items: description: |- - Terraform Cloud workspaces can only be accessed by users with the correct permissions. + HCP Terraform workspaces can only be accessed by users with the correct permissions. You can manage permissions for a workspace on a per-team basis. When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, with full admin permissions. These teams' access can't be removed from a workspace. @@ -720,12 +720,12 @@ spec: manually. properties: id: - description: Latest plan-only/speculative plan Terraform Cloud - run ID. + description: Latest plan-only/speculative plan HCP Terraform run + ID. type: string status: - description: Latest plan-only/speculative plan Terraform Cloud - run status. + description: Latest plan-only/speculative plan HCP Terraform run + status. type: string terraformVersion: description: The version of Terraform to use for this run. @@ -739,15 +739,15 @@ spec: description: The configuration version of this run. type: string id: - description: Current(both active and finished) Terraform Cloud - run ID. + description: Current(both active and finished) HCP Terraform run + ID. type: string outputRunID: description: Run ID of the latest run that could update the outputs. type: string status: - description: Current(both active and finished) Terraform Cloud - run status. + description: Current(both active and finished) HCP Terraform run + status. type: string type: object terraformVersion: diff --git a/charts/terraform-cloud-operator/templates/NOTES.txt b/charts/terraform-cloud-operator/templates/NOTES.txt index d388d131..b0f2ce93 100644 --- a/charts/terraform-cloud-operator/templates/NOTES.txt +++ b/charts/terraform-cloud-operator/templates/NOTES.txt @@ -1,4 +1,4 @@ -Thank you for installing HashiCorp Terraform Cloud Operator! +Thank you for installing HashiCorp HCP Terraform Operator! Documentation: - https://github.com/hashicorp/terraform-cloud-operator diff --git a/charts/terraform-cloud-operator/values.yaml b/charts/terraform-cloud-operator/values.yaml index 4b1cf20b..bf28e3b0 100644 --- a/charts/terraform-cloud-operator/values.yaml +++ b/charts/terraform-cloud-operator/values.yaml @@ -4,7 +4,7 @@ # -- Reference to one or more secrets essential for pulling container images. imagePullSecrets: [] -# -- The number of Terraform Cloud Operator replicas. +# -- The number of Operator replicas. replicaCount: 2 # Operator-global options. diff --git a/config/crd/bases/app.terraform.io_agentpools.yaml b/config/crd/bases/app.terraform.io_agentpools.yaml index b85d49f2..a4cefe1d 100644 --- a/config/crd/bases/app.terraform.io_agentpools.yaml +++ b/config/crd/bases/app.terraform.io_agentpools.yaml @@ -7517,7 +7517,7 @@ spec: description: List of the agent tokens to generate. items: description: |- - Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. + Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. In `spec` only the field `Name` is allowed, the rest are used in `status`. More infromation: - https://developer.hashicorp.com/terraform/cloud-docs/agents @@ -7564,7 +7564,7 @@ spec: type: integer targetWorkspaces: description: |- - TargetWorkspaces is a list of Terraform Cloud Workspaces which + TargetWorkspaces is a list of HCP Terraform Workspaces which the agent pool should scale up to meet demand. When this field is ommited the autoscaler will target all workspaces that are associated with the AgentPool. @@ -7649,7 +7649,7 @@ spec: description: List of the agent tokens generated by the controller. items: description: |- - Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. + Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. In `spec` only the field `Name` is allowed, the rest are used in `status`. More infromation: - https://developer.hashicorp.com/terraform/cloud-docs/agents diff --git a/config/crd/bases/app.terraform.io_modules.yaml b/config/crd/bases/app.terraform.io_modules.yaml index 5e8c1f7b..405b2900 100644 --- a/config/crd/bases/app.terraform.io_modules.yaml +++ b/config/crd/bases/app.terraform.io_modules.yaml @@ -223,15 +223,15 @@ spec: description: The configuration version of this run. type: string id: - description: Current(both active and finished) Terraform Cloud - run ID. + description: Current(both active and finished) HCP Terraform run + ID. type: string outputRunID: description: Run ID of the latest run that could update the outputs. type: string status: - description: Current(both active and finished) Terraform Cloud - run status. + description: Current(both active and finished) HCP Terraform run + status. type: string type: object workspaceID: diff --git a/config/crd/bases/app.terraform.io_projects.yaml b/config/crd/bases/app.terraform.io_projects.yaml index da80adc2..835a9621 100644 --- a/config/crd/bases/app.terraform.io_projects.yaml +++ b/config/crd/bases/app.terraform.io_projects.yaml @@ -62,7 +62,7 @@ spec: type: string teamAccess: description: |- - Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, + HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, users must belong to a team that has been granted the appropriate permissions. You can assign project-specific permissions to teams. More information: @@ -70,7 +70,7 @@ spec: - https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions items: description: |- - Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, + HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, users must belong to a team that has been granted the appropriate permissions. You can assign project-specific permissions to teams. More information: diff --git a/config/crd/bases/app.terraform.io_workspaces.yaml b/config/crd/bases/app.terraform.io_workspaces.yaml index ec53a1e8..1e74ffdf 100644 --- a/config/crd/bases/app.terraform.io_workspaces.yaml +++ b/config/crd/bases/app.terraform.io_workspaces.yaml @@ -45,7 +45,7 @@ spec: properties: agentPool: description: |- - Terraform Cloud Agents allow Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. + HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure. More information: - https://developer.hashicorp.com/terraform/cloud-docs/agents properties: @@ -199,7 +199,7 @@ spec: emailAddresses: description: |- The list of email addresses that will receive notification emails. - It is only available for Terraform Enterprise users. It is not available in Terraform Cloud. + It is only available for Terraform Enterprise users. It is not available in HCP Terraform. items: type: string minItems: 1 @@ -300,7 +300,7 @@ spec: remoteStateSharing: description: |- Remote state access between workspaces. - By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state. + By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. More information: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces properties: @@ -337,12 +337,12 @@ spec: type: object runTasks: description: |- - Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. More information: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks items: description: |- - Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. + Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Only one of the fields `ID` or `Name` is allowed. At least one of the fields `ID` or `Name` is mandatory. More information: @@ -437,7 +437,7 @@ spec: type: array teamAccess: description: |- - Terraform Cloud workspaces can only be accessed by users with the correct permissions. + HCP Terraform workspaces can only be accessed by users with the correct permissions. You can manage permissions for a workspace on a per-team basis. When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, with full admin permissions. These teams' access can't be removed from a workspace. @@ -445,7 +445,7 @@ spec: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access items: description: |- - Terraform Cloud workspaces can only be accessed by users with the correct permissions. + HCP Terraform workspaces can only be accessed by users with the correct permissions. You can manage permissions for a workspace on a per-team basis. When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, with full admin permissions. These teams' access can't be removed from a workspace. @@ -717,12 +717,12 @@ spec: manually. properties: id: - description: Latest plan-only/speculative plan Terraform Cloud - run ID. + description: Latest plan-only/speculative plan HCP Terraform run + ID. type: string status: - description: Latest plan-only/speculative plan Terraform Cloud - run status. + description: Latest plan-only/speculative plan HCP Terraform run + status. type: string terraformVersion: description: The version of Terraform to use for this run. @@ -736,15 +736,15 @@ spec: description: The configuration version of this run. type: string id: - description: Current(both active and finished) Terraform Cloud - run ID. + description: Current(both active and finished) HCP Terraform run + ID. type: string outputRunID: description: Run ID of the latest run that could update the outputs. type: string status: - description: Current(both active and finished) Terraform Cloud - run status. + description: Current(both active and finished) HCP Terraform run + status. type: string type: object terraformVersion: diff --git a/controllers/agentpool_controller.go b/controllers/agentpool_controller.go index aa969fcd..0561819f 100644 --- a/controllers/agentpool_controller.go +++ b/controllers/agentpool_controller.go @@ -40,7 +40,7 @@ type agentPoolInstance struct { instance appv1alpha2.AgentPool log logr.Logger - tfClient TerraformCloudClient + tfClient HCPTerraformClient } // agentPoolSyncPeriodSeconds is how frequently the AgentPool controller should reconcile @@ -92,7 +92,7 @@ func (r *AgentPoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( err = r.getTerraformClient(ctx, &ap) if err != nil { - ap.log.Error(err, "Agent Pool Controller", "msg", "failed to get terraform cloud client") + ap.log.Error(err, "Agent Pool Controller", "msg", "failed to get HCP Terraform client") r.Recorder.Event(&ap.instance, corev1.EventTypeWarning, "TerraformClient", "Failed to get Terraform Client") return requeueAfter(requeueInterval) } diff --git a/controllers/consts.go b/controllers/consts.go index 89e398b3..d0729fa3 100644 --- a/controllers/consts.go +++ b/controllers/consts.go @@ -9,9 +9,10 @@ import ( // SHARED CONSTANTS const ( - requeueInterval = 15 * time.Second annotationTrue = "true" annotationFalse = "false" + requeueInterval = 15 * time.Second + runMessage = "Triggered by HCP Terraform Operator" ) // AGENT POOL CONTROLLER'S CONSTANTS diff --git a/controllers/module_controller.go b/controllers/module_controller.go index e8e88944..469aa894 100644 --- a/controllers/module_controller.go +++ b/controllers/module_controller.go @@ -42,7 +42,7 @@ type moduleInstance struct { instance appv1alpha2.Module log logr.Logger - tfClient TerraformCloudClient + tfClient HCPTerraformClient } var ( @@ -98,7 +98,7 @@ func (r *ModuleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr err = r.getTerraformClient(ctx, &m) if err != nil { - m.log.Error(err, "Module Controller", "msg", "failed to get terraform cloud client") + m.log.Error(err, "Module Controller", "msg", "failed to get HCP Terraform client") r.Recorder.Event(&m.instance, corev1.EventTypeWarning, "TerraformClient", "Failed to get Terraform Client") return requeueAfter(requeueInterval) } @@ -280,7 +280,7 @@ func (r *ModuleReconciler) deleteModule(ctx context.Context, m *moduleInstance) m.log.Info("Delete Module", "msg", "destroy on deletion, create a new destroy run") run, err := m.tfClient.Client.Runs.Create(ctx, tfc.RunCreateOptions{ IsDestroy: tfc.Bool(true), - Message: tfc.String("Triggered by the Kubernetes Operator"), + Message: tfc.String(runMessage), Workspace: &tfc.Workspace{ ID: m.instance.Status.WorkspaceID, }, @@ -469,7 +469,7 @@ func (r *ModuleReconciler) reconcileModule(ctx context.Context, m *moduleInstanc if needNewRun(&m.instance) { m.log.Info("Reconcile Run", "msg", "create a new run") run, err := m.tfClient.Client.Runs.Create(ctx, tfc.RunCreateOptions{ - Message: tfc.String("Triggered by the Kubernetes Operator"), + Message: tfc.String(runMessage), Workspace: workspace, }) if err != nil { diff --git a/controllers/module_controller_test.go b/controllers/module_controller_test.go index bdd543ec..9aa86631 100644 --- a/controllers/module_controller_test.go +++ b/controllers/module_controller_test.go @@ -89,10 +89,10 @@ var _ = Describe("Module controller", Ordered, func() { return errors.IsNotFound(err) }).Should(BeTrue()) - // Make sure that the Terraform Cloud workspace is deleted + // Make sure that the HCP Terraform workspace is deleted Eventually(func() bool { err := tfClient.Workspaces.Delete(ctx, organization, workspace) - // The Terraform Cloud client will return the error 'ResourceNotFound' once the workspace does not exist + // The HCP Terraform client will return the error 'ResourceNotFound' once the workspace does not exist return err == tfc.ErrResourceNotFound || err == nil }).Should(BeTrue()) }) diff --git a/controllers/project_controller.go b/controllers/project_controller.go index 798ba324..50354dab 100644 --- a/controllers/project_controller.go +++ b/controllers/project_controller.go @@ -39,7 +39,7 @@ type projectInstance struct { instance appv1alpha2.Project log logr.Logger - tfClient TerraformCloudClient + tfClient HCPTerraformClient } //+kubebuilder:rbac:groups=app.terraforp.io,resources=projects,verbs=get;list;watch;create;update;patch;delete diff --git a/controllers/project_controller_team_access_test.go b/controllers/project_controller_team_access_test.go index 4d362f2c..89f0053e 100644 --- a/controllers/project_controller_team_access_test.go +++ b/controllers/project_controller_team_access_test.go @@ -77,10 +77,10 @@ var _ = Describe("Project controller", Ordered, func() { return errors.IsNotFound(err) }).Should(BeTrue()) - // Make sure that the Terraform Cloud project is deleted + // Make sure that the HCP Terraform project is deleted Eventually(func() bool { err := tfClient.Projects.Delete(ctx, instance.Status.ID) - // The Terraform Cloud client will return the error 'ResourceNotFound' once the project does not exist + // The HCP Terraform client will return the error 'ResourceNotFound' once the project does not exist return err == tfc.ErrResourceNotFound || err == nil }).Should(BeTrue()) }) diff --git a/controllers/project_controller_test.go b/controllers/project_controller_test.go index 09f050bd..1ed2ae59 100644 --- a/controllers/project_controller_test.go +++ b/controllers/project_controller_test.go @@ -71,10 +71,10 @@ var _ = Describe("Project controller", Ordered, func() { return errors.IsNotFound(err) }).Should(BeTrue()) - // Make sure that the Terraform Cloud project is deleted + // Make sure that the HCP Terraform project is deleted Eventually(func() bool { err := tfClient.Projects.Delete(ctx, instance.Status.ID) - // The Terraform Cloud client will return the error 'ResourceNotFound' once the workspace does not exist + // The HCP Terraform client will return the error 'ResourceNotFound' once the workspace does not exist return err == tfc.ErrResourceNotFound || err == nil }).Should(BeTrue()) }) @@ -90,7 +90,7 @@ var _ = Describe("Project controller", Ordered, func() { initProjectID := instance.Status.ID - // Delete the Terraform Cloud project + // Delete the HCP Terraform project Expect(tfClient.Projects.Delete(ctx, instance.Status.ID)).Should(Succeed()) // Wait until the controller re-creates the project and updates Status.ID with a new valid project ID @@ -110,7 +110,7 @@ var _ = Describe("Project controller", Ordered, func() { instance.Spec.Name = fmt.Sprintf("%v-new", instance.Spec.Name) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace + // Wait until the controller updates HCP Terraform workspace Eventually(func() bool { prj, err := tfClient.Projects.Read(ctx, instance.Status.ID) Expect(prj).ShouldNot(BeNil()) @@ -122,14 +122,14 @@ var _ = Describe("Project controller", Ordered, func() { // Create a new Kubernetes project object and wait until the controller finishes the reconciliation createProject(instance) - // Change the Terraform Cloud project name + // Change the HCP Terraform project name prj, err := tfClient.Projects.Update(ctx, instance.Status.ID, tfc.ProjectUpdateOptions{ Name: tfc.String(fmt.Sprintf("%v-new", instance.Spec.Name)), }) Expect(prj).ShouldNot(BeNil()) Expect(err).Should(Succeed()) - // Wait until the controller updates Terraform Cloud project + // Wait until the controller updates HCP Terraform project Eventually(func() bool { err := k8sClient.Get(ctx, namespacedName, instance) Expect(err).Should(Succeed()) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index e6930684..6a9a8e28 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -111,7 +111,7 @@ var _ = BeforeSuite(func() { if terraformToken == "" { Fail("Environment variable TFC_TOKEN is required, but either not set or empty") } - // Terraform Cloud Client + // HCP Terraform Client tfClient, err = tfc.NewClient(&tfc.Config{Token: os.Getenv("TFC_TOKEN")}) Expect(err).ToNot(HaveOccurred()) Expect(tfClient).ToNot(BeNil()) diff --git a/controllers/workspace_controller.go b/controllers/workspace_controller.go index 15b3cc3d..dc5bf77f 100644 --- a/controllers/workspace_controller.go +++ b/controllers/workspace_controller.go @@ -28,7 +28,7 @@ import ( "github.com/hashicorp/terraform-cloud-operator/version" ) -type TerraformCloudClient struct { +type HCPTerraformClient struct { Client *tfc.Client } @@ -43,7 +43,7 @@ type workspaceInstance struct { instance appv1alpha2.Workspace log logr.Logger - tfClient TerraformCloudClient + tfClient HCPTerraformClient } // +kubebuilder:rbac:groups=app.terraform.io,resources=workspaces,verbs=get;list;watch;create;update;patch;delete @@ -98,7 +98,7 @@ func (r *WorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( err = r.getTerraformClient(ctx, &w) if err != nil { - w.log.Error(err, "Workspace Controller", "msg", "failed to get terraform cloud client") + w.log.Error(err, "Workspace Controller", "msg", "failed to get HCP Terraform client") r.Recorder.Event(&w.instance, corev1.EventTypeWarning, "TerraformClient", "Failed to get Terraform Client") return requeueAfter(requeueInterval) } @@ -484,7 +484,7 @@ func (r *WorkspaceReconciler) reconcileWorkspace(ctx context.Context, w *workspa r.Recorder.Eventf(&w.instance, corev1.EventTypeNormal, "ReconcileWorkspace", "Successfully created a new workspace with ID %s", w.instance.Status.WorkspaceID) } - // read the Terraform Cloud workspace to compare it with the Kubernetes object spec + // read the HCP Terraform workspace to compare it with the Kubernetes object spec workspace, err = r.readWorkspace(ctx, w) if err != nil { // 'ResourceNotFound' means that the TF Cloud workspace was removed from the TF Cloud bypass the operator @@ -506,7 +506,7 @@ func (r *WorkspaceReconciler) reconcileWorkspace(ctx context.Context, w *workspa } } - // update workspace if any changes have been made in the Kubernetes object spec or Terraform Cloud workspace + // update workspace if any changes have been made in the Kubernetes object spec or HCP Terraform workspace if needToUpdateWorkspace(&w.instance, workspace) { w.log.Info("Reconcile Workspace", "msg", fmt.Sprintf("observed and desired states are not matching, need to update workspace ID %s", w.instance.Status.WorkspaceID)) workspace, err = r.updateWorkspace(ctx, w, workspace) diff --git a/controllers/workspace_controller_run_tasks_test.go b/controllers/workspace_controller_run_tasks_test.go index e127f6c0..21629f2a 100644 --- a/controllers/workspace_controller_run_tasks_test.go +++ b/controllers/workspace_controller_run_tasks_test.go @@ -32,7 +32,7 @@ var _ = Describe("Workspace controller", Ordered, func() { // KNOWN ISSUE // // Run Task should be created dynamically before run tests and then removed once tests are done. - // However, due to a bug on the Terraform Cloud end, a Run Task cannot be removed immediately once the workspace is removed. + // However, due to a bug on the HCP Terraform end, a Run Task cannot be removed immediately once the workspace is removed. // The Run Task remains associated with the deleted workspace due to the "cool down" period of ~15 minutes. // // IPL-3276. diff --git a/controllers/workspace_controller_runs.go b/controllers/workspace_controller_runs.go index bdc327ca..d0c66d65 100644 --- a/controllers/workspace_controller_runs.go +++ b/controllers/workspace_controller_runs.go @@ -21,7 +21,7 @@ func (r *WorkspaceReconciler) reconcileRuns(ctx context.Context, w *workspaceIns runType = rt } options := tfc.RunCreateOptions{ - Message: tfc.String("Triggered by the Kubernetes Operator"), + Message: tfc.String(runMessage), Workspace: workspace, } diff --git a/controllers/workspace_controller_test.go b/controllers/workspace_controller_test.go index ba3635c2..82e388ce 100644 --- a/controllers/workspace_controller_test.go +++ b/controllers/workspace_controller_test.go @@ -82,7 +82,7 @@ var _ = Describe("Workspace controller", Ordered, func() { initWorkspaceID := instance.Status.WorkspaceID - // Delete the Terraform Cloud workspace + // Delete the HCP Terraform workspace Expect(tfClient.Workspaces.DeleteByID(ctx, instance.Status.WorkspaceID)).Should(Succeed()) // Wait until the controller re-creates the workspace and updates Status.WorkspaceID with a new valid workspace ID @@ -99,7 +99,7 @@ var _ = Describe("Workspace controller", Ordered, func() { // Create a new Kubernetes workspace object and wait until the controller finishes the reconciliation createWorkspace(instance) - // Delete the Terraform Cloud workspace + // Delete the HCP Terraform workspace Expect(tfClient.Workspaces.DeleteByID(ctx, instance.Status.WorkspaceID)).Should(Succeed()) }) @@ -111,7 +111,7 @@ var _ = Describe("Workspace controller", Ordered, func() { instance.Spec.Name = fmt.Sprintf("%v-new", instance.Spec.Name) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace + // Wait until the controller updates HCP Terraform workspace Eventually(func() bool { ws, err := tfClient.Workspaces.ReadByID(ctx, instance.Status.WorkspaceID) Expect(ws).ShouldNot(BeNil()) @@ -155,7 +155,7 @@ var _ = Describe("Workspace controller", Ordered, func() { Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace + // Wait until the controller updates HCP Terraform workspace Eventually(func() bool { ws, err := tfClient.Workspaces.ReadByID(ctx, instance.Status.WorkspaceID) Expect(ws).ShouldNot(BeNil()) @@ -178,7 +178,7 @@ var _ = Describe("Workspace controller", Ordered, func() { instance.Spec.TerraformVersion = "" Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace + // Wait until the controller updates HCP Terraform workspace Eventually(func() bool { ws, err := tfClient.Workspaces.ReadByID(ctx, instance.Status.WorkspaceID) Expect(ws).ShouldNot(BeNil()) @@ -209,7 +209,7 @@ var _ = Describe("Workspace controller", Ordered, func() { // Update the Kubernetes workspace tags instance.Spec.Tags = []appv1alpha2.Tag{"kubernetes-operator", "env:dev"} Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { wsTags := listWorkspaceTags(instance.Status.WorkspaceID) return compareTags(wsTags, expectTags) @@ -268,10 +268,10 @@ func deleteWorkspace(instance *appv1alpha2.Workspace) { return errors.IsNotFound(err) }).Should(BeTrue()) - // Make sure that the Terraform Cloud workspace is deleted + // Make sure that the HCP Terraform workspace is deleted Eventually(func() bool { err := tfClient.Workspaces.Delete(ctx, instance.Spec.Organization, instance.Spec.Name) - // The Terraform Cloud client will return the error 'ResourceNotFound' once the workspace does not exist + // The HCP Terraform client will return the error 'ResourceNotFound' once the workspace does not exist return err == tfc.ErrResourceNotFound || err == nil }).Should(BeTrue()) } diff --git a/controllers/workspace_controller_variables_test.go b/controllers/workspace_controller_variables_test.go index 7d26b0e0..577bbfce 100644 --- a/controllers/workspace_controller_variables_test.go +++ b/controllers/workspace_controller_variables_test.go @@ -120,7 +120,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryTerraform) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) @@ -178,7 +178,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryTerraform) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) @@ -216,7 +216,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryTerraform) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) @@ -256,7 +256,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryEnv) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) @@ -314,7 +314,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryEnv) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) @@ -352,7 +352,7 @@ var _ = Describe("Workspace controller", Label("Variables"), Ordered, func() { } expectVariables = workspaceVariableToTFC(instance, tfc.CategoryEnv) Expect(k8sClient.Update(ctx, instance)).Should(Succeed()) - // Wait until the controller updates Terraform Cloud workspace correcly + // Wait until the controller updates HCP Terraform workspace correcly Eventually(func() bool { variables := listWorkspaceVars(instance.Status.WorkspaceID) return compareVars(variables, expectVariables) diff --git a/docs/agentpool.md b/docs/agentpool.md index 6301ebee..b16a3163 100644 --- a/docs/agentpool.md +++ b/docs/agentpool.md @@ -1,12 +1,12 @@ # `AgentPool` -`AgentPool` controller allows managing [Terraform Cloud Agent Pools](https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools), [Terraform Cloud Agent Tokens](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#agent-api-tokens) and can perform TFC agent scaling. The Kubernetes CR acts as a single source of truth. It means that all Agent Pool changes made outside of the CR will be returned to the state specified in the CR. +`AgentPool` controller allows managing [HCP Terraform Agent Pools](https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools), [HCP Terraform Agent Tokens](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#agent-api-tokens) and can perform TFC agent scaling. The Kubernetes CR acts as a single source of truth. It means that all Agent Pool changes made outside of the CR will be returned to the state specified in the CR. ## Agent Pool Custom Resorce Please refer to the [CRD](../config/crd/bases/app.terraform.io_agentpools.yaml) and [API Reference](./api-reference.md#agentpool) to get the full list of available options. -In the following example, we are going to create a new Terraform Cloud Agent Pool with 3 agent tokens. Take a look at the [Prerequisites](./usage.md#prerequisites) before proceeding further. +In the following example, we are going to create a new HCP Terraform Agent Pool with 3 agent tokens. Take a look at the [Prerequisites](./usage.md#prerequisites) before proceeding further. 1. Create a YAML manifest. @@ -41,7 +41,7 @@ In the following example, we are going to create a new Terraform Cloud Agent Poo $ kubectl apply -f agentpool.yaml ``` -3. Wait till the Operator creates a new agent pool `agent-pool-demo` under the `kubernetes-operator` organization, 3 agent tokens: `white`, `blue`, and `red` and the deployment for agent pods `agents-of-agent-pool-demo`. You can validate that either by logging in to the Terraform Cloud WEB UI and navigating to the Agent Pools or via CLI. Soon, the agent should register themselves with Terraform Cloud and appear in the Agent Pool UI. +3. Wait till the Operator creates a new agent pool `agent-pool-demo` under the `kubernetes-operator` organization, 3 agent tokens: `white`, `blue`, and `red` and the deployment for agent pods `agents-of-agent-pool-demo`. You can validate that either by logging in to the HCP Terraform WEB UI and navigating to the Agent Pools or via CLI. Soon, the agent should register themselves with HCP Terraform and appear in the Agent Pool UI. Here is an example of the Status and Events outputs of the successfully created Agent Pool and Agent Tokens: diff --git a/docs/annotations-and-labels.md b/docs/annotations-and-labels.md index db6b50a7..55548896 100644 --- a/docs/annotations-and-labels.md +++ b/docs/annotations-and-labels.md @@ -1,4 +1,4 @@ -# Annotations and Labels used by Terraform Cloud Operator +# Annotations and Labels used by HCP Terraform Operator ## Annotations @@ -10,4 +10,4 @@ ## Labels -Terraform Cloud Operator does not use any labels. +HCP Terraform Operator does not use any labels. diff --git a/docs/api-reference.md b/docs/api-reference.md index 65effaaa..b292bbe9 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -45,7 +45,7 @@ _Appears in:_ | --- | --- | | `maxReplicas` _integer_ | MaxReplicas is the maximum number of replicas for the Agent deployment. | | `minReplicas` _integer_ | MinReplicas is the minimum number of replicas for the Agent deployment. | -| `targetWorkspaces` _[TargetWorkspace](#targetworkspace)_ | TargetWorkspaces is a list of Terraform Cloud Workspaces which
the agent pool should scale up to meet demand. When this field
is ommited the autoscaler will target all workspaces that are
associated with the AgentPool. | +| `targetWorkspaces` _[TargetWorkspace](#targetworkspace)_ | TargetWorkspaces is a list of HCP Terraform Workspaces which
the agent pool should scale up to meet demand. When this field
is ommited the autoscaler will target all workspaces that are
associated with the AgentPool. | | `cooldownPeriodSeconds` _integer_ | CooldownPeriodSeconds is the time to wait between scaling events. Defaults to 300. | @@ -107,7 +107,7 @@ _Appears in:_ -Agent Token is a secret token that a Terraform Cloud Agent is used to connect to the Terraform Cloud Agent Pool. +Agent Token is a secret token that a HCP Terraform Agent is used to connect to the HCP Terraform Agent Pool. In `spec` only the field `Name` is allowed, the rest are used in `status`. More infromation: - https://developer.hashicorp.com/terraform/cloud-docs/agents @@ -333,7 +333,7 @@ _Appears in:_ | `token` _string_ | The token of the notification. | | `triggers` _[NotificationTrigger](#notificationtrigger) array_ | The list of run events that will trigger notifications.
Trigger represents the different TFC notifications that can be sent as a run's progress transitions between different states.
There are two categories of triggers:
- Health Events: `assessment:check_failure`, `assessment:drifted`, `assessment:failed`.
- Run Events: `run:applying`, `run:completed`, `run:created`, `run:errored`, `run:needs_attention`, `run:planning`. | | `url` _string_ | The URL of the notification.
Must match pattern: `^https?://.*` | -| `emailAddresses` _string array_ | The list of email addresses that will receive notification emails.
It is only available for Terraform Enterprise users. It is not available in Terraform Cloud. | +| `emailAddresses` _string array_ | The list of email addresses that will receive notification emails.
It is only available for Terraform Enterprise users. It is not available in HCP Terraform. | | `emailUsers` _string array_ | The list of users belonging to the organization that will receive notification emails. | @@ -375,7 +375,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `id` _string_ | Latest plan-only/speculative plan Terraform Cloud run ID. | +| `id` _string_ | Latest plan-only/speculative plan HCP Terraform run ID. | | `terraformVersion` _string_ | The version of Terraform to use for this run. | @@ -413,7 +413,7 @@ _Appears in:_ | `organization` _string_ | Organization name where the Workspace will be created.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations | | `token` _[Token](#token)_ | API Token to be used for API calls. | | `name` _string_ | Name of the Project. | -| `teamAccess` _[ProjectTeamAccess](#projectteamaccess) array_ | Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization,
users must belong to a team that has been granted the appropriate permissions.
You can assign project-specific permissions to teams.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects#permissions
- https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions | +| `teamAccess` _[ProjectTeamAccess](#projectteamaccess) array_ | HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization,
users must belong to a team that has been granted the appropriate permissions.
You can assign project-specific permissions to teams.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/organize-workspaces-with-projects#permissions
- https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/permissions#project-permissions | @@ -422,7 +422,7 @@ _Appears in:_ -Terraform Cloud's access model is team-based. In order to perform an action within a Terraform Cloud organization, +HCP Terraform's access model is team-based. In order to perform an action within a HCP Terraform organization, users must belong to a team that has been granted the appropriate permissions. You can assign project-specific permissions to teams. More information: @@ -444,7 +444,7 @@ _Appears in:_ RemoteStateSharing allows remote state access between workspaces. -By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state. +By default, new workspaces in HCP Terraform do not allow other workspaces to access their state. More information: - https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces @@ -469,7 +469,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `id` _string_ | Current(both active and finished) Terraform Cloud run ID. | +| `id` _string_ | Current(both active and finished) HCP Terraform run ID. | | `configurationVersion` _string_ | The configuration version of this run. | | `outputRunID` _string_ | Run ID of the latest run that could update the outputs. | @@ -546,7 +546,7 @@ _Appears in:_ -Teams are groups of Terraform Cloud users within an organization. +Teams are groups of HCP Terraform users within an organization. If a user belongs to at least one team in an organization, they are considered a member of that organization. Only one of the fields `ID` or `Name` is allowed. At least one of the fields `ID` or `Name` is mandatory. @@ -567,7 +567,7 @@ _Appears in:_ -Terraform Cloud workspaces can only be accessed by users with the correct permissions. +HCP Terraform workspaces can only be accessed by users with the correct permissions. You can manage permissions for a workspace on a per-team basis. When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it, with full admin permissions. These teams' access can't be removed from a workspace. @@ -699,7 +699,7 @@ Workspace is the Schema for the workspaces API -AgentPool allows Terraform Cloud to communicate with isolated, private, or on-premises infrastructure. +AgentPool allows HCP Terraform to communicate with isolated, private, or on-premises infrastructure. Only one of the fields `ID` or `Name` is allowed. At least one of the fields `ID` or `Name` is mandatory. More information: @@ -737,7 +737,7 @@ _Appears in:_ -Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle. +Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Only one of the fields `ID` or `Name` is allowed. At least one of the fields `ID` or `Name` is mandatory. More information: @@ -771,16 +771,16 @@ _Appears in:_ | `applyMethod` _string_ | Define either change will be applied automatically(auto) or require an operator to confirm(manual).
Must be one of the following values: `auto`, `manual`.
Default: `manual`.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#auto-apply-and-manual-apply | | `allowDestroyPlan` _boolean_ | Allows a destroy plan to be created and applied.
Default: `true`.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#destruction-and-deletion | | `description` _string_ | Workspace description. | -| `agentPool` _[WorkspaceAgentPool](#workspaceagentpool)_ | Terraform Cloud Agents allow Terraform Cloud to communicate with isolated, private, or on-premises infrastructure.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/agents | +| `agentPool` _[WorkspaceAgentPool](#workspaceagentpool)_ | HCP Terraform Agents allow HCP Terraform to communicate with isolated, private, or on-premises infrastructure.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/agents | | `executionMode` _string_ | Define where the Terraform code will be executed.
Must be one of the following values: `agent`, `local`, `remote`.
Default: `remote`.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode | -| `runTasks` _[WorkspaceRunTask](#workspaceruntask) array_ | Run tasks allow Terraform Cloud to interact with external systems at specific points in the Terraform Cloud run lifecycle.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks | +| `runTasks` _[WorkspaceRunTask](#workspaceruntask) array_ | Run tasks allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks | | `tags` _[Tag](#tag) array_ | Workspace tags are used to help identify and group together workspaces.
Tags must be one or more characters; can include letters, numbers, colons, hyphens, and underscores; and must begin and end with a letter or number. | -| `teamAccess` _[TeamAccess](#teamaccess) array_ | Terraform Cloud workspaces can only be accessed by users with the correct permissions.
You can manage permissions for a workspace on a per-team basis.
When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it,
with full admin permissions. These teams' access can't be removed from a workspace.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access | +| `teamAccess` _[TeamAccess](#teamaccess) array_ | HCP Terraform workspaces can only be accessed by users with the correct permissions.
You can manage permissions for a workspace on a per-team basis.
When a workspace is created, only the owners team and teams with the "manage workspaces" permission can access it,
with full admin permissions. These teams' access can't be removed from a workspace.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/access | | `terraformVersion` _string_ | The version of Terraform to use for this workspace.
If not specified, the latest available version will be used.
Must match pattern: `^\\d{1}\\.\\d{1,2}\\.\\d{1,2}$`
More information:
- https://www.terraform.io/cloud-docs/workspaces/settings#terraform-version | | `workingDirectory` _string_ | The directory where Terraform will execute, specified as a relative path from the root of the configuration directory.
More information:
- https://www.terraform.io/cloud-docs/workspaces/settings#terraform-working-directory | | `environmentVariables` _[Variable](#variable) array_ | Terraform Environment variables for all plans and applies in this workspace.
Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#environment-variables | | `terraformVariables` _[Variable](#variable) array_ | Terraform variables for all plans and applies in this workspace.
Variables defined within a workspace always overwrite variables from variable sets that have the same type and the same key.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables#terraform-variables | -| `remoteStateSharing` _[RemoteStateSharing](#remotestatesharing)_ | Remote state access between workspaces.
By default, new workspaces in Terraform Cloud do not allow other workspaces to access their state.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces | +| `remoteStateSharing` _[RemoteStateSharing](#remotestatesharing)_ | Remote state access between workspaces.
By default, new workspaces in HCP Terraform do not allow other workspaces to access their state.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/state#accessing-state-from-other-workspaces | | `runTriggers` _[RunTrigger](#runtrigger) array_ | Run triggers allow you to connect this workspace to one or more source workspaces.
These connections allow runs to queue automatically in this workspace on successful apply of runs in any of the source workspaces.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers | | `versionControl` _[VersionControl](#versioncontrol)_ | Settings for the workspace's VCS repository, enabling the UI/VCS-driven run workflow.
Omit this argument to utilize the CLI-driven and API-driven workflows, where runs are not driven by webhooks on your VCS provider.
More information:
- https://www.terraform.io/cloud-docs/run/ui
- https://www.terraform.io/cloud-docs/vcs | | `sshKey` _[SSHKey](#sshkey)_ | SSH key used to clone Terraform modules.
More information:
- https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/ssh-keys | diff --git a/docs/examples/workspace-terraformVariables.yaml b/docs/examples/workspace-terraformVariables.yaml index 893dcfb0..98acbf2f 100644 --- a/docs/examples/workspace-terraformVariables.yaml +++ b/docs/examples/workspace-terraformVariables.yaml @@ -14,7 +14,7 @@ spec: key: token name: kubernetes-operator-demo # More about Terraform variables: https://developer.hashicorp.com/terraform/language/values/variables#assigning-values-to-root-module-variables - # More about Terraform Cloud Workspace Variables: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables + # More about HCP Terraform Workspace Variables: https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables terraformVariables: - name: counter hcl: true diff --git a/docs/faq.md b/docs/faq.md index 4acf5281..180d1934 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -16,19 +16,19 @@ ## General Questions -- **What is the difference between versions `v1` and `v2` of the Operator?** +- **What is the difference between Terraform Cloud Operator and HCP Terraform Operator?** - The second version of the Operator was developed to address some major concerns that we encountered in the first version. + The HCP Terraform Operator was developed to address some major concerns that we encountered in the first version. - Here is the list of major improvements in the version 2: + Here is the list of major improvements in the HCP Terraform Operator compared to its predecessor, the [Terraform Cloud Operator](https://github.com/hashicorp/terraform-k8s): - A new operator option `--namespace` allows configuration of namespaces to watch. It can be one of the following: all, single, or multiple namespaces. By default, the Operator watches all namespaces, and as your setup grows, you can have multiple deployments of the Operator to better handle the load. - - A new operator option `--sync-period` allows configuration of the minimum frequency at which all watched resources are reconciled. This allows faster synchronization of the state between Custom Resources and Terraform Cloud. + - A new operator option `--sync-period` allows configuration of the minimum frequency at which all watched resources are reconciled. This allows faster synchronization of the state between Custom Resources and HCP Terraform. - - The Operator manages a Terraform Cloud client for each Custom Resource. This means that a single deployment of the Operator can work across multiple Terraform Cloud organizations. + - The Operator manages a HCP Terraform client for each Custom Resource. This means that a single deployment of the Operator can work across multiple HCP Terraform organizations. - - The Operator consists of multiple controllers that manage different Terraform Cloud resources. This provides additional flexibility, e.g. a module can be executed in a workspace that is not managed by the Operator. More details about controllers you can find in the [README](../README.md) file. + - The Operator consists of multiple controllers that manage different HCP Terraform resources. This provides additional flexibility, e.g. a module can be executed in a workspace that is not managed by the Operator. More details about controllers you can find in the [README](../README.md) file. - Each controller has the option to manage the number of workers it has. By default, each controller has 1 worker. A worker is a thread that runs the control loop for a given Custom Resource. The more workers the controller has, the more Customer Resources it can handle concurrently. This improves the Operator's performance. Please refer to the [performance FAQ section](./faq.md#performance) to better understand the pros and cons. @@ -38,7 +38,7 @@ - Controllers produce event messages for each Custom Resource. - - Better coverage of features supported by Terraform Cloud, more information [here](./features.md). + - Better coverage of features supported by HCP Terraform, more information [here](https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes#supported-terraform-cloud-features). - Better test coverage. @@ -62,7 +62,7 @@ - **What will happen if I have multiple deployments of the Operator watching the same namespace(s)?** - Unexpected behaviour is likely when multiple deployments of the operator try to reconcile the same resource. Most likely you will notice that Customer Resource objects are constantly reconciled and this can cause constant updates of Terraform Cloud objects. For example, the `Module` controller might trigger a new run every reconciliation and because of that the Run queue could grow infinitely. + Unexpected behaviour is likely when multiple deployments of the operator try to reconcile the same resource. Most likely you will notice that Customer Resource objects are constantly reconciled and this can cause constant updates of HCP Terraform objects. For example, the `Module` controller might trigger a new run every reconciliation and because of that the Run queue could grow infinitely. It is definitely better to avoid such situations. @@ -76,15 +76,15 @@ - **Does the Operator work with Terraform Enterprise / TFE?** - Yes, the operator can be configured to use the custom TFE API endpoint using the [`operator.tfeAddress`](../charts/terraform-cloud-operator/README.md#values) value in the Helm chart. This value should be a valid URL including the protocol(`https://`), for the API of a Terraform Enterprise instance. Once the `operator.tfeAddress` attribute is set, the operator will no longer access the public Terraform Cloud, but rather the private Terraform Enterprise instance. + Yes, the operator can be configured to use the custom TFE API endpoint using the [`operator.tfeAddress`](../charts/terraform-cloud-operator/README.md#values) value in the Helm chart. This value should be a valid URL including the protocol(`https://`), for the API of a Terraform Enterprise instance. Once the `operator.tfeAddress` attribute is set, the operator will no longer access the public HCP Terraform, but rather the private Terraform Enterprise instance. -- **What can I do if the Operator cannot get a Terraform Cloud client due to a TLS certificate issue?** +- **What can I do if the Operator cannot get a HCP Terraform client due to a TLS certificate issue?** There are multiple reasons why you may observe an error message in logs that indicate an issue with a TLS certificate. The error message example: _*tls: failed to verify certificate: x509: certificate has expired or is not yet valid*_ * You have a Terraform Enterprise instance and use the TLS certificate that is signed by a Certificate Authority that is not recognized by the Operator. In this case, you can use the value `customCAcertificates` of the Helm chart to specify a Certificate Authority bundle to validate API TLS certificates. * You have a Terraform Enterprise instance and the TLS certificate has expired. In this case, you can use the value `operator.skipTLSVerify` of the Helm chart to skip the TLS validation. **Be aware of the potential security risks.** - * There is a TLS proxy between the Operator and Terraform Cloud / Enterprise instance that is installed by your security team to decrypt TLS connections. In this case, you can use the value `operator.skipTLSVerify` or `customCAcertificates` of the Helm chart to skip the TLS validation or specify a Certificate Authority bundle to validate API TLS certificates, respectively. Alternatively, you could talk to your security team to add an expection to this connection. + * There is a TLS proxy between the Operator and HCP Terraform / Enterprise instance that is installed by your security team to decrypt TLS connections. In this case, you can use the value `operator.skipTLSVerify` or `customCAcertificates` of the Helm chart to skip the TLS validation or specify a Certificate Authority bundle to validate API TLS certificates, respectively. Alternatively, you could talk to your security team to add an expection to this connection. - **What does `kube-rbac-proxy` do?** @@ -142,7 +142,7 @@ - **How many Custom Resources can be managed by a single deployment of the Operator?** - In theory, a single deployment of the Operator can manage thousands of resources. However, the Operator's performance depends on the number of API calls it does and the Terraform Cloud API [rate limit](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#rate-limiting) for the token used. + In theory, a single deployment of the Operator can manage thousands of resources. However, the Operator's performance depends on the number of API calls it does and the HCP Terraform API [rate limit](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#rate-limiting) for the token used. The number of API calls the Operator does depends on multiple factors: @@ -152,13 +152,13 @@ - The type of the resource. - - The Terraform Cloud features being used. + - The HCP Terraform features being used. - With the default values of `sync-period` (5 minutes) and `*-workers` (1 worker per controller), we recommend managing **100 resources per token**. This number can vary based on previously mentioned factors. This number can be updated later to accommodate changes in the Terraform Cloud API. + With the default values of `sync-period` (5 minutes) and `*-workers` (1 worker per controller), we recommend managing **100 resources per token**. This number can vary based on previously mentioned factors. This number can be updated later to accommodate changes in the HCP Terraform API. - **What can be done to improve performance?** - The Operator allows you to refer to Terraform Cloud resources by their name or ID. For example, the `Workspace` controller allows you to specify another workspace to use as a [Run Trigger](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers). It accepts a list of workspaces that will be triggered where each item can either be the `ID` or `Name` of the workspace. When you use a name, the Operator does an API call on each reconciliation in order to get the ID of the target Workspace. This makes configurations easier to read, but causes more API calls to be as the operator needs to figure out what the ID of workspace is from the name. + The Operator allows you to refer to HCP Terraform resources by their name or ID. For example, the `Workspace` controller allows you to specify another workspace to use as a [Run Trigger](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-triggers). It accepts a list of workspaces that will be triggered where each item can either be the `ID` or `Name` of the workspace. When you use a name, the Operator does an API call on each reconciliation in order to get the ID of the target Workspace. This makes configurations easier to read, but causes more API calls to be as the operator needs to figure out what the ID of workspace is from the name. One way to improve performance is to use the referred object ID. In this example, by the Workspace ID. In this case, the Operator will use the ID directly without trying to resolve it. @@ -189,7 +189,7 @@ - **What will happen if I delete an Agent Pool Customer Resource?** - The Agent Pool controller will delete Agent Pool from Terraform Cloud, as well as the Kubernetes Secret that stores the Agent Tokens that were generated for this pool. + The Agent Pool controller will delete Agent Pool from HCP Terraform, as well as the Kubernetes Secret that stores the Agent Tokens that were generated for this pool. - **What triggers Agents scaling?** diff --git a/docs/module.md b/docs/module.md index dff78313..76ff815f 100644 --- a/docs/module.md +++ b/docs/module.md @@ -1,6 +1,6 @@ # `Module` -`Module` controller allows executing arbitrary Terraform Modules code in Terraform Cloud Workspace via Kubernetes Custom Resources. +`Module` controller allows executing arbitrary Terraform Modules code in HCP Terraform Workspace via Kubernetes Custom Resources. Please refer to the [CRD](../config/crd/bases/app.terraform.io_modules.yaml) and [API Reference](./api-reference.md#module) to get the full list of available options. diff --git a/docs/project.md b/docs/project.md index a39fd7d9..058bf565 100644 --- a/docs/project.md +++ b/docs/project.md @@ -1,6 +1,6 @@ # `Project` -`Project` controller allows managing Terraform Cloud Projects via Kubernetes Custom Resources. +`Project` controller allows managing HCP Terraform Projects via Kubernetes Custom Resources. Please refer to the [CRD](../config/crd/bases/app.terraform.io_projects.yaml) and [API Reference](./api-reference.md#project) to get the full list of available options. diff --git a/docs/usage.md b/docs/usage.md index 5ea2b15e..dbc60203 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -2,9 +2,9 @@ ## Prerequisites -- The Operator requires a Terraform Cloud [organization](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations) name and a [team 'owners' token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#team-api-tokens) in order to access the Terraform Cloud API. +- The Operator requires a HCP Terraform [organization](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/organizations) name and a [team 'owners' token](https://developer.hashicorp.com/terraform/cloud-docs/users-teams-organizations/api-tokens#team-api-tokens) in order to access the HCP Terraform API. - The API token must be stored in a Kubernetes secret. -- A single instance of the Operator can manage Terraform Cloud resources for different organizations and/or different API tokens. For that purpose, the organization name and a reference to the corresponding Kubernetes secret are shipped within the custom resource. +- A single instance of the Operator can manage HCP Terraform resources for different organizations and/or different API tokens. For that purpose, the organization name and a reference to the corresponding Kubernetes secret are shipped within the custom resource. Below are examples of how to create a Kubernetes secret and store the API token there. The examples assume that the API token is already known. diff --git a/main.go b/main.go index f9e01ce9..70a11676 100644 --- a/main.go +++ b/main.go @@ -201,7 +201,7 @@ func main() { os.Exit(1) } - setupLog.Info(fmt.Sprintf("Terraform Cloud Operator Version: %s", version.Version)) + setupLog.Info(fmt.Sprintf("HCP Terraform Operator Version: %s", version.Version)) setupLog.Info("starting manager") if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { setupLog.Error(err, "problem running manager") diff --git a/version/version.go b/version/version.go index 9d633c2b..fa46db17 100644 --- a/version/version.go +++ b/version/version.go @@ -9,5 +9,8 @@ var ( // The version should remain as 'X.0.0-dev' throughout the entire development cycle of a specific major version X. // The minor and patch components should remain unchanged. Version = "2.0.0-dev" - UserAgent = fmt.Sprintf("TerraformCloudOperator/v%s", Version) + UserAgent = fmt.Sprintf("HCPTerraformOperator/v%s", Version) + // The user agent 'TerraformCloudOperator' was only used for version 2.3.0 and will remain here for visibility. + // It is not commented out to ensure that future generations will not miss it. + _ = fmt.Sprintf("TerraformCloudOperator/v%s", Version) )