Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update readme and 'Agent' spelling refactor to 'agent' #8

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# terraform-google-terraform-cloud-agents

Creates self hosted Terraform Cloud Agents on Google Cloud. Using these Terraform modules you can quickly deploy agent pools for your Terraform Cloud workflows.
Creates self hosted Terraform Cloud agents on Google Cloud. Using these Terraform modules you can quickly deploy agent pools for your Terraform Cloud workflows.

## [Terraform Cloud Agents on GKE](modules/tfc-agent-gke/README.md)
## [Terraform Cloud agents on GKE](modules/tfc-agent-gke/README.md)

The `tfc-agent-gke` module provisions the resources required to deploy self hosted Terraform Cloud Agents on Google Cloud infrastructure using Google Kubernetes Engine (GKE).
The `tfc-agent-gke` module provisions the resources required to deploy self hosted Terraform Cloud agents on Google Cloud infrastructure using Google Kubernetes Engine (GKE).

This includes

Expand All @@ -15,11 +15,12 @@ This includes

*Below are some examples:*

- [Terraform Cloud Agents on GKE](examples/tfc-agent-gke-simple/README.md) - This example shows how to deploy a simple GKE self hosted Terraform Cloud Agent.
- [Terraform Cloud agents on GKE](examples/tfc-agent-gke-simple/README.md) - This example shows how to deploy the Terraform Cloud agent on GKE.
- [Terraform Cloud agents on GKE with a custom image](examples/tfc-agent-gke-custom/README.md) - This example shows how to deploy a custom built Terraform Cloud agent image on GKE.

## [Terraform Cloud Agents on Managed Instance Groups using VMs](modules/tfc-agent-mig-vm/README.md)
## [Terraform Cloud agents on Managed Instance Groups using VMs](modules/tfc-agent-mig-vm/README.md)

The `tfc-agent-mig-vm` module provisions the resources required to deploy Terrform Cloud Agent on Google Cloud infrastructure using Managed Instance Groups.
The `tfc-agent-mig-vm` module provisions the resources required to deploy Terrform Cloud agent on Google Cloud infrastructure using Managed Instance Groups (MIG).

This includes

