String secretValue = client.accessSecretVersion(nameParam).getPayload().getData(). SecretVersionName nameParam = SecretVersionName.of(projectId, name, "latest") String name = secretName.substring(secretName.lastIndexOf("/") + 1) Although I have researched a bit and found from AWS docs that I can create a JSON file where I can write all Secret Key/Value and then pass that file to AWS Secrets manager command: aws secretsmanager create-secret -name MyTestDatabaseSecret \ -description 'My test database secret created with the CLI' \ -secret-string file://mycreds. 7,327 13 13 gold badges 76 76 silver badges 155 155 bronze badges. google-cloud-run google-secret-manager Share. Deloitte thought leaders discuss how to develop a holistic approach to the ethical use of technology. public String getSecret(final String secretName) ) Store and consume secrets using Secret Manager Which is not very helpful in this case. Trustworthy and Ethical Tech: The Leadership Challenge. It requires the GCP Secret library and also the GCP Cloud Core library for loading the project ID. Here is a snippet that I'm using to load this information. I don't think it is asking too much for dedicated teams to make libraries for common languages with proper documentation. I'd really like to see some improvment from Google around this. There are various similarly named methods like getSecret, getSecretVersion and accessSecretVersion The javadoc itself seems to be largely autogenerated with protobuf language everywhere. The quick-start lacks a clear Java example for getting a secret without it being set in the same method - I'd expect this to have been the most common use case! This has certainly added complexity in my app when doing local development.Īdditionally Google's documentation is really quite poor. While Cloud Run is a really interesting technology at the time of writing it lacks the ability to load secrets through the Cloud Run configuration. Operations against all keys (software-protected keys and HSM-protected keys), secrets, and certificates are billed at a flat rate of 0.03 per 10,000 operations. The question is now answered however I have been experiencing a similar problem using Cloud Run with Java & Quarkus and a native image created using GraalVM. UPDATE 2021: There is now a Cloud Run preview for loading secrets to an environment variable or a volume.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |