{"id":3289,"date":"2019-11-06T22:46:16","date_gmt":"2019-11-06T13:46:16","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=3289"},"modified":"2019-11-06T22:46:18","modified_gmt":"2019-11-06T13:46:18","slug":"post-3289","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2019\/11\/06\/post-3289\/","title":{"rendered":"Cloud\u00a0Shell\u304b\u3089CloudSQL\u306b\u63a5\u7d9a\u3067403\u30a8\u30e9\u30fc\u306b\u306a\u308b"},"content":{"rendered":"\n<p>GCP\uff08Google\u00a0Cloud\u00a0Platform\uff09\u3067\u3001Cloud\u00a0Shell\u304b\u3089\u3001Cloud\u00a0SQL\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001403\u30a8\u30e9\u30fc\u306b\u306a\u308a\u3001\u63a5\u7d9a\u3067\u304d\u306a\u3044\u3002GCP\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5171\u6709\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u3054\u3068\u306b\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308b\u30e6\u30fc\u30b6\u3068\u3001\u6b63\u5e38\u306b\u63a5\u7d9a\u3067\u304d\u308b\u30e6\u30fc\u30b6\u304c\u3044\u308b\uff08\u306e\u3067\u3001Cloud\u00a0SQL\u306e\u30b5\u30fc\u30d3\u30b9\u306e\u554f\u984c\u3067\u306f\u306a\u3044\uff09\u3002\u539f\u56e0\u306f\u3001CGP\u306eIAM\u306e\u8a2d\u5b9a\u306e\u4e0d\u5099\u3002<\/p>\n\n\n\n<p>\u63a5\u7d9a\u304c\u30a8\u30e9\u30fc\u306e\u3068\u304d<\/p>\n\n\n\n<pre>\nzen@cloudshell:~ (devPJ)$ gcloud sql connect devDB --user=conusr\nERROR: (gcloud.sql.connect) HTTPError 403: The client is not authorized to make this request.\nzen@cloudshell:~ (devPJ)$\n<\/pre>\n\n\n\n<p>\u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u3068\u304d\uff08MySQL\u306e\u30e6\u30fc\u30b6\u8a8d\u8a3c\u306f\u5225\uff09<\/p>\n\n\n\n<pre>\nzen@cloudshell:~ (devPJ)$ gcloud sql connect devDB --user=conusr\nWhitelisting your IP for incoming connection for 5 minutes...\u283c     \n<\/pre>\n\n\n\n<p>\u5bfe\u51e6<\/p>\n\n\n\n<p>Clolud\u00a0Shell\u304b\u3089\u3001Cloud\u00a0SQL\u306b\u63a5\u7d9a\u3059\u308b\u306b\u306f\u3001GCP\u306eIAM\u3067\u3001\u300cCloud\u00a0SQL\u00a0\u7de8\u96c6\u8005\u300d\u306e\u6a29\u9650\u3092\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u95b2\u89a7\u8005\u3060\u3068\u3001Cloud\u00a0Shell\u304b\u3089\u306f\u63a5\u7d9a\u3067\u304d\u305a\u3001403\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"377\" src=\"https:\/\/www.xenos.jp\/~zen\/blog2\/wp-content\/uploads\/2019\/11\/GCP-CloudSQL-IAM.png\" alt=\"\" class=\"wp-image-3290\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>GCP\uff08Google\u00a0Cloud\u00a0Platform\uff09\u3067\u3001Cloud\u00a0Shell\u304b\u3089\u3001Cloud\u00a0SQL\u306b\u63a5\u7d9a\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001403\u30a8\u30e9\u30fc\u306b\u306a\u308a\u3001\u63a5\u7d9a\u3067\u304d\u306a\u3044\u3002GCP\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5171\u6709\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u3054\u3068\u306b\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308b\u30e6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[185,184,92],"class_list":["post-3289","post","type-post","status-publish","format-standard","hentry","category-tech-memo","tag-cloudsql","tag-gcp","tag-google"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/3289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/comments?post=3289"}],"version-history":[{"count":1,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/3289\/revisions"}],"predecessor-version":[{"id":3291,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/3289\/revisions\/3291"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=3289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=3289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=3289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}