numerous-evening-73913
07/17/2024, 10:16 PMmodern-zebra-45309
07/17/2024, 10:30 PMnumerous-evening-73913
07/17/2024, 10:31 PM${PROJECT}
in the YAML, is it possible to use Pulumi without that config?
All of the docs show how to retrieve a project, but none actually create it.modern-zebra-45309
07/17/2024, 10:32 PMnumerous-evening-73913
07/17/2024, 10:32 PMmodern-zebra-45309
07/17/2024, 10:33 PMmodern-zebra-45309
07/17/2024, 10:34 PMmodern-zebra-45309
07/17/2024, 10:39 PMmodern-zebra-45309
07/17/2024, 10:44 PMmodern-zebra-45309
07/17/2024, 10:51 PMclusterProvider
). This provider is then passed to all resources that are created on the Kubernetes cluster, e.g., const ns = new k8s.core.v1.Namespace(name, {}, { provider: clusterProvider });
tells Pulumi to use the clusterProvider
to make the namespace.)
In your case, you make the GCP project, then you create a GCP provider for this particular project, and then you pass this specific provider to the resources you want to create in that project.modern-zebra-45309
07/17/2024, 10:54 PMproject
as an input to GCP Pulumi resources. This would actually already work with the quickstart:
import pulumi
from pulumi_gcp import storage, organizsations
# Create a new GCP project
my_project = organizations.Project("my_project",
name="My Project",
project_id="your-project-id",
org_id="1234567")
# Create a Google Cloud resource (Storage Bucket)
bucket = storage.Bucket("my-bucket", project=my_project.project_id, location="US")
# Export the DNS name of the bucket
pulumi.export("bucket_name", bucket.url)
numerous-evening-73913
07/17/2024, 10:54 PMnumerous-evening-73913
07/17/2024, 10:55 PMmodern-zebra-45309
07/17/2024, 10:55 PM