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

Improve docs on how to use this module #12

Open
icamys opened this issue Aug 8, 2021 · 2 comments
Open

Improve docs on how to use this module #12

icamys opened this issue Aug 8, 2021 · 2 comments

Comments

@icamys
Copy link

icamys commented Aug 8, 2021

Hi team. I'm new to Terraform and I have been faced with using it with Ansible. It looks like this module may help in useing common configurations between Terraform and Ansible. However, it's quite unclear how exactly should I use this module.

I installed it and copied the example code in my modules.tf inside my project:

module "yaml_config" {
  source = "cloudposse/config/yaml"
  version     = "0.7.0"

  map_config_local_base_path = "./../config"

  map_config_paths = [
    "*.yaml",
  ]

  context = module.this.context
}

But when I plan this configuration I get the error:

│ Error: Reference to undeclared module
│ 
│   on modules.tf line 11, in module "yaml_config":
│   11:   context = module.this.context
│ 
│ No module call named "this" is declared in the root module.

Are there any steps I've missed during the configuration?

@aknysh
Copy link
Member

aknysh commented Aug 8, 2021

@icamys
Thanks for testing and suggestion.
We definitely need to improve the docs, but please take a look at all the examples here https://github.com/cloudposse/terraform-yaml-config/tree/main/examples

These are working examples, we have examples folder in all our modules.

Regarding the error

No module call named "this" is declared in the root module.

you need to add the file context.tf https://github.com/cloudposse/terraform-yaml-config/blob/main/examples/complete/context.tf to your code.

Please watch this video for more details https://www.youtube.com/watch?v=V2b5F6jt6tQ

@pataquets
Copy link

If readme examples may get outdated or might not work, it would be better to just have a item list of examples linking to the repo files, instead of embedding them in the readme, IMO.

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

3 participants