Java Code Examples for com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder#defaultClient()

The following examples show how to use com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder#defaultClient() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetadataHandler.java    From aws-athena-query-federation with Apache License 2.0 6 votes vote down vote up
/**
 * @param sourceType Used to aid in logging diagnostic info when raising a support case.
 */
public MetadataHandler(String sourceType)
{
    this.sourceType = sourceType;
    this.spillBucket = System.getenv(SPILL_BUCKET_ENV);
    this.spillPrefix = System.getenv(SPILL_PREFIX_ENV) == null ?
            DEFAULT_SPILL_PREFIX : System.getenv(SPILL_PREFIX_ENV);
    if (System.getenv(DISABLE_SPILL_ENCRYPTION) == null ||
            !DISABLE_ENCRYPTION.equalsIgnoreCase(System.getenv(DISABLE_SPILL_ENCRYPTION))) {
        encryptionKeyFactory = (System.getenv(KMS_KEY_ID_ENV) != null) ?
                new KmsKeyFactory(AWSKMSClientBuilder.standard().build(), System.getenv(KMS_KEY_ID_ENV)) :
                new LocalKeyFactory();
    }
    else {
        encryptionKeyFactory = null;
    }

    this.secretsManager = new CachableSecretsManager(AWSSecretsManagerClientBuilder.defaultClient());
    this.athena = AmazonAthenaClientBuilder.defaultClient();
    this.verifier = new SpillLocationVerifier(AmazonS3ClientBuilder.standard().build());
}
 
Example 2
Source File: MetricsRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public MetricsRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(),
            AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(),
            AmazonCloudWatchClientBuilder.standard().build());
}
 
Example 3
Source File: ExampleRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
/**
 * Default constructor used by Lambda.
 */
public ExampleRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(), AmazonAthenaClientBuilder.defaultClient());
    if (System.getenv(NUM_ROWS_PER_SPLIT) != null) {
        numRowsPerSplit = Integer.parseInt(System.getenv(NUM_ROWS_PER_SPLIT));
    }
}
 
Example 4
Source File: RecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
/**
 * @param sourceType Used to aid in logging diagnostic info when raising a support case.
 */
public RecordHandler(String sourceType)
{
    this.sourceType = sourceType;
    this.amazonS3 = AmazonS3ClientBuilder.defaultClient();
    this.secretsManager = new CachableSecretsManager(AWSSecretsManagerClientBuilder.defaultClient());
    this.athena = AmazonAthenaClientBuilder.defaultClient();
}
 
Example 5
Source File: CloudwatchRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public CloudwatchRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(),
            AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(),
            AWSLogsClientBuilder.defaultClient());
}
 
Example 6
Source File: DocDBRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public DocDBRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(),
            AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(),
            new DocDBConnectionFactory());
}
 
Example 7
Source File: ElasticsearchRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public ElasticsearchRecordHandler()
{
    super(AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(), SOURCE_TYPE);

    this.typeUtils = new ElasticsearchTypeUtils();
    this.clientFactory = new AwsRestHighLevelClientFactory(getEnv(AUTO_DISCOVER_ENDPOINT)
            .equalsIgnoreCase("true"));
    this.queryTimeout = Long.parseLong(getEnv(QUERY_TIMEOUT_SEARCH));
}
 
Example 8
Source File: RedisRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public RedisRecordHandler()
{
    this(AmazonS3ClientBuilder.standard().build(),
            AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(),
            new JedisPoolFactory());
}
 
Example 9
Source File: HbaseRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 5 votes vote down vote up
public HbaseRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(),
            AWSSecretsManagerClientBuilder.defaultClient(),
            AmazonAthenaClientBuilder.defaultClient(),
            new HbaseConnectionFactory());
}
 
Example 10
Source File: AwsSecretsManagerBootstrapConfiguration.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
AWSSecretsManager smClient(AwsSecretsManagerProperties awsSecretsManagerProperties) {
	return StringUtils.isNullOrEmpty(awsSecretsManagerProperties.getRegion())
			? AWSSecretsManagerClientBuilder.defaultClient()
			: AWSSecretsManagerClientBuilder.standard()
					.withRegion(awsSecretsManagerProperties.getRegion()).build();
}
 
Example 11
Source File: TPCDSRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 4 votes vote down vote up
public TPCDSRecordHandler()
{
    super(AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(), AmazonAthenaClientBuilder.defaultClient(), SOURCE_TYPE);
}
 
Example 12
Source File: ExampleRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 4 votes vote down vote up
public ExampleRecordHandler()
{
    this(AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(), AmazonAthenaClientBuilder.defaultClient());
}
 
Example 13
Source File: PostGreSqlRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 4 votes vote down vote up
public PostGreSqlRecordHandler(final DatabaseConnectionConfig databaseConnectionConfig)
{
    this(databaseConnectionConfig, AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(), AmazonAthenaClientBuilder.defaultClient(),
            new GenericJdbcConnectionFactory(databaseConnectionConfig, PostGreSqlMetadataHandler.JDBC_PROPERTIES), new PostGreSqlQueryStringBuilder(POSTGRES_QUOTE_CHARACTER));
}
 
Example 14
Source File: MySqlRecordHandler.java    From aws-athena-query-federation with Apache License 2.0 4 votes vote down vote up
public MySqlRecordHandler(final DatabaseConnectionConfig databaseConnectionConfig)
{
    this(databaseConnectionConfig, AmazonS3ClientBuilder.defaultClient(), AWSSecretsManagerClientBuilder.defaultClient(), AmazonAthenaClientBuilder.defaultClient(),
            new GenericJdbcConnectionFactory(databaseConnectionConfig, MySqlMetadataHandler.JDBC_PROPERTIES), new MySqlQueryStringBuilder(MYSQL_QUOTE_CHARACTER));
}