Create a private upload container with its region, class, and retention in one call
One call creates a container and sets its region, its storage class, its visibility, and its lifecycle policy. Storage applies those settings to every file that your application uploads to the container. For each upload, Storage returns a CDN URL, a CRC32C checksum that you can compare with the source file, and a version ID.
Impact
The sample creates a private container called mariposa-user-uploads in the EU region, in hot storage, with a lifecycle policy under which Storage deletes each file once it is 365 days old. That call is the only setup that your code performs, because Storage provisions the bucket, the CDN distribution, and the integrity checks behind it.
Prompt for a coding agent: Create a private EU container for user uploads that deletes each file after 365 days.
Select a file to view its contents