GCP
decryptersとかencryptersとかカンマ区切り文字列のlistとか改行できないしいけてないよなあとか思ってたけど複数keyに権限割り振りたいとか要望あるからそうせざるをえなさそうだったhttps://t.co/CXNOdvl9iF— shigemk2 (@shigemk2) 2022年7月21日 list str…
やっていることはこの辺 Simple Cloud KMS module that allows managing a keyring, zero or more keys in the keyring, and IAM role bindings on individual keys. The resources/services/activations/deletions that this module will create/trigger ar…
サービスアカウントにどっちかの権限が必要 Cloud KMS Admin: roles/cloudkms.admin Owner: roles/owner github.com
ロケーション指定しなくていいんだね 変更不可能だからかな $ terraform import google_storage_bucket.image-store image-store-bucket $ terraform import google_storage_bucket.image-store tf-test-project/image-store-bucket registry.terraform.io
GCPのmemorystoreをいい感じに作ってくれるやつ github.com
GOOGLE_ENCRYPTION_KEYは環境変数でtfvarsではない 設定の中でdataは使えないから、例えばcarlpett/terraform-provider-sopsを使って暗号化した情報を参照させる方法は使えない customer-supplied-keysは本当にcustomer-supplied-keysなので独自の暗号鍵を自…
21.2.0。 モジュールを利用したgoogle_container_node_poolのterraform importで以下エラーが出る。 google_container_cluster.primary.addons_config[0].horizontal_pod_autoscaling is empty list of object http_load_balancingとhorizontal_pod_autoscal…
topicとかsubscriptionに火もづくIAMポリシー google_pubsub_subscription_iam_member: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subscription are preserved. registry.terraform.…
cloud natのterraformにない max_ports_per_vm (Optional) Maximum number of ports allocated to a VM from this NAT. This field can only be set when enableDynamicPortAllocation is enabled. とな registry.terraform.io モジュールは対応中 github.com…
roles/editorであらかたなんとかなりそうな感じ cloud.google.com
google providerのβ版 workload identity系のところでprovider google-betaになる registry.terraform.io registry.terraform.io 初見だとどこに書いていいかわからないかもしれないけどこの辺に書く resource "google_iam_workload_identity_pool" "this" {…
割とroleの一覧。 cloud.google.com
workload identityをterraform管理するふうのやつだけど違う registry.terraform.io
サービスアカウントの管理 IAMのバインディングも管理 github.com
はい。 gcloud projects get-iam-policy example-project-id-1 --filter "bindings.members=(serviceAccount:xxxxxx@xxxxxx.iam.gserviceaccount.com)" cloud.google.com
terraform-google-modules/networkのsubmodule firewall-rulesでcompute_firewallは管理できる。そんな難しくなかった。 registry.terraform.io registry.terraform.io
このサブモジュールを利用して作成されるリソースのタイプはgoogle_compute_instance_from_templateなので、google_compute_instanceじゃない。 google_compute_instanceを使いたい時はモジュール使わない方が良さそう github.com registry.terraform.io
見て覚える感じ 二つのlistを合わせて一つのmapを作る > zipmap(["a", "b"], [1, 2]) { "a" = 1 "b" = 2 } Each pair of elements with the same index from the two lists will be used as the key and value of an element in the resulting map. If the s…
自分はterraform-google-modules/cloud-storageのsimple_bucketサブモジュールで遭遇したんだけど、必要なelementが足りてないってこと?あまりにも情報量が少ないのでめんくらっちゃった。 こういうふうに書いてterraform planしたらばrefreshing state自体…
cloud.google.com Terraform的にはこの辺かな registry.terraform.io
サービスアカウント情報を管理。 resourceもdataもあるしdataはresourceを定義しなくても使える。 registry.terraform.io
timeoutsの設定、masterにはマージされているけど現状最新の21.1.0じゃ設定にないから、内部で設定してあるデフォルト値のようなものが入る。 github.com github.com
addressとかnatとかが既に作成されているならregistryの書き方をなぞった方が早いかも registry.terraform.io github.com
2022/06/17のmasterブランチにはtimeoutsオプションがありげだったけど2週間前にマージされた機能であるから、まだ21.1.0にはなかった github.com
network/subnetwork/routeをまとめて作るterraformのモジュールでGCP開発。 github.com flow log周りとかsecondary ip rangeとか、terraform-google-modulesのソースコードを見たらわかるけどループでぐるぐる回してる このモジュールの設定が、実際のterraf…
ルートのリソース。 A Route resource must have exactly one specification of either nextHopGateway, nextHopInstance, nextHopIp, nextHopVpnTunnel, or nextHopIlb. なんかoptionalな風を見せてるけどnext hopの設定はどれか設定してやらないといけない…
cloud.google.com exportできるリソースタイプのリストを出力する。 gcloud beta resource-config list-resource-types --[project|organization|folder]=<PARENT></parent>
gcloud beta resource-config bulk-exportのresoure-types、case sensitiveなんやね cloud.google.com
lsはなんかちょっとS3より直感的かも知れない。rmでオブジェクト削除。 cloud.google.com cloud.google.com
形式はTerraformです。 gcloud beta resource-config bulk-exportしてHCLファイルを出力し、gcloud beta resource-config terraform generate-importしてTerraformモジュールとimportスクリプトを出力し、スクリプトを実行してterraform importする。import…