Pulumi AI seems to get stuck on public aws bucket ...
# getting-started
f
Pulumi AI seems to get stuck on public aws bucket creation- it always tries to set
acl='public-read'
, but then the code crashes on deploy
Error creating S3 bucket: InvalidBucketAclWithObjectOwnership: Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting
. Then, if you ask Pulumi AI how to fix it, it'll 100% of the time hallucinate an
ownership_controls
argument to aws.s3.Bucket which simply doesn't exist. Any tips on how to actually modify ownership controls on S3 buckets via Pulumi? It looks like a surprisingly nested parameter for something that is required when making buckets for public facing content.
I'm getting the same error from every one of the example public bucket configs in the documentation as well
Bucket, Bucketv2, the ACL config itself
The bucket ownership controls also throw errors when run:
Copy code
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example", bucket="example")
example_bucket_ownership_controls = aws.s3.BucketOwnershipControls("example",
    bucket=example.id,
    rule=aws.s3.BucketOwnershipControlsRuleArgs(
        object_ownership="BucketOwnerPreferred",
    ))
That seems to run into
TypeError: sequence item 1: expected str instance, NoneType found
Copied straight from TypeError: sequence item 1: expected str instance, NoneType found
I ended up cribbing from here to get something that appears to work:
Copy code
<https://github.com/pulumi/examples/blob/master/aws-py-s3-folder/__main__.py>
I'll report back with any more findings.