Search in sources :

Example 1 with AwsCrossAccountRole

use of com.google.cloud.bigquery.connection.v1.AwsCrossAccountRole in project java-bigqueryconnection by googleapis.

the class CreateAwsConnection method main.

public static void main(String[] args) throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "MY_PROJECT_ID";
    // Note: As of now location only supports aws-us-east-1
    String location = "MY_LOCATION";
    String connectionId = "MY_CONNECTION_ID";
    // Example of role id arn:aws:iam::accountId:role/myrole
    String iamRoleId = "MY_AWS_ROLE_ID";
    AwsCrossAccountRole role = AwsCrossAccountRole.newBuilder().setIamRoleId(iamRoleId).build();
    AwsProperties awsProperties = AwsProperties.newBuilder().setCrossAccountRole(role).build();
    Connection connection = Connection.newBuilder().setAws(awsProperties).build();
    createAwsConnection(projectId, location, connectionId, connection);
}
Also used : AwsCrossAccountRole(com.google.cloud.bigquery.connection.v1.AwsCrossAccountRole) AwsProperties(com.google.cloud.bigquery.connection.v1.AwsProperties) Connection(com.google.cloud.bigquery.connection.v1.Connection)

Aggregations

AwsCrossAccountRole (com.google.cloud.bigquery.connection.v1.AwsCrossAccountRole)1 AwsProperties (com.google.cloud.bigquery.connection.v1.AwsProperties)1 Connection (com.google.cloud.bigquery.connection.v1.Connection)1