I have created in TF (0.11.14
) a GCP role, attached it to a service account and also created a key for the later as follows:
resource "google_service_account_key" "my_service_account_key" {
service_account_id = "${google_service_account.my_service_account.id}"
}
I then take the private_key
as output in the following way:
output "my_service_account_private_key" {
value = "${google_service_account_key.my_service_account_key.private_key}"
sensitive = true
}
Which prints me a very long string in the likes of
ewogICJK49fo34KFo4 .... 49k92kljg==
Assuming the role has permissions enabling read/write to a GCS bucket, how can I pass the above credential / private key to a (GKE) pod / deployment, so that the pods are granted the specific service account (and therefore are able to perform what the corresponding permissions allow, as for example reading / writing to a bucket)?
Your main steps are
I believe you got steps 1 and 2 covered. I researched for two examples (1, 2) that might be of some assistance for the remaining steps .