S3 Authentication Methods
There are several different ways to authenticate when you are using ybload to load data from AWS S3 or S3-compatible object storage. You can authenticate implicitly by using supported S3-specific mechanisms, or explicitly by using ybload command-line options. Your organization's S3 administrator should provide instructions for the approach you should use. See Best Practices for Managing AWS Access Keys for further recommendations.
S3 credentials must be provided in a manner supported by ybload and the AWS Java SDK:
Secure methods (integrated into your organization's login/identity mechanism):
EC2 roles (when running on Amazon EC2 instances)
SAML 2.0-compatible identity provider
Custom identity provider bridge to AWS
Other methods:
Environment variables:
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY. Other AWS environment variables are also supported, includingAWS_SESSION_TOKEN,AWS_PROFILE,AWS_REGION, andAWS_CREDENTIAL_PROFILES_FILE.URI query parameters:
aws_access_key_idandaws_secret_access_keyA credential file, typically located at
~/.aws/credentials(location may vary by platform)Required Permissions
Note that
ybloadrequires access to read both the object and object metadata. Metadata access is a grantable permission separate from read access. Attempting to load a file from a public bucket with the option to download the file using an HTTP URL will causeybloadto fail and throw the following error:Forbidden (Service: Amazon S3; Status Code: 403; Error Code: 403 Forbidden; Request ID: xxxxxxxxxxxxxxxx)
An installation of the AWS CLI is not required, but it does provide the aws configure command, which is useful for setting credentials. For details, see the AWS Command Line Interface documentation.
Order of Precedence for Authentication Methods
You may have multiple credential settings available to you, based on your AWS account setup and how you script the ybload command. Therefore it is important to know which authentication mechanism takes precedence when the ybload command is run. Note that credentials set explicitly with ybload object storage options, if set (either on the command line or in a properties file), always take precedence over implicit credentials set via aws configure or other methods.
The order of precedence is as follows:
- Access key and access key ID specified with the
--object-store-identityand--object-store-credentialcommand-line options - Access key and access key ID specified with the
yb.file.prefix in one of the following: - URI parameter
- Properties file named with the
--object-store-provider-configcommand-line option - Access key and access key ID without the
yb.file.prefix in one of the following: - URI parameter
- Properties file named with the
--object-store-provider-configcommand-line option - Implicit authentication via environment variables and supported AWS configuration files:
~/.aws/*files: (~/.aws/credentialsor~/.aws/config)
Parent topic:Loading from Amazon S3