Expand All @@ -36,11 +37,12 @@ Deployment of Managed Instance Groups requires a [Google VM image](https://cloud

*Below are some examples:*

- [Terraform Cloud Agents on MIG VMs](examples/tfc-agent-mig-native-simple/README.md) - This example shows how to deploy a MIG Terraform Cloud Agent with startup scripts.
- [Terraform Cloud agents on MIG VMs](examples/tfc-agent-mig-vm-simple/README.md) - This example shows how to deploy the Terraform Cloud agent on MIG with startup scripts.
- [Terraform Cloud agents on MIG VMs from Packer image](examples/tfc-agent-mig-vm-packer/README.md) - This example shows how to deploy the Terraform Cloud agent with an image pre-baked using Packer.

## [Terraform Cloud Agents Instance Groups using Container VMs](modules/tfc-agent-mig-container-vm/README.md)
## [Terraform Cloud agents Instance Groups using Container VMs](modules/tfc-agent-mig-container-vm/README.md)

The `tfc-agent-mig-container-vm` module provisions the resources required to deploy Terraform Cloud Agents on Google Cloud infrastructure using Managed Instance Groups and Container VMs.
The `tfc-agent-mig-container-vm` module provisions the resources required to deploy Terraform Cloud agents on Google Cloud infrastructure using Managed Instance Groups and Container VMs.

This includes

Expand All @@ -53,18 +55,37 @@ This includes

*Below are some examples:*

- [Terraform Cloud Agents on MIG Container VMs](examples/tfc-agent-mig-container-vm-simple/README.md) - This example shows how to deploy a Terraform Cloud Agent on MIG Container VMs.
- [Terraform Cloud agents on MIG Container VMs](examples/tfc-agent-mig-container-vm-simple/README.md) - This example shows how to deploy a Terraform Cloud agent on MIG Container VMs.

## [Terraform Cloud OIDC (Dynamic Credentials)](modules/tfc-oidc/README.md)

The `tfc-oidc` module handles the opinionated creation of infrastructure necessary to configure [Workload Identity pools](https://cloud.google.com/iam/docs/workload-identity-federation#pools) and [providers](https://cloud.google.com/iam/docs/workload-identity-federation#providers) for authenticating to GCP using [Terraform Cloud Dynamic Credentials](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/dynamic-provider-credentials/gcp-configuration).

This includes

- Enabling necessary APIs
- Creation of a Workload Identity pool
- Configuring a Workload Identity provider
- Granting external identities necessary IAM roles on Service Accounts

*Below are some examples:*

- [OIDC Simple](examples/oidc-simple/README.md) - This example shows how to use this module along with a Service Account to access storage buckets.

## Requirements

These sections describe requirements for using this module.

### Software

The following dependencies must be available:
The following dependencies might be required based on the module being used:

- [Terraform][terraform] v0.13
- [Terraform CLI][terraform-cli]
- [Terraform Provider for GCP][terraform-provider-gcp]
- [Terraform Provider for GCP beta][terraform-provider-gcp-beta]
- [Google Cloud CLI][gcloud-cli]
- [Kubernetes Provider][k8s-provider]
- [Random Provider][random-provider]

## Contributing

Expand All @@ -74,7 +95,11 @@ information on contributing to this module.
[iam-module]: https://registry.terraform.io/modules/terraform-google-modules/iam/google
[project-factory-module]: https://registry.terraform.io/modules/terraform-google-modules/project-factory/google
[terraform-provider-gcp]: https://www.terraform.io/docs/providers/google/index.html
[terraform]: https://www.terraform.io/downloads.html
[terraform-provider-gcp-beta]: https://registry.terraform.io/providers/hashicorp/google-beta/latest
[terraform-cli]: https://www.terraform.io/downloads.html
[gcloud-cli]: https://cloud.google.com/sdk/gcloud
[k8s-provider]: https://registry.terraform.io/providers/hashicorp/kubernetes/latest
[random-provider]: https://registry.terraform.io/providers/hashicorp/random/latest

## Security Disclosures

Expand Down
4 changes: 2 additions & 2 deletions examples/tfc-agent-gke-custom/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Simple Self Hosted Terraform Cloud agent on GKE
# Custom Self Hosted Terraform Cloud agent on GKE

## Overview

This example shows how to deploy Terraform Cloud agents on Google Kubernetes Engine (GKE) using the `tfc-agent-gke` module.
This example shows how to deploy a custom Terraform Cloud agent image on Google Kubernetes Engine (GKE) using the `tfc-agent-gke` module.

It creates the Terraform Cloud agent pool, registers the agent to that pool and creates a project and an empty workspace with the agent attached.

Expand Down
11 changes: 5 additions & 6 deletions examples/tfc-agent-mig-vm-packer/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Example Terraform Cloud Agent that support Docker Workflows
# Example Terraform Cloud agent from Packer image

## Overview

This example showcases how to use Packer to pre-bake a Google VM Image with the necessary toolchain including Terraform Cloud Agent and deploy this image using the `tfc-agent-mig` module.
This example showcases how to use Packer to pre-bake a Google VM Image with the necessary toolchain including Terraform Cloud agent and deploy this image using the `tfc-agent-mig` module.

We use startup script to register the runner when it comes online.

In this example, Packer creates a VM image that has the following:

- curl
- jq
- Docker
- Terraform Cloud Agent
- Terraform Cloud agent

## Steps to deploy this example

Expand Down Expand Up @@ -58,9 +57,9 @@ In this example, Packer creates a VM image that has the following:
terraform apply
```

1. Your Terraform Cloud Agents should become active at Organization Setting > Security > Agents.
1. Your Terraform Cloud agents should become active at Organization Setting > Security > Agents.

1. Create additonal workspaces or use the existing workspace to run Terraform through the Terraform Cloud Agent.[Click here for more info on running the workspace](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace_run#example-usage).
1. Create additonal workspaces or use the existing workspace to run Terraform through the Terraform Cloud agent.[Click here for more info on running the workspace](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/workspace_run#example-usage).

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand Down
4 changes: 2 additions & 2 deletions modules/tfc-agent-gke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ This example shows how to deploy a custom Terraform Cloud agent image with GKE.
| tfc\_agent\_cpu\_request | CPU request for the Terraform Cloud agent container | `string` | `"2"` | no |
| tfc\_agent\_image | The Terraform Cloud agent image to use | `string` | `"hashicorp/tfc-agent:latest"` | no |
| tfc\_agent\_k8s\_secrets | Name for the k8s secret required to configure TFC agent on GKE | `string` | `"tfc-agent-k8s-secrets"` | no |
| tfc\_agent\_max\_replicas | Maximum replicas for the Terraform Cloud Agent pod autoscaler | `string` | `"10"` | no |
| tfc\_agent\_max\_replicas | Maximum replicas for the Terraform Cloud agent pod autoscaler | `string` | `"10"` | no |
| tfc\_agent\_memory\_request | Memory request for the Terraform Cloud agent container | `string` | `"2Gi"` | no |
| tfc\_agent\_min\_replicas | Minimum replicas for the Terraform Cloud Agent pod autoscaler | `string` | `"1"` | no |
| tfc\_agent\_min\_replicas | Minimum replicas for the Terraform Cloud agent pod autoscaler | `string` | `"1"` | no |
| tfc\_agent\_name\_prefix | This name may be used in the Terraform Cloud user interface to help easily identify the agent | `string` | `"tfc-agent-k8s"` | no |
| tfc\_agent\_single | Enable single mode. This causes the agent to handle at most one job and<br>immediately exit thereafter. Useful for running agents as ephemeral<br>containers, VMs, or other isolated contexts with a higher-level scheduler<br>or process supervisor. | `bool` | `false` | no |
| tfc\_agent\_token | Terraform Cloud agent token. (Organization Settings >> Agents) | `string` | n/a | yes |
Expand Down
4 changes: 2 additions & 2 deletions modules/tfc-agent-gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ variable "tfc_agent_token" {

variable "tfc_agent_min_replicas" {
type = string
description = "Minimum replicas for the Terraform Cloud Agent pod autoscaler"
description = "Minimum replicas for the Terraform Cloud agent pod autoscaler"
default = "1"
}

variable "tfc_agent_max_replicas" {
type = string
description = "Maximum replicas for the Terraform Cloud Agent pod autoscaler"
description = "Maximum replicas for the Terraform Cloud agent pod autoscaler"
default = "10"
}
2 changes: 1 addition & 1 deletion modules/tfc-agent-mig-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This example shows how to deploy a MIG self hosted Terraform Cloud agent bootstr
| tfc\_agent\_secret | The secret id for storing the Terraform Cloud agent secret | `string` | `"tfc-agent"` | no |
| tfc\_agent\_single | Enable single mode. This causes the agent to handle at most one job and<br>immediately exit thereafter. Useful for running agents as ephemeral<br>containers, VMs, or other isolated contexts with a higher-level scheduler<br>or process supervisor | `bool` | `false` | no |
| tfc\_agent\_token | Terraform Cloud agent token. (Organization Settings >> Agents) | `string` | n/a | yes |
| tfc\_agent\_version | Terraform Cloud Agent version to install | `string` | `"1.12.0"` | no |
| tfc\_agent\_version | Terraform Cloud agent version to install | `string` | `"1.12.0"` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion modules/tfc-agent-mig-vm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ variable "tfc_agent_labels" {

variable "tfc_agent_version" {
type = string
description = "Terraform Cloud Agent version to install"
description = "Terraform Cloud agent version to install"
default = "1.12.0"
}

Expand Down