Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
feat: add aws connection support
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 334870265

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Oct 1 12:16:35 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: aa72330a8d16d281df131e8d37bb1a4bde53401f
Source-Link: googleapis/googleapis@aa72330
  • Loading branch information
yoshi-automation committed Oct 17, 2020
1 parent 5b89dab commit d3faf3d
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 2 deletions.
4 changes: 4 additions & 0 deletions google/cloud/bigquery/connection/__init__.py
Expand Up @@ -21,6 +21,8 @@
from google.cloud.bigquery.connection_v1.services.connection_service.client import (
ConnectionServiceClient,
)
from google.cloud.bigquery.connection_v1.types.connection import AwsCrossAccountRole
from google.cloud.bigquery.connection_v1.types.connection import AwsProperties
from google.cloud.bigquery.connection_v1.types.connection import CloudSqlCredential
from google.cloud.bigquery.connection_v1.types.connection import CloudSqlProperties
from google.cloud.bigquery.connection_v1.types.connection import Connection
Expand All @@ -32,6 +34,8 @@
from google.cloud.bigquery.connection_v1.types.connection import UpdateConnectionRequest

__all__ = (
"AwsCrossAccountRole",
"AwsProperties",
"CloudSqlCredential",
"CloudSqlProperties",
"Connection",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigquery/connection_v1/__init__.py
Expand Up @@ -16,6 +16,8 @@
#

from .services.connection_service import ConnectionServiceClient
from .types.connection import AwsCrossAccountRole
from .types.connection import AwsProperties
from .types.connection import CloudSqlCredential
from .types.connection import CloudSqlProperties
from .types.connection import Connection
Expand All @@ -28,6 +30,8 @@


__all__ = (
"AwsCrossAccountRole",
"AwsProperties",
"CloudSqlCredential",
"CloudSqlProperties",
"Connection",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigquery/connection_v1/types/__init__.py
Expand Up @@ -25,6 +25,8 @@
Connection,
CloudSqlProperties,
CloudSqlCredential,
AwsProperties,
AwsCrossAccountRole,
)


Expand All @@ -38,4 +40,6 @@
"Connection",
"CloudSqlProperties",
"CloudSqlCredential",
"AwsProperties",
"AwsCrossAccountRole",
)
52 changes: 52 additions & 0 deletions google/cloud/bigquery/connection_v1/types/connection.py
Expand Up @@ -33,6 +33,8 @@
"Connection",
"CloudSqlProperties",
"CloudSqlCredential",
"AwsProperties",
"AwsCrossAccountRole",
},
)

Expand Down Expand Up @@ -163,6 +165,8 @@ class Connection(proto.Message):
User provided description.
cloud_sql (~.gcbc_connection.CloudSqlProperties):
Cloud SQL properties.
aws (~.gcbc_connection.AwsProperties):
Amazon Web Services (AWS) properties.
creation_time (int):
Output only. The creation timestamp of the
connection.
Expand All @@ -184,6 +188,10 @@ class Connection(proto.Message):
proto.MESSAGE, number=4, oneof="properties", message="CloudSqlProperties",
)

aws = proto.Field(
proto.MESSAGE, number=8, oneof="properties", message="AwsProperties",
)

creation_time = proto.Field(proto.INT64, number=5)

last_modified_time = proto.Field(proto.INT64, number=6)
Expand Down Expand Up @@ -236,4 +244,48 @@ class CloudSqlCredential(proto.Message):
password = proto.Field(proto.STRING, number=2)


class AwsProperties(proto.Message):
r"""Connection properties specific to Amazon Web Services (AWS).
Attributes:
cross_account_role (~.gcbc_connection.AwsCrossAccountRole):
Authentication using Google owned AWS IAM
user's access key to assume into customer's AWS
IAM Role.
"""

cross_account_role = proto.Field(
proto.MESSAGE,
number=2,
oneof="authentication_method",
message="AwsCrossAccountRole",
)


class AwsCrossAccountRole(proto.Message):
r"""Authentication method for Amazon Web Services (AWS) that uses
Google owned AWS IAM user's access key to assume into customer's
AWS IAM Role.
Attributes:
iam_role_id (str):
The user’s AWS IAM Role that trusts the
Google-owned AWS IAM user Connection.
iam_user_id (str):
Output only. Google-owned AWS IAM User for a
Connection.
external_id (str):
Output only. A Google-generated id for representing
Connection’s identity in AWS. External Id is also used for
preventing the Confused Deputy Problem. See
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
"""

iam_role_id = proto.Field(proto.STRING, number=1)

iam_user_id = proto.Field(proto.STRING, number=2)

external_id = proto.Field(proto.STRING, number=3)


__all__ = tuple(sorted(__protobuf__.manifest))
4 changes: 2 additions & 2 deletions synth.metadata
Expand Up @@ -11,8 +11,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "d3697d47929f34c43bcc4de16c7c761a80e97cf1",
"internalRef": "333502684"
"sha": "aa72330a8d16d281df131e8d37bb1a4bde53401f",
"internalRef": "334870265"
}
},
{
Expand Down

0 comments on commit d3faf3d

Please sign in to comment.