Skip to content

Commit f146b2f

Browse files
authored
Merge pull request #33 from johnnyplaydrums/add-input-pubic-ip
Add input assign_public_ip
2 parents a7117f3 + 10bcdf5 commit f146b2f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Please refer to the [examples](./examples/basic) on how to get started.
8383
| <a name="input_agent_log_level"></a> [agent\_log\_level](#input\_agent\_log\_level) | The logging verbosity for the agent. Valid values are trace, debug, info (default), warn, and error. | `string` | `"info"` | no |
8484
| <a name="input_agent_memory"></a> [agent\_memory](#input\_agent\_memory) | The amount of memory, in MB, allocated to the agent container(s). | `number` | `512` | no |
8585
| <a name="input_agent_single_execution"></a> [agent\_single\_execution](#input\_agent\_single\_execution) | Whether to use single-execution mode. | `bool` | `true` | no |
86+
| <a name="input_assign_public_ip"></a> [assign\_public\_ip](#input\_assign\_public\_ip) | Whether to assign a public IP address to the ECS tasks. Set to true when using public subnets. | `bool` | `false` | no |
8687
| <a name="input_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#input\_cloudwatch\_log\_group\_name) | The name of the CloudWatch log group where agent logs will be sent. | `string` | `"/hcp/hcp-terraform-agent"` | no |
8788
| <a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | The number of days to retain logs in the CloudWatch log group. | `number` | `365` | no |
8889
| <a name="input_create_cloudwatch_log_group"></a> [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Whether the CloudWatch log group should be created. | `bool` | `true` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ resource "aws_ecs_service" "hcp_terraform_agent" {
162162
}
163163

164164
network_configuration {
165-
assign_public_ip = "false"
165+
assign_public_ip = var.assign_public_ip
166166
security_groups = [aws_security_group.hcp_terraform_agent.id]
167167
subnets = var.subnet_ids
168168
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,9 @@ variable "kms_key_arn" {
208208
type = string
209209
default = ""
210210
}
211+
212+
variable "assign_public_ip" {
213+
type = bool
214+
description = "Whether to assign a public IP address to the ECS tasks. Set to true when using public subnets."
215+
default = false
216+
}

0 commit comments

Comments
 (0)