Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#3309 from jingyih/bqcc_ref
Browse files Browse the repository at this point in the history
chore: add public sample for BigQueryConnection referenced by IAMPolicyMember
  • Loading branch information
google-oss-prow[bot] authored Dec 4, 2024
2 parents bc85425 + d2d887f commit cfb1539
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1
kind: BigQueryConnectionConnection
metadata:
name: iampolicymember-dep-bqccref
spec:
location: us-central1
projectRef:
# Replace ${PROJECT_ID?} with your project ID
external: ${PROJECT_ID?}
cloudSQL:
instanceRef:
name: iampolicymember-dep-bqccref
databaseRef:
name: iampolicymember-dep-bqccref
type: "MYSQL"
credential:
secretRef:
name: iampolicymember-dep-bqccref
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
name: iampolicymember-sample-bqccref
spec:
memberFrom:
bigQueryConnectionConnectionRef:
type: cloudSQL
name: iampolicymember-dep-bqccref
role: roles/editor
resourceRef:
kind: Project
# Replace ${PROJECT_ID?} with your project ID
external: projects/${PROJECT_ID?}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: Secret
metadata:
name: iampolicymember-dep-bqccref
type: kubernetes.io/basic-auth
stringData:
username: iampolicymember-dep-bqccref
password: cGFzc3dvcmQ=
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLDatabase
metadata:
name: iampolicymember-dep-bqccref
spec:
charset: utf8
instanceRef:
name: iampolicymember-dep-bqccref
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLInstance
metadata:
name: iampolicymember-dep-bqccref
spec:
databaseVersion: MYSQL_5_7
region: us-central1
settings:
locationPreference:
zone: us-central1-a
tier: db-custom-1-3840
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLUser
metadata:
name: iampolicymember-dep-bqccref
spec:
instanceRef:
name: iampolicymember-dep-bqccref
host: foo
password:
valueFrom:
secretKeyRef:
name: iampolicymember-dep-bqccref
key: password
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,101 @@ metadata:
name: iampolicymember-dep-orgrole
```

### Policy Member With BigQueryConnection Reference
```yaml
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: iam.cnrm.cloud.google.com/v1beta1
kind: IAMPolicyMember
metadata:
name: iampolicymember-sample-bqccref
spec:
memberFrom:
bigQueryConnectionConnectionRef:
type: cloudSQL
name: iampolicymember-dep-bqccref
role: roles/editor
resourceRef:
kind: Project
# Replace ${PROJECT_ID?} with your project ID
external: projects/${PROJECT_ID?}
---
apiVersion: bigqueryconnection.cnrm.cloud.google.com/v1beta1
kind: BigQueryConnectionConnection
metadata:
name: iampolicymember-dep-bqccref
spec:
location: us-central1
projectRef:
# Replace ${PROJECT_ID?} with your project ID
external: ${PROJECT_ID?}
cloudSQL:
instanceRef:
name: iampolicymember-dep-bqccref
databaseRef:
name: iampolicymember-dep-bqccref
type: "MYSQL"
credential:
secretRef:
name: iampolicymember-dep-bqccref
---
apiVersion: v1
kind: Secret
metadata:
name: iampolicymember-dep-bqccref
type: kubernetes.io/basic-auth
stringData:
username: iampolicymember-dep-bqccref
password: cGFzc3dvcmQ=
---
apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLDatabase
metadata:
name: iampolicymember-dep-bqccref
spec:
charset: utf8
instanceRef:
name: iampolicymember-dep-bqccref
---
apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLInstance
metadata:
name: iampolicymember-dep-bqccref
spec:
databaseVersion: MYSQL_5_7
region: us-central1
settings:
locationPreference:
zone: us-central1-a
tier: db-custom-1-3840
---
apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLUser
metadata:
name: iampolicymember-dep-bqccref
spec:
instanceRef:
name: iampolicymember-dep-bqccref
host: foo
password:
valueFrom:
secretKeyRef:
name: iampolicymember-dep-bqccref
key: password
```

### Policy Member With Member Reference
```yaml
# Copyright 2020 Google LLC
Expand Down

0 comments on commit cfb1539

Please sign in to comment.