-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command to make a bucket public #87
Comments
Here's my prototype: @cli.command()
@click.argument("bucket")
@common_boto3_options
def make_bucket_public(bucket, **boto_options):
"""
Make a bucket public. All files will be visible to anyone who knows the URL.
s3-credentials make-bucket-public my-bucket
"""
s3 = make_client("s3", **boto_options)
try:
print("Putting public access block")
response1 = s3.put_public_access_block(
Bucket=bucket,
PublicAccessBlockConfiguration={
"BlockPublicAcls": False,
"IgnorePublicAcls": False,
"BlockPublicPolicy": False,
"RestrictPublicBuckets": False,
},
)
print("Putting bucket policy")
response2 = s3.put_bucket_policy(
Bucket=bucket,
Policy=json.dumps(policies.bucket_policy_allow_all_get(bucket)),
)
except botocore.exceptions.ClientError as ex:
click.echo(ex.__dict__, err=True)
raise click.ClickException(ex)
click.echo(json.dumps(response1, indent=4, default=str))
click.echo(json.dumps(response2, indent=4, default=str)) |
I think it's possible the |
I asked ChatGPT what all of those boolean flags meant and it said:
So I think they should all be |
Related to:
The text was updated successfully, but these errors were encountered: