tf-cloud-agents

aws-ia/tf-cloud-agents/aws

Terraform Module HCL AWS ✓ Verified

Creates self-hosted Terraform Cloud Agent on AWS (https://registry.terraform.io/modules/aws-ia/tf-cloud-agents/aws/latest)

Install
module "tf-cloud-agents" {
source = "aws-ia/tf-cloud-agents/aws"
version = "0.0.2"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform Cloud Agent on Amazon ECS This solution creates self-hosted HashiCorp Cloud Platform (HCP) Terraform agent on Amazon ECS cluster. HCP Terraform allows you to manage isolated, private, or on-premises infrastructure using self-hosted HCP Terraform agents. The agent polls HCP Terraform or HCP Terraform Enterprise for any changes to your configuration and executes the changes locally, so you do not need to allow public ingress traffic to your resources. Agents allow you to control infrastructure in private environments without modifying your network perimeter. Architecture !Terraform Cloud Agent on Amazon ECS architecture Prerequisites To use this module you need to have the following: 1. HashiCorp Cloud Platform (HCP) Terraform subscription 2. Terraform API token with permission to

Inputs (28)
NameTypeDescriptionDefault
hcp_terraform_org_namestringThe name of the HCP Terraform or HCP Terraform Enterprise organization where the required
subnet_idslist(string)IDs of the subnet(s) where agents can be deployed required
namestringA name to apply to resources. The combination of `name` and `hcp_terraform_org_n required
vpc_idstringID of the VPC where the cluster is running. required
agent_memorynumberThe amount of memory, in MB, allocated to the agent container(s).512
agent_imagestringThe Docker image to launch."hashicorp/tfc-agent:latest"
agent_auto_updatestringWhether the agent should auto-update. Valid values are minor, patch, and disable"minor"
task_policy_arnslist(string)ARN(s) of IAM policies to attach to the agent task. Determines what actions the []
kms_key_arnstringThe ARN of the KMS key to create. If empty, a new key will be created.""
assign_public_ipboolWhether to assign a public IP address to the ECS tasks. Set to true when using pfalse
hcp_terraform_addressstringThe HTTPS address of the HCP Terraform or HCP Terraform Enterprise instance."https://app.terraform.io"
tfe_agent_pool_namestringTerraform agent pool name to be used when agent creation is omitted""
agent_log_levelstringThe logging verbosity for the agent. Valid values are trace, debug, info (defaul"info"
agent_egress_portsset(string)Egress ports to allow the agent to communicate with the HCP Terraform instance.[ "443", "7146" ]
agent_cidr_blockslist(string)CIDR blocks to allow the agent to communicate with the HCP Terraform instance.[ "0.0.0.0/0" ]
cloudwatch_log_group_retentionnumberThe number of days to retain logs in the CloudWatch log group.365
cloudwatch_log_group_namestringThe name of the CloudWatch log group where agent logs will be sent."/hcp/hcp-terraform-agent"
create_ecs_clusterboolWhether to create a new ECS cluster for the agent.true
create_cloudwatch_log_groupboolWhether the CloudWatch log group should be created.true
ecs_cluster_arnstringARN of the ECS cluster where the agent will be deployed."arn:aws:ecs:us-west-2:000000000000:clus
create_tfe_agent_poolboolWhether to omit agent pool/token creationtrue
agent_cpunumberThe CPU units allocated to the agent container(s). See https://docs.aws.amazon.c256
agent_single_executionboolWhether to use single-execution mode.true
extra_env_varslist(object({ name = striExtra environment variables to pass to the agent container.[]
Outputs (11)
ecs_task_revision — Revision number of the ECS task definition.
security_group_name — Name of the VPC security group attached to the service.
security_group_id — ID of the VPC security group attached to the service.
task_role_name — Name of the IAM role attached to the task containers.
task_role_arn — ARN of the IAM role attached to the task containers.
ecs_service_arn — ARN of the ECS service.
log_stream_prefix — Prefix for the CloudWatch log stream.
kms_key_arn — The ARN of the created KMS key
agent_pool_name — Name of the HCP Terraform agent pool.
agent_pool_id — ID of the HCP Terraform agent pool.
ecs_task_arn — ARN of the ECS task definition.
Resources (12)
aws_cloudwatch_log_groupaws_ecs_serviceaws_ecs_task_definitionaws_iam_roleaws_iam_role_policyaws_iam_role_policy_attachmentaws_kms_keyaws_security_groupaws_security_group_ruleaws_ssm_parametertfe_agent_pooltfe_agent_token
Topics & Tags
ia-automator
Details
FrameworkTerraform Module
LanguageHCL
Version0.0.2
Cloud AWS
★ Stars9
Forks7
Total downloads6.6k
Inputs28
Outputs11
Resources12
Examples1
LicenseApache-2.0
Namespaceaws-ia
Updated