I created a secret on the Secrets Manager console. Then I took tried using the Go code quickstart guide like
ctx := context.Background()
client, err := secretmanager.NewClient(ctx)
if err != nil {
log.Println(err)
}
// Build the request.
req := &secretmanagerpb.AccessSecretVersionRequest{
Name: "projects/my-project/secrets/API_KEY/versions/latest",
}
// Call the API.
result, err := client.AccessSecretVersion(ctx, req)
if err != nil {
log.Println(err)
}
but then I get
rpc error: code = PermissionDenied desc = Permission 'secretmanager.versions.access' denied for resource 'projects/my-project/secrets/API_KEY/versions/latest' (or it may not exist)
which makes sense because how does the secrets manager api even know that my code has admin privileges?
gcloud config list
and paste the not criticals data in your question? – Supplicatory