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

Remove gcloud dependency #408

Closed
2 tasks
morgante opened this issue Apr 27, 2020 · 14 comments
Closed
2 tasks

Remove gcloud dependency #408

morgante opened this issue Apr 27, 2020 · 14 comments

Comments

@morgante
Copy link
Contributor

We would like to remove all null_resources from this module and not require gcloud in the execution environment.

This will require:

  • Removing the need for the precheck script: Remove preconditions script #407
  • Adding native Terraform support to handle deleting/disabling the default service account
@bharathkkb
Copy link
Member

Adding native Terraform support to handle deleting/disabling the default service account

@morgante this would be in the provider right?

@morgante
Copy link
Contributor Author

@morgante this would be in the provider right?

Correct

@umairidris
Copy link
Contributor

Does the org policy constraints/iam.automaticIamGrantsForDefaultServiceAccounts remove the need for step 2?

@morgante
Copy link
Contributor Author

morgante commented May 4, 2020

Unfortunately that doesn't support cases where you don't manage the org policies for the organization or folder. (Even google.com is an example.)

@leone145
Copy link

leone145 commented May 5, 2020

I would like to see this. If the module.gcloud_deprivilege.null_resource.run_command[0] becomes tainted and editor was previously removed, it will not apply without manual intervention.

@djbingham
Copy link

I would also love to see this. I've abandoned plans to use Terraform Cloud because I couldn't get this module to work properly (Terraform Cloud doesn't have gcloud in its execution environment).

Would a reasonable alternative (or temporary) solution be to depend on the gcloud Terraform module, rather than requiring gcloud to be pre-installed in the execution environment? Other modules do that and seem to work ok.

@morgante
Copy link
Contributor Author

@djbingham Yes that would be a reasonable workaround to get this working on Terraform Cloud. I haven't had cycles to work on it, but I'd be happy to review a PR.

@thiagonache
Copy link
Contributor

@morgante can you mark task number one as done and update the second task with currently issue on the provider repo, please? I'll try to get this done.

@thiagonache
Copy link
Contributor

@morgante we have the new resource on the master of terraform provider.
I've been thinking about how to remove gcloud. Maybe we can add the new resource and remove the gcloud local exec but keep the variables to avoid a breaking change, but we'll need to remove these variables at some point. Or let's just assume it is a breaking change?

@morgante
Copy link
Contributor Author

morgante commented Nov 3, 2020

@thiagonache Which variables are you referring to?

@thiagonache
Copy link
Contributor

thiagonache commented Nov 3, 2020 via email

@thiagonache
Copy link
Contributor

thiagonache commented Nov 3, 2020

variable "use_tf_google_credentials_env_var" {
  description = "Use GOOGLE_CREDENTIALS environment variable to run gcloud auth activate-service-account with."
  type        = bool
  default     = false
}

variable "skip_gcloud_download" {
  description = "Whether to skip downloading gcloud (assumes gcloud is already available outside the module)"
  type        = bool
  default     = false
}

My understanding is that we don't need these two variables anymore.

Also,

variable "default_service_account" {
  description = "Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`."
  default     = "disable"
  type        = string
}

This should be upper case, which is simple to fix but we should change it to the upper case at some point.

@thiagonache
Copy link
Contributor

I've drafted a PR it is working on my machine, but we'll have to wait until the next release of terraform google provider.
#491

@bharathkkb
Copy link
Member

fixed by #491

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

6 participants