Hi,
I am trying to create an S3 bucket with a CORS rule:
s3.NewS3Bucket(*stack, &bucketName, &s3.S3BucketConfig{
Bucket: &bucketName,
CorsRule: &s3.S3BucketCorsRule{
AllowedMethods: &([]*string{jsii.String("GET")}),
},
})
I get a runtime error:
default - panic: "Value did not match any type in union: Expected array type, got {\"$jsii.struct\":{\"fqn\":\"hashicorp_aws.s3.S3BucketCorsRule\",\"data\":{\"allowedMethods\":[\"GET\"]}}}, Expected object reference, got {\"$jsii.struct\":{\"fqn\":\"hashicorp_aws.s3.S3BucketCorsRule\",\"data\":{\"allowedMethods\":[\"GET\"]}}}"
github.com/aws/jsii-runtime-go/runtime.Create({0x1c7be9d, 0x19}, {0xc00041fc88, 0x3
[2022-05-27T13:14:12.915] [ERROR] default - , 0x3}, {0x1c63c00, 0xc00039f0d0})
/go/pkg/mod/github.com/aws/jsii-runtime-go@v1.59.0/runtime/runtime.go:186 +0x885
bricks/generated/hashicorp/aws/s3.NewS3Bucket({0x2ed73688, 0xc0000ea2e0}, 0xc00039f0b0, 0xc0000bc200)
/generated/hashicorp/aws/s3/s3.go:5685 +0xea
I get a similar error when I try to add a Grant
to the bucket like this:
s3.NewS3Bucket(*stack, &bucketName, &s3.S3BucketConfig{
Bucket: &bucketName,
Grant: &s3.S3BucketGrant{
Permissions: &([]*string{jsii.String("FULL_CONTROL")}),
Type: jsii.String("CanonicalUser"),
Id: canonicalUser.Id(),
},
)}
It makes me think that I am passing the arguments in the wrong way (I am not just new to CDKTF, but to Go too! )
Help appreciated. Thanks,
- A