mammoth-memory-47255
05/14/2025, 11:54 AMgreen-answer-22914
05/15/2025, 6:23 PMpulumi-gcp
provider itself. However, you can create a custom resource type using a Dynamic Provider that runs your arbitrary code during pulumi up
. This code can use the standard GCP SDKs, which will automatically pick up the same credentials that the main pulumi-gcp
provider uses (e.g., from Application Default Credentials, environment variables like GOOGLE_APPLICATION_CREDENTIALS
, or gcloud CLI configuration). Alternatively on the credential front, you could declare an Explicit Provider and pass that into resourceOptions.
import * as gcp from "@pulumi/gcp";
// Assume you have a provider instance:
const myProvider = new gcp.Provider("myProvider", {
credentials: "...",
project: "...",
region: "...",
});
// When creating a resource:
const myResource = new gcp.cloudrun.Service("myService", {
// ... resource args ...
}, { provider: myProvider });