Search in sources :

Example 6 with KinesisDatastoreProperties

use of org.talend.components.kinesis.KinesisDatastoreProperties in project components by Talend.

the class KinesisTestConstants method getDatastoreForRoleAssume.

public static KinesisDatastoreProperties getDatastoreForRoleAssume() {
    KinesisDatastoreProperties datastore = new KinesisDatastoreProperties("kinesisDatastore");
    datastore.init();
    datastore.specifySTS.setValue(true);
    String awsAccessKey = System.getProperty("aws.sts.role.accesskey");
    String awsSecretKey = System.getProperty("aws.sts.role.secretkey");
    if (StringUtils.isEmpty(awsAccessKey) || StringUtils.isEmpty(awsSecretKey)) {
        datastore.specifyCredentials.setValue(false);
    } else {
        datastore.accessKey.setValue(awsAccessKey);
        datastore.secretKey.setValue(awsSecretKey);
    }
    String roleArn = System.getProperty("aws.sts.role.arn");
    String roleSessionName = System.getProperty("aws.sts.role.sessionname");
    String roleExternalId = System.getProperty("aws.sts.role.externalid");
    datastore.roleArn.setValue(roleArn);
    datastore.roleSessionName.setValue(roleSessionName);
    if (!StringUtils.isEmpty(roleExternalId)) {
        datastore.specifyRoleExternalId.setValue(true);
        datastore.roleExternalId.setValue(roleExternalId);
    }
    return datastore;
}
Also used : KinesisDatastoreProperties(org.talend.components.kinesis.KinesisDatastoreProperties)

Aggregations

KinesisDatastoreProperties (org.talend.components.kinesis.KinesisDatastoreProperties)6 TalendKinesisProvider (org.apache.beam.sdk.io.kinesis.TalendKinesisProvider)1 Test (org.junit.Test)1 DatastoreRuntime (org.talend.components.common.datastore.runtime.DatastoreRuntime)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)1 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)1