This function converts an S3 path into its corresponding https or website-specific http URL.
Arguments
- s3_path
character A single S3 path to convert, starting with
"s3://"
.- website
logical Whether to construct a static website hosting URL. Default is
FALSE
. This can be used to serve an index.html file via http (unsecured) like the ones created withngr_s3_files_to_index()
.- aws_region
character The AWS region for the bucket. Default is
"us-west-2"
.
Value
character The https or http URL corresponding to the S3 path.
Details
The function removes the "s3://"
prefix, splits the remaining path into the bucket name and object key, and
constructs an https URL in the format https://<bucket>.s3.amazonaws.com/<key>
. If website = TRUE
, it constructs
a http URL in the format http://<bucket>.s3-website-<region>.amazonaws.com/<key>
.
Note: HTTPS is not supported for static website URLs directly from S3; use CloudFront for HTTPS.