I am creating single tenant GCP projects using the...
# google-cloud
a
I am creating single tenant GCP projects using the organizations.Project in Python. Is there a recommended way to wait for the Project creation to be completed and then move onto creating other infrastructure assets? Thanks!
Copy code
project_name = f"new-project-{client_codename}"
project = organizations.Project(project_name,
                                name=project_name,
                                billing_account="XXXXX-YYYYY-ZZZZZ", 
                                org_id="1234567890", 
                                project_id=project_name)
s
I would imagine if you take a dependency on the project when creating other infrastructure assets (i.e., use
project_name
or
project_id
or similar as an input when creating the other assets) then Pulumi should handle the dependencies correctly. Are you doing that now and it’s not working as expected?
a
Thanks that fixed it @salmon-account-74572, updated the bucket creation code from:
Copy code
bucket1 = storage.Bucket(f"bucket-{client_codename}", location="us-east1", project=project_id)
to:
Copy code
bucket1 = storage.Bucket(f"bucket-{client_codename}", location="us-east1", project=project.project_id)
s
Awesome, glad we could help!
a
Yes, thanks for the prompt response. appreciate it. I am happy to be able to use Python as opposed to YAML 😉
s
Feel free to spread the word about Pulumi!