Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for remote partials and dependencies #204

Open
tgeijg opened this issue Dec 13, 2024 · 0 comments
Open

add support for remote partials and dependencies #204

tgeijg opened this issue Dec 13, 2024 · 0 comments

Comments

@tgeijg
Copy link

tgeijg commented Dec 13, 2024

Describe the solution you'd like
Partials and dependencies can currently be declared using relative paths. It does not seem to be possible to list remote repos/files as partials or dependencies. This would however be a very useful feature.

Additional context
This request essentially relates to gruntwork-io/terragrunt#3658

When using a remote (default) boilerplate template when running terragrunt scaffold or terragrunt catalog, any partials or dependencies have to be defined within the same repository.

Consider a boilerplate template file like this:

locals {
  {{- template "locals" -}}
}
{{ template "terraform_config" }}
terraform {
  source = "{{ .sourceUrl }}"
}

inputs = {
  {{- if templateIsDefined "base_example" }} {{ template "base_example" }} {{end}}

  # --------------------------------------------------------------------------------------------------------------------
  # Required input variables
  # --------------------------------------------------------------------------------------------------------------------
  {{ range .requiredVariables }}
  {{ .Name }} = {{ .DefaultValuePlaceholder }}  # TODO: fill in value
  # Description: {{ .Description }}
  # Type: {{ .Type }}
  {{ end }}

  # --------------------------------------------------------------------------------------------------------------------
  # Optional input variables with their default values
  # Uncomment the ones which values you would like to change to anything other than what is listed below.
  # --------------------------------------------------------------------------------------------------------------------
  {{ range .optionalVariables }}
  # {{ .Name }} = {{ .DefaultValue }}    # Default value - only uncomment if this is not the desired value.
  # Description: {{ .Description }}
  # Type: {{ .Type }}
  {{ end }}
}

Most of the templates/partials can reside in the same boilerplate template repository. However, the base_example - which in this case is aiming to provide a commonly used inputs example for developer guidance - should ideally live with the (remote) terraform module code. That way it's easier to maintain the inputs example when changes to the terraform module are made. That is, the example partial can live closer to the code its providing an example for.

@tgeijg tgeijg added the enhancement New feature or request label Dec 13, 2024
@linear linear bot removed the enhancement New feature or request label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant