Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create Google Cloud Platform service account credentials JSON using Terraform
resource "google_service_account" "service_account" {
account_id = "test
display_name = "Test"
resource "google_service_account_key" "service_account" {
service_account_id =
public_key_type = "TYPE_X509_PEM_FILE"
resource "local_file" "service_account" {
content = base64decode(google_service_account_key.service_account.private_key)
filename = "../../serviceaccount.json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment