Skip to content

Commit

Permalink
Docs Update - export outputs from metaflow modules in minmal examples
Browse files Browse the repository at this point in the history
This change exports all outputs from the metaflow module which are values needed to configure metaflow.
  • Loading branch information
josephsirak committed Jul 11, 2023
1 parent c418de9 commit 99354c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ This module consists of submodules that can be used separately as well:

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

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

Here's a minimal end-to-end example of using this module with VPC:

```terraform
# Random suffix for this deployment
resource "random_string" "suffix" {
Expand Down Expand Up @@ -70,14 +71,19 @@ module "metaflow" {
}
}
# export all outputs from metaflow modules
output "metaflow" {
value = module.metaflow
}
# The module will generate a Metaflow config in JSON format, write it to a file
resource "local_file" "metaflow_config" {
content = module.metaflow.metaflow_profile_json
filename = "./metaflow_profile.json"
}
```

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).
**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).

<!-- BEGIN_TF_DOCS -->
## Modules
Expand Down
5 changes: 5 additions & 0 deletions examples/minimal/minimal_example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ module "metaflow" {
}
}

# export all outputs from metaflow modules
output "metaflow" {
value = module.metaflow
}

# The module will generate a Metaflow config in JSON format, write it to a file
resource "local_file" "metaflow_config" {
content = module.metaflow.metaflow_profile_json
Expand Down

0 comments on commit 99354c6

Please sign in to comment.