worried-helmet-23171
08/22/2022, 4:33 PMerror: Running program '/Users/gm/Desktop/git/pulumi-gcp-test/examples/bucket_test' failed with an unhandled exception:
Error: failed to register new resource test_bucket [xyz:index:GCPBucket]: 2 UNKNOWN: Unexpected <class 'TypeError'>: __init__() got an unexpected keyword argument 'options' t Object.registerResource (/Users/gm/Desktop/git/pulumi-gcp-test/sdk/nodejs/node_modules/@pulumi/runtime/resource.ts:292:27)
My provider code looks like this:
class Provider(provider.Provider):
def __init__(self) -> None:
super().__init__(xyz_provider.__version__, xyz_provider.__schema__)
def construct(
self,
name: str,
resource_type: str,
inputs: Inputs,
options: Optional[ResourceOptions] = None,
) -> ConstructResult:
if resource_type == "xyz:index:GCPBucket":
return _construct_gcp_bucket(name, inputs, options)
raise Exception(f"Unknown resource type {resource_type}")
def _construct_gcp_bucket(
name: str, inputs: Inputs, options: Optional[ResourceOptions] = None
) -> ConstructResult:
gcp_bucket = GCPBucket(name, GCPBucketArgs.from_inputs(inputs), options)
return provider.ConstructResult(
urn=gcp_bucket.urn, state={"bucket": gcp_bucket.bucket})
My test code:
import * as xyz from "@pulumi/xyz";
const gcp_bucket = new xyz.GCPBucket(
"test_bucket",
{
"name": "test_bucket", "location": "northamerica-northeast1" });
Any help is appreciated!