Analyzed script: ensure-release-projects.sh
- Terraform resources
- Variables used in Components
- Components
- Yaml representation of Components
- Reference
- Provider:
Google
k8s-staging-release-test
k8s-release-test-prod
- Components per
[PROJECT]
:- Project:
[PROJECT]
- IAM Policy Binding:
roles/viewer
:group:[email protected]
group:[email protected]
group:[email protected]
group:[email protected]
roles/cloudbuild.builds.editor
:group:[email protected]
group:[email protected]
roles/serviceusage.serviceUsageConsumer
1:group:[email protected]
group:[email protected]
roles/cloudbuild.builds.builder
:serviceAccount:[email protected]
roles/cloudkms.admin
:group:[email protected]
roles/cloudkms.cryptoKeyEncrypterDecrypter
:group:[email protected]
- API:
containerregistry
storage-component
cloudbuild
cloudkms
- GCR:
[PROJECT]
- IAM:
gs://artifacts.[PROJECT].appspot.com
allUsers:objectViewer
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketOwner
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
gs://[PROJECT]
:allUsers:objectViewer
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketOwner
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
gs://[PROJECT]-gcb
:allUsers:objectViewer
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketOwner
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
group:[email protected]:objectAdmin
group:[email protected]:legacyBucketReader
serviceAccount:[email protected]:objectCreator
serviceAccount:[email protected]:objectViewer
- GCS Bucket:
gs://artifacts.[PROJECT].appspot.com
:- bucketpolicyonly:
true
- bucketpolicyonly:
gs://[PROJECT]
:- bucketpolicyonly:
true
- location:
us
- bucketpolicyonly:
gs://[PROJECT]-gcb
:- bucketpolicyonly:
true
- location:
us
- bucketpolicyonly:
- Project:
# [PROJECTS]:
# - k8s-staging-release-test
# - k8s-release-test-prod
google_project:
- name: [PROJECT]
google_project_service:
- service: containerregistry.googleapis.com
project: [PROJECT]
- service: storage-component.googleapis.com
project: [PROJECT]
- service: cloudbuild.googleapis.com
project: [PROJECT]
- service: cloudkms.googleapis.com
project: [PROJECT]
google_container_registry:
- project: [PROJECT]
google_storage_bucket:
- name: artifacts.[PROJECT].appspot.com
bucket_policy_only: true
- name: [PROJECT]
location: us
bucket_policy_only: true
- name: "[PROJECT]-gcb"
location: us
bucket_policy_only: true
google_project_iam_binding:
- role: roles/viewer
members:
- group:[email protected]
- group:[email protected]
- group:[email protected]
- group:[email protected]
project: [PROJECT]
- role: roles/cloudbuild.builds.editor
members:
- group:[email protected]
- group:[email protected]
project: [PROJECT]
- role: roles/serviceusage.serviceUsageConsumer
members:
- group:[email protected]
- group:[email protected]
project: [PROJECT]
- role: roles/cloudbuild.builds.builder
members:
- serviceAccount:[email protected]
project: [PROJECT]
- role: roles/cloudkms.admin
members:
- group:[email protected]
project: [PROJECT]
- role: roles/cloudkms.cryptoKeyEncrypterDecrypter
members:
- group:[email protected]
project: [PROJECT]
google_storage_bucket_iam_binding:
# gs://artifacts.[PROJECT].appspot.com
- role: roles/storage.objectViewer
members:
- allUsers
bucket: gs://artifacts.[PROJECT].appspot.com
- role: roles/storage.objectAdmin
members:
- group:[email protected]
- group:[email protected]
- group:[email protected]
bucket: gs://artifacts.[PROJECT].appspot.com
- role: roles/storage.legacyBucketOwner
members:
- group:[email protected]
bucket: gs://artifacts.[PROJECT].appspot.com
- role: roles/storage.legacyBucketReader
members:
- group:[email protected]
- group:[email protected]
bucket: gs://artifacts.[PROJECT].appspot.com
# gs://[PROJECT]
#
# bindings are exactly the same as in gs://artifacts.[PROJECT].appspot.com
- role: roles/storage.objectViewer
members:
- allUsers
bucket: gs://[PROJECT]
- role: roles/storage.objectAdmin
members:
- group:[email protected]
- group:[email protected]
- group:[email protected]
bucket: gs://[PROJECT]
- role: roles/storage.legacyBucketOwner
members:
- group:[email protected]
bucket: gs://[PROJECT]
- role: roles/storage.legacyBucketReader
members:
- group:[email protected]
- group:[email protected]
bucket: gs://[PROJECT]
# gs://[PROJECT]-gcb
#
# IAM bindings differenciate "gs://[PROJECT]-gcb" from "gs://[PROJECT]"
# and "gs://artifacts.[PROJECT].appspot.com" only by binding "roles/storage.objectCreator"
# to "serviceAccount:[email protected]"
# any by explicitly binding "serviceAccount:[email protected]"
# as "roles/storage.objectViewer" which I'm not sure is necessary when "allUsers"
# are bound to "roles/storage.objectViewer" role already.
#
# [todo(@bartsmykla)]: check if explicitly binding
# "serviceAccount:[email protected]"
# to "roles/storage.objectViewer" role is necessary here
- role: roles/storage.objectViewer
members:
- allUsers
- serviceAccount:[email protected]
bucket: gs://[PROJECT]-gcb
- role: roles/storage.objectAdmin
members:
- group:[email protected]
- group:[email protected]
- group:[email protected]
bucket: gs://[PROJECT]-gcb
- role: roles/storage.objectCreator
members:
- serviceAccount:[email protected]
bucket: gs://[PROJECT]-gcb
- role: roles/storage.legacyBucketOwner
members:
- group:[email protected]
bucket: gs://[PROJECT]-gcb
- role: roles/storage.legacyBucketReader
members:
- group:[email protected]
- group:[email protected]
bucket: gs://[PROJECT]-gcb
google_storage_bucket_acl:
# we need to discuss if we wan't to manage this resource because as far I'm aware,
# good practice is to use IAMs instead of ACLs, but in this case
# ("legacyBucketOwner" and "legacyBucketReader") the ACLs will be implicitly
# created, so I prefer to put them also here "explicitly".
#
# [IMPORTANT!] be aware that every role entity used in ACLs is in form
# of type and proper entity separated by "-" (not ":"),
# so for group "[email protected]"
# it will be "[email protected]"
- bucket: gs://artifacts.[PROJECT].appspot.com
role_entity:
- OWNER:[email protected]
- READER:[email protected]
- READER:[email protected]
- bucket: gs://[PROJECT]
role_entity:
- OWNER:[email protected]
- READER:[email protected]
- READER:[email protected]
- bucket: gs://[PROJECT]-gcb
role_entity:
- OWNER:[email protected]
- READER:[email protected]
- READER:[email protected]
- 1 There is a comment from @justaugustus it's temporary and we should refactor this once we develop custom roles