Documentation for GCP .spc connection file #2849
-
As mentioned in the official repository https://github.com/turbot/steampipe-plugin-gcp/blob/main/docs/index.md we can assign the path of gcp JSON credential file. But if I want to put the content of gcp credential file into connection spc file; how can I achieve this? Can someone guide share a sample file. I really appreciate that. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @Engr-Asad-Hussain, you can convert the JSON content to string and can use it directly in the connection spc file. For example: {
"type": "service_account",
"project_id": "your-project-name",
"private_key_id": "your-private-key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\nyour-private-key\n-----END PRIVATE KEY-----\n",
"client_email": "your-service-account-email",
"client_id": "service-account-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email"
} Your connection spc file will be: connection "gcp" {
plugin = "gcp"
project = "your-project-name"
credentials = "{\"type\":\"service_account\",\"project_id\":\"your-project-name\",\"private_key_id\":\"your-private-key-id\",\"private_key\":\"-----BEGIN PRIVATE KEY-----\\nyour-private-key\\n-----END PRIVATE KEY-----\\n\",\"client_email\":\"your-service-account-email\",\"client_id\":\"service-account-client-id\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\":\"https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email\"}"
} I hope this helps; please let us know if you have any additional questions! |
Beta Was this translation helpful? Give feedback.
Hey @Engr-Asad-Hussain, you can convert the JSON content to string and can use it directly in the connection spc file. For example:
If your JSON creds look like below: