pulumi / pulumi-oci

An Oracle Cloud (OCI) Pulumi resource package, providing multi-language access to OCI
Other
27 stars 1 forks source link

Import existing Oracle Cloud Object Storage bucket failed #79

Open davidkhala opened 1 year ago

davidkhala commented 1 year ago

What happened?

oci:ObjectStorage:Bucket (public):
    error: Preview failed: refreshing urn:pulumi:oci-typescript::oci-typescript::oci:ObjectStorage/bucket:Bucket::public: 1 error occurred:
        * can not marshal to path in request for field NamespaceName. Due to can not marshal a nil pointer

Expected Behavior

There should not be an error.

Steps to reproduce

const namespace = 'myNamespace'

const myBucket = new oci.objectstorage.Bucket("public", {
  compartmentId: compartmentId,
  namespace: namespace
}, {
  import: 'ocid1.bucket.oc1.ap-singapore-1....'
});

Then run pulumi up

Output of pulumi about

CLI          
Version      3.53.1
Go Version   go1.19.5
Go Compiler  gc

Plugins
NAME    VERSION
nodejs  unknown
oci     0.1.1

Host     
OS       darwin
Version  13.1
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v16.15.0'

Current Stack: davidkhala/oci-typescript/oci-typescript

TYPE                                  URN
pulumi:pulumi:Stack                   urn:pulumi:oci-typescript::oci-typescript::pulumi:pulumi:Stack::oci-typescript-oci-typescript
pulumi:providers:oci                  urn:pulumi:oci-typescript::oci-typescript::pulumi:providers:oci::default_0_1_1
oci:Identity/compartment:Compartment  urn:pulumi:oci-typescript::oci-typescript::oci:Identity/compartment:Compartment::DavidLiuCompartment

Found no pending operations associated with oci-typescript

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/davidkhala
User           davidkhala
Organizations  davidkhala

Dependencies:
NAME            VERSION
@pulumi/oci     0.1.1
@pulumi/pulumi  3.33.2
@types/node     17.0.45

Pulumi locates its logs in /var/folders/zf/zjyf4bds3k7ctrwg68rrl0kr0000gn/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

davidkhala commented 1 year ago

I believe there is a different understandings on what should be the id of a Oracle Cloud bucket, I find this issue can be fixed by using

{
  import:'n/myNamespace/b/myBucketname'
}

But as an Oracle employee, the first concept in my mind about a resource id is the OCID. OCID format of a bucket is

ocid1.bucket.oc1.ap-singapore-1....

It is more intuitive and easy to get in OCI web console in tab Bucket Infomation with one-click copy.

image
AaronFriel commented 1 year ago

Hey @davidkhala thanks for this, we're going to flag this as a feature request because this provider's behavior is dependent on the upstream provider we're bridging.