|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "env0_agent_pool Resource - terraform-provider-env0" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +# env0_agent_pool (Resource) |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +# Create agent pool and install agent using helm chart |
| 17 | +
|
| 18 | +variable "agent_custom_configuration" { |
| 19 | + type = map(any) |
| 20 | + description = "See https://docs.envzero.com/guides/admin-guide/self-hosted-kubernetes-agent/custom-optional-configuration" |
| 21 | +} |
| 22 | +
|
| 23 | +resource "env0_agent_pool" "default" { |
| 24 | + name = "default sefl-hosted agent" |
| 25 | +} |
| 26 | +
|
| 27 | +resource "env0_agent_secret" "first" { |
| 28 | + agent_id = env0_agent_pool.default.id |
| 29 | +} |
| 30 | +
|
| 31 | +resource "helm_release" "this" { |
| 32 | + repository = "https://env0.github.io/self-hosted" |
| 33 | + chart = "env0-agent" |
| 34 | +
|
| 35 | + namespace = "env0-agent-default" |
| 36 | + name = "env0-agent-default" |
| 37 | +
|
| 38 | + create_namespace = true |
| 39 | + timeout = 600 |
| 40 | +
|
| 41 | + set_sensitive { |
| 42 | + name = "agentAccessToken" |
| 43 | + value = env0_agent_secret.first.secret |
| 44 | + } |
| 45 | +
|
| 46 | + values = [ |
| 47 | + yamlencode(var.agent_custom_configuration) |
| 48 | + ] |
| 49 | +} |
| 50 | +``` |
| 51 | + |
| 52 | +```terraform |
| 53 | +# Hosting deployment logs in your AWS account |
| 54 | +
|
| 55 | +data "aws_caller_identity" "this" {} |
| 56 | +data "aws_region" "this" {} |
| 57 | +data "env0_organization" "this" {} |
| 58 | +
|
| 59 | +resource "env0_agent_pool" "agent_with_logs_config" { |
| 60 | + name = "agent with logs config" |
| 61 | + logs { |
| 62 | + account_id = data.aws_caller_identity.this.account_id |
| 63 | + region = data.aws_region.this.region |
| 64 | + external_id = data.env0_organization.this.id |
| 65 | + } |
| 66 | +} |
| 67 | +
|
| 68 | +module "agent_logs" { |
| 69 | + source = "github.com/env0/k8s-modules?ref=v1.1.0//log-storage/aws/dynamodb" |
| 70 | +
|
| 71 | + agent_key = env0_agent_pool.agent_with_logs_config.id |
| 72 | + external_id = data.env0_organization.this.id |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +<!-- schema generated by tfplugindocs --> |
| 77 | +## Schema |
| 78 | + |
| 79 | +### Required |
| 80 | + |
| 81 | +- `name` (String) the agent pool name |
| 82 | + |
| 83 | +### Optional |
| 84 | + |
| 85 | +- `description` (String) the agent pool description |
| 86 | +- `logs` (Block List, Max: 1) self-hosted logs configuration (dynamo self-hosted) (see [below for nested schema](#nestedblock--logs)) |
| 87 | + |
| 88 | +### Read-Only |
| 89 | + |
| 90 | +- `agent_key` (String, Deprecated) the agent key identifier. Deprecated: use id instead |
| 91 | +- `id` (String) The ID of this resource. |
| 92 | + |
| 93 | +<a id="nestedblock--logs"></a> |
| 94 | +### Nested Schema for `logs` |
| 95 | + |
| 96 | +Required: |
| 97 | + |
| 98 | +- `account_id` (String) the AWS account id for self-hosted logs |
| 99 | +- `external_id` (String) the external id for self-hosted logs |
| 100 | +- `region` (String) the AWS region for self-hosted logs |
0 commit comments