Skip to content

Commit c46148d

Browse files
authored
Expose the internal attribute of the ALB (#21)
1 parent e33b252 commit c46148d

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ You can find a more complete example that uses this module but also includes set
112112
| <a name="input_subnet1_id"></a> [subnet1\_id](#input\_subnet1\_id) | First subnet used for availability zone redundancy | `string` | n/a | yes |
113113
| <a name="input_subnet2_id"></a> [subnet2\_id](#input\_subnet2\_id) | Second subnet used for availability zone redundancy | `string` | n/a | yes |
114114
| <a name="input_tags"></a> [tags](#input\_tags) | aws tags | `map(string)` | n/a | yes |
115+
| <a name="input_ui_alb_internal"></a> [ui\_alb\_internal](#input\_ui\_alb\_internal) | Defines whether the ALB for the UI is internal | `bool` | `false` | no |
115116
| <a name="input_ui_certificate_arn"></a> [ui\_certificate\_arn](#input\_ui\_certificate\_arn) | SSL certificate for UI. If set to empty string, UI is disabled. | `string` | `""` | no |
116117
| <a name="input_ui_static_container_image"></a> [ui\_static\_container\_image](#input\_ui\_static\_container\_image) | Container image for the UI frontend app | `string` | `""` | no |
117118
| <a name="input_vpc_cidr_block"></a> [vpc\_cidr\_block](#input\_vpc\_cidr\_block) | The VPC CIDR block that we'll access list on our Metadata Service API to allow all internal communications | `string` | n/a | yes |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module "metaflow-ui" {
5555
subnet2_id = var.subnet2_id
5656
ui_backend_container_image = local.metadata_service_container_image
5757
ui_static_container_image = local.ui_static_container_image
58+
alb_internal = var.ui_alb_internal
5859

5960
METAFLOW_DATASTORE_SYSROOT_S3 = module.metaflow-datastore.METAFLOW_DATASTORE_SYSROOT_S3
6061
certificate_arn = var.ui_certificate_arn

modules/ui/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The services are deployed behind an AWS ALB, and the module will output the ALB
1010
| Name | Description | Type | Default | Required |
1111
|------|-------------|------|---------|:--------:|
1212
| <a name="input_METAFLOW_DATASTORE_SYSROOT_S3"></a> [METAFLOW\_DATASTORE\_SYSROOT\_S3](#input\_METAFLOW\_DATASTORE\_SYSROOT\_S3) | METAFLOW\_DATASTORE\_SYSROOT\_S3 value | `string` | n/a | yes |
13+
| <a name="input_alb_internal"></a> [alb\_internal](#input\_alb\_internal) | Defines whether the ALB is internal | `bool` | `false` | no |
1314
| <a name="input_certificate_arn"></a> [certificate\_arn](#input\_certificate\_arn) | SSL certificate ARN. The certificate will be used by the UI load balancer. | `string` | n/a | yes |
1415
| <a name="input_database_password"></a> [database\_password](#input\_database\_password) | The database password | `string` | n/a | yes |
1516
| <a name="input_database_username"></a> [database\_username](#input\_database\_username) | The database username | `string` | n/a | yes |

modules/ui/ec2.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ resource "aws_security_group" "ui_lb_security_group" {
7575

7676
resource "aws_lb" "this" {
7777
name = "${var.resource_prefix}alb${var.resource_suffix}"
78-
internal = false
78+
internal = var.alb_internal
7979
load_balancer_type = "application"
8080
subnets = [var.subnet1_id, var.subnet2_id]
8181
security_groups = [

modules/ui/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ variable "ui_allow_list" {
115115
description = "A list of CIDRs the UI will be available to"
116116
default = ["0.0.0.0/0"]
117117
}
118+
119+
variable "alb_internal" {
120+
type = bool
121+
description = "Defines whether the ALB is internal"
122+
default = false
123+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ variable "tags" {
8484
type = map(string)
8585
}
8686

87+
variable "ui_alb_internal" {
88+
type = bool
89+
description = "Defines whether the ALB for the UI is internal"
90+
default = false
91+
}
92+
8793
# variables from infra project that defines the VPC we will deploy to
8894

8995
variable "subnet1_id" {

0 commit comments

Comments
 (0)