Created
May 19, 2020 19:43
-
-
Save magickatt/dadc95748c6ac74d42787fa6a11d322e to your computer and use it in GitHub Desktop.
Create Google Cloud Platform service account credentials JSON using Terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "google_service_account" "service_account" { | |
account_id = "test | |
display_name = "Test" | |
} | |
resource "google_service_account_key" "service_account" { | |
service_account_id = google_service_account.service_account.name | |
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