echoing-noon-85874
10/26/2024, 3:16 PMfunc CreateStorageBucket(ctx *pulumi.Context, cmnLogs []zapcore.Field, provider *gcp.Provider, config config.Config) (err error) {
log.Logger.Debug(log.TraceMsgFuncStart(CreateStorageBucketMethod), log.TraceMethodInputs(cmnLogs, config)...)
defer log.Logger.Debug(log.TraceMsgFuncEnd(CreateStorageBucketMethod), log.TraceError(cmnLogs, err)...)
// Declare variables
var bucket *storage.Bucket
bucketName := fmt.Sprintf("%s-%s", config.BucketName, uuid.New().String())
bucket, err = storage.NewBucket(ctx, bucketName, &storage.BucketArgs{
Location: pulumi.String(config.Location),
}, pulumi.Provider(provider))
if err != nil {
log.Logger.Error(log.TraceMsgErrorOccurredFrom(NewBucketMethod), log.TraceError(cmnLogs, err)...)
return err
}
// Export the bucket details
exportBucketDetails(ctx, bucket)
return nil
}
This is where the storage bucket create.
When we create a postaman req like this it'll create the bucket.
{
"stack": "dev",
"pulumi_project": "pulumi-compute-project",
"workload_specs": {
"type": "storage",
"cloud": "gcp",
"properties": {
"name": "mys3-225",
"bucketName": "mys3-2256",
"project": "prj-dev-platform-next",
"location": "us-central1"
}
}
}
now what's happening is when i rename the bucketName and send the req again, it'll only rename the bucketName. I want to create a new storage with the new name. How do i do that ?hallowed-horse-57635
10/26/2024, 3:31 PMechoing-noon-85874
10/26/2024, 3:36 PMhallowed-horse-57635
10/26/2024, 3:38 PMechoing-noon-85874
10/26/2024, 3:41 PMhallowed-horse-57635
10/26/2024, 3:45 PMechoing-noon-85874
10/26/2024, 3:48 PMhallowed-horse-57635
10/26/2024, 3:50 PMechoing-noon-85874
10/26/2024, 3:54 PMhallowed-horse-57635
10/26/2024, 3:56 PMechoing-noon-85874
10/26/2024, 5:59 PMhallowed-horse-57635
10/26/2024, 6:14 PMechoing-noon-85874
10/27/2024, 5:08 PM