Skip to main content

Reference for the teleport-agent-aws Terraform module

Report an Issue

This page lists the input fields and output values of the teleport-agent-aws Terraform module.

Source Code: github.com/gravitational/teleport/tree/master/integrations/terraform-modules/teleport/agent/aws

Teleport Agent Services Deployment on AWS ECS

This module deploys one or more Teleport services to AWS as an ECS task. It is not intended to deploy a Teleport cluster or its Auth Service and Proxy Service control plane. This module does not provision the persistent backend and audit event storage, load balancing, DNS, or TLS certificates required to operate a self-hosted Teleport cluster.

Any of the following services may be registered with an existing Teleport cluster using this module:

  • Teleport Application Service
  • Teleport Database Service
  • Teleport Discovery Service
  • Teleport Jamf Service
  • Teleport Kubernetes Service

Prerequisites

  • An existing Teleport cluster with Auth Service and Proxy Service
  • A reachable Teleport Proxy Service endpoint
  • A supported join method and credentials that the agent can use to join the cluster. The example creates an IAM join token using the Teleport Terraform provider. See the Join Methods and Token Reference for supported join methods and creating tokens.

Examples

Refer to the examples for example usage of this module.

How to get help

If you're having trouble, check out our GitHub Discussions.

For bugs related to this code, please open an issue.

Requirements

NameVersion
terraform>= 1.5.7
aws>= 6.0
http>= 3.0
random>= 3.0

Providers

NameVersion
aws>= 6.0
http>= 3.0
random>= 3.0

Modules

No modules.

Resources

NameType
aws_cloudwatch_log_group.thisresource
aws_ecs_cluster.teleport_agentresource
aws_ecs_service.teleport_agentresource
aws_ecs_task_definition.teleport_agentresource
aws_iam_role.ecs_executionresource
aws_iam_role.ecs_taskresource
aws_iam_role_policy.ecs_executionresource
aws_iam_role_policy.ecs_taskresource
aws_security_group.teleport_agentresource
aws_vpc_security_group_egress_rule.allow_all_outbound_from_teleport_agentresource
random_string.name_suffixresource
aws_caller_identity.thisdata source
aws_iam_policy_document.ecs_executiondata source
aws_iam_policy_document.ecs_execution_trustdata source
aws_iam_policy_document.ecs_task_inline_policydata source
aws_iam_policy_document.ecs_task_trustdata source
aws_partition.thisdata source
aws_region.thisdata source
aws_subnet.teleport_agentdata source
http_http.managed_updatesdata source

Inputs

NameDescriptionTypeDefaultRequired
apply_aws_tagsAdditional AWS tags to apply to all created AWS resources.map(string){}no
assign_public_ipWhether to assign public IP addresses to Teleport ECS tasks. If this is set to true, then var.ecs_service_subnets must be public subnets (route to an internet gateway). Otherwise, var.ecs_service_subnets must be private subnets (route to a NAT gateway).boolfalseno
createToggle creation of all resources.booltrueno
create_security_groupWhether to create a security group for the Teleport ECS tasks.booltrueno
ecs_cluster_nameName of the ECS cluster.string"teleport"no
ecs_cluster_use_name_prefixDetermines whether var.ecs_cluster_name is used as a prefix of the ECS cluster name.booltrueno
ecs_service_nameName of the ECS service.string"teleport"no
ecs_service_subnetsSubnet IDs where Teleport will be deployed. If var.assign_public_ip is true, then all of these subnets must be public subnets (route to an internet gateway). If var.assign_public_ip is false, then all of these subnets must be private subnets (route to a NAT gateway).list(string)n/ayes
ecs_task_cloudwatch_log_group_kms_key_idKMS key ID or ARN used to encrypt the ECS task CloudWatch log group. When null, CloudWatch Logs uses its default encryption key.stringnullno
ecs_task_cloudwatch_log_group_nameName for the ECS task CloudWatch log group.string"ecs-teleport"no
ecs_task_cloudwatch_log_group_regionAWS region for the ECS task CloudWatch log group. Defaults to the AWS provider region.stringnullno
ecs_task_cloudwatch_log_group_retention_daysNumber of days to retain logs in the ECS task CloudWatch log group.number30no
ecs_task_cloudwatch_log_group_skip_destroyWhether to preserve the ECS task CloudWatch log group when destroying module resources. Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state.boolfalseno
ecs_task_cloudwatch_log_group_use_name_prefixDetermines whether var.ecs_task_cloudwatch_log_group_name is used as a prefix of the ECS task CloudWatch log group name.booltrueno
ecs_task_cpuNumber of cpu units used by the ECS task.number2048no
ecs_task_definition_nameName of the ECS task.string"teleport"no
ecs_task_definition_use_name_prefixDetermines whether var.ecs_task_definition_name is used as a prefix of the ECS task definition name.booltrueno
ecs_task_desired_countDesired number of Teleport ECS tasks to run.number2no
ecs_task_force_new_deploymentSet to true to force the ECS service to redeploy tasks without configuration changes.boolfalseno
ecs_task_memoryAmount (in MiB) of memory used by the ECS task.number4096no
ecs_task_role_inline_policyOptional JSON policy document to merge into the inline policy attached to the ECS task IAM role.stringnullno
ecs_task_role_self_assumption_allowedWhether the ECS task IAM role can assume itself.booltrueno
environment_varsEnvironment variables to set on the Teleport ECS container.map(string){}no
managed_updates_enabledWhether to resolve the Teleport version from the configured Managed Updates endpoint when applying this module.booltrueno
managed_updates_groupUpdate group to query through the v2 Managed Updates endpoint.string"default"no
security_group_idsAdditional security group IDs to attach to the Teleport ECS tasks.list(string)[]no
teleport_configTeleport configuration. Write the configuration using native Terraform syntax. Warning: sensitive data, such as static join tokens, is visible to anyone who can read the task definition.anyn/ayes
teleport_container_imageContainer image used for Teleport ECS tasks.string"public.ecr.aws/gravitational/teleport-ent-distroless"no
teleport_version_overrideteleport_version_override is intended for development and MUST NOT be used to control the Teleport version in a typical deployment. This module is designed to run a specific Teleport version. You will face compatibility issues trying to run a different Teleport version with it. If you want to run Teleport version X.Y.Z, you should adjust the module version to X.Y.Z instead.stringnullno
vpc_idVPC ID where Teleport will be deployed.stringn/ayes

Outputs

NameDescription
ecs_cluster_arnARN of the ECS cluster for the Teleport ECS service.
ecs_cluster_nameName of the ECS cluster for the Teleport ECS service.
ecs_execution_role_arnThe ARN of the execution IAM role for the Teleport ECS task.
ecs_execution_role_nameThe name of the execution IAM role for the Teleport ECS task.
ecs_service_arnARN of the Teleport ECS service.
ecs_service_nameName of the Teleport ECS service.
ecs_task_cloudwatch_log_group_arnARN of the CloudWatch log group for the Teleport ECS task.
ecs_task_cloudwatch_log_group_nameName of the CloudWatch log group for the Teleport ECS task.
ecs_task_definition_arnARN of the Teleport ECS task definition.
ecs_task_role_arnThe ARN of the task IAM role for the Teleport ECS task.
ecs_task_role_nameThe name of the task IAM role for the Teleport ECS task.
security_group_idSecurity group ID created for the Teleport ECS service.
teleport_provision_token_allow_aws_arnA value that can be used with a Teleport IAM join token to allow the ECS cluster to join the Teleport cluster using its IAM credentials.