Error when creating S3 bucket using aws cli - Unknown options: --object-ownership, BucketOwnerEnforced
I'm getting this error when trying to create an s3logging bucket using the aws cli following the instructions found here: https://docs.aws.amazon.com/cli/latest/reference/s3api/create-bucket.html:
aws s3api create-bucket \ --bucket s3logs-us-east-1 \ --region us-east-1 \ --object-ownership BucketOwnerEnforced To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] Unknown options: --object-ownership, BucketOwnerEnforced
This is pretty frustrating as I'm LITERALLY just copying and pasting the example found in the documentation and changing the s3 bucket name.
This is my aws cli version:
aws --version aws-cli/1.19.1 Python/3.9.7 Linux/5.16.15-76051615-generic botocore/1.20.0
Any idea what's going wrong here?
I'm using CLI v2 and also getting the same error. Upon checking the help text for this command in CLI via
aws s3api create-bucket help, the
object-ownership option is not there (hence the error) even though the CLIv2 documentation has it as well (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/create-bucket.html).
This could either be a documentation issue or an actual CLI bug. You may open an issue for this in github (https://github.com/aws/aws-cli/issues).
For the meantime you can create your s3logging bucket using the
create-bucket CLI command but without the
object-ownership option and then just issue another CLI command
put-bucket-ownership-controls. More information here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-ownership-existing-bucket.html.
Error when creating S3 bucket using aws cli - Unknown options: --object-ownership, BucketOwnerEnforcedasked a month ago
How do I create a role for AWS Batch using the CLIasked 22 days ago
CLI cp returns: ...GetObjectTagging...not implementedasked 2 years ago
Access denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfrontasked 6 months ago
Error When I create a Bucket Policy Why?asked a year ago
S3 bucket stuck in an error stateasked 2 years ago
Virtual hosting an S3 bucket using Cloudfront + SSLasked 3 years ago
SAM CLI Deployment error creating S3 BucketAccepted Answerasked 8 months ago
AWS Cli ErrorAccepted Answerasked 3 years ago
Unknown options: s3:// error on using CPasked 2 years ago