Skip to content
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

put-public-access-block s3api endpoint exposed? #405

Open
2 of 3 tasks
FMKerckhof opened this issue Nov 1, 2021 · 1 comment
Open
2 of 3 tasks

put-public-access-block s3api endpoint exposed? #405

FMKerckhof opened this issue Nov 1, 2021 · 1 comment

Comments

@FMKerckhof
Copy link

Please specify whether your issue is about:

  • a possible bug
  • a question about package functionality
  • a suggested code or documentation change, improvement to the code, or feature request

Dear, I was wondering if the s3api endpoint put-public-access-block is/could be exposed through the aws.s3 package? I am aware of the existence of the put_bucket_policy and put_acl functions - but it would be quite convenient if - upon creating a new bucket - all objects and the bucket itself could be set to not public using the simple configuration options of public-access-block-configuration (see https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/put-public-access-block.html) .


## load package
library("aws.s3")

## code goes here
putbucket_result <- put_bucket("bucketname")
# unclear how to set this bucket (and objects) to non-public using put-public-access block

## session info for your system
sessionInfo()
# R version 4.1.1 (2021-08-10)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 10 x64 (build 19043)
# 
# Matrix products: default
# 
# locale:
# [1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
# [3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
# [5] LC_TIME=English_United Kingdom.1252    
# 
# attached base packages:
# [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
# [1] aws.s3_0.3.21
# 
# loaded via a namespace (and not attached):
#  [1] digest_0.6.28       aws.signature_0.6.0 R6_2.5.1            jsonlite_1.7.2      evaluate_0.14      
#  [6] httr_1.4.2          rlang_0.4.12        curl_4.3.2          xml2_1.3.2          rmarkdown_2.11     
# [11] tools_4.1.1         rsconnect_0.8.24    xfun_0.27           yaml_2.2.1          fastmap_1.1.0      
# [16] compiler_4.1.1      base64enc_0.1-3     htmltools_0.5.2     knitr_1.36 

My default way of setting this using AWS CLI (v2) would be:

aws --profile default s3api put-public-access-block \
    --bucket bucketname \
    --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
@UCDNJJ
Copy link

UCDNJJ commented Jan 7, 2022

I just wanted to second this recommendation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants