Skip to content

Commit 40eb571

Browse files
authored
Docs Update - default value for with_public_ip and export outputs from metaflow module (#69)
* Docs update - set default value for with_public_ip in README * Docs Update - export outputs from metaflow modules in minmal examples This change exports all outputs from the metaflow module which are values needed to configure metaflow. --------- Co-authored-by: Joseph Sirak <joseph@outerbounds.co>
1 parent fd5b56e commit 40eb571

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ This module consists of submodules that can be used separately as well:
1414

1515
![modules diagram](./docs/terraform_modules.png)
1616

17-
You can either use this high-level module, or submodules individually. See each module's corresponding `README.md` for more details.
17+
You can either use this high-level module, or submodules individually. See each submodule's corresponding `README.md` for more details.
1818

1919
Here's a minimal end-to-end example of using this module with VPC:
20+
2021
```terraform
2122
# Random suffix for this deployment
2223
resource "random_string" "suffix" {
@@ -63,21 +64,26 @@ module "metaflow" {
6364
subnet2_id = module.vpc.public_subnets[1]
6465
vpc_cidr_blocks = module.vpc.vpc_cidr_blocks
6566
vpc_id = module.vpc.vpc_id
66-
with_public_ip = var.with_public_ip
67+
with_public_ip = true
6768
6869
tags = {
6970
"managedBy" = "terraform"
7071
}
7172
}
7273
74+
# export all outputs from metaflow modules
75+
output "metaflow" {
76+
value = module.metaflow
77+
}
78+
7379
# The module will generate a Metaflow config in JSON format, write it to a file
7480
resource "local_file" "metaflow_config" {
7581
content = module.metaflow.metaflow_profile_json
7682
filename = "./metaflow_profile.json"
7783
}
7884
```
7985

80-
You can find a more complete example that uses this module but also includes setting up sagemaker notebooks and other non-Metaflow-specific parts of infra [in this repo](https://github.com/outerbounds/metaflow-tools/tree/master/aws/terraform).
86+
**Note:** You can find a more complete example that uses this module but also includes setting up sagemaker notebooks and other non-Metaflow-specific parts of infra [in this repo](https://github.com/outerbounds/metaflow-tools/tree/master/aws/terraform).
8187

8288
<!-- BEGIN_TF_DOCS -->
8389
## Modules
@@ -125,7 +131,7 @@ You can find a more complete example that uses this module but also includes set
125131
| <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 |
126132
| <a name="input_vpc_cidr_blocks"></a> [vpc\_cidr\_blocks](#input\_vpc\_cidr\_blocks) | The VPC CIDR blocks that we'll access list on our Metadata Service API to allow all internal communications | `list(string)` | n/a | yes |
127133
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The id of the single VPC we stood up for all Metaflow resources to exist in. | `string` | n/a | yes |
128-
| <a name="input_with_public_ip"></a> [with\_public\_ip](#input\_with\_public\_ip) | Enable public IP assignment for the Metadata Service. Typically you want this to be set to true if using public subnets as subnet1\_id and subnet2\_id, and false otherwise | `bool` | n/a | yes |
134+
| <a name="input_with_public_ip"></a> [with\_public\_ip](#input\_with\_public\_ip) | Enable public IP assignment for the Metadata Service. If the subnets specified for subnet1\_id and subnet2\_id are public subnets, you will NEED to set this to true to allow pulling container images from public registries. Otherwise this should be set to false. | `bool` | n/a | yes |
129135

130136
## Outputs
131137

examples/minimal/minimal_example.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ module "metaflow" {
5555
}
5656
}
5757

58+
# export all outputs from metaflow modules
59+
output "metaflow" {
60+
value = module.metaflow
61+
}
62+
5863
# The module will generate a Metaflow config in JSON format, write it to a file
5964
resource "local_file" "metaflow_config" {
6065
content = module.metaflow.metaflow_profile_json

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ variable "extra_ui_static_env_vars" {
168168

169169
variable "with_public_ip" {
170170
type = bool
171-
description = "Enable public IP assignment for the Metadata Service. Typically you want this to be set to true if using public subnets as subnet1_id and subnet2_id, and false otherwise"
171+
description = "Enable public IP assignment for the Metadata Service. If the subnets specified for subnet1_id and subnet2_id are public subnets, you will NEED to set this to true to allow pulling container images from public registries. Otherwise this should be set to false."
172172
}
173173

174174
variable "force_destroy_s3_bucket" {

0 commit comments

Comments
 (0)