terraform-provider-google | Terraform Google Cloud Platform provider | GCP library
kandi X-RAY | terraform-provider-google Summary
kandi X-RAY | terraform-provider-google Summary
Terraform Provider for Google Cloud Platform.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of terraform-provider-google
terraform-provider-google Key Features
terraform-provider-google Examples and Code Snippets
Community Discussions
Trending Discussions on terraform-provider-google
QUESTION
Context: I'm developing a TF Provider and I could see the latest "Writing Log Output" doc from HashiCorp where they recommend using tflog
package for logging.
That said, I can see TF Provider for GCP are still using log
package. What're the advantages of using tflog
over log
?
ANSWER
Answered 2022-Mar-29 at 19:35The Structured Logging section of the documentation you linked describes the authors' justification for recommending this different logging strategy:
The
tflog
package uses structured logging, based on go-hclog. Rather than writing logs as sentences with embedded variables and values,tflog
takes a sentence describing the logging event and a set of variables to log. When variables are separate from the log description, you can use them to programmatically parse, filter, and search log output. This separation also allows other parts of the system to associate variables with downstream log output.
Although not mentioned explicitly as an advantage in the documentation, it does also mention that tflog
has a notion of log levels, and there's no corresponding concept in the standard library log
package at the time of writing.
Given that, I would conclude that the two intended advantages of tflog
over standard library log
are:
tflog
uses a structured logging approach where the separate variables in the result are machine-parsable and therefore amenable to automated filtering via scripts.tflog
associates a log level with each message, and the SDKs allow customizing the log level for a particular execution to control the amount of output.
I think getting any further context on this would require asking the authors of the SDKs, since this is a subjective design tradeoff rather than a situation where there is one clear correct answer.
I assume that some existing providers continue to use standard library log
just because that code was written before tflog
existed. tflog
v0.2.0 (apparently the first publicly-published version) was released in December 2021, whereas big Terraform providers like the Google Cloud Platform provider have been under development for almost a decade before that.
QUESTION
The other day I made a silly mistake when modifying some IAM policies on our terraform environment, I applied a change where I wanted to ADD a policy, when in fact it took this as the ONLY policy to exist so wiped out some of the vital IAM policies for service accounts to run GKE etc. Not my best day to say the least (an lesson learnt!).
Everything has been put back to normal manually for now, as the service account permissions were never set via TF anyway - they're the sort of permissions that are applied when enabling APIs on GCP so its done by them in the background. Our GKE cluster can now be managed again and can autoscale etc.
However, now when I run our terraform plan I receive a 500 error on a resource that was never previously a problem (redacted sensivite info):
...ANSWER
Answered 2021-Sep-13 at 06:39Update: This was due to a missing permission on the servicenetworking API. The default service account created needed roles/servicenetworking.serviceAgent
permission again after it had been wiped.
More details here
QUESTION
I am new to the world of terraform. I am trying to use terraformer on a GCP project, but keep getting plugin not found:
...ANSWER
Answered 2021-Feb-12 at 15:23The daunting instructions worked!
QUESTION
I'm using Terraform to create GCP projects (google_project resource) through service account inpersonnation and I'm hitting a quota issue:
Error: Error waiting for creating folder: Error code 8, message: The project cannot be created because you have exceeded your allotted project quota.
My problem is identical to this Github Issue
I've requested and obtained a project quota increase and I'm able to create projects in the GCP console but not with the service account.
The proposed solution is to use another service account but this is really inconvenient.
- Is it possible to display the project quota associated with the service account ?
- Is there a way to reset or update the project quota associated with the service account so that I can avoid to setup a new one ?
Thx
...ANSWER
Answered 2020-Nov-25 at 14:54If you want to have an increased quota for a specific service account you have to fill a request to Google Cloud Platform specifying both the desired quota and the service account where you want this change to be applied. If you don't specify a service account in the email addresses box and instead you just include your personal email this quota increase will be applied to your personal email.
Currently, I'm not aware of any way to get the number of remaining projects for a specific service account. However, I found this Public Issue Tracker where a similar request was made. You can star it as you also want to have this feature and post a comment.
QUESTION
google_cloud_run_service.skills-online: Creating...
Error: Error creating Service: googleapi: got HTTP response code 404 with body:
Error 404 (Not Found)!!1
404. That’s an error.
The requested URL /apis/serving.knative.dev/v1/namespaces/skills-online/services was not found on this server. That’s all we know.
on main.tf line 11, in resource "google_cloud_run_service" "skills-online":
11: resource "google_cloud_run_service" "skills-online" {
...ANSWER
Answered 2020-May-01 at 17:19The google cloud run service is not available in asia-south1 region
which is why "Error creating Service: googleapi: got HTTP response code 404 with body:" is occurring, during creation google_cloud_run_service
I changed the region in my code, according to this list https://cloud.google.com/run/docs/locations.
I have selected asia-east1 (Taiwan) region.
The error has been resolved.
closed this issue https://github.com/terraform-providers/terraform-provider-google/issues/6258
QUESTION
I tried to automate the Shared VPC creation on GCP by using Terraform. I have enabled all the access to my service account (Org Admin, XpnAdmin, Storage Admin, Compute admin, Billing Admin)
But when i executed terraform apply it's throwing me following error:
missing permission on "billingAccounts/CXXXXXXXXXXXXXXXXXX": billing.resourceAssociations.create
I'm referring the Google provider Github code for this demo.
...ANSWER
Answered 2020-Apr-08 at 09:43It's quite likely you have the billing admin, but you also need the ability to create billing assignments, or "Billing Project Manager".
https://cloud.google.com/billing/v1/how-tos/access-control
billing.resourceAssociations.create AND resourcemanager.projects.createBillingAssignment on the Cloud Billing account.
There's some handy code to bootstrap a service account - Google Project Factory - You might want to have a look at that. Once that SA is created you shouldn't have permissions issues
QUESTION
When attempting to run an import of an existing app-engine default service, it fails due to a 403
terraform import google_app_engine_standard_app_version.frontpage app//default
The terraform service account is both owner and Appengine Admin (for good measure), IAP proxy and IAP proxy is disabled.
constraints/appengine.disableCodeDownload is not enforced at the org Level.
...ANSWER
Answered 2020-Jan-21 at 18:17I was calling an incorrect resource, I needed to include version ID as well.
terraform import google_app_engine_standard_app_version.frontpage {{project}}/{{service}}/{{version_id}}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install terraform-provider-google
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page