Created
June 18, 2015 03:26
-
-
Save holysugar/714f9f7c76e9557ac89a to your computer and use it in GitHub Desktop.
GCE でインスタンス名からCloudSQLにアクセス許可するワンライナー(手抜き版)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud compute instances list | | |
grep '^projectname-web' | | |
awk '{print $5}' | | |
tr "\n" " " | | |
xargs gcloud sql instances patch dbinstancename --authorized-network | |
# 本来はタグとかメタデータとかから取る方針にしたいのでこれは手抜き。 | |
# CloudSQL 側でもっと (GAEではなく) GCEなどから受け取れる前提で設定を簡単にできるようにならないのかな… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment