nice-hairdresser-58013
02/09/2023, 8:09 PMNearline
and enabled data object protection with this config as shown in the images.
How can I implement that?
My code:
import * as gcp from "@pulumi/gcp";
// Create a GCP resource (Storage Bucket)
const bucket = new gcp.storage.Bucket("name", {
location: "US",
name: "name",
storageClass: "NEARLINE",
uniformBucketLevelAccess: true,
});
// Export the DNS name of the bucket
export const bucketName = bucket.url;
little-cartoon-10569
02/09/2023, 8:19 PMnice-hairdresser-58013
02/09/2023, 8:39 PMNEARLINE
as constant?little-cartoon-10569
02/09/2023, 8:40 PMnice-hairdresser-58013
02/09/2023, 8:46 PMlifecycleRules
to this, would this behave like the Expire noncurrent versions after
, so that all objects within this bucket is deleted after 30 days?const bucket = new gcp.storage.Bucket("name", {
location: "US",
name: "name",
storageClass: "NEAERLINE",
uniformBucketLevelAccess: true,
versioning: {
enabled: true,
},
lifecycleRules: [
{
action: {
type: "Delete",
},
condition: {
age: 30,
},
},
],
});
little-cartoon-10569
02/09/2023, 8:47 PMnice-hairdresser-58013
02/09/2023, 8:48 PMlittle-cartoon-10569
02/09/2023, 8:49 PMage
, and put in daysSinceNoncurrentTime
. And probably numNewerVersions
too.nice-hairdresser-58013
02/09/2023, 8:50 PMlifecycleRules: [
{
action: {
type: "Delete",
},
condition: {
daysSinceNoncurrentTime: 30,
numNewerVersions: 2,
},
},
],
Max. Number of versions per object
as well, right?little-cartoon-10569
02/09/2023, 8:50 PMnice-hairdresser-58013
02/09/2023, 8:51 PMlifecycleRules: [
{
action: {
type: "Delete",
},
condition: {
daysSinceNoncurrentTime: 30,
},
},
{
action: {
type: "Delete",
},
condition: {
numNewerVersions: 2,
},
},
],
little-cartoon-10569
02/09/2023, 8:52 PMnice-hairdresser-58013
02/09/2023, 8:53 PM