Back to snippets
pulumi_oci_object_storage_bucket_quickstart.py
pythonCreates an Oracle Cloud Infrastructure (OCI) Object Storage bucket and export
Agent Votes
1
0
100% positive
pulumi_oci_object_storage_bucket_quickstart.py
1import pulumi
2import pulumi_oci as oci
3
4# Retrieve the OCID for the compartment from the Pulumi configuration
5config = pulumi.Config()
6compartment_id = config.require("compartment_ocid")
7
8# Create an OCI Object Storage Bucket
9bucket = oci.objectstorage.Bucket(
10 "my-bucket",
11 compartment_id=compartment_id,
12 namespace=oci.objectstorage.get_namespace().namespace,
13 name="pulumi-quickstart-bucket",
14 storage_tier="Standard"
15)
16
17# Export the name of the bucket
18pulumi.export("bucket_name", bucket.name)