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.
flat-yak-38918
06/23/2024, 6:51 PM
I'm getting the same error from every one of the example public bucket configs in the documentation as well
flat-yak-38918
06/23/2024, 6:51 PM
Bucket, Bucketv2, the ACL config itself
flat-yak-38918
06/23/2024, 7:11 PM
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
flat-yak-38918
06/23/2024, 7:11 PM
Copied straight from TypeError: sequence item 1: expected str instance, NoneType found
flat-yak-38918
06/23/2024, 7:23 PM
I ended up cribbing from here to get something that appears to work:
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.