S3
Learn how to store S3 credentials in RAW.
How to create
AWS access keys are a combination of an access key ID and secret access key. Using the S3 tab from the 'Credentials' list, we are able to set up public or private S3 buckets that reference data we want to process. To set up an S3 bucket, select the 'S3' button from the 'Credentials' tab, and you will be presented with the following form:
First, let's prepare a public bucket:
Select Save
and you can see the generated entry in the list of Credentials:
By selecting Test Access
, you can test the accessibility of the Credential:
The same process is followed for specifying private buckets. Again, after selecting S3, enter the bucket name, the respective region, and our AWS credentials, access key and access secret respectively:
After selecting Save
, the generated entry can be visuzalised in the list of Credentials:
Checking whether the new Credential can be accessed by RAW is accomplished by clicking on Test Access
:
If the specified bucket does not exist or is not accessible, we receive the following error message:
How to use from Snapi
An example of usage can be found in the following code:
athlete(name: string) =
let
summer = Csv.InferAndRead("s3://rawlabs-private-test-data/summer_olympics.csv"),
winter = Csv.InferAndRead("s3://rawlabs-public-test-data/winter_olympics.csv"),
total = Collection.Union(summer, winter)
in
Collection.Filter(total, x -> x.Athlete == name)
As can be seen above, the function athlete
creates a union from reading CSV files residing in a private and public S3 bucket respectively. This joint data is then used to search athletes by name.