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);
}
Aggregations