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

Terraform module's lack of compatibility #64

Open
gleidin opened this issue Jan 11, 2022 · 4 comments
Open

Terraform module's lack of compatibility #64

gleidin opened this issue Jan 11, 2022 · 4 comments

Comments

@gleidin
Copy link

gleidin commented Jan 11, 2022

Hi Folks,

I was trying to use this repository as a terraform module instead of copying all files into my terraform project, and I have seen that is not possible to do, is it designed to work only with all files? It would be better to be a module instead of being a terraform generic module, not?

The error threw was:
image

The way that i'm referencing it:

module "sumologic_observability_solution" {
  source = "github.com/SumoLogic/sumologic-solution-templates//aws-observability-terraform"
  aws_account_alias         = local.account_name
  sumologic_environment     = local.sumologic_environment
  sumologic_organization_id = local.sumologic_organization_id
  sumologic_access_id       = var.sumologic_access_id
  sumologic_access_key      = var.sumologic_access_key
}
@gleidin
Copy link
Author

gleidin commented Jan 11, 2022

Update: I found the problem, and ain't because of the module's lack of compatibility, it's a reference that breaks the code plan/init.

Inside of the aws-observability-terraform/main.tf line 20 we have the wrong module reference to cwd instead of point to the module ref, so I changed
json_file_directory_path = dirname(path.cwd) to json_file_directory_path = dirname(path.module) and works well.

I'm using the terraform version: Terraform v1.0.11 should this module support this version? 

Update: When using as a module as I first posted, we need to remove the dirname func and works fine either.

@gleidin
Copy link
Author

gleidin commented Jan 11, 2022

If necessary i can open a pr to fix it, I'm looking forward to using this module in production! Thanks.

@gleidin gleidin changed the title Terraform module lack of compatibility Terraform module's lack of compatibility Jan 11, 2022
@himanshu219
Copy link
Contributor

Currently it doesn't support module as a whole because the app json(https://github.com/SumoLogic/sumologic-solution-templates/tree/master/aws-observability/json) folder is in the CF solution and is referred by both tf and cf solution.

@gleidin
Copy link
Author

gleidin commented Jan 21, 2022

Yeap, I have seen that, and there is a bunch of other things that make it complicated, but should we have it? I mean, having this repository would be great and less complicated to apply and handle the state, if it was a module.

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

2 participants