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

generate provider.tf #136

Closed
tormath1 opened this issue Sep 10, 2020 · 0 comments · Fixed by #210
Closed

generate provider.tf #136

tormath1 opened this issue Sep 10, 2020 · 0 comments · Fixed by #210
Assignees
Labels
Type: Enhancement Provide a new feature or improve an existing one

Comments

@tormath1
Copy link
Contributor

from the documentation, it's asked to create a provider.tf to use the generated HCL / tfstate files. Terracognita should be able to generate it by itself.

AWS

terraform {
 backend "local" {
   path = "./$TFSTATE_PATH"
 }
}

provider "aws" {
 access_key = var.access_key
 secret_key = var.secret_key
 region     = var.region
}

variable "access_key" {}
variable "secret_key" {}
variable "region" {}

Google

terraform {
 backend "local" {
   path = "./$TFSTATE_PATH"
 }
}
provider "google" {
  credentials = file("${var.credentials}")
  project     = var.project
  region     = var.region
}
variable "region" {}
variable "project" {}
variable "credentials" {}

TFSTATE_PATH and region could be filled from the CLI flags. The credentials could be filled to but it would required to have read / write permissions (TC only requires read permission)

@tormath1 tormath1 added the Type: Enhancement Provide a new feature or improve an existing one label Sep 10, 2020
@xescugc xescugc self-assigned this Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Provide a new feature or improve an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants