Skip to content

Commit

Permalink
Further remove AWS docs (#496)
Browse files Browse the repository at this point in the history
* remove docs on configuring aws

* remove needless mention of config credentials for aws

* reduce mention in byoc notebook

* further remove mentions of aws
  • Loading branch information
zigaLuksic authored Nov 13, 2023
1 parent 29737dc commit 3a8f431
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 123 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ A high-level overview of the main functionalities:
* data collection objects,
* IO tools,

- download Sentinel-2 data from public [AWS S3 buckets](https://registry.opendata.aws/sentinel-2/) (required `[AWS]` package extension)
* restoration of .SAFE format,
* L1C and L2A data,
* command line interface,

- [Geopedia](https://portal.geopedia.world/) WMS and REST API.


Expand Down
71 changes: 0 additions & 71 deletions docs/source/aws_cli.rst

This file was deleted.

29 changes: 0 additions & 29 deletions docs/source/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,6 @@ Batch, BYOC, and other APIs). There is "OAuth clients" frame where we can create
For detailed instructions on how to obtain credentials, you can see the `Sentinel Hub webinar`_.



Amazon S3 Configuration
***********************

The package enables downloading Sentinel-2 L1C and L2A data from `Amazon S3`_ storage buckets. The data is contained in
Requester Pays buckets, therefore `AWS credentials`_ are required to use these capabilities. The credentials
can be set in the package configuration file with parameters ``aws_access_key_id`` and ``aws_secret_access_key``.

In case the credentials are not set, the package will instead automatically try to use **locally stored AWS credentials**,
if they were configured according to `AWS configuration instructions`_. Any other configuration parameters (e.g. region)
will also be collected in the same way.

The AWS account must have correct permissions set up to be able to download data from S3 buckets.
That can be configured in AWS IAM console. There are many ways how to configure sufficient permission, one of them
is setting them to *AmazonS3ReadOnlyAccess*.

.. warning::

Because Sentinel-2 satellite data on S3 is contained in Requester Pays buckets Amazon will charge users for
download according to `Amazon S3 Pricing`_. In this case users are charged for amount of data downloaded and
the number of requests. The *sentinelhub* package will make at most one GET request for each file downloaded.
Files *metadata.xml*, *tileInfo.json* and *productInfo.json* will be obtained without any charge from
`Sentinel Hub public repository`_.


Other configuration options
***************************

Expand All @@ -134,8 +109,4 @@ $ sentinelhub.config --help
.. _`Sentinel Hub Dashboard`: https://apps.sentinel-hub.com/dashboard/
.. _`Sentinel Hub services`: https://www.sentinel-hub.com/develop/documentation/api/ogc_api/
.. _`Sentinel Hub webinar`: https://www.youtube.com/watch?v=CBIlTOl2po4&t=1760s
.. _`Amazon S3`: https://aws.amazon.com/s3/
.. _`AWS credentials`: https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html
.. _`AWS configuration instructions`: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
.. _`Amazon S3 Pricing`: https://aws.amazon.com/s3/pricing/?p=ps
.. _`Sentinel Hub public repository`: https://roda.sentinel-hub.com/sentinel-s2-l1c/
2 changes: 0 additions & 2 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ Basic examples
examples/byoc_request.ipynb
examples/statistical_request.ipynb
examples/fis_request.ipynb
examples/aws_request.ipynb
aws_cli
6 changes: 1 addition & 5 deletions examples/batch_statistical.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@
"outputs": [],
"source": [
"AWS_ID = \"my-aws-access-id\"\n",
"AWS_SECRET = \"my-aws-secret-key\"\n",
"\n",
"# credentials are passed via config\n",
"config.aws_access_key_id = AWS_ID\n",
"config.aws_secret_access_key = AWS_SECRET"
"AWS_SECRET = \"my-aws-secret-key\"\n"
]
},
{
Expand Down
18 changes: 7 additions & 11 deletions examples/byoc_request.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
"# Insert your credentials here in case you don't already have them in the config.toml file:\n",
"SH_CLIENT_ID = \"\"\n",
"SH_CLIENT_SECRET = \"\"\n",
"AWS_ACCESS_KEY_ID = \"\"\n",
"AWS_SECRET_ACCESS_KEY = \"\"\n",
"\n",
"config = SHConfig()\n",
"\n",
Expand All @@ -85,11 +83,7 @@
" config.sh_client_secret = SH_CLIENT_SECRET\n",
"\n",
"if not config.sh_client_id or not config.sh_client_secret:\n",
" print(\"Warning! To use Sentinel Hub BYOC API, please provide the credentials (client ID and client secret).\")\n",
"\n",
"if AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY:\n",
" config.aws_access_key_id = AWS_ACCESS_KEY_ID\n",
" config.aws_secret_access_key = AWS_SECRET_ACCESS_KEY"
" print(\"Warning! To use Sentinel Hub BYOC API, please provide the credentials (client ID and client secret).\")"
]
},
{
Expand Down Expand Up @@ -714,11 +708,13 @@
"metadata": {},
"outputs": [],
"source": [
"def list_objects_path(bucket, year_count, month_count, day_count, config):\n",
"MY_AWS_ACCESS_KEY_ID = \"\"\n",
"MY_AWS_SECRET_ACCESS_KEY = \"\"\n",
"\n",
"\n",
"def list_objects_path(bucket, year_count, month_count, day_count):\n",
" tiles_path = []\n",
" client = boto3.client(\n",
" \"s3\", aws_access_key_id=config.aws_access_key_id, aws_secret_access_key=config.aws_secret_access_key\n",
" )\n",
" client = boto3.client(\"s3\", aws_access_key_id=MY_AWS_ACCESS_KEY_ID, aws_secret_access_key=MY_AWS_SECRET_ACCESS_KEY)\n",
" result = client.list_objects(Bucket=bucket, Delimiter=\"/\")\n",
" for year in result.get(\"CommonPrefixes\")[:year_count]:\n",
" year_result = client.list_objects(Bucket=bucket, Delimiter=\"/\", Prefix=year.get(\"Prefix\"))\n",
Expand Down

0 comments on commit 3a8f431

Please sign in to comment.