EasyManuals Logo

Amazon Redshift User Manual

Amazon Redshift
131 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #125 background imageLoading...
Page #125 background image
# Endpoint. Use s3-external-1.amazonaws.com for clusters in us-east
s3_endpoint=<s3 endpoint>
# Bucket to upload data.
s3_bucket=<bucket name>
# S3 prefix to add to uploaded data files. All files loaded will have this
prefix.
s3_prefix=<object prefix>
# Local directory from which to load data. All files in this directory will be
encrypted and loaded.
src_dir=<source location>
The following Java class uses the properties file to upload objects using client-side encryption.
import java.io.File;
import java.util.Properties;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.PropertiesCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
import com.amazonaws.services.s3.model.EncryptionMaterials;
import com.amazonaws.services.s3.model.PutObjectRequest;
public class SampleEncryptAndUploadDataToS3 {
private static final int MAX_RETRY_COUNT = 10;
public static void main(String[] args) throws Exception {
//Specify values in SampleEncryptAndUploadDataToS3.properties file.
AWSCredentials credentials = new PropertiesCredentials(
SampleEncryptAndUploadDataToS3.class.getResourceAsStream("AwsCreden
tials.properties"));
Properties config = new Properties();
config.load(SampleEncryptAndUploadDataToS3.class.getResourceAs
Stream("SampleEncryptAndUploadDataToS3.properties"));
String masterSymmetricKeyBase64 = getProperty(config, "master_symmet
ric_key");
String bucketName = getProperty(config, "s3_bucket");
String s3Prefix = getProperty(config, "s3_prefix");
String s3Endpoint = getProperty(config, "s3_endpoint");
API Version 2012-12-01
121
Amazon Redshift Management Guide
Example: Uploading Client-Side Encrypted Data

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Amazon Redshift and is the answer not in the manual?

Amazon Redshift Specifications

General IconGeneral
ProviderAmazon Web Services (AWS)
Query LanguageSQL
Data StorageColumnar storage
SecurityEncryption at rest and in transit, VPC, IAM
BackupAutomated and manual snapshots
DeploymentCloud-based
TypeCloud-based data warehouse service
Primary UseData warehousing, analytics
IntegrationIntegrates with AWS services, BI tools, and ETL tools
Pricing ModelOn-demand and reserved instance pricing
Data CompressionColumnar storage with data compression
Performance OptimizationQuery optimization

Related product manuals