Last active
April 28, 2022 20:59
-
-
Save jobquiroz/21b25c63af750e2020dff26176fc5ca8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.cloud import storage | |
# Setup variables | |
PROJECT_ID = 'project-id' # Ver nota relacionada GCP Setup - Getting Project ID | |
BUCKET = "bucket-name" | |
REGION = 'us-central1' | |
storage_client = storage.Client(project = PROJECT_ID) | |
if not storage_client.lookup_bucket(BUCKET): | |
bucketDef = storage_client.bucket(BUCKET) | |
bucket = storage_client.create_bucket(bucketDef, project=PROJECT_ID, location=REGION) | |
print(bucket) | |
else: | |
print(gcs.lookup_bucket(BUCKET)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment