The following instructions outline the multiple resources available to access Cuebiq's Amazon s3.
Available Resources:
_________________________________________________________________
Cyberduck
- Download Cyberduck here
- Open the Cyberduck application once downloaded
- Select “Open Connection” in top left corner:
- Enter the credentials provided by your Cuebiq rep, example below:
Server: Provided by your Cuebiq rep
Ex: https://s3.amazonaws.com/pathname/2/fd32e824-7qsr-4e96-a3a3-a218e6e4ce9/
Access Key ID: Provided by your Cuebiq rep
Ex: EHUA5XJNP4G3GKVHCPEC
Secret Access Key: Provided by your Cuebiq rep
Ex: G9WzzuD2I5AW+4V671IBvf2uCJ0VOTjUMHtFHYvA
Note: if the path you’re provided does not include a trailing forward slash and accessing the path does not work, please attempt by adding a forward slash at the end of the URL.
- Click "Connect"
- Once connected, you can access and download needed files
Alternatively, it is possible to connect to Cuebiq's s3 using Cyberduck via Bookmarks. To connect via Bookmarks:
- Click on the bookmarks tab in Cyberduck and hit the Plus sign at the bottom:
- In the window that appears, select Amazon S3 as the connection type.
- Enter a nickname, s3.amazonaws.com as the Server, and the access key provided.
- Then in Path, enter the s3 path provided by a Cuebiq rep, without the 's3://' at the beginning
- Make sure to include a trailing slash at the end of the s3 path
- Double-click on the new bookmark that's been set up and enter the Secret Key provided when prompted to connect
_________________________________________________________________
AWS CLI
Link to full documentation: https://aws.amazon.com/cli/
Installation documentation for AWS CLI can be found here - https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
1. Once installed, navigate to the command line and run the below command (In order to confirm that AWS CLI was correctly installed):
aws --version
2. Once AWS CLI is confirmed to be successfully installed, configure a profile with the below command
aws configure --profile cuebiq_data
3. You will then be prompted to enter the below fields:
AWS Access Key ID [None]: EHUA5XJNP4G3GKVHCPEC
AWS Secret Access Key [None]: G9WzzuD2I5AW+4V671IBvf2uCJ0VOTjUMHtFHYvA
Default region name [None]:
Default output format [None]:
Access key and secret key can be filled in with the credentials provided by your Cuebiq Rep. Default region name and Default output format can remain blank.
4. Once a profile has been configured, the below command can be used to test that access to Cuebiq's s3 bucket is working as expected:
aws s3 ls s3://<cuebiq_path_provided_goes_here>/
With the s3 path mirroring what Cuebiq has provided exactly. If configured correctly, you should now be able to see the folders within Cuebiq's s3.
_________________________________________________________________
Python via Boto3
Additional Boto3 s3 documentation can be found here
1. To test out the connection to Cuebiq’s s3 bucket, a script like the below can be used:
import boto3
source_aws_key='<access_key_goes_here>'
source_aws_secret='<secret_key_goes_here>'
source_bucket_name='<bucket_name_goes_here>'
Pfix = '<path_name_goes_here>'
- path name starts after s3 bucket name
- i.e., if full path is s3://pathname/1/ce-an-842/, path_name is # 1/ce-an_842/
Source_conn_S3 = boto3.client('s3', aws_access_key_id=source_aws_key,aws_secret_access_key=source_aws_secret)
result = Source_conn_S3.list_objects(Bucket=source_bucket_name,Prefix=Pfix, Delimiter='/')
for i in result['Contents']:
print(i['Key'].split('/')[-1])
2 .To download data locally from Cuebiq’s s3 bucket, a script like the below can be used:
import boto3
import os
ACCESS_KEY = '<access_key_goes_here>'
SECRET_KEY = '<secret_key_goes_here>'
def download_from_aws():
s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)
s3_resource = boto3.resource('s3', aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)
s3_bucket = s3_resource.Bucket('<bucket_name_goes_here>')
for file in s3_bucket.objects.filter(Prefix = '<path_name_goes_here>'):
print(file.key)
with open('/Users/username/Downloads/{}'.format(file.key.split('/')[-1]), 'wb') as data:
print(data)
s3.download_fileobj('cuebiq-pathname-nv', file.key, data)
_________________________________________________________________
MSP360 (Formerly Cloudberry)
Download Cloudberry here
1. Once Cloudberry is downloaded, follow the below steps to connect to an s3 bucket
- Open Cloudberry application and select Amazon S3 as the Cloud Storage type
2. Enter in a custom display name, as well as the AWS access Key and Secret Key provided by Cuebiq
3. Once AccessKey and SecretKey have been configured, double click on newly registered account and hit ‘Ok’ to allow connection
4. In the resulting right-side window, connect to the s3 bucket by entering in the entire path name, including the trailing slash at the end of the path
-
Ex: s3://pathname/2/fd32e824-7qsr-4e96-a3a3-a218e6e4ce9/
Comments
0 comments
Please sign in to leave a comment.