G-gen Tech Blog
Google Cloud(æ§ç§°GCP)ã®æ
å ±çºä¿¡ãè¡ãæè¡ããã°
2025-01-15T09:00:00+09:00
ggen-sugimura
Hatena::Blog
hatenablog://blog/13574176438010059131
Google Workspaceã®ã¨ã³ããã¤ã³ã管çã§ã¢ãã¤ã«ããã¤ã¹ãå®å
¨ã«ç®¡çãã
hatenablog://entry/6802418398306498772
2025-01-15T09:00:00+09:00
2025-01-15T09:00:02+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãGoogle Workspace ã® ã¨ã³ããã¤ã³ã管çã使ç¨ãã¦ãiPhone ã Android 端æ«ãªã©ã®ã¢ãã¤ã«ç«¯æ«ã管çããæ¹æ³ãç´¹ä»ãã¾ãã æ¦è¦ ã¨ã³ããã¤ã³ã管çã¨ã¯ ã¨ã³ããã¤ã³ã管çã使ç¨ããã¡ãªãã åææ¡ä»¶ åºæ¬ç®¡çã¨è©³ç´°ç®¡ç iOS ããã¤ã¹ã®è©³ç´°ç®¡ç æ¤è¨¼æé ã¨ã³ããã¤ã³ãè¨å® ããã¤ã¹ã®ç»é²ï¼iOS/Androidï¼ ããã¤ã¹ã®ç»é²ç¢ºèªï¼iOS/Androidï¼ iOS ã®ããªã·ã¼è¨å® Android ã®ããªã·ã¼è¨å® åä½ç¢ºèª iOS ã®åä½ç¢ºèªï¼ãã¼ã«ã«ä¿åä¸å¯ï¼ Android ã®åä½ç¢ºèªï¼æ¥åç¨ã¢ããªã®é
å¸ï¼ Androâ¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãGoogle Workspace ã® ã¨ã³ããã¤ã³ã管çã使ç¨ãã¦ãiPhone ã Android 端æ«ãªã©ã®ã¢ãã¤ã«ç«¯æ«ã管çããæ¹æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a><ul>
<li><a href="#ã¨ã³ããã¤ã³ã管çã¨ã¯">ã¨ã³ããã¤ã³ã管çã¨ã¯</a></li>
<li><a href="#ã¨ã³ããã¤ã³ã管çã使ç¨ããã¡ãªãã">ã¨ã³ããã¤ã³ã管çã使ç¨ããã¡ãªãã</a></li>
</ul>
</li>
<li><a href="#åææ¡ä»¶">åææ¡ä»¶</a><ul>
<li><a href="#åºæ¬ç®¡çã¨è©³ç´°ç®¡ç">åºæ¬ç®¡çã¨è©³ç´°ç®¡ç</a></li>
<li><a href="#iOS-ããã¤ã¹ã®è©³ç´°ç®¡ç">iOS ããã¤ã¹ã®è©³ç´°ç®¡ç</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼æé ">æ¤è¨¼æé </a></li>
<li><a href="#ã¨ã³ããã¤ã³ãè¨å®">ã¨ã³ããã¤ã³ãè¨å®</a><ul>
<li><a href="#ããã¤ã¹ã®ç»é²iOSAndroid">ããã¤ã¹ã®ç»é²ï¼iOS/Androidï¼</a></li>
<li><a href="#ããã¤ã¹ã®ç»é²ç¢ºèªiOSAndroid">ããã¤ã¹ã®ç»é²ç¢ºèªï¼iOS/Androidï¼</a></li>
<li><a href="#iOS-ã®ããªã·ã¼è¨å®">iOS ã®ããªã·ã¼è¨å®</a></li>
<li><a href="#Android-ã®ããªã·ã¼è¨å®">Android ã®ããªã·ã¼è¨å®</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#iOS-ã®åä½ç¢ºèªãã¼ã«ã«ä¿åä¸å¯">iOS ã®åä½ç¢ºèªï¼ãã¼ã«ã«ä¿åä¸å¯ï¼</a></li>
<li><a href="#Android-ã®åä½ç¢ºèªæ¥åç¨ã¢ããªã®é
å¸">Android ã®åä½ç¢ºèªï¼æ¥åç¨ã¢ããªã®é
å¸ï¼</a></li>
<li><a href="#Android-ã®åä½ç¢ºèªã¢ã«ã¦ã³ãã¯ã¤ã">Android ã®åä½ç¢ºèªï¼ã¢ã«ã¦ã³ãã¯ã¤ãï¼</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090136.png" width="800" height="448" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<h2 id="ã¨ã³ããã¤ã³ã管çã¨ã¯">ã¨ã³ããã¤ã³ã管çã¨ã¯</h2>
<p><strong>ã¨ã³ããã¤ã³ã管ç</strong>ã¯ãGoogle Workspace ãæä¾ããããã¤ã¹ç®¡çæ©è½ã§ããå¾æ¥å¡ã使ç¨ããã¢ãã¤ã«ç«¯æ«ããã½ã³ã³ãä¸å
çã«ç®¡çããçµç¹ã®ã»ãã¥ãªãã£ããªã·ã¼ãé©ç¨ã§ãã¾ãã</p>
<p>ä¸è¬çã«ããã®ãããªããã¤ã¹ç®¡çã®ä»çµã¿ã¯ <strong>MDM</strong>ï¼Mobile Device Managementï¼ã¨å¼ã°ãã¾ããMDM ã¯ãã»ãã¥ãªãã£ããªã·ã¼ã®é©ç¨ãã¢ããªã®é
å¸ãããã¤ã¹ã®ç£è¦ãç´å¤±ã»çé£æã®ãã¼ã¿æ¶å»ãªã©ã®æ©è½ãæä¾ãããã¼ã«å
¨è¬ãæãã¾ãã</p>
<ul>
<li>åè : <a href="https://workspace.google.com/intl/ja/products/admin/endpoint/">ã¨ã³ããã¤ã³ã管ç</a></li>
</ul>
<h2 id="ã¨ã³ããã¤ã³ã管çã使ç¨ããã¡ãªãã">ã¨ã³ããã¤ã³ã管çã使ç¨ããã¡ãªãã</h2>
<p>Google Workspace ã®ã¨ã³ããã¤ã³ã管çã使ç¨ããã¨ã以ä¸ã®ãããªã¡ãªãããããã¾ãã</p>
<table>
<thead>
<tr>
<th> ã¡ãªãã </th>
<th> 詳細 </th>
</tr>
</thead>
<tbody>
<tr>
<td> Google Workspace ã¨ã®ã·ã¼ã ã¬ã¹ãªçµ±å </td>
<td> ã¢ã«ã¦ã³ãã¨ç«¯æ«ã®ç®¡çãä¸å
åã§ãã¾ãã<strong>ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹</strong>㧠Gmail ã Google ãã©ã¤ãã¸ã®æè»ãªã¢ã¯ã»ã¹å¶å¾¡ãå¯è½ã§ãã </td>
</tr>
<tr>
<td> 追å è²»ç¨ãå°ç¨ã¢ããªä¸è¦ </td>
<td> Business Plus ã Enterprise ãã©ã³ãªã©ã«æ¨æºæè¼ããã¦ããã<strong>追å è²»ç¨ãå°ç¨ã¢ããªã¯ä¸è¦</strong>ã§ãã </td>
</tr>
<tr>
<td> Android ã¼ãã¿ããç»é²ã¨ BYOD </td>
<td> ã¼ãã¿ããç»é²ã§å¤æ°ã®ç«¯æ«ãç°¡åã«ã»ããã¢ããã§ãã¾ããã¾ãå人ææããã¤ã¹ï¼BYODï¼ã«ããã¦ãæ¥åãã¼ã¿ã¨å人ãã¼ã¿ãåé¢ã§ããããã«ãªããã»ãã¥ãªãã£ã¨ãã©ã¤ãã·ã¼ã両ç«ã§ãã¾ãã </td>
</tr>
</tbody>
</table>
<p><strong>ã¼ãã¿ããç»é²</strong>åã³<strong>ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹</strong>ã®è©³ç´°ãªè¨å®æé ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ãã¨è¨äºãåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/topic/13782289?hl=ja">Android ã®ã¼ãã¿ããç»é²ã®è¨å®</a></li>
</ul>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcontext-aware-access-with-google-workspace" title="ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã§Google Workspaceã®ã»ãã¥ãªãã£ãå¼·åãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/context-aware-access-with-google-workspace">blog.g-gen.co.jp</a></cite></p>
<h1 id="åææ¡ä»¶">åææ¡ä»¶</h1>
<h3 id="åºæ¬ç®¡çã¨è©³ç´°ç®¡ç">åºæ¬ç®¡çã¨è©³ç´°ç®¡ç</h3>
<p>Google Workspace ã®ã¨ã³ããã¤ã³ã管çã«ã¯ã<strong>åºæ¬ç®¡ç</strong>ã¨<strong>詳細管ç</strong>ãããã¾ããGoogle Workspace ã®ã¨ãã£ã·ã§ã³ã«ãã£ã¦ãã©ã¡ãã®æ©è½ãå©ç¨ã§ãããã決ã¾ãã¾ãã</p>
<table>
<thead>
<tr>
<th> æ©è½ã®å称 </th>
<th> 詳細 </th>
</tr>
</thead>
<tbody>
<tr>
<td> <strong>åºæ¬ç®¡ç</strong> </td>
<td> ããã¤ã¹ç»é²ãç´å¤±æã® Google ã¢ã«ã¦ã³ããªã¢ã¼ãåé¤ã<BR>ããã¤ã¹ã®ã»ãã¥ãªãã£ã¹ãã¼ã¿ã¹ï¼ä¾ï¼OS ãã¼ã¸ã§ã³ï¼<BR>ã®ç¢ºèªãªã©ã®åºæ¬çãªç®¡çæ©è½ãæä¾ãã¾ãã </td>
</tr>
<tr>
<td> <strong>詳細管ç</strong> </td>
<td> çµç¹ã§è¨±å¯ããã¦ããªãã¢ããªãç¦æ¢ããæ©è½ããã¼ã¿æä½å¶é<BR>ãªã©ãããé«åº¦ãªå¶å¾¡ãå¯è½ãå人ææããã¤ã¹ï¼BYODï¼<BR>ãã¼ãã¿ããç»é²ã«ãããæè»ã«ããã¤ã¹ã管çã§ãã¾ãã</td>
</tr>
</tbody>
</table>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/7576736?hl=ja">ã¢ãã¤ã«ç®¡çæ©è½ã®æ¯è¼</a></li>
</ul>
<h3 id="iOS-ããã¤ã¹ã®è©³ç´°ç®¡ç">iOS ããã¤ã¹ã®è©³ç´°ç®¡ç</h3>
<p>iOS ããã¤ã¹ã§è©³ç´°ç®¡çãè¡ãã«ã¯ãApple ããã·ã¥è¨¼ææ¸ãå¿
è¦ã§ãããã®è¨¼ææ¸ã¯ Apple Push Certificates Portal ã§åå¾ã§ãã¾ãã詳細ã¯ä»¥ä¸ã®ããã¥ã¡ã³ãã確èªãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/9904735?hl=ja">ä¼ç¤¾ææã® iOS ããã¤ã¹ã®ç®¡çãè¨å®ãã</a></li>
<li>åè : <a href="https://support.google.com/a/answer/6080359?hl=ja">Apple ããã·ã¥è¨¼ææ¸ãè¨å®ãã</a></li>
</ul>
<h1 id="æ¤è¨¼æé ">æ¤è¨¼æé </h1>
<p>以ä¸ã®æé ã§ã¨ã³ããã¤ã³ã管çãè¨å®ããåä½ã確èªãã¾ãã</p>
<ol>
<li><p><strong>ããã¤ã¹ã®ç»é²ï¼iOS/Androidï¼</strong><br/>
管çã³ã³ã½ã¼ã«ã«ããã¤ã¹ãç»é²ãã¾ãã</p></li>
<li><p><strong>iOS ã®ããªã·ã¼è¨å®</strong><br/>
Google ãã©ã¤ããããã¥ã¡ã³ãã®æ¥åãã¼ã¿ããã¼ã«ã«ï¼ä¾ï¼Files ã¢ããªï¼ã«ä¿åã§ããªãããå¶éãã¾ãã</p></li>
<li><p><strong>Android ã®ããªã·ã¼è¨å®</strong><br/>
æ¥åç¨ã¢ããªï¼ä¾ï¼Google Geminiï¼ããªã¢ã¼ãé
å¸ããããã®è¨å®ããã¾ãã</p></li>
<li><p><strong>iOS åä½ç¢ºèªï¼ãã¼ã«ã«ä¿åä¸å¯ï¼</strong><br/>
æ¥åãã¼ã¿ã Files ã¢ããªã«ä¿åã§ããªããã¨ã確èªãã¾ãã</p></li>
<li><p><strong>Android åä½ç¢ºèªï¼æ¥åç¨ã¢ããªã®é
å¸ï¼</strong><br/>
æ¥åç¨ã¢ããªãã¤ã³ã¹ãã¼ã«ãããã¢ã³ã¤ã³ã¹ãã¼ã«ã§ããªããã¨ã確èªãã¾ãã</p></li>
<li><p><strong>Android åä½ç¢ºèªï¼ã¢ã«ã¦ã³ãã¯ã¤ãï¼</strong><br/>
管çã³ã³ã½ã¼ã«ãã端æ«ä¸ã®ä¼ç¤¾ã§ä½¿ç¨ãã¦ãã Google ã¢ã«ã¦ã³ããåé¤ãã¾ãã</p></li>
</ol>
<h1 id="ã¨ã³ããã¤ã³ãè¨å®">ã¨ã³ããã¤ã³ãè¨å®</h1>
<h2 id="ããã¤ã¹ã®ç»é²iOSAndroid">ããã¤ã¹ã®ç»é²ï¼iOS/Androidï¼</h2>
<p>ããã¤ã¹ã® Google Chrome 㧠Googleï¼<a href="https://google.co.jp">https://google.co.jp</a>ï¼ã«ã¢ã¯ã»ã¹ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Googleã«ã¢ã¯ã»ã¹"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090129.png" width="800" height="379" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Googleã«ã¢ã¯ã»ã¹</figcaption></figure></p>
<p>ä¼ç¤¾ã§ä½¿ç¨ãã Google ã¢ã«ã¦ã³ãã§ãã°ã¤ã³ãããã¨ã§ã管çã³ã³ã½ã¼ã«ã«ããã¤ã¹ãç»é²ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ä¼ç¤¾ã¢ã«ã¦ã³ãã§ãã°ã¤ã³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090133.png" width="772" height="367" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ä¼ç¤¾ã¢ã«ã¦ã³ãã§ãã°ã¤ã³</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/users/answer/138740?hl=ja">iOS ããã¤ã¹ã§ Google Workspace ãè¨å®ãã</a></li>
<li>åè : <a href="https://support.google.com/a/users/answer/9370410?hl=ja">Android ããã¤ã¹ã§ Google Workspace ãè¨å®ãã</a></li>
</ul>
<h2 id="ããã¤ã¹ã®ç»é²ç¢ºèªiOSAndroid">ããã¤ã¹ã®ç»é²ç¢ºèªï¼iOS/Androidï¼</h2>
<p>Google Workspace ã®ç®¡çã³ã³ã½ã¼ã«ï¼<a href="https://admin.google.com">https://admin.google.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/182076?hl=ja">管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãã</a></li>
</ul>
<p>[ããã¤ã¹] > [ã¢ãã¤ã«ã¨ã¨ã³ããã¤ã³ã] > [ããã¤ã¹] ã¸ç§»åãããã£ã«ã¿ãã<strong>ã¡ã¼ã«ã¢ãã¬ã¹</strong>ã§ããã¤ã¹ãæ½åºããç»é²ããã¦ãããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ãã¤ã«ç«¯æ«ã®ç»é²ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090008.png" width="800" height="311" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ãã¤ã«ç«¯æ«ã®ç»é²ç¢ºèª</figcaption></figure></p>
<h2 id="iOS-ã®ããªã·ã¼è¨å®">iOS ã®ããªã·ã¼è¨å®</h2>
<p>[ã¢ãã¤ã«ã¨ã¨ã³ããã¤ã³ã] > [è¨å®] > [iOS] > [ãã¼ã¿å
±æ] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã¼ã¿å
±æãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090011.png" width="800" height="303" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¼ã¿å
±æãé¸æ</figcaption></figure></p>
<p>è¨å®ãé©ç¨ãã<strong>çµç¹é¨é</strong>ãé¸æãã[ãã¼ã¿æä½] ã® [ç·¨é] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ç·¨éãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090015.png" width="800" height="218" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç·¨éãé¸æ</figcaption></figure></p>
<p>以ä¸ãé¸æãã[ä¿å] ã¾ã㯠[ãªã¼ãã¼ã©ã¤ã] ãé¸æãã¾ãã</p>
<ul>
<li><strong>Google Workspace ã®ãã¼ã¿ãå¤é¨ã¨å
±æãããå¯è½æ§ã®ããæä½ã iOS ã§è¡ããã¨ãã¦ã¼ã¶ã¼ã«è¨±å¯ããªã</strong></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="è¨å®ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090018.png" width="800" height="571" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>è¨å®ãé¸æ</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15405201?hl=ja">iOS ããã¤ã¹ã§ã®é失ã«ãããã¼ã¿æ¼æ´©ãé²æ¢ãã</a></li>
</ul>
<h2 id="Android-ã®ããªã·ã¼è¨å®">Android ã®ããªã·ã¼è¨å®</h2>
<p>[ã¢ãã¤ã«ã¨ã¨ã³ããã¤ã³ã] > [è¨å®] > [ä¸è¬] > [å
¨è¬] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="å
¨è¬ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090022.png" width="800" height="301" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å
¨è¬ãé¸æ</figcaption></figure></p>
<p>è¨å®ãé©ç¨ãã<strong>çµç¹é¨é</strong>ãé¸æãã[ã¢ãã¤ã«ç®¡ç] ã® [ç·¨é] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ç·¨éãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090025.png" width="800" height="177" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç·¨éãé¸æ</figcaption></figure></p>
<p>[ã«ã¹ã¿ã ] ãã <code>Android</code> ã<strong>詳細</strong>ã«å¤æ´ãã[ä¿å] ã¾ã㯠[ãªã¼ãã¼ã©ã¤ã] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="è¨å®ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090028.png" width="800" height="598" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>è¨å®ãé¸æ</figcaption></figure></p>
<p>[ã¢ããª] > [ã¦ã§ãã¢ããªã¨ã¢ãã¤ã«ã¢ããª] ã¸ç§»åãã[ã¢ããªã追å ] ãã [éå®å
¬éã® Android ã¢ããªã追å ] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="éå®å
¬éã®Androidã¢ããªã追å ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090031.png" width="742" height="400" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>éå®å
¬éã®Androidã¢ããªã追å ãé¸æ</figcaption></figure></p>
<p>æ¤ç´¢ãã¼ã« <strong>Gemini</strong> ã¨å
¥åãããªã¹ããã <strong>Google Gemini</strong> ãé¸æãã[é¸æ] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Geminiã¢ããªãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090034.png" width="532" height="427" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Geminiã¢ããªãé¸æ</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090037.png" width="621" height="197" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>é¸æ</figcaption></figure></p>
<p>ã¢ããªãé©ç¨ãã対象ï¼å
¨ã¦ã¼ã¶ã¼ã¾ãã¯ç¹å®ã®çµç¹é¨éã Google ã°ã«ã¼ãï¼ãé¸æãã[ç¶è¡] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¤ã³ã¹ãã¼ã«å¯¾è±¡ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090040.png" width="800" height="465" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¤ã³ã¹ãã¼ã«å¯¾è±¡ãé¸æ</figcaption></figure></p>
<p>以ä¸ãé¸æãã[å®äº] ãé¸æãã¾ãã</p>
<ul>
<li><strong>èªåã¤ã³ã¹ãã¼ã«</strong></li>
<li><strong>ã¦ã¼ã¶ã¼ãã¢ããªãã¢ã³ã¤ã³ã¹ãã¼ã«ã§ããªãããã«ãã</strong></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ããªã¸ã®ã¢ã¯ã»ã¹æ¹æ³ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090043.png" width="800" height="448" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªã¸ã®ã¢ã¯ã»ã¹æ¹æ³ãé¸æ</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/2494992?hl=ja">éå®å
¬éã® Android ã¢ããªã Google Play ã§ç®¡çãã</a></li>
</ul>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="iOS-ã®åä½ç¢ºèªãã¼ã«ã«ä¿åä¸å¯">iOS ã®åä½ç¢ºèªï¼ãã¼ã«ã«ä¿åä¸å¯ï¼</h2>
<p>Google ããã¥ã¡ã³ãã¢ããªãèµ·åããä¼ç¤¾ã§ä½¿ã£ã¦ãã Google ã¢ã«ã¦ã³ããé¸æãã¾ãã</p>
<p>Google ããã¥ã¡ã³ããã¡ã¤ã«ãéããå³ä¸ã® [â¦] ãé¸æãã¾ãã</p>
<p> <figure class="figure-image figure-image-fotolife" title="... ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090102.png" width="800" height="139" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>... ãé¸æ</figcaption></figure></p>
<p>[å
±æã¨ã¨ã¯ã¹ãã¼ã] > [ã³ãã¼ãéä¿¡] > [PDF] > [OK] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã³ãã¼ãéä¿¡ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090105.png" width="516" height="365" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã³ãã¼ãéä¿¡ãé¸æ</figcaption></figure></p>
<p>["ãã¡ã¤ã«"ã«ä¿å] ãé¸æããã¨ã<strong>ãã¡ã¤ã«ãå
±æã§ãã¾ãã</strong>ã¨è¡¨ç¤ºããããã¼ã«ã«ã«ä¿åãã§ããªããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã¡ã¤ã«ã«ä¿åãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090108.png" width="483" height="338" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¡ã¤ã«ã«ä¿åãé¸æ</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ãã¼ã«ã«ã¸ã®ä¿å失æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090111.png" width="540" height="242" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¼ã«ã«ã¸ã®ä¿å失æ</figcaption></figure></p>
<h2 id="Android-ã®åä½ç¢ºèªæ¥åç¨ã¢ããªã®é
å¸">Android ã®åä½ç¢ºèªï¼æ¥åç¨ã¢ããªã®é
å¸ï¼</h2>
<p>è¨å®ã¢ããªããä¼ç¤¾ã§ä½¿ã£ã¦ãã Google ã¢ã«ã¦ã³ããé¸æããä»äºç¨ãããã¡ã¤ã«ã®ã»ããã¢ãããéå§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ä»äºç¨ãããã¡ã¤ã«ã®ã»ããã¢ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090052.png" width="230" height="484" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ä»äºç¨ãããã¡ã¤ã«ã®ã»ããã¢ãã</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/users/answer/9370410?hl=ja#zippy=%2C%E5%80%8B%E4%BA%BA%E3%81%AE%E3%83%87%E3%83%90%E3%82%A4%E3%82%B9%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%2C%E4%BB%95%E4%BA%8B%E7%94%A8%E3%83%97%E3%83%AD%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E4%BD%9C%E6%88%90">ä»äºç¨ãããã¡ã¤ã«ã®ä½æ</a></li>
</ul>
<p>以ä¸ã¡ãã»ã¼ã¸ã表示ãããå ´åã[ã¢ãã¤ã«ã¨ã¨ã³ããã¤ã³ã] > [ããã¤ã¹ã®æ¿èª] ãã端æ«ãé¸æãã[ããã¤ã¹ãæ¿èª] ãé¸æãã¾ãã</p>
<p><code>ãã®ããã¤ã¹ã¯æå¹ã«ãªã£ã¦ãã¾ãã 管çè
ã«ããããã¤ã¹ã®æ¿èªãå¿
è¦ã§ãã</code></p>
<p><figure class="figure-image figure-image-fotolife" title="ããã¤ã¹æªæ¿èªã¨ã©ã¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090046.png" width="352" height="243" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ããã¤ã¹æªæ¿èªã¨ã©ã¼</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ãã¤ã«ç«¯æ«ã®æ¿èª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090049.png" width="800" height="124" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ãã¤ã«ç«¯æ«ã®æ¿èª</figcaption></figure></p>
<p>ã»ããã¢ãããå®äºããã¨ãè¨å®ããã¢ããªã表示ããã¾ããæ¥åç¨ã¢ããªã¯ã¢ããªã®ã¢ã¤ã³ã³ã«éã®ã¢ã¤ã³ã³ã表示ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¥åç¨ã¢ããªã®ã¤ã³ã¹ãã¼ã«ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090055.png" width="340" height="178" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¥åç¨ã¢ããªã®ã¤ã³ã¹ãã¼ã«ç¢ºèª</figcaption></figure></p>
<p>æ¥åã¢ããªã¯ãå
ã®è¨å®ã®éããã¢ã³ã¤ã³ã¹ãã¼ã«ãããã¨ããã¨å¤±æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¥åç¨ã¢ããªã®ã¢ã³ã¤ã³ã¹ãã¼ã«ä¸å¯ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090058.png" width="392" height="590" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¥åç¨ã¢ããªã®ã¢ã³ã¤ã³ã¹ãã¼ã«ä¸å¯ç¢ºèª</figcaption></figure></p>
<h2 id="Android-ã®åä½ç¢ºèªã¢ã«ã¦ã³ãã¯ã¤ã">Android ã®åä½ç¢ºèªï¼ã¢ã«ã¦ã³ãã¯ã¤ãï¼</h2>
<p>[ããã¤ã¹] > [ã¢ãã¤ã«ã¨ã¨ã³ããã¤ã³ã] > [ããã¤ã¹] ãã端æ«ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Android ããã¤ã¹ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090117.png" width="800" height="182" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Android ããã¤ã¹ãé¸æ</figcaption></figure></p>
<p>[ãã®ä»] > [ã¢ã«ã¦ã³ããã¯ã¤ã] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ã«ã¦ã³ããã¯ã¤ããé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090120.png" width="364" height="528" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã«ã¦ã³ããã¯ã¤ããé¸æ</figcaption></figure></p>
<p>[ã¢ã«ã¦ã³ããã¯ã¤ã] ãé¸æããã¯ã¤ããå®è¡ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¯ã¤ãã®å®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090114.png" width="536" height="461" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¯ã¤ãã®å®è¡</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ã¯ã¤ãå¾ã®ããã¤ã¹ã¹ãã¼ã¿ã¹"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090123.png" width="800" height="256" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¯ã¤ãå¾ã®ããã¤ã¹ã¹ãã¼ã¿ã¹</figcaption></figure></p>
<p>ã¤ã³ã¹ãã¼ã«ããæ¥åã¢ããªãåé¤ããã¦ãããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¥åã¢ããªã®åé¤ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250115/20250115090126.png" width="316" height="180" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¥åã¢ããªã®åé¤ç¢ºèª</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/173390?hl=ja">ããã¤ã¹ããä¼æ¥ãã¼ã¿ãã¯ã¤ããã</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
BigQuery MLãå¾¹åºè§£èª¬ï¼
hatenablog://entry/6802418398318856635
2025-01-14T09:00:00+09:00
2025-01-14T09:05:38+09:00 G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ BigQuery ä¸ã§æ©æ¢°å¦ç¿ã¢ãã«ãä½æãè©ä¾¡ãå®è¡ããããã®æ©è½ã§ãã BigQuery ML ã«ã¤ãã¦è§£èª¬ãã¾ãã æ¦è¦ BigQuery ã¨ã¯ BigQuery ML ã¨ã¯ BigQuery ML ã®ä½¿ç¨æ¹æ³ ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹ BigQuery Editions ã¯ã¨ãªã®ãã©ã¤ã©ã³ BigQuery ML ã§ãµãã¼ããããã¢ãã« å
é¨ã¢ãã« å¤é¨ã¢ãã« ã¤ã³ãã¼ããããã¢ãã« ãªã¢ã¼ãã¢ãã« ã¦ã¼ã¶ã¼ã Vertex AI ã§ãããã¤ããã¢ãã« Google ã®çæ AI ã¢ãã« ã¿ã¹ã¯åºæã®ã½ãªã¥ã¼ã·ã§ã³ åºæ¬ç㪠SQL ã¹ãã¼ãã¡ã³ãâ¦
<p>G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ BigQuery ä¸ã§æ©æ¢°å¦ç¿ã¢ãã«ãä½æãè©ä¾¡ãå®è¡ããããã®æ©è½ã§ãã <strong>BigQuery ML</strong> ã«ã¤ãã¦è§£èª¬ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a><ul>
<li><a href="#BigQuery-ã¨ã¯">BigQuery ã¨ã¯</a></li>
<li><a href="#BigQuery-ML-ã¨ã¯">BigQuery ML ã¨ã¯</a></li>
</ul>
</li>
<li><a href="#BigQuery-ML-ã®ä½¿ç¨æ¹æ³">BigQuery ML ã®ä½¿ç¨æ¹æ³</a><ul>
<li><a href="#ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹">ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹</a></li>
<li><a href="#BigQuery-Editions">BigQuery Editions</a></li>
<li><a href="#ã¯ã¨ãªã®ãã©ã¤ã©ã³">ã¯ã¨ãªã®ãã©ã¤ã©ã³</a></li>
</ul>
</li>
<li><a href="#BigQuery-ML-ã§ãµãã¼ããããã¢ãã«">BigQuery ML ã§ãµãã¼ããããã¢ãã«</a><ul>
<li><a href="#å
é¨ã¢ãã«">å
é¨ã¢ãã«</a></li>
<li><a href="#å¤é¨ã¢ãã«">å¤é¨ã¢ãã«</a></li>
<li><a href="#ã¤ã³ãã¼ããããã¢ãã«">ã¤ã³ãã¼ããããã¢ãã«</a></li>
<li><a href="#ãªã¢ã¼ãã¢ãã«">ãªã¢ã¼ãã¢ãã«</a><ul>
<li><a href="#ã¦ã¼ã¶ã¼ã-Vertex-AI-ã§ãããã¤ããã¢ãã«">ã¦ã¼ã¶ã¼ã Vertex AI ã§ãããã¤ããã¢ãã«</a></li>
<li><a href="#Google-ã®çæ-AI-ã¢ãã«">Google ã®çæ AI ã¢ãã«</a></li>
<li><a href="#ã¿ã¹ã¯åºæã®ã½ãªã¥ã¼ã·ã§ã³">ã¿ã¹ã¯åºæã®ã½ãªã¥ã¼ã·ã§ã³</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#åºæ¬çãª-SQL-ã¹ãã¼ãã¡ã³ãé¢æ°">åºæ¬ç㪠SQL ã¹ãã¼ãã¡ã³ãã»é¢æ°</a><ul>
<li><a href="#CREATE-MODEL-ã¹ãã¼ãã¡ã³ã">CREATE MODEL ã¹ãã¼ãã¡ã³ã</a></li>
<li><a href="#MLEVALUATE-é¢æ°">ML.EVALUATE é¢æ°</a></li>
<li><a href="#MLPREDICT-é¢æ°">ML.PREDICT é¢æ°</a></li>
</ul>
</li>
<li><a href="#ç¹å¾´éã®åå¦ç">ç¹å¾´éã®åå¦ç</a><ul>
<li><a href="#èªååå¦ç">èªååå¦ç</a></li>
<li><a href="#æååå¦çTRANSFORM-ã¹ãã¼ãã¡ã³ã">æååå¦çï¼TRANSFORM ã¹ãã¼ãã¡ã³ãï¼</a></li>
</ul>
</li>
<li><a href="#ã¢ãã«ã®ã¢ãã¿ãªã³ã°">ã¢ãã«ã®ã¢ãã¿ãªã³ã°</a></li>
<li><a href="#BigQuery-ML-ã®æé">BigQuery ML ã®æé</a><ul>
<li><a href="#ãªã³ããã³ãæé">ãªã³ããã³ãæé</a></li>
<li><a href="#BigQuery-Editions-ã®æé">BigQuery Editions ã®æé</a></li>
<li><a href="#å¤é¨ã¢ãã«ã®æé">å¤é¨ã¢ãã«ã®æé</a></li>
<li><a href="#ãªã¢ã¼ãã¢ãã«ã®æé">ãªã¢ã¼ãã¢ãã«ã®æé</a></li>
</ul>
</li>
<li><a href="#ä»ã®æ©æ¢°å¦ç¿ç³»ãããã¯ãã¨ã®çµ±å">ä»ã®æ©æ¢°å¦ç¿ç³»ãããã¯ãã¨ã®çµ±å</a><ul>
<li><a href="#Vertex-AI">Vertex AI</a></li>
<li><a href="#Colab-Enterprise">Colab Enterprise</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250112/20250112073648.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<h2 id="BigQuery-ã¨ã¯">BigQuery ã¨ã¯</h2>
<p><a href="https://cloud.google.com/bigquery/docs/introduction?hl=ja">BigQuery</a> ã¯ãGoogle Cloud ã®ãã«ããã¼ã¸ãåæç¨ãã¼ã¿ãã¼ã¹ï¼ãã¼ã¿ã¦ã§ã¢ãã¦ã¹ï¼ãµã¼ãã¹ã§ããã¤ã³ãã©ç®¡çä¸è¦ã®åæç¨ãã¼ã¿ãã¼ã¹ãå¾é課éã§ä½¿ç¨ã§ãã¾ãã</p>
<p>å½è¨äºã§ã¯ BigQuery èªä½ã®èª¬æã¯å²æãã¾ãããããã¯ãã®å
¨å®¹ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-explained-basics" title="BigQueryãå¾¹åºè§£èª¬ï¼(åºæ¬ç·¨) - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-explained-basics">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-explained-advanced" title="BigQueryãå¾¹åºè§£èª¬ï¼(å¿ç¨ç·¨) - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-explained-advanced">blog.g-gen.co.jp</a></cite></p>
<h2 id="BigQuery-ML-ã¨ã¯">BigQuery ML ã¨ã¯</h2>
<p><strong>BigQuery ML</strong> ã¨ã¯ãBigQuery ä¸ã§æ©æ¢°å¦ç¿ã¢ãã«ã®ãã¬ã¼ãã³ã°ãäºæ¸¬ãè©ä¾¡ãè¡ããã¨ãã§ããæ©è½ã§ããBigQuery ã§ä½¿ãããæ¨æº SQL æºæ ã® <strong>GoogleSQL</strong> ã使ç¨ããBigQuery ä¸ã®ãã¼ã¿ã使ã£ãæ©æ¢°å¦ç¿ã容æã«å®ç¾ã§ãã¾ãã</p>
<p>é常ãæ©æ¢°å¦ç¿ã¢ãã«ã®éçºã«ã¯ãæ©æ¢°å¦ç¿ãã¬ã¼ã ã¯ã¼ã¯ã«å¯¾ããé«åº¦ãªç¥èã¨ããã°ã©ãã³ã°æè¡ãè¦æ±ããã¾ãããã®ãããªå°éçã¹ãã«ãæã¤ã¡ã³ãã¼ã®ç¢ºä¿ãé£ããå ´åã§ãã£ã¦ããBigQuery ML ã§ã¯ <strong>SQL ã®ç¥èãããã°ã¢ãã«ã®éçºãè¡ããã¨ãã§ãã¾ã</strong>ã</p>
<p>BigQuery ML ã§ã¯ãã¢ãã«ã®ãã¬ã¼ãã³ã°ãäºæ¸¬ã§ä½¿ç¨ãããã¼ã¿ã¯ BigQuery èªä½ã«æ ¼ç´ããã¦ãããã®ãã·ã¼ã ã¬ã¹ã«ä½¿ç¨ãããã¨ãã§ãã<strong>ãã¼ã¿ã®èç©ã»ã¢ãã«ã®å¦ç¿ã»äºæ¸¬ã®å®è¡ã BigQuery å
ã§å®çµãã¾ãã</strong>ããã«ãããã¢ãã«éçºã®ããã®ç¿çãå¿
è¦ãªãã¼ã«ãæ¸ããã¾ã大éã®ãã¼ã¿ç§»åã«ããæéã»æéãªã©ã®ã³ã¹ããæãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/bqml-introduction?hl=ja">BigQuery ã® AI 㨠ML ã®æ¦è¦</a></li>
</ul>
<h1 id="BigQuery-ML-ã®ä½¿ç¨æ¹æ³">BigQuery ML ã®ä½¿ç¨æ¹æ³</h1>
<h2 id="ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹">ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹</h2>
<p>BigQuery ML ã¯ã以ä¸ã®ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§å©ç¨ãããã¨ãã§ãã¾ãã</p>
<ul>
<li><a href="https://cloud.google.com/bigquery/docs/bigquery-web-ui?hl=ja">Google Cloud ã³ã³ã½ã¼ã«</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/bq-command-line-tool?hl=ja">bq ã³ãã³ãã©ã¤ã³ ãã¼ã«</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/rest">BigQuery REST API</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/notebooks-introduction?hl=ja">BigQuery ã«çµ±åããã Colab Enterprise ãã¼ãããã¯</a></li>
<li>Jupyter ãã¼ãããã¯ããã¸ãã¹ ã¤ã³ããªã¸ã§ã³ã¹ ãã©ãããã©ã¼ã ãªã©ã®å¤é¨ãã¼ã«</li>
</ul>
<p>Google Cloud ã³ã³ã½ã¼ã«ãã使ç¨ããã¨ãBigQuery ã§é常㮠SQL ãå®è¡ããã¨ãã¨åæ§ã®ä½¿ç¨æ㧠BigQuery ML ã®æ©è½ãå©ç¨ãããã¨ãã§ãã¾ãã</p>
<p>5çªç®ã® Jupyter ãã¼ãããã¯ã使ã£ãæ¹æ³ã«ã¤ãã¦ã以ä¸ã®è¨äºã§ã¯ããã«ããã¼ã¸ãã® Jupyter ãã¼ãããã¯ç°å¢ã§ãã <strong>Vertex AI Workbench</strong> ããããã¸ãã¯ã³ãã³ã <code>%%bigquery</code> 㧠BigQuery ML ã使ç¨ããä¾ã示ããã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbuilding-kmeans-model-with-bigquery-ml" title="Vertex AI Workbenchã¨BigQuery MLã§æ©æ¢°å¦ç¿ã¢ãã«(ã¯ã©ã¹ã¿ãªã³ã°)ãæ§ç¯ãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/building-kmeans-model-with-bigquery-ml">blog.g-gen.co.jp</a></cite></p>
<h2 id="BigQuery-Editions">BigQuery Editions</h2>
<p>BigQuery ã®èª²éã¢ã¼ãã¨ãã¦<strong>ãªã³ããã³ã</strong>ãé¸æãã¦ããå ´åãBigQuery ML ãå¾é課éã§ä½¿ç¨ãããã¨ãã§ãã¾ãã</p>
<p>課éã¢ã¼ãã¨ã㦠<strong>BigQuery Editions</strong>ãé¸æãã¦ããå ´åãBigQuery ML 㯠Enterprise ãã£ã¢ããã³ Enterprise Plus ãã£ã¢ã§ã®ã¿ä½¿ç¨ãããã¨ãã§ãã¾ãï¼Standard ãã£ã¢ã§ã¯ä½¿ç¨ä¸å¯ï¼ã</p>
<p>BigQuery Editions ã®è©³ç´°ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-editions-explained" title="BigQuery Editionsãå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-editions-explained">blog.g-gen.co.jp</a></cite></p>
<h2 id="ã¯ã¨ãªã®ãã©ã¤ã©ã³">ã¯ã¨ãªã®ãã©ã¤ã©ã³</h2>
<p>BigQuery ML ã«éãããBigQuery ã§ã¯ã¯ã¨ãªå®è¡åã«<strong>ãã©ã¤ã©ã³</strong>ãè¡ããã¨ã§ãå®éã«å¦çãè¡ãåã«ãå¦çããããã¼ã¿éããªã³ããã³ãã§çºçããæéãè¦ç©ããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã©ã¤ã©ã³ã«ãããå¦çããããã¼ã¿éãã¯ã¨ãªå®è¡åã«ç¢ºèªã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090540.png" width="800" height="196" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã©ã¤ã©ã³ã«ãããå¦çããããã¼ã¿éãã¯ã¨ãªå®è¡åã«ç¢ºèªã§ãã</figcaption></figure></p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/running-queries?hl=ja#dry-run">ãã©ã¤ã©ã³</a></li>
</ul>
<h1 id="BigQuery-ML-ã§ãµãã¼ããããã¢ãã«">BigQuery ML ã§ãµãã¼ããããã¢ãã«</h1>
<p>以éã«ç´¹ä»ããã®ã¯2025å¹´1ææç¹ã§ãµãã¼ãããã¦ããã¢ãã«ã§ããææ°ã®ãµãã¼ãç¶æ³ã«ã¤ãã¦ã¯ä»¥ä¸ã®ãªã³ã¯å
ãåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/bqml-introduction?hl=ja#supported_models">BigQuery ã® AI 㨠ML ã®æ¦è¦ - ãµãã¼ãããã¦ããã¢ãã«</a></li>
</ul>
<h2 id="å
é¨ã¢ãã«">å
é¨ã¢ãã«</h2>
<p>BigQuery ML ã®çµã¿è¾¼ã¿ã®ã¢ãã«ã¨ãã¦ã以ä¸ã®ã¢ãã«ã使ç¨ã㦠BigQuery å
é¨ã§ãã¬ã¼ãã³ã°ãè¡ããã¨ãã§ãã¾ãã</p>
<ul>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-contribution-analysis">è²¢ç®åº¦åæï¼Contribution analysisï¼</a>ï¼2025å¹´1æç¾å¨ããã¬ãã¥ã¼ï¼</li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-glm">ç·å½¢å帰ï¼Linear regressionï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-glm">ãã¸ã¹ãã£ãã¯å帰ï¼Logistic regressionï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-kmeans">K å¹³åæ³ã¯ã©ã¹ã¿ãªã³ã°ï¼K-means clusteringï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-matrix-factorization">è¡åå解ï¼Matrix factorizationï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-pca">主æååæï¼PCA: Principal component analysisï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-time-series">æç³»åï¼Time seriesï¼</a></li>
</ul>
<p>ã¢ãã«ã®ä½ææã«ä½¿ç¨ãã <code>CREATE MODEL</code> ã¹ãã¼ãã¡ã³ãï¼å¾è¿°ï¼ã® <code>OPTIONS</code> ã§ããã¬ã¼ãã³ã°ã«ä½¿ç¨ããã¢ãã«ãæå®ã§ãã¾ãã</p>
<h2 id="å¤é¨ã¢ãã«">å¤é¨ã¢ãã«</h2>
<p>以ä¸ã®ã¢ãã«ã¯ BigQuery ML ã®å¤é¨ã«ãããå¥ã® AI/ML ãµã¼ãã¹ã§ãã <strong>Vertex AI</strong> ã使ç¨ãã¦ãã¬ã¼ãã³ã°ããã¾ãã</p>
<ul>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-dnn-models">ãã£ã¼ã ãã¥ã¼ã©ã« ãããã¯ã¼ã¯ï¼DNN: Deep neural networkï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-wnd-models">ã¯ã¤ãï¼ãã£ã¼ãï¼Wide & Deepï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-autoencoder">ãªã¼ãã¨ã³ã³ã¼ãï¼Autoencoderï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-boosted-tree">ãã¼ã¹ãããªã¼ï¼Boosted Treeï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-random-forest">ã©ã³ãã ãã©ã¬ã¹ãï¼Random forestï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-automl">AutoML</a></li>
</ul>
<h2 id="ã¤ã³ãã¼ããããã¢ãã«">ã¤ã³ãã¼ããããã¢ãã«</h2>
<p>BigQuery ã®å¤é¨ã§ãã¬ã¼ãã³ã°ãããã«ã¹ã¿ã ã¢ãã«ã Cloud Storage ããã¤ã³ãã¼ãããBigQuery ML ã§äºæ¸¬ãå®è¡ãããã¨ãã§ãã¾ããBigquery ML ã§ã¤ã³ãã¼ãã§ããã¢ãã«ã®ç¨®é¡ã¯ä»¥ä¸ã®éãã§ãã</p>
<ul>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-onnx">Open Neural Network Exchangeï¼ONNXï¼</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-tensorflow">TensorFlow</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-tflite">TensorFlow Lite</a></li>
<li><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-xgboost">XGBoost</a></li>
</ul>
<h2 id="ãªã¢ã¼ãã¢ãã«">ãªã¢ã¼ãã¢ãã«</h2>
<h3 id="ã¦ã¼ã¶ã¼ã-Vertex-AI-ã§ãããã¤ããã¢ãã«">ã¦ã¼ã¶ã¼ã Vertex AI ã§ãããã¤ããã¢ãã«</h3>
<p><a href="https://cloud.google.com/bigquery/docs/bqml-introduction?hl=ja#remote_models">ãªã¢ã¼ãã¢ãã«</a>ã§ã¯ãVertex AI ã§ãããã¤ããæ©æ¢°å¦ç¿ã¢ãã«ã使ç¨ãã¦äºæ¸¬ãå®è¡ãããã¨ãã§ãã¾ããã¢ãã«ã大ããã㦠BigQuery ã«ã¤ã³ãã¼ãã§ããªãå ´åãªã©ã«ä½¿ç¨ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Vertex AI ã§ãããã¤ããã¢ãã«ããªã¢ã¼ãã¢ãã«ã¨ãã¦ä½¿ç¨ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090557.png" width="800" height="386" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Vertex AI ã§ãããã¤ããã¢ãã«ããªã¢ã¼ãã¢ãã«ã¨ãã¦ä½¿ç¨ãã</figcaption></figure></p>
<h3 id="Google-ã®çæ-AI-ã¢ãã«">Google ã®çæ AI ã¢ãã«</h3>
<p>BigQuery ML ããã¯ã<strong>Gemini</strong> çãVertex AI ã§æä¾ããã <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models?hl=ja#foundation_models">Google ã®çæ AI ã¢ãã«</a>ããªã¢ã¼ãã¢ãã«ã¨ãã¦å©ç¨ã§ãã¾ãã</p>
<p>以ä¸ã®è¨äºã§ã¯ãBigQuery ML ã®ãªã¢ã¼ãã¢ãã«ã§ Google éçºã®å¤§è¦æ¨¡è¨èªã¢ãã«ã§ãã <strong>PaLM 2</strong> ã使ç¨ãã¦ãããã¹ãã®ææ
åæãè¡ã£ã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fusing-palm2-with-bigquery-ml" title="BigQuery MLã§Vertex AIã®åºç¤ã¢ãã«PaLM2ãå¼ã³åºãã¦ææ
åæãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/using-palm2-with-bigquery-ml">blog.g-gen.co.jp</a></cite></p>
<p>ãªã¢ã¼ãã¢ãã«ã¨ãã¦ä½¿ç¨ã§ããçæ AI ã¢ãã«ã®ææ°æ
å ±ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/generative-ai-overview">Generative AI overview</a></li>
</ul>
<h3 id="ã¿ã¹ã¯åºæã®ã½ãªã¥ã¼ã·ã§ã³">ã¿ã¹ã¯åºæã®ã½ãªã¥ã¼ã·ã§ã³</h3>
<p>BigQuery ML ãããGoogle Cloud ãç¨æãããç¹å®ã®ã¿ã¹ã¯ã«ç¹åããæ©æ¢°å¦ç¿ã¢ãã«ã® APIï¼<strong>äºåãã¬ã¼ãã³ã°æ¸ã¿ API</strong>ï¼ãå©ç¨ã§ãã¾ãã</p>
<p>å©ç¨å¯è½ãªäºåãã¬ã¼ãã³ã°æ¸ã¿ API ã«ã¯ä»¥ä¸ã®ãããªç¨®é¡ãããã¾ãããããã GoogleSQL ã®é¢æ°ã使ç¨ãã¦ãªã¯ã¨ã¹ããéä¿¡ãã¾ãã</p>
<table>
<thead>
<tr>
<th> ã¿ã¹ã¯ </th>
<th> API ã®åå </th>
<th> GoogleSQL ã®é¢æ° </th>
</tr>
</thead>
<tbody>
<tr>
<td> èªç¶è¨èªå¦ç </td>
<td> <a href="https://cloud.google.com/natural-language">Cloud Natural Language API</a> </td>
<td> <a href="https://cloud.google.com/bigquery/docs/understand-text">ML.UNDERSTAND_TEXT</a> </td>
</tr>
<tr>
<td> æ©æ¢°ç¿»è¨³ </td>
<td> <a href="https://cloud.google.com/translate">Cloud Translation API</a> </td>
<td> <a href="https://cloud.google.com/bigquery/docs/translate-text">ML.TRANSLATE</a> </td>
</tr>
<tr>
<td> é³å£°æåå¤æ </td>
<td> <a href="https://cloud.google.com/speech-to-text">Speech-to-Text API</a> </td>
<td> <a href="https://cloud.google.com/bigquery/docs/transcribe">ML.TRANSCRIBE</a> </td>
</tr>
<tr>
<td> ããã¥ã¡ã³ãå¦ç </td>
<td> <a href="https://cloud.google.com/document-ai">Document AI API</a> </td>
<td> <a href="https://cloud.google.com/bigquery/docs/process-document">ML.PROCESS_DOCUMENT</a> </td>
</tr>
<tr>
<td> ã³ã³ãã¥ã¼ã¿ ãã¸ã§ã³ </td>
<td> <a href="https://cloud.google.com/vision">Cloud Vision API</a> </td>
<td> <a href="https://cloud.google.com/bigquery/docs/annotate-image">ML.ANNOTATE_IMAGE</a> </td>
</tr>
</tbody>
</table>
<h1 id="åºæ¬çãª-SQL-ã¹ãã¼ãã¡ã³ãé¢æ°">åºæ¬ç㪠SQL ã¹ãã¼ãã¡ã³ãã»é¢æ°</h1>
<p><a href="https://cloud.google.com/bigquery/docs/create-machine-learning-model">å
¬å¼ããã¥ã¡ã³ãã®ãã¥ã¼ããªã¢ã«</a> ãå
ã«ãBigQuery ML ã«ãããåºæ¬ç㪠SQL æã解説ãã¾ãã</p>
<p>ã¢ãã«ãå ´é¢ã«å¿ãã¦ã©ã®ãããªã¹ãã¼ãã¡ã³ãã»é¢æ°ã使ç¨ã§ããã®ãã¯ã以ä¸ã®ããã¥ã¡ã³ãã§è§£èª¬ããã¦ãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/e2e-journey">åã¢ãã«ã®ã¨ã³ããã¼ã¨ã³ãã®ã¦ã¼ã¶ã¼ ã¸ã£ã¼ãã¼</a></li>
</ul>
<h2 id="CREATE-MODEL-ã¹ãã¼ãã¡ã³ã">CREATE MODEL ã¹ãã¼ãã¡ã³ã</h2>
<p>BigQuery ML ã§ã¯ãGoogleSQL ã® <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create">CREATE MODEL</a> ã¹ãã¼ãã¡ã³ãã使ç¨ãã¦ã¢ãã«ã®ãã¬ã¼ãã³ã°ãè¡ãã¾ãã</p>
<p>ã¢ãã«ã®ä½æã«ã¯ <code>CREATE MODEL</code> ã®ä»ã«ããã¼ã¿ã»ããå
ã«åãååã®ã¢ãã«ãåå¨ããªãå ´åã®ã¿ã¢ãã«ãä½æãã <code>CREATE MODEL IF NOT EXISTS</code> ããåãååã®ã¢ãã«ãåå¨ãã¦ããå ´åã¯ç½®ãæãã <code>CREATE OR REPLACE MODEL</code> ã¹ãã¼ãã¡ã³ããå©ç¨ã§ãã¾ãã</p>
<p>以ä¸ã¯ã<code>CREATE OR REPLACE MODEL</code> ã¹ãã¼ãã¡ã³ãã使ç¨ãã¦ã<code>bqml_tutorial</code> ãã¼ã¿ã»ããå
ã« <code>sample_model</code> ã¨ããååã§ãã¸ã¹ãã£ãã¯å帰ã¢ãã«ãä½æããä¾ã§ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink>#standardSQL
<span class="synStatement">CREATE</span> <span class="synStatement">OR</span> <span class="synIdentifier">REPLACE</span> MODEL `bqml_tutorial.sample_model`
OPTIONS(model_type = <span class="synSpecial">'</span><span class="synConstant">logistic_reg</span><span class="synSpecial">'</span>) <span class="synSpecial">AS</span> <span class="synStatement">SELECT</span>
<span class="synSpecial">IF</span>(totals.transactions <span class="synSpecial">IS</span> <span class="synSpecial">NULL</span>, <span class="synConstant">0</span>, <span class="synConstant">1</span>) <span class="synSpecial">AS</span> label,
IFNULL(device.operatingSystem, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> os,
device.isMobile <span class="synSpecial">AS</span> is_mobile,
IFNULL(geoNetwork.country, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> country,
IFNULL(totals.pageviews, <span class="synConstant">0</span>) <span class="synSpecial">AS</span> pageviews
<span class="synSpecial">FROM</span>
`bigquery-<span class="synSpecial">public</span>-data.google_analytics_sample.ga_sessions_*`
<span class="synSpecial">WHERE</span>
_TABLE_SUFFIX <span class="synStatement">BETWEEN</span> <span class="synSpecial">'</span><span class="synConstant">20160801</span><span class="synSpecial">'</span> <span class="synStatement">AND</span> <span class="synSpecial">'</span><span class="synConstant">20170630</span><span class="synSpecial">'</span>
</pre>
<p>使ç¨ããã¢ãã«ã¯ <code>OPTIONS</code> ã® <code>model_type=</code> ã§è¨å®ãã¦ãã¾ãã<code>FROM</code> ã§æå®ãããã¼ã¿ããã<code>SELECT</code> ã§æå®ããç¹å¾´éã使ç¨ãã¦ã¢ãã«ã®å¦ç¿ãè¡ã£ã¦ãã¾ãã</p>
<p>Google Cloud ã³ã³ã½ã¼ã«ã <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-train">ML.TRAINING_INFO</a> é¢æ°ã使ç¨ãããã¨ã§ãã¢ãã«ã®ãã¬ã¼ãã³ã°æã®çµ±è¨æ
å ±ã確èªãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¯ã¨ãªã®çµæã¨ãã¦ãã¬ã¼ãã³ã°æã®çµ±è¨æ
å ±ã確èªã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090543.png" width="800" height="385" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¯ã¨ãªã®çµæã¨ãã¦ãã¬ã¼ãã³ã°æã®çµ±è¨æ
å ±ã確èªã§ãã</figcaption></figure></p>
<p>ãã¬ã¼ãã³ã°ããã¢ãã«ã®å種è©ä¾¡ææ¨ã¯ãã¢ãã«ã®è©³ç´°ãããã¤ã§ã確èªãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ä½æããã¢ãã«ã®å種è©ä¾¡ææ¨ã確èªãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090547.png" width="800" height="564" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ä½æããã¢ãã«ã®å種è©ä¾¡ææ¨ã確èªãã</figcaption></figure></p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/model-overview">ã¢ãã«ã®ä½æ</a></li>
</ul>
<h2 id="MLEVALUATE-é¢æ°">ML.EVALUATE é¢æ°</h2>
<p>ä½æããã¢ãã«ã®è©ä¾¡ã¯ <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-evaluate">ML.EVALUATE</a> é¢æ°ã§è¡ããã¨ãã§ãã¾ãã</p>
<p>以ä¸ã® SQL ãå®è¡ãããã¨ã§ã<code>ML.EVALUATE</code> é¢æ°ã® <code>MODEL</code> å¼æ°ã§æå®ããã¢ãã«ã«å¯¾ãã¦è©ä¾¡ãè¡ãã¾ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink>#standardSQL
<span class="synStatement">SELECT</span>
*
<span class="synSpecial">FROM</span>
ML.EVALUATE(
MODEL `bqml_tutorial.sample_model`,
(
<span class="synStatement">SELECT</span>
<span class="synSpecial">IF</span>(totals.transactions <span class="synSpecial">IS</span> <span class="synSpecial">NULL</span>, <span class="synConstant">0</span>, <span class="synConstant">1</span>) <span class="synSpecial">AS</span> label,
IFNULL(device.operatingSystem, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> os,
device.isMobile <span class="synSpecial">AS</span> is_mobile,
IFNULL(geoNetwork.country, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> country,
IFNULL(totals.pageviews, <span class="synConstant">0</span>) <span class="synSpecial">AS</span> pageviews
<span class="synSpecial">FROM</span>
`bigquery-<span class="synSpecial">public</span>-data.google_analytics_sample.ga_sessions_*`
<span class="synSpecial">WHERE</span>
_TABLE_SUFFIX <span class="synStatement">BETWEEN</span> <span class="synSpecial">'</span><span class="synConstant">20170701</span><span class="synSpecial">'</span> <span class="synStatement">AND</span> <span class="synSpecial">'</span><span class="synConstant">20170801</span><span class="synSpecial">'</span>
)
)
</pre>
<p>ã³ã³ã½ã¼ã«ä¸ã§ã®åºåã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ML.EVALUATE é¢æ°ã«ããã¢ãã«ã®è©ä¾¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090550.png" width="800" height="151" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ML.EVALUATE é¢æ°ã«ããã¢ãã«ã®è©ä¾¡</figcaption></figure></p>
<p>è©ä¾¡æã«åºåãããææ¨ã¯ã¢ãã«ã®ç¨®é¡ã«ãã£ã¦ç°ãªãã¾ããã¾ãã<code>ML.CONFUSION_MATRIX</code>ï¼æ··åè¡åï¼ã <code>ML.ROC_CURVE</code>ï¼ROC æ²ç·ï¼ãªã©ã®é¢æ°ãæä¾ããã¦ãã¾ãã</p>
<p>詳細ã¯ä»¥ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/evaluate-overview">BigQuery ML ã¢ãã«ã®è©ä¾¡ã®æ¦è¦</a></li>
</ul>
<h2 id="MLPREDICT-é¢æ°">ML.PREDICT é¢æ°</h2>
<p>ä½æããã¢ãã«ã使ç¨ãã¦äºæ¸¬ãè¡ãã«ã¯ã<a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-predict">ML.PREDICT</a> é¢æ°ã使ç¨ãã¾ãã</p>
<p>以ä¸ã®ããã« <code>ML.PREDICT</code> é¢æ°ã® <code>MODEL</code> å¼æ°ã§æå®ããã¢ãã«ã使ç¨ãã¦äºæ¸¬ãè¡ãã¾ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink>#standardSQL
<span class="synStatement">SELECT</span>
country,
<span class="synIdentifier">SUM</span>(predicted_label) <span class="synSpecial">AS</span> total_predicted_purchases
<span class="synSpecial">FROM</span>
ML.PREDICT(
MODEL `bqml_tutorial.sample_model`,
(
<span class="synStatement">SELECT</span>
IFNULL(device.operatingSystem, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> os,
device.isMobile <span class="synSpecial">AS</span> is_mobile,
IFNULL(totals.pageviews, <span class="synConstant">0</span>) <span class="synSpecial">AS</span> pageviews,
IFNULL(geoNetwork.country, <span class="synSpecial">""</span>) <span class="synSpecial">AS</span> country
<span class="synSpecial">FROM</span>
`bigquery-<span class="synSpecial">public</span>-data.google_analytics_sample.ga_sessions_*`
<span class="synSpecial">WHERE</span>
_TABLE_SUFFIX <span class="synStatement">BETWEEN</span> <span class="synSpecial">'</span><span class="synConstant">20170701</span><span class="synSpecial">'</span> <span class="synStatement">AND</span> <span class="synSpecial">'</span><span class="synConstant">20170801</span><span class="synSpecial">'</span>
)
)
<span class="synSpecial">GROUP</span> <span class="synSpecial">BY</span> country
<span class="synSpecial">ORDER</span> <span class="synSpecial">BY</span> total_predicted_purchases <span class="synSpecial">DESC</span>
LIMIT <span class="synConstant">10</span>
</pre>
<p>ã³ã³ã½ã¼ã«ä¸ã§ã®åºåã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ML.PREDICT é¢æ°ã«ããäºæ¸¬"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250114/20250114090554.png" width="587" height="383" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ML.PREDICT é¢æ°ã«ããäºæ¸¬</figcaption></figure></p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/inference-overview">ã¢ãã«æ¨å®ã®æ¦è¦</a></li>
</ul>
<h1 id="ç¹å¾´éã®åå¦ç">ç¹å¾´éã®åå¦ç</h1>
<h2 id="èªååå¦ç">èªååå¦ç</h2>
<p>BigQuery ML ã§ã¯èªååå¦çã¨ãã¦ãã¢ãã«ã®ãã¬ã¼ãã³ã°æã«ä»¥ä¸ã®åå¦çãèªåã§è¡ã£ã¦ãã¾ãã</p>
<ul>
<li>æ¬ æãã¼ã¿ã®è£å®</li>
<li>å¤ã®å¤æï¼æ¨æºåãã¯ã³ãããã¨ã³ã³ã¼ãã£ã³ã°ãã¿ã¤ã ã¹ã¿ã³ãã®å¤æãªã©ï¼</li>
</ul>
<p>èªååå¦çã®è©³ç´°ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/auto-preprocessing">èªåç¹å¾´åå¦ç</a></li>
</ul>
<h2 id="æååå¦çTRANSFORM-ã¹ãã¼ãã¡ã³ã">æååå¦çï¼TRANSFORM ã¹ãã¼ãã¡ã³ãï¼</h2>
<p><code>TRANSFORM</code> ã¹ãã¼ãã¡ã³ãã使ç¨ãããã¨ã§ãåå¦çç¨ã®é¢æ°ã使ç¨ãããã¨ãã§ãã¾ãã</p>
<p>ãã¨ãã°ã以ä¸ã® SQL ã§ã¯ã<code>ML.QUANTILE_BUCKETIZE</code> é¢æ°ã§ <code>mother_age</code> åã®<a href="https://developers.google.com/machine-learning/crash-course/numerical-data/binning">ãã±ããåï¼ããã³ã°ï¼</a>ãã<code>ML.FEATURE_CROSS</code> é¢æ°ã§ <code>is_male</code> å㨠<code>mother_race</code> åã®<a href="https://developers.google.com/machine-learning/crash-course/categorical-data/feature-crosses">ç¹å¾´ã¯ãã¹</a>ãä½æããåå¦çãè¡ã£ã¦ããã¢ãã«ãä½æãã¦ãã¾ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink>#standardSQL
<span class="synStatement">CREATE</span> MODEL `bqml_tutorial.natality_model`
TRANSFORM(
weight_pounds,
is_male,
gestation_weeks,
ML.QUANTILE_BUCKETIZE(mother_age, <span class="synConstant">5</span>) OVER() <span class="synSpecial">AS</span> bucketized_mother_age,
<span class="synIdentifier">CAST</span>(mother_race <span class="synSpecial">AS</span> string) <span class="synSpecial">AS</span> mother_race,
ML.FEATURE_CROSS(
STRUCT(
is_male,
<span class="synIdentifier">CAST</span>(mother_race <span class="synSpecial">AS</span> STRING) <span class="synSpecial">AS</span> mother_race
)
) is_male_mother_race
)
OPTIONS (
model_type = <span class="synSpecial">'</span><span class="synConstant">linear_reg</span><span class="synSpecial">'</span>,
input_label_cols = [<span class="synSpecial">'</span><span class="synConstant">weight_pounds</span><span class="synSpecial">'</span>]
) <span class="synSpecial">AS</span> <span class="synStatement">SELECT</span>
*
<span class="synSpecial">FROM</span>
`bigquery-<span class="synSpecial">public</span>-data.samples.natality`
<span class="synSpecial">WHERE</span>
weight_pounds <span class="synSpecial">IS</span> <span class="synStatement">NOT</span> <span class="synSpecial">NULL</span> <span class="synStatement">AND</span> RAND() < <span class="synConstant">0</span>.<span class="synConstant">001</span>
</pre>
<p>ãã®ä»ãæååå¦çã«ä½¿ç¨ã§ããé¢æ°ã«ã¤ãã¦ã¯ä»¥ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/manual-preprocessing">æåã§ã®ç¹å¾´ã®åå¦ç</a></li>
</ul>
<h1 id="ã¢ãã«ã®ã¢ãã¿ãªã³ã°">ã¢ãã«ã®ã¢ãã¿ãªã³ã°</h1>
<p><code>ML.VALIDATE_DATA_SKEW</code> é¢æ°ã <code>ML.VALIDATE_DATA_DRIFT</code> é¢æ°ã使ç¨ãããã¨ã§ããã¬ã¼ãã³ã°ã«ä½¿ç¨ãããã¼ã¿ã¨ãå®éã®ã¢ãã«éç¨æã«äºæ¸¬ã«ä½¿ç¨ããããã¼ã¿ï¼ãµã¼ãã³ã°ãã¼ã¿ï¼ã®çµ±è¨æ
å ±ãæ¯è¼ãã<strong>ãã¼ã¿ã¹ãã¥ã¼</strong>ã<strong>ãã¼ã¿ããªãã</strong>ã®çºçãæ¤ç¥ãããã¨ãã§ãã¾ãã</p>
<p><strong>ãã¼ã¿ã¹ãã¥ã¼ï¼Data Skewï¼</strong>ã¨ã¯ããã¬ã¼ãã³ã°ã§ä½¿ç¨ãããã¼ã¿ã®åå¸ã¨ãæ¬çªç°å¢ã§æä¾ããããã¼ã¿ã®åå¸ã大ããç°ãªã£ã¦ãããã¨ã«ãããã¢ãã«ã®äºæ¸¬æ§è½ãä¸ãã£ã¦ãã¾ãç¾è±¡ã®ãã¨ã§ãããã¬ã¼ãã³ã°ãé©åã«è¡ãã¦ããªãç¶æ³ã§ããã¨èãããã¾ãã</p>
<p><strong>ãã¼ã¿ããªããï¼Data Driftï¼</strong>ã¨ã¯ãæ¬çªç°å¢ã§æä¾ããããã¼ã¿ã®åå¸ãæéã®çµéã¨ã¨ãã«å¤§ããå¤åãã¦ãã¾ããã¨ã«ãããã¢ãã«ã®äºæ¸¬æ§è½ãä¸ãã£ã¦ãã¾ãç¾è±¡ã®ãã¨ã§ããã¢ãã«ã®å£åã¨æãã¦ãããã§ãããã</p>
<p>ã¢ãã«ã®ã¢ãã¿ãªã³ã°ã«ä½¿ç¨ã§ããé¢æ°ã®ç¨®é¡ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/docs/model-monitoring-overview">ã¢ãã« ã¢ãã¿ãªã³ã°ã®æ¦è¦</a></li>
</ul>
<h1 id="BigQuery-ML-ã®æé">BigQuery ML ã®æé</h1>
<p>BigQuery ML ã®æéã®è©³ç´°ããã³ææ°æ
å ±ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/bigquery/pricing?hl=en#bqml">BigQuery ML pricing</a></li>
</ul>
<h2 id="ãªã³ããã³ãæé">ãªã³ããã³ãæé</h2>
<p>BigQuery ã®èª²éã¢ã¼ãããªã³ããã³ãã®å ´åãBigQuery ã§å¦çããããã¼ã¿ã®ãã¤ãæ°ã«å¿ãã¦èª²éãçºçãã¾ããã¢ãã«ä½æã¨äºæ¸¬ã§ãã¤ãæ°ãããã®æéå価ãç°ãªãç¹ã«æ³¨æãå¿
è¦ã§ãã</p>
<p>ãã¨ãã°ããã¸ã¹ãã£ãã¯å帰ã¢ãã«ãç·åå帰ã¢ãã«ã®ä½ææã®ãã¬ã¼ãã³ã°ã§ã¯ <code>$375/1TB</code>ãè©ä¾¡ã»äºæ¸¬ã¿ã¹ã¯ã§ã¯ <code>$7.5/1TB</code> ã®æéãçºçãã¾ãï¼æ±äº¬ãªã¼ã¸ã§ã³ã2025å¹´1ææç¹ï¼ã</p>
<h2 id="BigQuery-Editions-ã®æé">BigQuery Editions ã®æé</h2>
<p>課éã¢ã¼ãã¨ã㦠BigQuery Editions ãå©ç¨ããå ´åãBigQuery ML ã®æé㯠Editions ã®ä½¿ç¨éã«å«ã¾ãã¾ãã</p>
<p>使ç¨ããã¢ãã«ã«ãã£ã¦å©ç¨ããã <a href="https://cloud.google.com/bigquery/docs/reservations-intro?hl=ja#assignments">Editions ã®å²ãå½ã¦</a>ãç°ãªããå
é¨ã¢ãã«ã®ä½æã»äºæ¸¬ã«ã¯ Editions ã® <code>QUERY</code> å²ãå½ã¦ããå¤é¨ã¢ãã«ã®å©ç¨ã«ã¯ <code>ML_EXTERNAL</code> ãå©ç¨ããã¾ãã</p>
<h2 id="å¤é¨ã¢ãã«ã®æé">å¤é¨ã¢ãã«ã®æé</h2>
<p>BigQuery å¤é¨ã®ã¢ãã«ã使ç¨ãã¦ãã¬ã¼ãã³ã°ãè¡ãå¤é¨ã¢ãã«ã§ã¯ããªã³ããã³ãã®æéããã㯠BigQuery Editions ã®æéï¼BigQuery ã§å¦çãããã¶ãã®æéï¼ã«å ãã<a href="https://cloud.google.com/vertex-ai/pricing?hl=ja">Vertex AI ã®ãã¬ã¼ãã³ã°æé</a>ãçºçãã¾ãã</p>
<h2 id="ãªã¢ã¼ãã¢ãã«ã®æé">ãªã¢ã¼ãã¢ãã«ã®æé</h2>
<p>ãªã¢ã¼ãã¢ãã«ã§ãå¤é¨ã¢ãã«åæ§ã«ã BigQuery ã§å¦çãããã¶ãã®æéã«å ãããªã¢ã¼ãã¢ãã«ã¨ãã¦ä½¿ç¨ãããµã¼ãã¹ã®æéãé©ç¨ããã¾ãã</p>
<p>ãã¨ãã°ããªã¢ã¼ãã¢ãã«ã¨ã㦠Cloud AI Vision API ã使ç¨ããå ´å㯠<a href="https://cloud.google.com/vision/pricing?hl=ja">Cloud AI Vision API ã®æé</a>ããVertex AI ã®åºç¤ã¢ãã«ï¼çæ AI ã¢ãã«ï¼ã使ç¨ããå ´å㯠<a href="https://cloud.google.com/vertex-ai/generative-ai/pricing?hl=ja">Vertex AI ã®æé</a>ã追å ã§çºçãã¾ãã</p>
<h1 id="ä»ã®æ©æ¢°å¦ç¿ç³»ãããã¯ãã¨ã®çµ±å">ä»ã®æ©æ¢°å¦ç¿ç³»ãããã¯ãã¨ã®çµ±å</h1>
<h2 id="Vertex-AI">Vertex AI</h2>
<p><a href="https://cloud.google.com/vertex-ai/docs/start/introduction-unified-platform?hl=ja">Vertex AI</a> ã¯æ©æ¢°å¦ç¿ã¢ãã«ã®éçºã«é¢ããæ§ã
ãªæ©è½ãçµ±åããããããã¯ãã§ãã</p>
<p>Vertex AI ã«ã¯éçºããæ©æ¢°å¦ç¿ã¢ãã«ãéä¸ç®¡çããããã® <a href="https://cloud.google.com/vertex-ai/docs/model-registry/introduction?hl=ja">Model Registry</a> ã¨ããæ©è½ããããBigQuery ML ã§éçºããã¢ãã«ãããã§ç®¡çãããã¨ãã§ãã¾ãã</p>
<p>Model Registory ã§ç®¡çããã¦ããã¢ãã«ã¯ãã¼ã¸ã§ãã³ã°ãè©ä¾¡ããããã¤ã容æã«è¡ããã¨ãã§ãã¾ããVertex AI ã® <a href="https://cloud.google.com/vertex-ai/docs/general/deployment?hl=ja">Endpoints</a> æ©è½ã§ã¯ããã«ããã¼ã¸ãã®å®è¡ç°å¢ã«ã¢ãã«ããããã¤ããçæãããã¨ã³ããã¤ã³ãã使ç¨ãã¦ãªã³ã©ã¤ã³ã®äºæ¸¬ãå®è¡ãããã¨ãã§ãã¾ãã</p>
<p>Vertex AI ã®è©³ç´°ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fvertexai-explained" title="Vertex AI ãå¾¹åºè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/vertexai-explained">blog.g-gen.co.jp</a></cite></p>
<h2 id="Colab-Enterprise">Colab Enterprise</h2>
<p><a href="https://cloud.google.com/colab/docs/introduction">Colab Enterprise</a> ã¯ãGoogle Cloud ä¸ã«äºåæ§ç¯ãããããã¼ã¸ããªãã¼ãããã¯ç°å¢ãæä¾ãããµã¼ãã¹ã§ãã</p>
<p>Colab Enterprise ã®ãã¼ãããã¯ã使ç¨ãã¦ããã¼ãããã¯ãã BigQuery ML ã«ããã¿ã¹ã¯ãå®è¡ãããã¨ãã§ãã¾ããã¢ãã«ã®éçºæã« Python ã®æ©æ¢°å¦ç¿ã©ã¤ãã©ãªã使ç¨ããè¤éãªãã¼ã¿å¦çãå¿
è¦ãªå ´åãªã©ã«æ´»ç¨ã§ãã¾ãã</p>
<p>Colab Enterprise ã®ãµã¼ãã¹è©³ç´°ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcolab-enterprise-and-vertexai-workbench-explained" title="Colab Enterpriseã¨Vertex AI Workbenchãå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/colab-enterprise-and-vertexai-workbench-explained">blog.g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
Evantarcã¨Workflowsã§ã¤ãã³ãããªãã³ã«Cloud Run jobsãå®è¡ãã¦ã¿ã
hatenablog://entry/6802418398309256704
2025-01-10T09:00:00+09:00
2025-01-10T09:00:01+09:00 G-gen ã®åºå£ã§ããæ¬è¨äºã§ã¯ãEvantarc 㨠Workflows ãå©ç¨ã㦠ã¤ãã³ãããªãã³ã« Cloud Run jobs ãå®è¡ããæ¹æ³ããç´¹ä»ãã¾ãã æ¦è¦ Cloud Run functions 㨠Cloud Run jobs æ¤è¨¼ã®æ¦è¦ Eventarc Workflows Cloud Storage ã®æºå Cloud Storage ãã±ããã®ä½æ Cloud Strage ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸ BigQuery ãã¼ãã«ã®ä½æ Cloud Run jobs ã®ä½æ ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ Docker ã³ã³ããã®ä½æã«å¿
è¦ãªãªã½ã¼ã¹ã®ä½æ mainâ¦
<p>G-gen ã®åºå£ã§ããæ¬è¨äºã§ã¯ãEvantarc 㨠Workflows ãå©ç¨ã㦠ã¤ãã³ãããªãã³ã« Cloud Run jobs ãå®è¡ããæ¹æ³ããç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a><ul>
<li><a href="#Cloud-Run-functions-ã¨-Cloud-Run-jobs">Cloud Run functions 㨠Cloud Run jobs</a></li>
<li><a href="#æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</a></li>
<li><a href="#Eventarc">Eventarc</a></li>
<li><a href="#Workflows">Workflows</a></li>
</ul>
</li>
<li><a href="#Cloud-Storage-ã®æºå">Cloud Storage ã®æºå</a><ul>
<li><a href="#Cloud-Storage-ãã±ããã®ä½æ">Cloud Storage ãã±ããã®ä½æ</a></li>
<li><a href="#Cloud-Strage-ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸">Cloud Strage ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸</a></li>
</ul>
</li>
<li><a href="#BigQuery-ãã¼ãã«ã®ä½æ">BigQuery ãã¼ãã«ã®ä½æ</a></li>
<li><a href="#Cloud-Run-jobs-ã®ä½æ">Cloud Run jobs ã®ä½æ</a><ul>
<li><a href="#ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ</a></li>
<li><a href="#Docker-ã³ã³ããã®ä½æã«å¿
è¦ãªãªã½ã¼ã¹ã®ä½æ">Docker ã³ã³ããã®ä½æã«å¿
è¦ãªãªã½ã¼ã¹ã®ä½æ</a><ul>
<li><a href="#mainpy">main.py</a></li>
<li><a href="#requirementstxt">requirements.txt</a></li>
<li><a href="#Procfile">Procfile</a></li>
</ul>
</li>
<li><a href="#Artifact-Registry-ã®ä½æ">Artifact Registry ã®ä½æ</a></li>
<li><a href="#Artifact-Registry-ã«ã¢ãããã¼ã">Artifact Registry ã«ã¢ãããã¼ã</a></li>
<li><a href="#Cloud-Run-jobs-ã®ä½æ-1">Cloud Run jobs ã®ä½æ</a></li>
</ul>
</li>
<li><a href="#Workflows-ã®ä½æ">Workflows ã®ä½æ</a><ul>
<li><a href="#ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®</a></li>
<li><a href="#ã¯ã¼ã¯ããã¼ã®ä½æ">ã¯ã¼ã¯ããã¼ã®ä½æ</a><ul>
<li><a href="#cloud-run-job-workflowyaml">cloud-run-job-workflow.yaml</a></li>
</ul>
</li>
<li><a href="#ã¯ã¼ã¯ããã¼ã®ãããã¤">ã¯ã¼ã¯ããã¼ã®ãããã¤</a></li>
</ul>
</li>
<li><a href="#Eventarc-ããªã¬ã¼ã®è¨å®">Eventarc ããªã¬ã¼ã®è¨å®</a><ul>
<li><a href="#ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®-1">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®</a></li>
<li><a href="#Eventarc-ã®ä½æ">Eventarc ã®ä½æ</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213091632.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<h2 id="Cloud-Run-functions-ã¨-Cloud-Run-jobs">Cloud Run functions 㨠Cloud Run jobs</h2>
<p>ã¤ãã³ãããªãã³ã«ãã¼ã¿ãå¦çããã«ã¯ãCloud Run functions ã使ã£ãæ¹æ³ãªã©ãããã¾ããä¾ãã°ãCloud Storage ã«ãªãã¸ã§ã¯ããæ ¼ç´ããããèªåçã« Cloud Run functions ãèµ·åãããããªå¦çããé常ã«ç°¡åã«å®è£
ã§ãã¾ããããããCloud Run functions ã«ã¯æ大9åï¼ã¤ãã³ãããªãã³é¢æ°ã®å ´åï¼ã®å®è¡æéå¶éããããªã©ãããã¤ãã®å¶ç´ãããã¾ãã</p>
<p>å½è¨äºã§ã¯ã<strong>Cloud Run jobs</strong> ã使ã£ã¦ã¤ãã³ãããªãã³ãªå¦çãå®ç¾ããæ¤è¨¼ãè¡ãã¾ãããCloud Run jobs ã«ã¯ãCloud Run functions ã¨æ¯è¼ãã¦ä»¥ä¸ã®ãããªã¡ãªãããããã¾ãã</p>
<ul>
<li>æ大å®è¡æéã168æéã§ãããã¨ï¼2025å¹´1æç¾å¨ã§ã¯24æéãè¶
ããå¦ç㯠Previewï¼</li>
<li>ã¿ã¹ã¯ã®ä¸¦åå®è¡æ°ãæ示çã«æå®å¯è½ã§ãããã¨</li>
</ul>
<p>Cloud Run jobs ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã®ã§ããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-run-jobs-explained" title="Cloud Run jobs ãå¾¹åºè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-run-jobs-explained">blog.g-gen.co.jp</a></cite></p>
<p>ã¾ã以ä¸ã®è¨äºã§ã¯ãCloud Storage ã«ããã¹ããã¡ã¤ã«ãæ ¼ç´ããããã¨ãèµ·ç¹ã¨ã㦠Cloud Run functions ãå¼ã³åºããVertex AI Gemini API ã§åå¾ããããã¹ãã®è¦ç´çµæã BigQuery ã«ä¿åããå¦çãå®è£
ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fgen-ai-with-event-driven-architecture" title="ã¤ãã³ãããªãã³ÃçæAIã§æ¥å ±ãèªåè¦ç´ãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/gen-ai-with-event-driven-architecture">blog.g-gen.co.jp</a></cite></p>
<p>å½è¨äºã§ã¯ãä¸è¨è¨äºã® Cloud Run functions ã®é¨åã Cloud Run jobs ã«ç½®ãæãã¦ãã¤ãã³ãããªãã³ã« Cloud Run jobs ãå®è¡ããæ§æãå®è£
ãã¾ãã</p>
<h2 id="æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</h2>
<p>å½è¨äºã§è¡ã£ãæ¤è¨¼ã®ã¢ã¼ããã¯ãã£ã¯ä»¥ä¸ã®éãã§ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250110/20250110090011.png" width="800" height="325" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<ol>
<li>ãã¼ã«ã« PC ããæ¥å ±ã®ããã¹ããã¡ã¤ã«ã Cloud Storage ã«ã¢ãããã¼ã</li>
<li>ãã¡ã¤ã«ãã¢ãããã¼ãããããã¨ãæ¤ç¥ã㦠Eventarc ããªã¬ã¼ã Workflows ãèµ·å</li>
<li>Workflows ãåãåã£ãã¤ãã³ãæ
å ±ãç°å¢å¤æ°ã«ã»ããã㦠Cloud Run jobs ãèµ·å</li>
<li>Cloud Run jobs ã Gemini ã§æ¥å ±ãã¡ã¤ã«ãè¦ç´ããçµæã BigQuery ãã¼ãã«ã«æ ¼ç´</li>
</ol>
<h2 id="Eventarc">Eventarc</h2>
<p><strong>Evantarc</strong> 㯠Google Cloud ã§ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£ãæ§ç¯ããããã®ãã«ããã¼ã¸ããµã¼ãã¹ã§ããã¤ãã³ãã®çºçå
ããæ§ã
ãªå®å
ã¸ã®è»¢éãããµã¼ãã¬ã¹ã§å®¹æã«æ§ç¯ã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/eventarc/docs?hl=ja">Eventarc ã®æ¦è¦</a></li>
<li>åè : <a href="https://cloud.google.com/eventarc/docs/event-driven-architectures?hl=ja">ã¤ãã³ã ããªãã³ ã¢ã¼ããã¯ãã£</a></li>
</ul>
<p>以ä¸ã®è¨äºã§ã¯ Eventarc ã使ã£ãã¢ã¼ããã¯ãã£ã®ä¾ãç´¹ä»ããã¦ãã¾ãã®ã§ããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fnotify-using-eventarc-for-cloudrun" title="Eventarc + Cloud Run 㧠Google Cloud ãªã½ã¼ã¹ã®ä½æã Slack éç¥ãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/notify-using-eventarc-for-cloudrun">blog.g-gen.co.jp</a></cite></p>
<h2 id="Workflows">Workflows</h2>
<p><strong>Workflows</strong>ï¼ã¾ã㯠Cloud Workflowsï¼ã¯ Google Cloud ã®ãã«ããã¼ã¸ãã§ãµã¼ãã¼ã¬ã¹ãªãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ãµã¼ãã¹ã§ããå®ç¾©ããé çªã« Cloud Run ã Cloud Run functions ãå®è¡ããããBigQuery ã§ã¯ã¨ãªãçºè¡ãããªã©ãæ§ã
㪠Google Cloud ãµã¼ãã¹ãå®è¡ããããä»»æã® HTTP ã¨ã³ããã¤ã³ãã«ãªã¯ã¨ã¹ããéããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/workflows/docs/overview?hl=ja">ã¯ã¼ã¯ããã¼ã®æ¦è¦</a></li>
</ul>
<p>以ä¸ã®è¨äºã§ Workflows ã«ã¤ãã¦è§£èª¬ãã¦ãã¾ãã®ã§ããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-workflows-explained" title="Cloud Workflowsãå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-workflows-explained">blog.g-gen.co.jp</a></cite></p>
<h1 id="Cloud-Storage-ã®æºå">Cloud Storage ã®æºå</h1>
<h2 id="Cloud-Storage-ãã±ããã®ä½æ">Cloud Storage ãã±ããã®ä½æ</h2>
<p>æ¥å ±ãã¡ã¤ã«ãã¢ãããã¼ãããããã®ãã±ãããä½æãã¾ãã</p>
<p><strong>ãã±ããåã«ç½®ãæãã¦ãã ãã</strong> ã®é¨åããä½æããããã±ããåã«ç½®ãæãã¦ã以ä¸ã®ã³ãã³ããå®è¡ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synIdentifier">BUCKET_NAME</span>=<span class="synStatement">"</span><span class="synConstant">ä½æããããã±ããåã«ç½®ãæãã¦ãã ãã</span><span class="synStatement">"</span>
gcloud storage buckets create gs://<span class="synPreProc">${BUCKET_NAME}</span> <span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1
</pre>
<h2 id="Cloud-Strage-ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸">Cloud Strage ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸</h2>
<p>Cloud Storage ããã®ããªã¬ã¼ãä½æããå ´åãPub/Sub ãããªãã·ã£ã¼ã®ãã¼ã«ãããã¸ã§ã¯ãã® Cloud Storage ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã«ä»ä¸ããå¿
è¦ãããã¾ãã</p>
<p><strong>ããã¸ã§ã¯ã ID ã«ç½®ãæãã¦ãã ãã</strong> ã®é¨åãããèªèº«ã®ããã¸ã§ã¯ã ID ã«ç½®ãæãã¦ã以ä¸ã®ã³ãã³ããå®è¡ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synIdentifier">PROJECT</span>=<span class="synStatement">"</span><span class="synConstant">ããã¸ã§ã¯ã ID ã«ç½®ãæãã¦ãã ãã</span><span class="synStatement">"</span>
<span class="synIdentifier">SERVICE_ACCOUNT</span>=<span class="synStatement">"</span><span class="synPreProc">$(</span><span class="synSpecial">gcloud storage service-agent --project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT})</span><span class="synStatement">"</span>
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">serviceAccount:</span><span class="synPreProc">${SERVICE_ACCOUNT}</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">='</span><span class="synConstant">roles/pubsub.publisher</span><span class="synStatement">'</span>
</pre>
<h1 id="BigQuery-ãã¼ãã«ã®ä½æ">BigQuery ãã¼ãã«ã®ä½æ</h1>
<p>æ¥å ±ãã¼ã¿ãæ ¼ç´ããããã® BigQuery ãã¼ãã«ãä½æãã¾ãã</p>
<p>以ä¸ã®ã³ãã³ãã§ã¯ã<code>report</code> ã¨ããååã®ãã¼ã¿ã»ããã¨ã<code>daily_report</code> ã¨ããååã®ãã¼ãã«ãä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ãã¼ã¿ã»ãããä½æ</span>
bq <span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1 mk <span class="synStatement">\</span>
<span class="synSpecial">--dataset</span> <span class="synStatement">\</span>
<span class="synPreProc">${PROJECT}</span>:report
<span class="synComment"># ãã¼ãã«ãä½æ</span>
bq mk <span class="synStatement">\</span>
<span class="synSpecial">--table</span> <span class="synStatement">\</span>
<span class="synSpecial">--schema</span> date:DATE,name:STRING,text:STRING <span class="synStatement">\</span>
<span class="synSpecial">--clustering_fields</span> date,name <span class="synStatement">\</span>
<span class="synPreProc">${PROJECT}</span>:report.daily_report
</pre>
<p> name ã«ã©ã 㨠date ã«ã©ã ãã¯ã©ã¹ã¿åãã¦ãã¼ãã«ãä½æãããã¨ã§ãname ã«ã©ã ããã³ date ã«ã©ã ã§ãã£ã«ã¿ããããã¯ã¨ãªãå®è¡ããã¨ãã«ã¹ãã£ã³éãåæ¸ãã¦ãããã©ã¼ãã³ã¹ãåä¸ããããã¨ãã§ãã¾ãã</p>
<h1 id="Cloud-Run-jobs-ã®ä½æ">Cloud Run jobs ã®ä½æ</h1>
<h2 id="ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ</h2>
<p>Cloud Run jobs ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ããä½æãã¾ãã</p>
<p>Cloud Run jobs ã Gemini API ã§æç« ãè¦ç´ããããBigQuery ã«ãã¼ã¿ãæ¸ãè¾¼ãã ãããã°ãåºåãããããããã«ã以ä¸ã®ãã¼ã«ã Workflows ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã«ä»ä¸ããå¿
è¦ãããã¾ãã</p>
<ul>
<li>BigQuery ãã¼ã¿ç·¨éè
ï¼<code>roles/bigquery.dataEditor</code>ï¼</li>
<li>BigQuery ã¸ã§ãã¦ã¼ã¶ã¼ï¼<code>roles/bigquery.jobUser</code>ï¼</li>
<li>Storage ãªãã¸ã§ã¯ãé²è¦§è
ï¼<code>roles/storage.objectViewer</code>ï¼</li>
<li>Vertex AI ã¦ã¼ã¶ã¼ï¼<code>roles/aiplatform.user</code>ï¼</li>
<li>ãã°æ¸ãè¾¼ã¿ï¼<code>roles/logging.logWriter</code>ï¼</li>
</ul>
<p>以ä¸ã®ã³ãã³ããå®è¡ããã¨ã<code>sa-daily-report-job</code> ã¨ããååã®ãµã¼ãã¹ã¢ã«ã¦ã³ããä½æããããã®å¾ãå¿
è¦ãªãã¼ã«ãä»ä¸ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud iam service-accounts create sa-daily-report-job
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/bigquery.dataEditor
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/bigquery.jobUser
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/storage.objectViewer
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/aiplatform.user
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/logging.logWriter
</pre>
<h2 id="Docker-ã³ã³ããã®ä½æã«å¿
è¦ãªãªã½ã¼ã¹ã®ä½æ">Docker ã³ã³ããã®ä½æã«å¿
è¦ãªãªã½ã¼ã¹ã®ä½æ</h2>
<p>主è¦ãªå¦çã Python ã³ã¼ãã§å®è¡ãã <code>main.py</code>ãã³ã¼ãå
ã§å©ç¨ããããã±ã¼ã¸ããªã¹ãåãã <code>requirements.txt</code>ããã㦠<code>Procfile</code> ãä½æãã¾ãã</p>
<p><strong>Procfile</strong> ã¨ã¯ãã³ã³ããã®èµ·åæã«å¼ã³åºãããããã»ã¹ãå®ç¾©ãããã¡ã¤ã«ã§ãPython 㧠Buildpack ãå©ç¨ããå ´åã«ããã¦ã¯ããã¡ã¤ã«ã®ä½æãå¿
é ã«ãªãã¾ããBuildpack ãå©ç¨ããã°ãDockerfile ãä½æããã«ã³ã¼ããã³ã³ããã¤ã¡ã¼ã¸ã«å¤æãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/docs/buildpacks/overview?hl=ja">Google Cloud ã® Buildpack</a></li>
<li>åè : <a href="https://cloud.google.com/docs/buildpacks/about-procfile?hl=ja">Procfile ã«ã¤ãã¦</a></li>
</ul>
<h3 id="mainpy">main.py</h3>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">import</span> vertexai
<span class="synPreProc">from</span> vertexai.generative_models <span class="synPreProc">import</span> GenerativeModel, Part, SafetySetting
<span class="synPreProc">import</span> os
<span class="synPreProc">import</span> argparse
<span class="synPreProc">from</span> datetime <span class="synPreProc">import</span> datetime
<span class="synPreProc">import</span> logging
<span class="synPreProc">from</span> google.cloud <span class="synPreProc">import</span> bigquery, storage
<span class="synPreProc">import</span> google.cloud.logging
PROJECT_ID = os.environ.get(<span class="synConstant">"PROJECT_ID"</span>)
REGION = os.environ.get(<span class="synConstant">"REGION"</span>)
DATASET_ID = os.environ.get(<span class="synConstant">"DATASET_ID"</span>)
TABLE_ID = os.environ.get(<span class="synConstant">"TABLE_ID"</span>)
TABLE_NAME = f<span class="synConstant">"{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}"</span>
INPUT_BUCKET = os.environ.get(<span class="synConstant">"INPUT_BUCKET"</span>)
INPUT_FILE = os.environ.get(<span class="synConstant">"INPUT_FILE"</span>)
<span class="synComment"># Vertex AI ã®åæå</span>
vertexai.init(project=PROJECT_ID, location=REGION)
<span class="synComment"># Cloud Logging ã¯ã©ã¤ã¢ã³ãã®ã¤ã³ã¹ã¿ã³ã¹å</span>
logger_client = google.cloud.logging.Client()
logger_client.setup_logging()
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
<span class="synComment"># Cloud Storage ã¯ã©ã¤ã¢ã³ãã®ã¤ã³ã¹ã¿ã³ã¹å</span>
storage_client = storage.Client()
<span class="synComment"># Cloud Storage ãããã¡ã¤ã«ãèªã㧠Gemini ã«è¦ç´ãããé¢æ°</span>
<span class="synStatement">def</span> <span class="synIdentifier">summarize_text_from_file</span>() -> <span class="synIdentifier">str</span>:
<span class="synStatement">try</span>:
<span class="synComment"># Cloud Storage ã«ãããã¡ã¤ã«ã®ããã¹ããèªã¿åã</span>
bucket = storage_client.bucket(INPUT_BUCKET)
blob = bucket.blob(INPUT_FILE)
file_content = blob.download_as_string()
text = file_content.decode(<span class="synConstant">"utf-8"</span>)
<span class="synStatement">except</span> <span class="synType">Exception</span> <span class="synStatement">as</span> e:
logger.error(f<span class="synConstant">"Error during reading file: {e}"</span>)
<span class="synStatement">raise</span>
<span class="synStatement">try</span>:
<span class="synComment"># Gemini ã«è¦ç´ããã</span>
model = GenerativeModel(<span class="synConstant">"gemini-1.5-flash-002"</span>)
generation_config = {
<span class="synConstant">"max_output_tokens"</span>: <span class="synConstant">500</span>,
<span class="synConstant">"temperature"</span>: <span class="synConstant">0.1</span>,
<span class="synConstant">"top_p"</span>: <span class="synConstant">0.1</span>,
}
response = model.generate_content(
f<span class="synConstant">"""以ä¸ã®æç« ãè¦ç´ãã¦ãã ãã:</span><span class="synSpecial">\n</span><span class="synConstant">{file_content}</span><span class="synSpecial">\n</span><span class="synConstant">è¦ç´:</span><span class="synSpecial">\n</span><span class="synConstant">"""</span>,
generation_config=generation_config
)
<span class="synStatement">except</span> <span class="synType">Exception</span> <span class="synStatement">as</span> e:
logger.error(f<span class="synConstant">"Error during summarization: {e}"</span>)
<span class="synStatement">raise</span>
<span class="synStatement">return</span> response.candidates[<span class="synConstant">0</span>].content.parts[<span class="synConstant">0</span>].text
<span class="synComment"># BigQuery ã®ãã¼ãã«ã«ãã¼ã¿ãæ¿å
¥ããé¢æ°</span>
<span class="synStatement">def</span> <span class="synIdentifier">insert_into_bigquery</span>(summary_text: <span class="synIdentifier">str</span>):
<span class="synStatement">try</span>:
<span class="synComment"># ãã¡ã¤ã«ã®ååããæ¥ä»ã¨ååãåå¾ãã</span>
<span class="synIdentifier">file</span> = INPUT_FILE.split(<span class="synConstant">"/"</span>)[-<span class="synConstant">1</span>] <span class="synComment"># ãã©ã«ãé¨åãæ¶ã</span>
date_str, name_txt = <span class="synIdentifier">file</span>.split(<span class="synConstant">"_"</span>)
name = name_txt.split(<span class="synConstant">"."</span>)[<span class="synConstant">0</span>]
<span class="synStatement">try</span>:
date_object = datetime.strptime(date_str, <span class="synConstant">'%Y%m%d'</span>)
formatted_date = date_object.strftime(<span class="synConstant">"%Y-%m-%d"</span>)
<span class="synStatement">except</span> <span class="synType">ValueError</span>:
<span class="synStatement">raise</span> <span class="synType">ValueError</span>(<span class="synConstant">"Invalid filename date format. Expected YYYYMMDD."</span>)
client = bigquery.Client(project=PROJECT_ID)
table_ref = client.get_table(f<span class="synConstant">"{TABLE_NAME}"</span>)
<span class="synComment"># éè¤ã«ãªããªãããã«ããã¼ã¿ãæ¿å
¥ãã</span>
query = f<span class="synConstant">"""MERGE {TABLE_NAME} t</span>
<span class="synConstant"> USING (</span>
<span class="synConstant"> SELECT CAST('{formatted_date}' AS DATE) AS date, </span>
<span class="synConstant"> '{name}' AS name, </span>
<span class="synConstant"> '''{summary_text}''' AS text) i</span>
<span class="synConstant"> ON t.date = i.date AND t.name = i.name</span>
<span class="synConstant"> WHEN MATCHED THEN</span>
<span class="synConstant"> UPDATE SET text = i.text</span>
<span class="synConstant"> WHEN NOT MATCHED THEN</span>
<span class="synConstant"> INSERT (date, name, text) VALUES (i.date, i.name, i.text)"""</span>
query_job = client.query(query)
<span class="synStatement">try</span>:
query_job.result()
logger.debug(f<span class="synConstant">"{INPUT_FILE} insert successful."</span>)
<span class="synStatement">except</span> <span class="synType">Exception</span> <span class="synStatement">as</span> e:
logger.error(f<span class="synConstant">"{INPUT_FILE} insert failed: {e}"</span>)
<span class="synStatement">raise</span>
<span class="synStatement">except</span> <span class="synType">Exception</span> <span class="synStatement">as</span> e:
logger.error(f<span class="synConstant">"An unexpected error occurred while insert into bigquery: {e}"</span>)
<span class="synStatement">raise</span>
<span class="synStatement">if</span> __name__ == <span class="synConstant">"__main__"</span>:
summary_result = summarize_text_from_file()
insert_into_bigquery(summary_result)
</pre>
<h3 id="requirementstxt">requirements.txt</h3>
<pre class="code lang-python" data-lang="python" data-unlink>google-cloud-aiplatform==<span class="synConstant">1.73</span>.<span class="synConstant">0</span>
google-cloud-bigquery==<span class="synConstant">3.25</span>.<span class="synConstant">0</span>
google-cloud-logging==<span class="synConstant">3.11</span>.<span class="synConstant">2</span>
</pre>
<h3 id="Procfile">Procfile</h3>
<p>Buildpacks ã§ã¯ web ããã»ã¹ãå®ç¾©ãããã¨ãå¿
é ã§ããweb ããã»ã¹ãå®ç¾©ããªãã£ãå ´åã <code>web process not found in Procfile</code> ã¨ããã¨ã©ã¼ãçºçãã¾ãã<br/>
ãã ããä»å㯠HTTP ãã©ãã£ãã¯ãåä¿¡ããå¿
è¦ããªãã®ã§ãå®éã«ã¯ web ããã»ã¹ã¯ä½¿ç¨ããã¾ããã</p>
<pre class="code" data-lang="" data-unlink>web: echo "no web"
python: python</pre>
<h2 id="Artifact-Registry-ã®ä½æ">Artifact Registry ã®ä½æ</h2>
<p>ã³ã³ããã¤ã¡ã¼ã¸ãä¿åããããã® Artifact Registry æ¨æºãªãã¸ããªãä½æãã¾ãã</p>
<p>以ä¸ã®ã³ãã³ãã§ã¯ã<code>my-repo</code> ã¨ããååã®ãªãã¸ããªãä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud artifacts repositories create my-repo <span class="synStatement">\</span>
<span class="synSpecial">--repository-format</span><span class="synStatement">=</span>docker <span class="synStatement">\</span>
<span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1
</pre>
<h2 id="Artifact-Registry-ã«ã¢ãããã¼ã">Artifact Registry ã«ã¢ãããã¼ã</h2>
<p>Buildpack ã使ç¨ãã¦ã³ã³ããã¤ã¡ã¼ã¸ããã«ãããä½æãã Artifact Registry ãªãã¸ããªã«ããã·ã¥ãã¾ãã</p>
<p>以ä¸ã®ã³ãã³ãã§ã¯ãã½ã¼ã¹ã³ã¼ãããã«ããã<code>my-repo</code> ãªãã¸ããªã« <code>daily-report-job</code> ã¨ããã¤ã¡ã¼ã¸åã§ããã·ã¥ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud builds submit <span class="synSpecial">--pack</span> <span class="synIdentifier">image</span>=asia-northeast1-docker.pkg.dev/<span class="synPreProc">${PROJECT}</span>/my-repo/daily-report-job
</pre>
<h2 id="Cloud-Run-jobs-ã®ä½æ-1">Cloud Run jobs ã®ä½æ</h2>
<p>以ä¸ã®ã³ãã³ãã§ã¯ã<code>daily-report-job</code> ã¨ããååã® Cloud Run jobs ãä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud run <span class="synStatement">jobs</span> create daily-report-job <span class="synStatement">\</span>
<span class="synSpecial">--image</span><span class="synStatement">=</span>asia-northeast1-docker.pkg.dev/<span class="synPreProc">${PROJECT}</span>/my-repo/daily-report-job:latest <span class="synStatement">\</span>
<span class="synSpecial">--command</span><span class="synStatement">=</span>python <span class="synStatement">\</span>
<span class="synSpecial">--args</span><span class="synStatement">=</span>main.py <span class="synStatement">\</span>
<span class="synSpecial">--region</span><span class="synStatement">=</span>asia-northeast1 <span class="synStatement">\</span>
<span class="synSpecial">--service-account</span><span class="synStatement">=</span>sa-daily-report-job@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com
<span class="synSpecial">--set-env-vars</span><span class="synStatement">=</span><span class="synIdentifier">INPUT_BUCKET</span>=<span class="synPreProc">${BUCKET_NAME}</span>,<span class="synIdentifier">INPUT_FILE</span>=input_file.txt,<span class="synIdentifier">PROJECT_ID</span>=<span class="synPreProc">${PROJECT}</span>,<span class="synIdentifier">DATASET_ID</span>=report,<span class="synIdentifier">TABLE_ID</span>=daily_report
</pre>
<p>ç°å¢å¤æ° <code>INPUT_BUCKET</code> ããã³ <code>INPUT_FILE</code> ã¯ãå®éã«ã¯ Workflows ãã¸ã§ããèµ·åããéã«éããã¦ããã¤ãã³ãæ
å ±ãå©ç¨ãã¦ãªã¼ãã¼ã©ã¤ãããã¾ãã</p>
<h1 id="Workflows-ã®ä½æ">Workflows ã®ä½æ</h1>
<h2 id="ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®</h2>
<p>Workflows ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ããä½æãã¾ãã</p>
<p>Workflows ã¯ç°å¢å¤æ°ããªã¼ãã¼ã©ã¤ãã㦠Cloud Run jobs ãèµ·åããå®è¡çµæãåãåãããã«ã以ä¸ã®ãã¼ã«ã Workflows ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã«ä»ä¸ããå¿
è¦ãããã¾ãã</p>
<ul>
<li>Cloud Run ãããããã¼ï¼<code>roles/run.developer</code>ï¼</li>
</ul>
<p>ãªãç°å¢å¤æ°ããªã¼ãã¼ã©ã¤ãã㦠Cloud Run jobs ãèµ·åãããã¼ã«ã¨ãã¦ãä¸è¨ã®ä»ã«ããªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ï¼<code>roles/run.jobsExecutorWithOverrides</code>ï¼ããã¼ã«ãããã¾ããããã¡ãã ã¨å®è¡çµæãåãåãããã«å¿
è¦ãª <code>run.executions.get</code> 権éãä¸è¶³ãã¦ãããããä¸è¨ã®ãã¼ã«ã¨ãã¦ãã¾ãã</p>
<p>以ä¸ã®ã³ãã³ããå®è¡ããã¨ã<code>sa-cloud-run-job-workflow</code> ã¨ããååã®ãµã¼ãã¹ã¢ã«ã¦ã³ããä½æããããã®å¾ãå¿
è¦ãªãã¼ã«ãä»ä¸ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud iam service-accounts create sa-cloud-run-job-workflow
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-cloud-run-job-workflow@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/run.developer
</pre>
<h2 id="ã¯ã¼ã¯ããã¼ã®ä½æ">ã¯ã¼ã¯ããã¼ã®ä½æ</h2>
<p>Cloud Run jobs ãå®è¡ããããã®ã¯ã¼ã¯ããã¼ãã<code>cloud-run-job-workflow.yaml</code> ã¨ãã YAML ãã¡ã¤ã«ã«å®ç¾©ãã¾ãã</p>
<h3 id="cloud-run-job-workflowyaml">cloud-run-job-workflow.yaml</h3>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synIdentifier">main</span><span class="synSpecial">:</span>
<span class="synIdentifier">params</span><span class="synSpecial">:</span> <span class="synSpecial">[</span>event<span class="synSpecial">]</span>
<span class="synIdentifier">steps</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">init</span><span class="synSpecial">:</span>
<span class="synIdentifier">assign</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">project_id</span><span class="synSpecial">:</span> ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
<span class="synStatement">- </span><span class="synIdentifier">event_bucket</span><span class="synSpecial">:</span> ${event.data.bucket}
<span class="synStatement">- </span><span class="synIdentifier">event_file</span><span class="synSpecial">:</span> ${event.data.name}
<span class="synStatement">- </span><span class="synIdentifier">job_name</span><span class="synSpecial">:</span> daily-report-job
<span class="synStatement">- </span><span class="synIdentifier">job_location</span><span class="synSpecial">:</span> asia-northeast1
<span class="synStatement">- </span><span class="synIdentifier">run_job</span><span class="synSpecial">:</span>
<span class="synIdentifier">call</span><span class="synSpecial">:</span> googleapis.run.v1.namespaces.jobs.run
<span class="synIdentifier">args</span><span class="synSpecial">:</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> ${"namespaces/" + project_id + <span class="synConstant">"/jobs/"</span> + job_name}
<span class="synIdentifier">location</span><span class="synSpecial">:</span> ${job_location}
<span class="synIdentifier">body</span><span class="synSpecial">:</span>
<span class="synIdentifier">overrides</span><span class="synSpecial">:</span>
<span class="synIdentifier">containerOverrides</span><span class="synSpecial">:</span>
<span class="synIdentifier">env</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> INPUT_BUCKET
<span class="synIdentifier">value</span><span class="synSpecial">:</span> ${event_bucket}
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> INPUT_FILE
<span class="synIdentifier">value</span><span class="synSpecial">:</span> ${event_file}
<span class="synIdentifier">result</span><span class="synSpecial">:</span> job_execution
<span class="synStatement">- </span><span class="synIdentifier">finish</span><span class="synSpecial">:</span>
<span class="synIdentifier">return</span><span class="synSpecial">:</span> ${job_execution}
</pre>
<h2 id="ã¯ã¼ã¯ããã¼ã®ãããã¤">ã¯ã¼ã¯ããã¼ã®ãããã¤</h2>
<p>以ä¸ã®ã³ãã³ããå®è¡ãã¦ã¯ã¼ã¯ããã¼ããããã¤ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud workflows deploy cloud-run-job-workflow <span class="synStatement">\</span>
<span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1 <span class="synStatement">\</span>
<span class="synSpecial">--source</span><span class="synStatement">=</span>cloud-run-job-workflow.yaml
<span class="synSpecial">--service-account</span><span class="synStatement">=</span>serviceAccount:sa-cloud-run-job-workflow@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com
</pre>
<h1 id="Eventarc-ããªã¬ã¼ã®è¨å®">Eventarc ããªã¬ã¼ã®è¨å®</h1>
<h2 id="ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®-1">ãµã¼ãã¹ã¢ã«ã¦ã³ãã®è¨å®</h2>
<p>Eventarc ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ããä½æãã¾ãã</p>
<p>Eventarc 㯠Cloud Storage ããã¤ãã³ããåä¿¡ã㦠Workflows ãèµ·åããããã以ä¸ã®ãã¼ã«ã Eventarc ã§ä½¿ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã«ä»ä¸ããå¿
è¦ãããã¾ãã</p>
<ul>
<li>Eventarc ã¤ãã³ãåä¿¡è
ï¼<code>roles/eventarc.eventReceiver</code>ï¼</li>
<li>ã¯ã¼ã¯ããã¼èµ·åå
ï¼<code>roles/workflows.invoker</code>ï¼</li>
</ul>
<p>以ä¸ã®ã³ãã³ããå®è¡ããã¨ããµã¼ãã¹ã¢ã«ã¦ã³ã <code>sa-cloud-run-job-workflow-trigger</code> ãä½æããããã®ãµã¼ãã¹ã¢ã«ã¦ã³ãã«å¿
è¦ãªæ¨©éãä»ä¸ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud iam service-accounts create sa-cloud-run-job-workflow-trigger
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-cloud-run-job-workflow-trigger@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/eventarc.eventReceiver
gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">=</span>serviceAccount:sa-cloud-run-job-workflow-trigger@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">=</span>roles/workflows.invoker
</pre>
<h2 id="Eventarc-ã®ä½æ">Eventarc ã®ä½æ</h2>
<p>以ä¸ã®ã³ãã³ãã§ãEventarc ããªã¬ã¼ã <code>cloud-run-job-workflow-trigger</code> ã¨ããååã§ä½æãã¾ãã</p>
<p>ãã®ã³ãã³ãã§ã¯ãããã»ã©ä½æãããµã¼ãã¹ã¢ã«ã¦ã³ã <code>sa-cloud-run-job-workflow-trigger</code> ãæå®ãããã<code>destination-workflow</code> ãªãã·ã§ã³ã§å®å
ã®ã¯ã¼ã¯ããã¼ã§ãã <code>cloud-run-job-workflow</code> ãæå®ãã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud eventarc triggers create cloud-run-job-workflow-trigger <span class="synStatement">\</span>
<span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1 <span class="synStatement">\</span>
<span class="synSpecial">--destination-workflow</span><span class="synStatement">=</span>cloud-run-job-workflow <span class="synStatement">\</span>
<span class="synSpecial">--destination-workflow-location</span><span class="synStatement">=</span>asia-northeast1 <span class="synStatement">\</span>
<span class="synSpecial">--event-filters</span><span class="synStatement">="</span><span class="synConstant">type=google.cloud.storage.object.v1.finalized</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--event-filters</span><span class="synStatement">="</span><span class="synConstant">bucket=</span><span class="synPreProc">${BUCKET_NAME}</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--service-account</span><span class="synStatement">=</span>sa-cloud-run-job-workflow-trigger@<span class="synPreProc">${PROJECT}</span>.iam.gserviceaccount.com
</pre>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<p>ã¾ãã¯ãæ¥å ±ã®ããã¹ããã¡ã¤ã«ãç¨æãã¾ããä¾ã¨ãã¦ã以ä¸ã®ããã¹ããæ¸ãè¾¼ã¾ããããã¹ããã¡ã¤ã« <code>20241231_å±±ç°å¤ªé.txt</code> ãä½æãã¾ãã</p>
<pre class="code" data-lang="" data-unlink>ä»æ¥ã®æ¥åå
容:
åå: æ¨æ¥åå¾ãããªã³ã©ã¤ã³ã¹ãã¢ã®é¡§å®¢è¡åãã°ãã¼ã¿(ç´5TB)ã®BigQueryã¸ã®ãã¼ãä½æ¥ãå®æ½ãDataflowãã¤ãã©ã¤ã³ãç¨ãã¦ããã¼ãã£ã·ã§ãã³ã°ã¨ã¯ã©ã¹ã¿ãªã³ã°ãè¡ããã¯ã¨ãªããã©ã¼ãã³ã¹ã®æé©åãå³ã£ãããã¼ãå®äºå¾ããã¼ã¿ã®æ´åæ§ã確èªãããã¼ã¿å質ã«åé¡ããªããã¨ãæ¤è¨¼ããããã¼ãæéã¯äºæ³éãç´3æéã§ãã£ãããä¸é¨ãã¼ã¿ã®éè¤ã確èªããããããéè¤ãã¼ã¿åé¤ã¯ã¨ãªãè¨è¿°ãå®è¡ãç´1%ã®éè¤ãã¼ã¿ãåé¤ãããã
åå¾: BigQueryä¸ã§é¡§å®¢ã»ã°ã¡ã³ãã¼ã·ã§ã³ã®ããã®SQLã¯ã¨ãªãéçºã»å®è¡ãè³¼è²·é »åº¦ãå¹³åè³¼å
¥é¡ãæçµè³¼å
¥æ¥ãªã©ãåºã«ã"é«é »åº¦è³¼å
¥è
", "ä½é »åº¦ä½é¡è³¼å
¥è
", "ä¼ç 顧客" ã®3ã¤ã®ã»ã°ã¡ã³ãã«åé¡ããã¯ã¨ãªãä½æãããåã»ã°ã¡ã³ãã®äººå£çµ±è¨ãã¼ã¿(å¹´é½¢ãæ§å¥ãªã©)ã¨ã®é¢é£æ§ãåæããããã«ãã¦ã¼ã¶ã¼å±æ§ãã¼ãã«ã¨çµåãåæãå®æ½ã åæçµæãå¯è¦åããããã«ãLooker Studioãç¨ããããã·ã¥ãã¼ããä½æéå§ãæ¬æ¥ä¸ã«ä¸»è¦ææ¨ã®è¡¨ç¤ºã¾ã§å®äºãããã
ãã®ä»: ããã¸ã§ã¯ãXã®ä»å¾ã®åæè¨ç»ã«ã¤ãã¦ãã¼ã ãªã¼ãã¼ã¨ãã¼ãã£ã³ã°ãå®æ½ã 顧客ãã£ã¼ã³äºæ¸¬ã¢ãã«æ§ç¯ã®ããã®ãã¼ã¿æºåã«ã¤ãã¦è°è«ããå¿
è¦ãªãã¼ã¿é
ç®ã¨ãã¼ã¿ã½ã¼ã¹ãç¹å®ãããæ¥é±ããæ©æ¢°å¦ç¿ã¢ãã«ã®æ§ç¯ã«çæããäºå®ã ã¾ããBigQueryã®æéãç£è¦ããã³ã¹ãæé©åã®ããã®æ¤è¨ãéå§ããããã¼ãã£ã·ã§ãã³ã°ã¨ã¯ã©ã¹ã¿ãªã³ã°ã®å¹æãæ¤è¨¼ããæ´ãªãæé©åã®å¯è½æ§ãæ¢ãã
課é¡ã¨åé¡ç¹:
ãã¼ã¿ãã°ã«å«ã¾ããä¸é¨ã®é¡§å®¢IDã«éè¤ãè¦ãããããã¼ã¿åéå
ã§ã®ãã¼ã¿ã¯ã¬ã³ã¸ã³ã°ã®å¿
è¦æ§ãææããé¢ä¿é¨ç½²ã¸ã®å ±åãæ¤è¨ãã¦ããã
Looker Studioããã·ã¥ãã¼ãã®ä½æã«æéãããã£ã¦ãããããå¹ççãªå¯è¦åãã¼ã«ã®æ¤è¨ãå¿
è¦ãããããªãã
ææ¥ã®äºå®:
ããã¸ã§ã¯ãX: 顧客ãã£ã¼ã³äºæ¸¬ã¢ãã«æ§ç¯ã®ããã®ãã¼ã¿æºåéå§ãå¿
è¦ãªãã¼ã¿ã®æ½åºã¨åå¦çãè¡ãã
ããã¸ã§ã¯ãY (æºå段é): ããã¸ã§ã¯ãYã®è¦ä»¶å®ç¾©æ¸ä½æã«åãã¦ãé¢ä¿è
ã¨ã®æã¡åãããè¡ãã
ã³ã¡ã³ã:
æ¬æ¥ãããã¸ã§ã¯ãXã®ãã¼ã¿åæã大ããé²å±ãããBigQueryã¨Dataflowãã¤ãã©ã¤ã³ãç¨ãããã¼ã¿å¦çã¯å¹ççã§ãã£ãããããããã¼ã¿å質ã«é¢ãã課é¡ãæµ®ã彫ãã«ãªã£ããããé¢ä¿é¨ç½²ã¨ã®é£æºãå¼·åãããã¼ã¿ã¯ãªãªãã£åä¸ã«åªããå¿
è¦ãããã</pre>
<p>ãã®æ¥å ±ãã¡ã¤ã«ã Cloud Storage ã«ã¢ãããã¼ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>gcloud storage <span class="synStatement">cp</span> 20241231_å±±ç°å¤ªé.txt gs://<span class="synPreProc">${BUCKET_NAME}</span>
</pre>
<p>BigQuery ãè¦ãã¨ããã¼ãã«ã«æ¥å ±ã®ãã¼ã¿ãæ¸ãè¾¼ã¾ãã¦ãããã¨ã確èªã§ãã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250110/20250110090014.png" width="800" height="283" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>以ä¸ã¯ãè¦ç´å¾ã®æç« ã§ãã</p>
<pre class="code" data-lang="" data-unlink>ãã®ãã°ã¯ãBigQueryã¨Dataflowãç¨ãããã¼ã¿å¦çã«é¢ããå ±åã§ãã
**åå:** 5TBã®ãªã³ã©ã¤ã³ã¹ããªã¼ã ãã¼ã¿ã®BigQueryã¸ã®ãã¼ãä½æ¥ãå®æ½ãDataflowãã¤ãã©ã¤ã³ãç¨ãã¦ãã¼ãã£ã·ã§ãã³ã°ã¨ã¯ã¬ã³ã¸ã³ã°ãè¡ããã¯ã¨ãªã®æé©åãå®ç¾ãã¾ãããå¦çæéã¯äºæ³éãç´3æéã§ããããä¸é¨ãã¼ã¿ã®æ¬ æã確èªããã1%ã®ãã¼ã¿ã復æ§ä¸è½ã§ããã
**åå¾:** BigQueryä¸ã§ã課éã¿ã¤ããå¹³å課éé¡ãæçµèª²éæ¥ãªã©ãåºã«ããé«èª²éã¦ã¼ã¶ã¼ãããä½èª²éã¦ã¼ã¶ã¼ãããæ½å¨é¡§å®¢ãã®3ã¤ã®ã»ã°ã¡ã³ãã«åé¡ããSQLã¯ã¨ãªãä½æã»å®è¡ãã¾ãããåã»ã°ã¡ã³ãã®ã¦ã¼ã¶ã¼å±æ§ï¼å¹´é½¢ãæ§å¥ãªã©ï¼ã¨ã®é¢é£æ§ãåæããLooker Studioã§è¦è¦åãã¾ããã
**ãã®ä»:** ããã¸ã§ã¯ãXã®ä»å¾ã®åæè¨ç»ã¨ãã¦ããã£ã¼ã³äºæ¸¬ã¢ãã«ã¨ããã¢ã¼ã·ã§ã³æ½çã®ãã¼ã¿æ´åã決å®ãã¾ãããBigQueryã®ãã°ãç£è¦ããã³ã¹ãæé©åã®ããã®æ¹åçãæ¤è¨ãã¾ãããã¼ãã£ã·ã§ãã³ã°ã¨ã¯ã¬ã³ã¸ã³ã°ã®ãã¤ã³ããæ確åããä»å¾ã®ãã¼ã¿å質åä¸ã«ç¹ãã¾ãã
**課é¡ã¨åé¡ç¹:** ä¸é¨ã®é¡§å®¢IDã«ãã¼ã¿æ¬ æãè¦ã¤ããã¾ããããã¼ã¿ã®å®å
¨æ§ç¢ºä¿ã®ããããã¼ã¿ã¯ã¬ã³ã¸ã³ã°ã¨ã¢ãã¿ãªã³ã°ã®å¼·åãå¿
è¦ã§ããLooker Studioã§ã®ããã·ã¥ãã¼ãä½æã«æéãããã£ã¦ãã¾ããããå¹ççãªå¯è¦åæ¹æ³ã®æ¤è¨ãå¿
è¦ã§ãã
**ä»å¾ã®äºå®:** ããã¸ã§ã¯ãXã§ã¯ããã£ã¼ã³äºæ¸¬ã®ããã®ãã¼ã¿æ´åã¨å¿
è¦ãªãã¼ã¿ã®æ½åºã»åå¦çãè¡ãã¾ããããã¸ã§ã¯ãY(ãã£ã¼ã³äºæ¸¬ã¢ãã«)ã§ã¯ãè¦ä»¶å®ç¾©æ¸ãä½æããé¢ä¿è
ã¨ã®æã¡åãããè¡ãã¾ãã
å
¨ä½ã¨ãã¦ããã¼ã¿å¦çã¯æ¦ãæåãã¾ãããããã¼ã¿æ¬ æãå¯è¦åã®å¹çæ§ã¨ãã£ã課é¡ãæ®ã£ã¦ãããä»å¾ã®æ¹åãå¿
è¦ã§ãããã¨ãå ±åããã¦ãã¾ãã</pre>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-deguchi/profile_128x128.png?1730365677);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">åºå£ æ太æ <a href="https://blog.g-gen.co.jp/archive/author/ggen-kataiwa">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2024å¹´7æã«G-genã«å
¥ç¤¾ã<br>ç¦å²¡å¨ä½ã§ãGoogle Cloud ããã¹ã¿ã¼ããããæ¥ã
ã¨ã³ã¸ãã¢ã¨ãã¦ä¿®è¡ä¸ã<br>
</div>
</div>
</div>
</div>
ggen-deguchi
Gemini APIã¸ã®ãªã¯ã¨ã¹ãã§ã¨ã©ã¼ã³ã¼ã429ãResource exhausted, please try again later.ã
hatenablog://entry/6802418398318530416
2025-01-09T10:15:00+09:00
2025-01-09T10:15:00+09:00 G-genã®ææã§ããVertex API çµç±ã§ Gemini ã¢ãã«ã¸ API ãªã¯ã¨ã¹ããéä¿¡ããéã«ãã¨ã©ã¼ã³ã¼ã 429 㧠Resource exhausted, please try again later. ã¨ããã¨ã©ã¼ãé »ç¹ã«çºçãã¾ããããã®åå ã¨å¯¾å¦æ³ãç´¹ä»ãã¾ãã äºè±¡ åå 対å¦æ³ 2ã¤ã®å¯¾å¦æ¡ ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã Provisioned Throughput Provisioned Throughput ã¨ã¯ GSU è³¼å
¥æé è³¼å
¥æ¹æ³ã¨æé èæ
®äºé
äºè±¡ Vertex API çµç±ã§ Gemini ã¢ãã«ã¸ API ãªã¯ã¨ã¹ããéä¿¡ããéãã¨ã©ã¼ã³ã¼ãâ¦
<p>G-genã®ææã§ããVertex API çµç±ã§ Gemini ã¢ãã«ã¸ API ãªã¯ã¨ã¹ããéä¿¡ããéã«ãã¨ã©ã¼ã³ã¼ã 429 㧠<code>Resource exhausted, please try again later.</code> ã¨ããã¨ã©ã¼ãé »ç¹ã«çºçãã¾ããããã®åå ã¨å¯¾å¦æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#äºè±¡">äºè±¡</a></li>
<li><a href="#åå ">åå </a></li>
<li><a href="#対å¦æ³">対å¦æ³</a><ul>
<li><a href="#2ã¤ã®å¯¾å¦æ¡">2ã¤ã®å¯¾å¦æ¡</a></li>
<li><a href="#ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã">ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã</a></li>
<li><a href="#Provisioned-Throughput">Provisioned Throughput</a><ul>
<li><a href="#Provisioned-Throughput-ã¨ã¯">Provisioned Throughput ã¨ã¯</a></li>
<li><a href="#GSU">GSU</a></li>
<li><a href="#è³¼å
¥æé">è³¼å
¥æé</a></li>
<li><a href="#è³¼å
¥æ¹æ³ã¨æé">è³¼å
¥æ¹æ³ã¨æé</a></li>
<li><a href="#èæ
®äºé
">èæ
®äºé
</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108220357.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="äºè±¡">äºè±¡</h1>
<p>Vertex API çµç±ã§ Gemini ã¢ãã«ã¸ API ãªã¯ã¨ã¹ããéä¿¡ããéãã¨ã©ã¼ã³ã¼ã 429 㧠<code>Resource exhausted, please try again later.</code> ã¨ããã¨ã©ã¼ãçºçãã¾ãããã¬ã¹ãã³ã¹å
ã® status 㯠<code>RESOURCE_EXHAUSTED</code> ã§ãã</p>
<p>ãã°ãããã¦å試è¡ããã¨ãªã¯ã¨ã¹ããæåããã¨ããããã¾ããããã°ãã°åãã¨ã©ã¼ã¨ãªãã¾ãã</p>
<h1 id="åå ">åå </h1>
<p>ãã®ã¨ã©ã¼ã¯ãå¦çã®ããã®ãªã½ã¼ã¹ã Google å´ã§æ¯æ¸ãããã¨ãé²ããããGoogle ã«ãã£ã¦ API å©ç¨ãå¶éããã¦ãããã¨ãæå³ãã¦ãã¾ããGoogle ã¯éæãç©çã¤ã³ãã©ã¹ãã©ã¯ãã£ãå¼·åãã¦ãã¾ãããGemini API ã¯å¤ãã®ã¦ã¼ã¶ã¼ã«å©ç¨ããã¦ããããããã°ãã°ãã®ã¡ãã»ã¼ã¸ã表示ããããã¨ãããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/error-code-429?hl=ja">ã¨ã©ã¼ã³ã¼ã 429</a></li>
</ul>
<h1 id="対å¦æ³">対å¦æ³</h1>
<h2 id="2ã¤ã®å¯¾å¦æ¡">2ã¤ã®å¯¾å¦æ¡</h2>
<p>次ã®ããããã®å¯¾å¦æ³ãèãããã¾ãã</p>
<ol>
<li>ã¢ããªã±ã¼ã·ã§ã³ã«<strong>ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã</strong>ï¼exponential backoffãææ°ããã¯ãªãï¼ãå®è£
ãã</li>
<li><strong>Provisioned Throughput</strong>ï¼ãããã¸ã§ãã³ã°ãããã¹ã«ã¼ãããï¼ãè³¼å
¥ãã</li>
</ol>
<h2 id="ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã">ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã</h2>
<p><code>1.</code> ã®<strong>ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªã</strong>ï¼ææ°ããã¯ãªãï¼ã¯ãã¯ã©ã¦ããµã¼ãã¹ã® API ãªã¯ã¨ã¹ãã使ç¨ããã¢ããªã±ã¼ã·ã§ã³ãå®è£
ããéã«ä¸è¬çãªææ³ã§ãã</p>
<p>ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªãã§ã¯ãAPI ãªã¯ã¨ã¹ãããµã¼ãã¼å´ã¨ã©ã¼ãä¸æçãªé害ã§å¤±æããå ´åã«ãå¾
æ©æéã1ç§ã2ç§ã4ç§ã8ç§...ã®ããã«ã¹ãä¹ããªããå試è¡ãç¹°ãè¿ãã¾ãã</p>
<p>å試è¡ãç¡éã«ç¹°ãè¿ããªãããã試è¡åæ°ãè¦å®ã®åæ°ã«éãã¦ããªã¯ã¨ã¹ããæåããªãå ´åãã¨ã©ã¼çµäºãããããå®è£
ãã¾ãããã®ããã«ãªãã©ã¤åæ°ã«ä¸éãè¨ãããã¨ã truncated exponential backoffï¼åãæ¨ã¦åã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªãï¼ã¨ãå¼ã³ã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/storage/docs/retry-strategy?hl=ja#exponential-backoff">ææ°ããã¯ãªã ã¢ã«ã´ãªãºã </a></li>
</ul>
<p>ãã®ææ³ãåããã¨ã«ããããªã¼ã¸ã§ã³ã§å¤ãã®ã¦ã¼ã¶ã¼ããã® API ãªã¯ã¨ã¹ãã輻輳ãã¦ãªã½ã¼ã¹ãæ¯æ¸ãã¦ããå ´åã§ãããã°ããå¾
ã£ã¦ããå試è¡ãããã¨ã§ãæçµçã« API ãªã¯ã¨ã¹ããæåããå¯è½æ§ãé«ãããã¾ãã</p>
<h2 id="Provisioned-Throughput">Provisioned Throughput</h2>
<h3 id="Provisioned-Throughput-ã¨ã¯">Provisioned Throughput ã¨ã¯</h3>
<p><code>2.</code> ã® <strong>Provisioned Throughput</strong>ï¼ãããã¸ã§ãã³ã°ãããã¹ã«ã¼ãããï¼ã¨ã¯ãGemini ã Claude ã® API ã¹ã«ã¼ããããäºåã«äºç´è³¼å
¥ãã¦ãããåºå®éé¡ã§å©ç¨ããæé¡ãµãã¹ã¯ãªãã·ã§ã³ãµã¼ãã¹ã§ãã</p>
<p>Provisioned Throughput ã¯ãäºåã«ã¢ãã«ã¨ãã±ã¼ã·ã§ã³ï¼ãªã¼ã¸ã§ã³ï¼ãæå®ãã¦è³¼å
¥ãã¾ãããµãã¼ãããã¦ããã¢ãã«ã¯ gemini-1.5-flashãgemini-1.5-proãimagen-3.0-generate-001ãAnthropic Claude 3.5 Sonnet ãªã©ã§ãã対象ã¢ãã«ã®ä¸è¦§ã¯ä»¥ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput?hl=ja">ãããã¸ã§ãã³ã°ãããã¹ã«ã¼ããã</a></li>
</ul>
<p>åè¿°ã®ã¨ã¯ã¹ããã³ã·ã£ã«ããã¯ãªãã¯ãªã½ã¼ã¹æ¯æ¸ã«å¯¾ããæ ¹æ¬çãªå¯¾å¦ã«ã¯ãªã£ã¦ãã¾ããããProvisioned Throughput ãè³¼å
¥ããæ¹æ³ã§ã¯ãå¾é課éå©ç¨ããããªã½ã¼ã¹ãåªå
ãã¦ç¢ºä¿ããã¾ããéè¦ãªæ¬çªç°å¢ã¢ããªã±ã¼ã·ã§ã³ã§ã® Gemini ã®å©ç¨ããæé¡å©ç¨æéãåºå®ãããå ´åãªã©ã«å©ç¨ãæ¤è¨ãã¾ãã</p>
<h3 id="GSU">GSU</h3>
<p>Provisioned Throughput ã¯ã<strong>GSU</strong>ï¼Generative AI Scale Unitï¼ã¨ããåä½ã§è³¼å
¥ãã¾ãã1 GSU ã¯ãä¾ãã° Gemini 1.5 Pro ã®å ´åã800æå/ç§ã§ãã</p>
<p>ãã®ç§ãããã®æåæ°ã«ã¤ãã¦ã1æåã®ã¤ã³ãããã¯1æåã¨ãã¦ã«ã¦ã³ãããã¾ãããä¾ãã° Gemini 1.5 Pro ã®å ´åã1æåã®ã¢ã¦ããããã¯3æåã¨ãã¦ã«ã¦ã³ãããã¾ããã¾ã1æã®ç»åã¯1,052æåã¨ãã¦ã«ã¦ã³ãããã¾ãããã®æ¶è²»æåæ°ã<strong>ãã¼ã³ãã¦ã³ç</strong>ã¨ããã¾ãã</p>
<p>1 GSU ãããã®ã¹ã«ã¼ãããï¼æå/ç§ï¼ããã¼ã³ãã¦ã³çã¯ã¢ãã«ã«ãã£ã¦ç°ãªãã®ã§ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput?hl=ja#supported-models">ãµãã¼ãããã¦ããã¢ãã«</a></li>
</ul>
<h3 id="è³¼å
¥æé">è³¼å
¥æé</h3>
<p>Provisioned Throughput ã¯1ã¶æã3ã¶æã1å¹´ã®æéã§è³¼å
¥ã§ãã¾ããèªåæ´æ°ãæå¹ã«ãããã¨ã§ãæ´æ°ä½æ¥ãçç¥ãããã¨ãã§ãã¾ããä¸åº¦è³¼å
¥ããã¨ãã³ãããããæéã¯æ³¨æããã£ã³ã»ã«ãããã¨ã¯ã§ãã¾ããã</p>
<p>è³¼å
¥æã«ã¯ã¢ãã«ãæå®ããå¿
è¦ããããçæ AI ã§ã¯é »ç¹ã«æ°ããã¢ãã«ãç»å ´ãããã¨ãèæ
®ããã¨ã1å¹´åä½ã®è³¼å
¥ã«ã¯æ
éã«ãªãã¹ãã¨èãããã¾ãããã ã以ä¸ã®ããã¥ã¡ã³ãã§ã¯ãåããªã¼ã¸ã§ã³å
ã§ãã¤åãäºæ¥è
ããæä¾ããã¦ããã¢ãã«ã§ããã°ããã¼ã¸ã§ã³ã®åãæ¿ããã§ãããã¨ã示ããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput?hl=ja#considerations">å®æè³¼å
¥ãéå§ããåã«èæ
®ãã¹ããã¨</a></li>
</ul>
<h3 id="è³¼å
¥æ¹æ³ã¨æé">è³¼å
¥æ¹æ³ã¨æé</h3>
<p>è³¼å
¥ã¯ Google Cloud ã³ã³ã½ã¼ã«ã®ããããã¸ã§ãã³ã°ãããã¹ã«ã¼ããããç»é¢ï¼<a href="https://console.cloud.google.com/vertex-ai/provisioned-throughput">https://console.cloud.google.com/vertex-ai/provisioned-throughput</a>ï¼ããè³¼å
¥ãããã¨ãã§ãã¾ãã</p>
<p>åç»é¢ã§ã¢ãã«ããªã¼ã¸ã§ã³ãGSU æ°ãæéãå
¥åããã¨ãæéè¦ç©ããã表示ããã¾ãã</p>
<p>è³¼å
¥ã«å¿
è¦ãªæ¨©éãªã©ã®è©³ç´°ã¯ã以ä¸ã®ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput?hl=ja#purchase-provisioned-throughput">ãããã¸ã§ãã³ã°ãããã¹ã«ã¼ããããè³¼å
¥ãã</a></li>
</ul>
<h3 id="èæ
®äºé
">èæ
®äºé
</h3>
<p>èæ
®äºé
ã¨ãã¦ã¯ã以ä¸ãæãããã¾ãã</p>
<ul>
<li>å®éã®ã¹ã«ã¼ãããã Provisioned Throughput ã®æ³¨æéãè¶
ããã¨ãè¶
éåã¯å¾é課éã§å¦çããã</li>
<li>æªä½¿ç¨ã®ã¹ã«ã¼ãããã¯ç¿æã«ç¹°ãè¶ããªã</li>
</ul>
<p>ãã®ä»ã®èæ
®äºé
ã«ã¤ãã¦ã¯ä»¥ä¸ã®ããã¥ã¡ã³ãã注ææ·±ããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput?hl=ja#considerations">å®æè³¼å
¥ãéå§ããåã«èæ
®ãã¹ããã¨</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura
çµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æã(constraints/iam.allowedPolicyMemberDomains)ãé©ç¨ããã¦ãã¾ããã¸ã®å¯¾å¦æ³
hatenablog://entry/6802418398311609267
2025-01-08T09:00:00+09:00
2025-01-08T09:30:07+09:00 G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ IAM ããªã·ã¼ãç·¨éãããã¨ããéã«ãçµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æãï¼constraints/iam.allowedPolicyMemberDomainsï¼ãé©ç¨ããã¦ãã¾ãã ã¨è¡¨ç¤ºããã¦ã¨ã©ã¼ã«ãªã£ãã¨ãã®å¯¾å¦æ³ãç´¹ä»ãã¾ãã äºè±¡ã¨ã¡ãã»ã¼ã¸ åå 対å¦æ¹æ³ 対å¦æé 顧客 ID ã®ç¢ºèª IAM 権éã®ç¢ºèª çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§» å¶ç´ã®ç·¨éç»é¢ã¸é·ç§» å¶ç´ãç·¨é çµæã®ç¢ºèª æå¾ã« ã¯ã¼ã¯ã¢ã©ã¦ã³ã é¢é£è¨äº äºè±¡ã¨ã¡ãã»ã¼ã¸ Google Cloudï¼æ§ç§° GCPï¼ã§ãIAM ããªã·ã¼ãç·¨éãâ¦
<p>G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ IAM ããªã·ã¼ãç·¨éãããã¨ããéã«ã<code>çµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æãï¼constraints/iam.allowedPolicyMemberDomainsï¼ãé©ç¨ããã¦ãã¾ãã</code> ã¨è¡¨ç¤ºããã¦ã¨ã©ã¼ã«ãªã£ãã¨ãã®å¯¾å¦æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#äºè±¡ã¨ã¡ãã»ã¼ã¸">äºè±¡ã¨ã¡ãã»ã¼ã¸</a></li>
<li><a href="#åå ">åå </a></li>
<li><a href="#対å¦æ¹æ³">対å¦æ¹æ³</a></li>
<li><a href="#対å¦æé ">対å¦æé </a><ul>
<li><a href="#顧客-ID-ã®ç¢ºèª">顧客 ID ã®ç¢ºèª</a></li>
<li><a href="#IAM-権éã®ç¢ºèª">IAM 権éã®ç¢ºèª</a></li>
<li><a href="#çµç¹ãã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ">çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ</a></li>
<li><a href="#çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»">çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»</a></li>
<li><a href="#å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»">å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»</a></li>
<li><a href="#å¶ç´ãç·¨é">å¶ç´ãç·¨é</a></li>
</ul>
</li>
<li><a href="#çµæã®ç¢ºèª">çµæã®ç¢ºèª</a></li>
<li><a href="#æå¾ã«">æå¾ã«</a><ul>
<li><a href="#ã¯ã¼ã¯ã¢ã©ã¦ã³ã">ã¯ã¼ã¯ã¢ã©ã¦ã³ã</a></li>
<li><a href="#é¢é£è¨äº">é¢é£è¨äº</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241217/20241217090310.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="äºè±¡ã¨ã¡ãã»ã¼ã¸">äºè±¡ã¨ã¡ãã»ã¼ã¸</h1>
<p>Google Cloudï¼æ§ç§° GCPï¼ã§ãIAM ããªã·ã¼ãç·¨éããGoogle ã¢ã«ã¦ã³ãã« IAM ãã¼ã«ãç´ã¥ãããã¨ããéã«ã以ä¸ã®ã¡ãã»ã¼ã¸ã表示ãããç·¨éã失æãã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="çµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æãï¼constraints/iam.allowedPolicyMemberDomainsï¼ãé©ç¨ããã¦ãã¾ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090004.png" width="671" height="406" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>çµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æãï¼constraints/iam.allowedPolicyMemberDomainsï¼ãé©ç¨ããã¦ãã¾ãã</figcaption></figure></p>
<blockquote><p>IAM ããªã·ã¼ã®æ´æ°ã«å¤±æãã¾ãã<br/>
çµç¹ã®ããªã·ã¼ããã¡ã¤ã³ã§å¶éãããå
±æãï¼constraints/iam.allowedPolicyMemberDomainsï¼ãé©ç¨ããã¦ãã¾ããããªã·ã¼ã§ããªã³ã·ãã«ã¨ãã¦è¿½å ã§ããã®ã¯ã許å¯ããããã¡ã¤ã³ã®ããªã³ã·ãã«ã®ã¿ã§ããããªã³ã·ãã«ã®ã¡ã¼ã«ã¢ãã¬ã¹ãä¿®æ£ãã¦ãããä¸åº¦ã試ããã ãããå
±æå
ã®ãã¡ã¤ã³ã®å¶éã®è©³ç´°</p>
<p>ãªã¯ã¨ã¹ã ID: (æ°å)</p></blockquote>
<h1 id="åå ">åå </h1>
<p>ãã®äºè±¡ã¯ãçµç¹ããªã·ã¼ã®å¶ç´ <code>iam.allowedPolicyMemberDomains</code> ãçµç¹ã¬ãã«ããã©ã«ãã¬ãã«ã¾ãã¯ããã¸ã§ã¯ãã¬ãã«ã§æå¹åããã¦ããã¨ãã«çºçãã¾ãã</p>
<p><code>iam.allowedPolicyMemberDomains</code> ã¯ã<strong>許å¯ããã¦ããªãçµç¹ã«æå±ãã Google ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸ãç¦æ¢ããå¶ç´</strong>ã§ããä¾ã¨ãã¦ã<code>g-gen.co.jp</code> ã¨ããçµç¹ã® Google Cloud ããã¸ã§ã¯ãã§ã<code>example.com</code>ï¼ä»çµç¹ï¼ã®ããªã³ã·ãã«ã«å¯¾ã㦠IAM ãã¼ã«ãä»ä¸ãããã¨ããã±ã¼ã¹ã該å½ãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-domains?hl=ja">ãã¡ã¤ã³å¥ã® ID ã®å¶é</a></li>
</ul>
<p>ãã®å¶ç´ã¯ã2024å¹´åé 以éã«ä½æããã Google Cloud çµç¹ã§ã¯ããã©ã«ãã§æå¹åããã¦ãã¾ãããã以åã«ä½æãããçµç¹ã§ãã管çè
ãæ示çã«ãã®å¶ç´ãæå¹åãã¦ããå ´åã¯ããã®äºè±¡ãçºçãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/resource-manager/docs/secure-by-default-organizations?hl=ja#organization_policies_enforced_on_organization_resources">çµç¹ãªã½ã¼ã¹ã«é©ç¨ãããçµç¹ã®ããªã·ã¼</a></li>
</ul>
<p>ãªãçµç¹ã®ããªã·ã¼ã¨ã¯ãã»ãã¥ãªãã£ãçµ±å¶ã®åä¸ã®ããã«ãæå®ã®ã«ã¼ã«ã Google Cloud ç°å¢å
¨ä½ã«é©ç¨ããä»çµã¿ã®ãã¨ã§ããçµç¹ã®ããªã·ã¼ã®è©³ç´°ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Forganization-policy-explained" title="çµç¹ã®ããªã·ã¼ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/organization-policy-explained">blog.g-gen.co.jp</a></cite></p>
<h1 id="対å¦æ¹æ³">対å¦æ¹æ³</h1>
<p>çµç¹ããªã·ã¼ã®å¶ç´ <code>iam.allowedPolicyMemberDomains</code> ã¯ãªã¹ãåã®å¶ç´ã§ãããã©ã«ãã§ã¯èªçµç¹ã®ã¿ã許å¯ããã¦ãã¾ãã</p>
<p>ãããã£ã¦ã<strong>ä»çµç¹ã® Google ã¢ã«ã¦ã³ãã« IAM ãã¼ã«ãä»ä¸ããã</strong>å ´åã¯ãã®å¶ç´ã®è¨±å¯ãªã¹ãã«ã<strong>ãã®çµç¹ãæ示çã«è¿½å </strong>ããå¿
è¦ãããã¾ãã</p>
<p>çµç¹ããªã·ã¼ã®å¶ç´ã¯ãçµç¹ã¬ãã«ããã©ã«ãã¬ãã«ãããã¸ã§ã¯ãã¬ãã«ã§é©ç¨ãããã¨ãã§ãã親ãªã½ã¼ã¹ã®ããªã·ã¼ã¯åãªã½ã¼ã¹ã«<strong>ç¶æ¿</strong>ããã¾ãããã ããæ示çã«è¨å®ãããã¨ã§ãåãªã½ã¼ã¹å´ã§è¦ªãªã½ã¼ã¹ã®å¶ç´ããªã¼ãã¼ã©ã¤ãï¼ä¸æ¸ãï¼ãããã¨ãå¯è½ã§ãã</p>
<p>ãã£ã¦ãåãå¾ãé¸æè¢ã¨ãã¦ã¯ã以ä¸ã®ããããã«ãªãã¾ãã</p>
<ol>
<li><code>iam.allowedPolicyMemberDomains</code> ã<strong>çµç¹ã¬ãã«</strong>ã§ç·¨éãã</li>
<li><code>iam.allowedPolicyMemberDomains</code> ã<strong>ãã©ã«ãã¬ãã«</strong>ã§ãªã¼ãã¼ã©ã¤ããã¦ç·¨éãã</li>
<li><code>iam.allowedPolicyMemberDomains</code> ã<strong>ããã¸ã§ã¯ãã¬ãã«</strong>ã§ãªã¼ãã¼ã©ã¤ããã¦ç·¨éãã</li>
</ol>
<p>ä¸è¨ã®ãã¡ <code>1.</code>ã<code>2.</code> ã®å ´åãçµç¹å
¨ä½ãããã¯ãã©ã«ãå
¨ä½ã§å½±é¿ãåã³ã¾ããã<code>3.</code> ã®å½±é¿ç¯å²ã¯å½è©²ããã¸ã§ã¯ãã®ã¿ã§ãã</p>
<p>ãèªèº«ã®ç°å¢æ§æã¨ç
§ããåãããå½±é¿ç¯å²ãååã«ç解ããããã§é©åãªã¹ã³ã¼ãã§è¨å®ããã ããã¨ãæ¨å¥¨ãã¾ãã</p>
<h1 id="対å¦æé ">対å¦æé </h1>
<h2 id="顧客-ID-ã®ç¢ºèª">顧客 ID ã®ç¢ºèª</h2>
<p>許å¯ãªã¹ãã«å¤é¨çµç¹ã追å ããã«ã¯ããã®çµç¹ã®<code>顧客 ID</code>ãææ¡ãã¦ããå¿
è¦ãããã¾ãã</p>
<p>以ä¸ãåèã«è¿½å 対象çµç¹ã®é¡§å®¢ ID ãåå¾ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-domains?hl=ja#retrieving_customer_id">Google Workspace ãå®¢æ§ ID ã®åå¾</a> (<code>gcloud / API</code>ããåå¾)</li>
<li>åè : <a href="https://support.google.com/a/answer/10070793?hl=ja">顧客 ID ã®ç¢ºèª</a> (<code>Admin ã³ã³ã½ã¼ã«</code>ããåå¾)</li>
</ul>
<p>ã¾ãã以ä¸ã®è¨äºãåèã«ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fhow-to-retrieve-organization-id" title="Google Cloudçµç¹ã®çµç¹IDã顧客IDã調ã¹ãæ¹æ³ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/how-to-retrieve-organization-id">blog.g-gen.co.jp</a></cite></p>
<h2 id="IAM-権éã®ç¢ºèª">IAM 権éã®ç¢ºèª</h2>
<p>å½æé ãå®æ½ããã«ã¯ãæä½ãã Google ã¢ã«ã¦ã³ãããããã¯ã¢ã«ã¦ã³ããæå±ããã°ã«ã¼ãããçµç¹ã¬ãã«ã§<strong>çµç¹ããªã·ã¼ç®¡çè
</strong>ï¼<code>roles/orgpolicy.policyAdmin</code>ï¼ãã¼ã«ãæã£ã¦ããå¿
è¦ãããã¾ãã</p>
<p>çµç¹ããªã·ã¼ç®¡çè
ãä»ä¸ã§ããæãä¸ä½ã¬ãã«ã®ãªã½ã¼ã¹ã¯ãçµç¹ãã§ãããã£ã¦ããã©ã«ããããã¸ã§ã¯ãã¬ãã«ã§å¶ç´ããªã¼ãã¼ã©ã¤ãããå ´åã§ããçµç¹ã¬ãã«ã§çµç¹ããªã·ã¼ç®¡çè
ãã¼ã«ãæã£ã¦ããå¿
è¦ãããã¾ãã</p>
<p>ä½æ¥è
ã® Google ã¢ã«ã¦ã³ããå¿
è¦ãªæ¨©éãæã£ã¦ããªãå ´åã¯ãçµç¹ã¬ãã«ã§ IAM ãã¼ã«ãçµç¹ããªã·ã¼ç®¡çè
ããä»ä¸ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/access-control-org?hl=ja">IAM ã使ç¨ããçµç¹ãªã½ã¼ã¹ã®ã¢ã¯ã»ã¹å¶å¾¡</a></li>
</ul>
<h2 id="çµç¹ãã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ">çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ</h2>
<p>Google Cloud ã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ããããã¸ã§ã¯ãã»ã¬ã¯ã¿ã¼ãã¯ãªãã¯ãã¦ãå¶ç´ãç¡å¹åãé©ç¨ããçµç¹ããã©ã«ããã¾ãã¯ããã¸ã§ã¯ããé¸æãã¾ãã</p>
<p>å½è¨äºã®ã対å¦æ¹æ³ãããããèªã¿ã«ãªããå¶ç´ã®ç·¨éä½ç½®ã決ããããã§é¸æãã¦ãã ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090007.png" width="800" height="367" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»">çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»</h2>
<p>ã³ã³ã½ã¼ã«ä¸é¨ã®æ¤ç´¢ããã¯ã¹ã«ãçµç¹ã®ããªã·ã¼ãã¨å
¥åãããµã¸ã§ã¹ãããã<code>çµç¹ã®ããªã·ã¼</code>ãé¸æãã¾ãã</p>
<p>ã¾ãã¯ã<code>IAM ã¨ç®¡ç</code>ç»é¢ããç´æ¥é·ç§»ãã¦ãæ§ãã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090011.png" width="800" height="345" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»">å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»</h2>
<p>å¶ç´ä¸è¦§ã®ä¸é¨ã®ãã£ã«ã¿ã« <code>constraints/iam.allowedPolicyMemberDomains</code> ãå
¥åãããã£ã«ã¿çµæã®ä¸ãã <code>Domain restricted sharing</code> ãã¯ãªãã¯ãã¦ç·¨éç»é¢ã¸é·ç§»ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090014.png" width="800" height="511" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="å¶ç´ãç·¨é">å¶ç´ãç·¨é</h2>
<p><code>ããªã·ã¼ã管ç</code>ãã¯ãªãã¯ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090018.png" width="800" height="536" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>以ä¸ã®é ã§ã«ã¼ã«ã追å ããæå¾ã«<code>ããªã·ã¼ãè¨å®</code>ãã¯ãªãã¯ãã¾ãã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> # </th>
<th style="text-align:left;"> é
ç® </th>
<th style="text-align:left;"> è¨å®å¤ </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> 1 </td>
<td style="text-align:left;"> ããªã·ã¼ã®ã½ã¼ã¹ </td>
<td style="text-align:left;"> <code>親ã®ããªã·ã¼ããªã¼ãã¼ã©ã¤ããã</code> </td>
</tr>
<tr>
<td style="text-align:left;"> 2 </td>
<td style="text-align:left;"> ããªã·ã¼ã®é©ç¨ </td>
<td style="text-align:left;"> <code>親ã¨çµåãã</code> â»è¦ªã®è¨å®ãä¸æ¸ãããå ´åã¯<code>交æ</code>ãé¸æãã </td>
</tr>
<tr>
<td style="text-align:left;"> 3 </td>
<td style="text-align:left;"> ããªã·ã¼ã®å¤ </td>
<td style="text-align:left;"> <code>ã«ã¹ã¿ã </code>ãé¸æãã </td>
</tr>
<tr>
<td style="text-align:left;"> 4 </td>
<td style="text-align:left;"> ããªã·ã¼ã¿ã¤ã </td>
<td style="text-align:left;"> <code>許å¯</code>ãé¸æãã </td>
</tr>
<tr>
<td style="text-align:left;"> 5 </td>
<td style="text-align:left;"> ã«ã¹ã¿ã å¤ </td>
<td style="text-align:left;"> <code>顧客ID</code>ãå
¥åãã </td>
</tr>
</tbody>
</table>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090022.png" width="595" height="800" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="çµæã®ç¢ºèª">çµæã®ç¢ºèª</h1>
<p>è¨å®ãå®äºããã¨ã以ä¸ã®ãããªè¡¨ç¤ºã«ãªãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20250108/20250108090026.png" width="800" height="680" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æå¾ã«">æå¾ã«</h1>
<h2 id="ã¯ã¼ã¯ã¢ã©ã¦ã³ã">ã¯ã¼ã¯ã¢ã©ã¦ã³ã</h2>
<p>çµç¹ããªã·ã¼ã®å¤æ´ãé£ããå ´åã¯ãGoogle ã°ã«ã¼ãã«å¤é¨çµç¹ã®ã¡ã³ãã¼ã追å ãããã®ã°ã«ã¼ãã«æ¨©éãä»ä¸ãããã¨ã§ãã¡ã¤ã³å¶éã®å¶ç´ãåé¿ãããã¨ãå¯è½ã§ãã</p>
<p>詳細ã¯ä»¥ä¸ã®å
¬å¼ããã¥ã¡ã³ããã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-domains?hl=ja#google_groups">Google ã°ã«ã¼ã</a></li>
</ul>
<h2 id="é¢é£è¨äº">é¢é£è¨äº</h2>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Ftrouble-shoot-service-account-key-creation-is-disabled" title="ããµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ããã¸ã®å¯¾å¦æ³ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/trouble-shoot-service-account-key-creation-is-disabled">blog.g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-yutakei/20220512/20220512214329.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">æ¦äº ç¥ä» <a href="https://blog.g-gen.co.jp/archive/author/ggen-yutakei">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨æå±ãG-genå¯ä¸ã®å±±æ¢¨çå¨ä½ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2025 é¸åºãIaC ã CI/CD å¨ãã®ãµã¼ãã¹ããããã¯ããèå³åéã§ãã</p>
<p class="sw-profile__txt">趣å³ã¯ãã¼ããã¤ã¯ããã¼ãã¬ã¼ã¹ããµãã«ã¼è¦³æ¦ã§ãã</p>
<!-- 以ä¸ã®è¡ã追å -->
<a href="https://twitter.com/ggenyutakei?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ggenyutakei</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-yutakei
2024å¹´12æã®ã¤ããªã·Google Cloudã¢ãããã¼ã
hatenablog://entry/6802418398312333970
2025-01-06T09:00:00+09:00
2025-01-06T09:00:03+09:00 G-gen ã®ææã§ãã2024å¹´12æã®ã¤ããªã· Google Cloudï¼æ§ç§° GCPï¼ã¢ãããã¼ããã¾ã¨ãã¦ãç´¹ä»ãã¾ããè¨è¼ã¯å
¨ã¦ãè¨äºå
¬éå½æã®ãã®ã§ãã®ã§ãçæãã ããã ã¯ããã« Google ãã©ã¼ã ã§æ°ãã権éãResponderï¼åçè
ï¼ããå©ç¨å¯è½ã« Vertex AI Search 㧠gemini-1.5-flash-002-high-fidelityï¼Previewï¼ Google Deepmindã大è¦æ¨¡ä¸çã¢ãã« Genie 2 ãçºè¡¨ Parameter Manager ã Preview å
¬é ç»åçæã¢ãã«ãImagen 3ããä¸è¬å
¬é Gemini 2.â¦
<p>G-gen ã®ææã§ãã2024å¹´12æã®ã¤ããªã· Google Cloudï¼æ§ç§° GCPï¼ã¢ãããã¼ããã¾ã¨ãã¦ãç´¹ä»ãã¾ããè¨è¼ã¯å
¨ã¦ãè¨äºå
¬éå½æã®ãã®ã§ãã®ã§ãçæãã ããã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#Google-ãã©ã¼ã ã§æ°ãã権éResponderåçè
ãå©ç¨å¯è½ã«">Google ãã©ã¼ã ã§æ°ãã権éãResponderï¼åçè
ï¼ããå©ç¨å¯è½ã«</a></li>
<li><a href="#Vertex-AI-Search-ã§-gemini-15-flash-002-high-fidelityPreview">Vertex AI Search 㧠gemini-1.5-flash-002-high-fidelityï¼Previewï¼</a></li>
<li><a href="#Google-Deepmind大è¦æ¨¡ä¸çã¢ãã«-Genie-2-ãçºè¡¨">Google Deepmindã大è¦æ¨¡ä¸çã¢ãã« Genie 2 ãçºè¡¨</a></li>
<li><a href="#Parameter-Manager-ã-Preview-å
¬é">Parameter Manager ã Preview å
Ž</a></li>
<li><a href="#ç»åçæã¢ãã«Imagen-3ãä¸è¬å
¬é">ç»åçæã¢ãã«ãImagen 3ããä¸è¬å
Ž</a></li>
<li><a href="#Gemini-20-ãçºè¡¨">Gemini 2.0 ãçºè¡¨</a></li>
<li><a href="#BigQuery-ã®ã¯ãã¹ãªã¼ã¸ã§ã³ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã-GA">BigQuery ã®ã¯ãã¹ãªã¼ã¸ã§ã³ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã GA</a></li>
<li><a href="#BigQuery-ã§-BigQuery-Managed-Disaster-Recovery-ã-GA">BigQuery 㧠BigQuery Managed Disaster Recovery ã GA</a></li>
<li><a href="#VPC-SC-ã®-IngressEgress-rules-ã®-Google-ã°ã«ã¼ãæå®ã-GA">VPC SC ã® Ingress/Egress rules ã® Google ã°ã«ã¼ãæå®ã GA</a></li>
<li><a href="#Google-Workspace-ã§-NotebookLM-Plus-ãå©ç¨å¯è½ã«">Google Workspace 㧠NotebookLM Plus ãå©ç¨å¯è½ã«</a></li>
<li><a href="#æ°ãµã¼ãã¹-Google-Agentspace-ãçºè¡¨">æ°ãµã¼ãã¹ Google Agentspace ãçºè¡¨</a></li>
<li><a href="#Compute-Engine-ã§-Windows-Server-2025-ãå©ç¨å¯è½ã«">Compute Engine 㧠Windows Server 2025 ãå©ç¨å¯è½ã«</a></li>
<li><a href="#Cloud-IAM-ã§-Principal-access-boundary-policies-ã-Preview--GA">Cloud IAM 㧠Principal access boundary policies ã Preview â GA</a></li>
<li><a href="#Looker-Studio-ã®ãã¼ã¿ã½ã¼ã¹ç·¨éç»é¢ã§ãã¼ã¿ã®ãã¬ãã¥ã¼ãå¯è½ã«">Looker Studio ã®ãã¼ã¿ã½ã¼ã¹ç·¨éç»é¢ã§ãã¼ã¿ã®ãã¬ãã¥ã¼ãå¯è½ã«</a></li>
<li><a href="#å
¨ã¨ãã£ã·ã§ã³ã§-AppSheet-管çç»é¢ãå©ç¨å¯è½ã«">å
¨ã¨ãã£ã·ã§ã³ã§ AppSheet 管çç»é¢ãå©ç¨å¯è½ã«</a></li>
<li><a href="#Gemini-20-Flash-Thinking-ã®è©¦é¨éç¨çã-Google-AI-Studio-ã§å
¬é">Gemini 2.0 Flash Thinking ã®è©¦é¨éç¨çã Google AI Studio ã§å
Ž</a></li>
<li><a href="#Google-ãã©ã¤ãã§åç»ãã¢ãããã¼ãå¾ããã«åçã§ããããã«">Google ãã©ã¤ãã§åç»ãã¢ãããã¼ãå¾ããã«åçã§ããããã«</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240603/20240603200204.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p>å½è¨äºã§ã¯ãæ¯æã® Google Cloudï¼æ§ç§° GCPï¼ã Google Workspaceï¼æ§ç§° GSuiteï¼ã®ã¢ãããã¼ãã®ãã¡ãç¹ã«éè¦ãªãã®ãã¾ã¨ãã¾ãã</p>
<p>ã¾ãå½è¨äºã¯ãGoogle Cloud ã«é¢ããããç¨åº¦ã®ç¥èãåæã«è¨è¼ããã¦ãã¾ããåæç¥èãå¾ãã«ã¯ããã²ä»¥ä¸ã®è¨äºããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcontents-for-google-cloud-learners" title="Google Cloud ãµã¼ãã¹ã«ããå¦ç¿ã³ã³ãã³ãé - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/contents-for-google-cloud-learners">blog.g-gen.co.jp</a></cite></p>
<p>ãªã³ã¯å
ã®å
¬å¼ã¬ã¤ãã¯ãè±èªçã§è¡¨ç¤ºããªãã¨ææ°æ
å ±ãåæ ããã¦ããªãå ´åãããã¾ãããã注æãã ããã</p>
<h1 id="Google-ãã©ã¼ã ã§æ°ãã権éResponderåçè
ãå©ç¨å¯è½ã«">Google ãã©ã¼ã ã§æ°ãã権éãResponderï¼åçè
ï¼ããå©ç¨å¯è½ã«</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/12/add-granular-control-to-google-forms.html">Adding granular control options for who can respond to Google Forms</a> (2024-12-03)</p>
<p>Google ãã©ã¼ã ã§æ°ãã権éãResponderï¼åçè
ï¼ããå©ç¨å¯è½ã«ã</p>
<p>å¾æ¥ã¯ãã©ã¼ã ãã¤ã³ã¿ã¼ãããå
¬éããããåçå¯è½ãªäººãçµãã¨ãã¯ç¹å®ãã¡ã¤ã³ã«ããéå®ã§ããªãã£ããä»å¾ã¯ã¢ã«ã¦ã³ããã°ã«ã¼ãã«éå®ãã¦å
¬éãããã¨ãå¯è½ã«ãªã£ãã</p>
<h1 id="Vertex-AI-Search-ã§-gemini-15-flash-002-high-fidelityPreview">Vertex AI Search 㧠gemini-1.5-flash-002-high-fidelityï¼Previewï¼</h1>
<p><a href="https://cloud.google.com/generative-ai-app-builder/docs/grounded-gen?hl=en#high-fidelity-models">High fidelity models</a> (2024-12-04)</p>
<p>Vertex AI Search 㧠gemini-1.5-flash-002-high-fidelity ã¢ãã«ã Preview å
¬éã</p>
<p>gemini-1.5-flash-002-high-fidelity ã¢ãã«ã¨ã¯ãã³ã³ããã¹ããã¼ã¹ã®è³ªåã«æé©åããã RAG ç¨ã¢ãã«ãæ£ç¢ºæ§ãå®å
¨æ§ãéè¦ãããã¥ã¼ãã³ã°ãããã¦ãããéèããã«ã¹ã±ã¢ãªã©æ£ç¢ºæ§ãéè¦ãªç¨éãæ³å®ã</p>
<h1 id="Google-Deepmind大è¦æ¨¡ä¸çã¢ãã«-Genie-2-ãçºè¡¨">Google Deepmindã大è¦æ¨¡ä¸çã¢ãã« Genie 2 ãçºè¡¨</h1>
<p><a href="https://deepmind.google/discover/blog/genie-2-a-large-scale-foundation-world-model/">Genie 2: A large-scale foundation world model</a> (2024-12-04)</p>
<p>Google Deepmind ããåºç¤ä¸çã¢ãã«ï¼A large-scale foundation world modelï¼Genie 2 ãçºè¡¨ããã</p>
<p>ã¢ã¯ã·ã§ã³å¶å¾¡å¯è½ã§ãã¬ã¤å¯è½ãª 3D ç°å¢ãçæã§ãããçæããã¯ã¼ã«ãã¯ããã¼ãã¼ãã¨ãã¦ã¹å
¥åã使ç¨ãã¦ã人éã¾ã㯠AI ã¨ã¼ã¸ã§ã³ãã«ãã£ã¦ãã¬ã¤ã§ãããä¸äººç§°è¦ç¹ãã¢ã¤ã½ã¡ããªã㯠ãã¥ã¼ãä¸äººç§°é転ãããªãªã©ããã¾ãã¾ãªç°å¢ãçæå¯è½ã</p>
<h1 id="Parameter-Manager-ã-Preview-å
¬é">Parameter Manager ã Preview å
Ž</h1>
<p><a href="https://cloud.google.com/secret-manager/parameter-manager/docs/overview?hl=en">Parameter Manager overview</a> (2024-12-06)</p>
<p>Secret Manager ã®æ´¾çæ©è½ã¨ã㦠Parameter Manager ã Preview å
¬éã</p>
<p>ç°å¢è¨å®å¤ãéä¸ç®¡çããä»çµã¿ãã·ã¼ã¯ã¬ãã管çãå¯è½ã ããSecret Manager ã«ã¯åå¨ãããrotation schedulesããç¡ããªã©ã®å·®ç°ããããç¾å¨ gcloud/REST ã®ã¿ã§æä¾ã
ã·ã¼ã¯ã¬ããæ
å ±ã¯ Secret Manager ã§ããã®ä»ã®ç°å¢åºæè¨å®å¤ã¯ Parameter Manager ã§ç®¡çãããã¨ãæ³å®ããã</p>
<p>Parameter Manager ãã Secret Manager ã®ã·ã¼ã¯ã¬ãããåç
§ãããã¨ãã§ããã¡ããã© AWS Secret Manager 㨠Parameter Store ã®é¢ä¿ã«ä¼¼ã¦ããã</p>
<h1 id="ç»åçæã¢ãã«Imagen-3ãä¸è¬å
¬é">ç»åçæã¢ãã«ãImagen 3ããä¸è¬å
Ž</h1>
<p><a href="https://cloud.google.com/vertex-ai/generative-ai/docs/image/overview?hl=en">Imagen on Vertex AI | AI Image Generator</a> (2024-12-10)</p>
<p>ç»åçæã¢ãã«ãImagen 3ããä¸è¬å
¬éããããããã¾ã§ã¯è¨±å¯ãªã¹ãå¶ã ã£ããVertex AIçµç±ã§å
¨ã¦ã¼ã¶ã¼ãå©ç¨å¯è½ã«ãªã£ãã以ä¸ã®ã¢ãã«ãå©ç¨å¯è½ã</p>
<ul>
<li>imagen-3.0-generate-001</li>
<li>imagen-3.0-fast-generate-001</li>
</ul>
<p>ãã ãç»åã®ç·¨éã few-shot learning ãå¯è½ãªä»¥ä¸ã®ã¢ãã«ã¯å¼ãç¶ãã許å¯å¶ã</p>
<ul>
<li>imagen-3.0-capability</li>
</ul>
<h1 id="Gemini-20-ãçºè¡¨">Gemini 2.0 ãçºè¡¨</h1>
<p><a href="https://news.mynavi.jp/techplus/article/20241212-3084231/">GoogleããGemini 2.0ããçºè¡¨ãAIã¢ãã«ã¯âã¨ã¼ã¸ã§ã³ãæ代âã«</a> (2024-12-12)</p>
<p>Google ãçæAIã¢ãã« Gemini ã®ææ°çãGemini 2.0 ãçºè¡¨ã</p>
<p>ãã«ãã¢ã¼ãã«å¯¾å¿ãããã«å¼·åã<code>gemini-2.0-flash-exp</code> ã Gemini ã¢ããªã Vertex AI StudioãGoogle AI Studio ã§æ¢ã«ä½¿ç¨å¯è½ã«ãªã£ã¦ããã</p>
<h1 id="BigQuery-ã®ã¯ãã¹ãªã¼ã¸ã§ã³ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã-GA">BigQuery ã®ã¯ãã¹ãªã¼ã¸ã§ã³ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã GA</h1>
<p><a href="https://cloud.google.com/bigquery/docs/data-replication?hl=en">Cross-region dataset replication</a> (2024-12-11)</p>
<p>BigQuery ã§ã¯ãã¹ãªã¼ã¸ã§ã³ ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã Preview â GAã</p>
<p>å¥ãªã¼ã¸ã§ã³ã«ãã¼ã¿ãéåæã§è¤è£½ãããã¼ã¿ã®å
ç¢æ§ã¨å¯ç¨æ§ãé«ããããããã¼ã¿ã»ããã®ãªã¼ã¸ã§ã³é移è¡ã«ãå©ç¨å¯è½ã</p>
<p>ãã ããã©ã¤ããªãªã¼ã¸ã§ã³ãé害æãã»ã«ã³ããªãªã¼ã¸ã§ã³ã¯ Read Only ã«ãªãã詳細ã¯ä»¥ä¸ã®è¨äºãåç
§ã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fusing-bigquery-cross-region-replication" title="BigQueryã®ã¯ãã¹ãªã¼ã¸ã§ã³ã»ãã¼ã¿ã»ããã¬ããªã±ã¼ã·ã§ã³ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/using-bigquery-cross-region-replication">blog.g-gen.co.jp</a></cite></p>
<h1 id="BigQuery-ã§-BigQuery-Managed-Disaster-Recovery-ã-GA">BigQuery 㧠BigQuery Managed Disaster Recovery ã GA</h1>
<p><a href="https://cloud.google.com/bigquery/docs/managed-disaster-recovery?hl=en">Managed disaster recovery</a> (2024-12-11)</p>
<p>BigQuery 㧠BigQuery Managed Disaster Recovery ã Preview â GAã</p>
<p>ãªã¼ã¸ã§ã³é害ã®ã¨ãã«ãã¼ã¿ã®ã¿ãªããã³ã³ãã¥ã¼ããªã½ã¼ã¹äºç´ããã§ã¤ã«ãªã¼ãããæ¸ãè¾¼ã¿ãå«ãã¯ã¼ã¯ãã¼ããç¶ç¶ã§ããã</p>
<h1 id="VPC-SC-ã®-IngressEgress-rules-ã®-Google-ã°ã«ã¼ãæå®ã-GA">VPC SC ã® Ingress/Egress rules ã® Google ã°ã«ã¼ãæå®ã GA</h1>
<p><a href="https://cloud.google.com/vpc-service-controls/docs/release-notes?hl=en#December_11_2024">VPC Service Controls release notes - December 11, 2024</a> (2024-12-11)</p>
<p>VPC Service Controls å¢ç㧠Ingress/Egress rules ã§ã® Google ã°ã«ã¼ãæå®ã Preview â GAã</p>
<p>å¾æ¥ã¯ Google ã¢ã«ã¦ã³ããç´æ¥æå®ããå¿
è¦ããã£ãããã°ã«ã¼ãæå®ãã§ããããã«ãªããéç¨ã®ç
©éãããã解æ¶ãããã</p>
<h1 id="Google-Workspace-ã§-NotebookLM-Plus-ãå©ç¨å¯è½ã«">Google Workspace 㧠NotebookLM Plus ãå©ç¨å¯è½ã«</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/12/notebooklm-plus-gemini-for-google-workspace-users.html">NotebookLM Plus now available to Google Workspace customers</a> (2024-12-13)</p>
<p>Google Workspace 㧠NotebookLM Plus ãå©ç¨å¯è½ã«ããã¨ãã¨ç¡æã§å©ç¨ã§ãã NotebookLM ã®æåçãPlus ã§ã¯æ§ã
ãªæ©è½ãå¶éç·©åããã¼ã¿ã®ä¿è·ã追å ãããã</p>
<p>NotebookLM ã¯èªåå°ç¨ã®AIãã¼ãããã¯ããã¼ã¿ãã¢ãããã¼ããã¦çæAIã«èªã¿è¾¼ã¾ãçæããã¹ããèªåã®ã¡ã¢ãè¨è¿°ãã¦ããããåæãè³æä½æãæ
å ±æ´çãªã©ã«å©ç¨ã§ããã</p>
<p>è¦Geminiã¢ããªã³ã©ã¤ã»ã³ã¹ã</p>
<h1 id="æ°ãµã¼ãã¹-Google-Agentspace-ãçºè¡¨">æ°ãµã¼ãã¹ Google Agentspace ãçºè¡¨</h1>
<p><a href="https://cloud.google.com/blog/products/ai-machine-learning/bringing-ai-agents-to-enterprises-with-google-agentspace?hl=en">Introducing Google Agentspace: Bringing AI agents and AI-powered search to enterprises</a> (2024-12-14)</p>
<p>æ°ãµã¼ãã¹ Google Agentspace ãçºè¡¨ãEarly accessã«ç³è¾¼å¯è½ã以ä¸ã®æ©è½ãåããã</p>
<ol>
<li>èªç¤¾ãã¼ã¿ãã¢ãããã¼ããã¦AIããå©ç¨ã§ãã NotebookLM Plus</li>
<li>ã³ã³ãã«ã Google ãã©ã¤ããSharePoint çããæ¤ç´¢ã§ããã¨ã³ã¿ã¼ãã©ã¤ãºãµã¼ã</li>
<li>人ã®ä»£ããã«ã¿ã¹ã¯ãããªãã¨ã¼ã¸ã§ã³ã</li>
</ol>
<h1 id="Compute-Engine-ã§-Windows-Server-2025-ãå©ç¨å¯è½ã«">Compute Engine 㧠Windows Server 2025 ãå©ç¨å¯è½ã«</h1>
<p><a href="https://cloud.google.com/compute/docs/images/os-details?hl=en#windows_server">Windows Server</a> (2024-12-16)</p>
<p>Compute Engine 㧠Windows Server 2025 ãå©ç¨å¯è½ã«ãªã£ããEoSï¼ã¤ã¡ã¼ã¸å»æ¢æ¥ï¼ã¯ 2034-10-10ã</p>
<p>ãªããã®åã® Windows Server 2022 ã® EoS 㯠2031-10-14ã</p>
<h1 id="Cloud-IAM-ã§-Principal-access-boundary-policies-ã-Preview--GA">Cloud IAM 㧠Principal access boundary policies ã Preview â GA</h1>
<p><a href="https://cloud.google.com/iam/docs/principal-access-boundary-policies?hl=en">Principal access boundary policies</a> (2024-12-17)</p>
<p>Cloud IAM 㧠Principal access boundary policies ã Preview â GAã</p>
<p>èªçµç¹ã®ããªã³ã·ãã«ãã©ã®ãªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ã§ãããã®å¢çï¼boundaryï¼ãè¨ãããããã¢ã¯ã»ã¹å
ãèªçµç¹ã®ãªã½ã¼ã¹ã«éå®ããããç¹å®ãã©ã«ãå
ã«éå®ãããã§ããã</p>
<h1 id="Looker-Studio-ã®ãã¼ã¿ã½ã¼ã¹ç·¨éç»é¢ã§ãã¼ã¿ã®ãã¬ãã¥ã¼ãå¯è½ã«">Looker Studio ã®ãã¼ã¿ã½ã¼ã¹ç·¨éç»é¢ã§ãã¼ã¿ã®ãã¬ãã¥ã¼ãå¯è½ã«</h1>
<p><a href="https://support.google.com/looker-studio/answer/15446333">Preview your data</a> (2024-12-17)</p>
<p>Looker Studio ã§ãã¼ã¿ã½ã¼ã¹ã®ç·¨éç»é¢ã§ãã¼ã¿å
容ããã¬ãã¥ã¼ã§ããããã«ãªã£ãã</p>
<p>BigQueryãGoogle ã¹ãã¬ããã·ã¼ããLookerãExcelãCSV ã«å¯¾å¿ã</p>
<h1 id="å
¨ã¨ãã£ã·ã§ã³ã§-AppSheet-管çç»é¢ãå©ç¨å¯è½ã«">å
¨ã¨ãã£ã·ã§ã³ã§ AppSheet 管çç»é¢ãå©ç¨å¯è½ã«</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/12/appsheet-admin-console-general-availability.html">Now generally available: Monitor and manage AppSheet usage in your organization with the AppSheet Admin console</a> (2024-12-18)</p>
<p>Google Workspace ã®å
¨ã¨ãã£ã·ã§ã³ã§ AppSheet ã®ç®¡çç»é¢ãå©ç¨å¯è½ã«ãªã£ãã</p>
<p>ã¢ããªã®å©ç¨ç¶æ³ã誰ãã¢ããªãããããä½ã£ã¦ããããã©ã¤ã»ã³ã¹æ°ããªã©ã横æã§é²è¦§ã§ãã管çç»é¢ã</p>
<h1 id="Gemini-20-Flash-Thinking-ã®è©¦é¨éç¨çã-Google-AI-Studio-ã§å
¬é">Gemini 2.0 Flash Thinking ã®è©¦é¨éç¨çã Google AI Studio ã§å
Ž</h1>
<p><a href="https://ai.google.dev/gemini-api/docs/thinking-mode?hl=ja">Gemini 2.0 Flash ã®æèã¢ã¼ã</a> (2024-12-19)</p>
<p>Gemini 2.0 Flash Thinking ã®è©¦é¨éç¨çï¼gemini-2.0-flash-thinking-exp-1219ï¼ã Vertex AIï¼Generative AI on Vertex AIï¼ã¨ Google AI Studio ã§å
¬éã</p>
<p>ãã®ã¢ãã«ã§ã¯ãçæçµæã ãã§ãªããçæã«è³ã£ããæèãããã»ã¹ãçæãã¦è¡¨ç¤ºããã</p>
<h1 id="Google-ãã©ã¤ãã§åç»ãã¢ãããã¼ãå¾ããã«åçã§ããããã«">Google ãã©ã¤ãã§åç»ãã¢ãããã¼ãå¾ããã«åçã§ããããã«</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/12/release-notes-12-20-2024.html">Google Workspace Updates Weekly Recap - December 20, 2024</a> (2024-12-20)</p>
<p>Google ãã©ã¤ãã§åç»ãã¢ãããã¼ãå¾ãããã«åçã§ããããã«ãªã£ãã</p>
<p>ããã¾ã§ã¯ã¢ãããã¼ãå¾ã«æ°åãæ°ååãå¦çã®æéãå¿
è¦ã ã£ãã</p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura
Compute Engineã¤ã³ã¹ã¿ã³ã¹ã«ãã¼ã«ã«Kubernetesã¯ã©ã¹ã¿ãæ§ç¯ããï¼Minikubeï¼
hatenablog://entry/6802418398302598666
2024-12-27T09:00:00+09:00
2024-12-27T09:00:02+09:00 G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ã³ã³ãã ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ ãã¼ã«ã§ãã Kubenretes ã®å¦ç¿ç¨ã®ãããMinikube ã使ã£ã¦ Compute Engineï¼Google Compute EngineãGCEï¼ä»®æ³ãã·ã³ä¸ã«ãã¼ã«ã« Kubernetes ã¯ã©ã¹ã¿ãæ§ç¯ãã¦ããã¾ãã ã¯ããã« å½è¨äºã®ç®ç Minikube ã¨ã¯ Compute Engine ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ ä½æ¥ã®æ¦è¦ ã·ã§ã«å¤æ°ã®è¨å® VPCã»ãµããããã®ä½æ VPC ã®ä½æ ãµããããã®ä½æ ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ Minikube ã®è¦ä»¶ã«ã¤ã㦠ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ã®è¨å® ã¤â¦
<p>G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ã³ã³ãã ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ ãã¼ã«ã§ãã Kubenretes ã®å¦ç¿ç¨ã®ãããMinikube ã使ã£ã¦ Compute Engineï¼Google Compute EngineãGCEï¼ä»®æ³ãã·ã³ä¸ã«ãã¼ã«ã« Kubernetes ã¯ã©ã¹ã¿ãæ§ç¯ãã¦ããã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#å½è¨äºã®ç®ç">å½è¨äºã®ç®ç</a></li>
<li><a href="#Minikube-ã¨ã¯">Minikube ã¨ã¯</a></li>
</ul>
</li>
<li><a href="#Compute-Engine-ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ">Compute Engine ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</a><ul>
<li><a href="#ä½æ¥ã®æ¦è¦">ä½æ¥ã®æ¦è¦</a></li>
<li><a href="#ã·ã§ã«å¤æ°ã®è¨å®">ã·ã§ã«å¤æ°ã®è¨å®</a></li>
<li><a href="#VPCãµããããã®ä½æ">VPCã»ãµããããã®ä½æ</a><ul>
<li><a href="#VPC-ã®ä½æ">VPC ã®ä½æ</a></li>
<li><a href="#ãµããããã®ä½æ">ãµããããã®ä½æ</a></li>
</ul>
</li>
<li><a href="#ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ">ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</a><ul>
<li><a href="#Minikube-ã®è¦ä»¶ã«ã¤ãã¦">Minikube ã®è¦ä»¶ã«ã¤ãã¦</a></li>
<li><a href="#ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ-1">ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</a></li>
</ul>
</li>
<li><a href="#ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ã®è¨å®">ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ã®è¨å®</a></li>
<li><a href="#ã¤ã³ã¹ã¿ã³ã¹ã«-SSH-æ¥ç¶">ã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶</a><ul>
<li><a href="#ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶GUI-ã®å ´å">ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶ï¼GUI ã®å ´åï¼</a></li>
<li><a href="#gcloud-ã³ãã³ãã§-SSH-æ¥ç¶CLI-ã®å ´å">gcloud ã³ãã³ã㧠SSH æ¥ç¶ï¼CLI ã®å ´åï¼</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#Docker-ã®ã¤ã³ã¹ãã¼ã«">Docker ã®ã¤ã³ã¹ãã¼ã«</a><ul>
<li><a href="#Minikube-ã®-driver-ã«ã¤ãã¦">Minikube ã® driver ã«ã¤ãã¦</a></li>
<li><a href="#ããã±ã¼ã¸ãªã¹ãã®æ´æ°">ããã±ã¼ã¸ãªã¹ãã®æ´æ°</a></li>
<li><a href="#ã¤ã³ã¹ãã¼ã«">ã¤ã³ã¹ãã¼ã«</a><ul>
<li><a href="#APT-ãªãã¸ããªã®ã»ããã¢ãã">APT ãªãã¸ããªã®ã»ããã¢ãã</a></li>
<li><a href="#Docker-ã®ã¤ã³ã¹ãã¼ã«-1">Docker ã®ã¤ã³ã¹ãã¼ã«</a></li>
</ul>
</li>
<li><a href="#Docker-ã®åä½ç¢ºèª">Docker ã®åä½ç¢ºèª</a></li>
<li><a href="#ã¯ãªã¼ã³ã¢ãã">ã¯ãªã¼ã³ã¢ãã</a></li>
</ul>
</li>
<li><a href="#Minikube-ã®ã¤ã³ã¹ãã¼ã«">Minikube ã®ã¤ã³ã¹ãã¼ã«</a><ul>
<li><a href="#APT-ãªãã¸ããªã®ã»ããã¢ãã-1">APT ãªãã¸ããªã®ã»ããã¢ãã</a></li>
<li><a href="#ã¤ã³ã¹ãã¼ã«-1">ã¤ã³ã¹ãã¼ã«</a></li>
</ul>
</li>
<li><a href="#Minikube-ã®å®è¡">Minikube ã®å®è¡</a><ul>
<li><a href="#Minikube-å®è¡ã¦ã¼ã¶ã¼ã-docker-ã°ã«ã¼ãã«è¿½å ">Minikube å®è¡ã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã«è¿½å </a></li>
<li><a href="#Minikube-ã®å®è¡-1">Minikube ã®å®è¡</a></li>
<li><a href="#Pod-ã®ä½æ">Pod ã®ä½æ</a></li>
<li><a href="#Pod-ã®å
¬é">Pod ã®å
Ž</a></li>
<li><a href="#ã¯ãªã¼ã³ã¢ãã-1">ã¯ãªã¼ã³ã¢ãã</a></li>
</ul>
</li>
<li><a href="#ããã¯ã¢ããã®åå¾">ããã¯ã¢ããã®åå¾</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241111/20241111071615.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="å½è¨äºã®ç®ç">å½è¨äºã®ç®ç</h2>
<p>å½è¨äºã§ã¯ <strong>Minikube</strong> ã¨ãã OSSï¼ãªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ï¼ã使ç¨ãã¦ãCompute Engine ã®ä»®æ³ãã·ã³ï¼ã¤ã³ã¹ã¿ã³ã¹ï¼ä¸ã«å¦ç¿ç¨ã® <strong>Kubernetes ã¯ã©ã¹ã¿</strong>ãæ§ç¯ããæ¹æ³ãç´¹ä»ãã¾ãã</p>
<p>Kubernetes ã¯ã³ã³ãã ãªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ ãã¼ã«ã®ããã¡ã¯ãã¹ã¿ã³ãã¼ãã§ãããããã¼ã¸ã㪠Kubernetes ã¯ã©ã¹ã¿ãæä¾ãã <strong>Google Kubernetes Engineï¼GKEï¼</strong>㯠Google Cloud ã«ããã代表çãªãµã¼ãã¹ã®ä¸ã¤ã§ãã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/kubernetes-explained">Kubernetes ã®åºæ¬ã解説 - G-gen Tech Blog</a></li>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/gke-explained">Google Kubernetes Engineï¼GKEï¼ãå¾¹åºè§£èª¬ - G-gen Tech Blog</a></li>
</ul>
<p>Kubernetes ã¯ã³ã³ããã®éç¨ç®¡çã®ããã®é常ã«å¼·åãªãã¼ã«ã§ããåé¢ãç¬èªã®ç¨èªãè¨å®ãã¡ã¤ã«ãé«é »åº¦ã®ãã¼ã¸ã§ã³ã¢ãããªã©ãå¦ç¿ã³ã¹ããé«ããã¨ã§ç¥ããã¦ãã¾ããå½è¨äºã®å
容ã¯ã<strong>Kubernetes ã«å
¥éããããã®ç°¡æçãªå¦ç¿ç°å¢ããä½ã³ã¹ãã§ç¨æãã</strong>ãã¨ãç®çã¨ãã¦ãã¾ãã</p>
<p>å¦ç¿ç°å¢ã¨ã㦠Compute Engine ãç¨ããã¡ãªããã¨ãã¦ã使ç¨ããªãã¨ãã¯ã¤ã³ã¹ã¿ã³ã¹ãåæ¢ãã¦æéãç¯ç´ã§ããç¹ãããã·ã³ã¤ã¡ã¼ã¸çã使ç¨ãã¦ããã¯ã¢ãããåå¾ããå¿
è¦ã«å¿ãã¦æ軽ã«ãªã¹ãã¢ãããã¨ãã§ããç¹ãããã¾ãã</p>
<p>ãªããGKE ã§ã¯è«æ±å
ã¢ã«ã¦ã³ãã«ã¤ãæé¡ $74.40 ã®ç¡ææ ãæä¾ããã¦ãã¾ããå®éã® GKE ã¯ã©ã¹ã¿ã使ç¨ãã¦å¦ç¿ãè¡ãããå ´åã¯ãAutopilot ã¯ã©ã¹ã¿ã§ãã®ç¡ææ ãå©ç¨ãã¦ã¿ãã®ãããã§ãããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/kubernetes-engine/pricing?hl=ja#cluster_management_fee_and_free_tier">ã¯ã©ã¹ã¿ç®¡çææ°æã¨ç¡ææ </a></li>
</ul>
<p>ãã ããGKE ã¯è¨å¤§ãªéã®ãã°ã Cloud Logging ã«åºåãããããCloud Logging ã®æéã«ã注æãæãå¿
è¦ãããã¾ãã</p>
<p>ã¾ãã以ä¸ã®è¨äºã§ã¯ <strong>Terraform</strong> ã使ç¨ã㦠Autopilot ã¢ã¼ãã® GKE ã¯ã©ã¹ã¿ãä½æããæ¹æ³ãç´¹ä»ãã¦ãã¾ãã®ã§ãåèã«ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fprivate-gke-made-with-terraform" title="Google Kubernetes Engine(GKE)ã®éå®å
¬éã¯ã©ã¹ã¿ãTerraformã§ä½æãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/private-gke-made-with-terraform">blog.g-gen.co.jp</a></cite></p>
<h2 id="Minikube-ã¨ã¯">Minikube ã¨ã¯</h2>
<p>Minikube ã¯ãã¼ã«ã«ç°å¢ã§ Kubernetes ãå®è¡ããããã®ãã¼ã«ã§ããMinikube ã使ãã¨ãä»®æ³ãã·ã³ä¸ã«ã·ã³ã°ã«ãã¼ãã® Kubernetes ã¯ã©ã¹ã¿ãæ§ç¯ãããã¨ãã§ãã¾ããMinikube ã§ã¯ Kubernetes ã®å
¨ã¦ã®æ©è½ã使ç¨ã§ããããã§ã¯ããã¾ããããåºæ¬çãªåä½ã®ç¢ºèªãéçºç°å¢ã¨ãã¦å©ç¨ãããã¨ãã§ãã¾ãã</p>
<p>å½è¨äºã§ã¯ã以ä¸ã®å
¬å¼ãã¥ã¼ããªã¢ã«ãå
ã« Minikube ãã¤ã³ã¹ãã¼ã«ããã¯ã©ã¹ã¿ã®æ§ç¯ãè¡ãã¾ãã</p>
<ul>
<li>åè : <a href="https://kubernetes.io/ja/docs/setup/learning-environment/minikube/">Minikubeã使ç¨ãã¦ãã¼ã«ã«ç°å¢ã§Kubernetesãåãã</a></li>
<li>åè : <a href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fdebian+package">minikube start</a></li>
</ul>
<h1 id="Compute-Engine-ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ">Compute Engine ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</h1>
<h2 id="ä½æ¥ã®æ¦è¦">ä½æ¥ã®æ¦è¦</h2>
<p>Google Cloud ããã¸ã§ã¯ãã« Compute Engine ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã</p>
<p>ã¤ã³ã¹ã¿ã³ã¹ã¯ VPC å
ã®ãµããããã«ä½æããå¿
è¦ãããããããããã®ãªã½ã¼ã¹ãå
ã«ä½æãããã®ä¸ã«ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã</p>
<p>ããã¦ãã¤ã³ã¹ã¿ã³ã¹å
ã§ä½æ¥ããéã« VPC ã®å¤é¨ããæ¥ç¶ã§ããããã«ãæ¥ç¶ã許å¯ãããã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ãè¨å®ãã¦ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="å½è¨äºã§ä½æãã Compute Engine ç°å¢ã®æ§æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241227/20241227090012.png" width="800" height="401" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å½è¨äºã§ä½æãã Compute Engine ç°å¢ã®æ§æ</figcaption></figure></p>
<p>å½è¨äºã§ã¯ <strong>gcloud ã³ãã³ã</strong>ãç¨ãã¦ãªã½ã¼ã¹ã®ä½æãè¡ã£ã¦ããã¾ããgcloud ã³ãã³ãã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯ä»¥ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/docs/install?hl=ja">gcloud CLI ãã¤ã³ã¹ãã¼ã«ãã</a></li>
</ul>
<p>ã¾ããGoogle Cloud ã³ã³ã½ã¼ã«ããå©ç¨ã§ãã <strong>Cloud Shell</strong>ï¼ãã©ã¦ã¶ãã¼ã¹ã®ã¿ã¼ããã«ç°å¢ï¼ã«ã¯ gcloud ã³ãã³ããããªã¤ã³ã¹ãã¼ã«ããã¦ããããã以éã®ä½æ¥ããã®ã¾ã¾å®æ½ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/shell/docs/using-cloud-shell?hl=ja">Cloud Shell ã使ç¨ãã</a></li>
</ul>
<h2 id="ã·ã§ã«å¤æ°ã®è¨å®">ã·ã§ã«å¤æ°ã®è¨å®</h2>
<p>ã³ãã³ãã§ä½åº¦ã使ç¨ããå¤ãã·ã§ã«å¤æ°ã«æ ¼ç´ãã¦ããã¾ããå½è¨äºã§ã¯ <code>SUFFIX</code> ã®å¤ã <strong>minikube</strong> ã¨ãã¦é²ãã¦ããã¾ãã<code>PROJECT</code> ã«ã¯ãªã½ã¼ã¹ãä½æããããã¸ã§ã¯ãã® ID ãã<code>REGION</code> ã«ã¯ <strong>asia-northeast1</strong> ãªã©ã®ãªã¼ã¸ã§ã³ãæå®ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synIdentifier">SUFFIX</span>=<span class="synSpecial">{</span>é©å½ãªå¤<span class="synSpecial">}</span> <span class="synComment"># å½è¨äºã§ã¯ minikube </span>
<span class="synIdentifier">PROJECT</span>=<span class="synSpecial">{</span>ããã¸ã§ã¯ãID<span class="synSpecial">}</span>
<span class="synIdentifier">REGION</span>=<span class="synSpecial">{</span>ãªã½ã¼ã¹ãä½æãããªã¼ã¸ã§ã³<span class="synSpecial">}</span>
</pre>
<h2 id="VPCãµããããã®ä½æ">VPCã»ãµããããã®ä½æ</h2>
<h3 id="VPC-ã®ä½æ">VPC ã®ä½æ</h3>
<p>以ä¸ã®ã³ãã³ã㧠VPC ãä½æãã¾ãããµãããããæåã§ä½æããããã<code>--subnet-mode</code> ãã©ã°ã§ <code>custom</code> ãæå®ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># VPC ãä½æãã</span>
$ gcloud compute networks create vpc-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--subnet-mode</span><span class="synStatement">=</span>custom <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT}</span>
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/gcloud/reference/compute/networks/create">gcloud compute networks createï¼ã³ãã³ããªãã¡ã¬ã³ã¹ï¼</a></li>
</ul>
<h3 id="ãµããããã®ä½æ">ãµããããã®ä½æ</h3>
<p>ä½æãã VPC ãæå®ãããã®ä¸ã«ãµãããããä½æãã¾ãã<code>--range</code> ãã©ã°ã§ã¯ãµããããã«å²ãå½ã¦ããã©ã¤ãã¼ã IP ã¢ãã¬ã¹ã®ç¯å²ã CIDR ã§æå®ãã¾ããå½è¨äºã§ã¯ <code>192.168.144.0/28</code> ãå²ãå½ã¦ã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ãµãããããä½æãã</span>
$ gcloud compute networks subnets create subnet-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--network</span><span class="synStatement">=</span>vpc-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--region</span><span class="synStatement">=</span><span class="synPreProc">${REGION}</span> <span class="synStatement">\</span>
<span class="synSpecial">--range</span><span class="synStatement">=</span><span class="synConstant">192</span>.<span class="synConstant">168</span>.<span class="synConstant">144</span>.<span class="synConstant">0</span>/<span class="synConstant">28</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT}</span>
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/gcloud/reference/compute/networks/subnets/create">gcloud compute networks subnets createï¼ã³ãã³ããªãã¡ã¬ã³ã¹ï¼</a></li>
</ul>
<h2 id="ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ">ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</h2>
<h3 id="Minikube-ã®è¦ä»¶ã«ã¤ãã¦">Minikube ã®è¦ä»¶ã«ã¤ãã¦</h3>
<p><a href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fdebian+package#what-youll-need">å
¬å¼ãã¥ã¼ããªã¢ã«</a>ã«ããã¨ãMinikube ã®ãªã½ã¼ã¹è¦ä»¶ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã</p>
<ul>
<li>2ã¤ä»¥ä¸ã® CPU</li>
<li>2 GB 以ä¸ã®ã¡ã¢ãªå®¹é</li>
<li>20 GB 以ä¸ã®ãã£ã¹ã¯é å</li>
</ul>
<p>ãã¨ãã°ã¡ã¢ãªãä¸è¶³ãã¦ããå ´åãMinikube ãå®è¡ãããã¨ãã¦ãã以ä¸ã®ããã«ã¨ã©ã¼ãåºã¦çµäºãã¦ãã¾ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã¡ã¢ãªä¸è¶³ã®å ´åãMinikube ãå®è¡ã§ããªã</span>
$ minikube <span class="synStatement">start</span> <span class="synSpecial">--driver</span><span class="synStatement">=</span>docker
ð minikube v1.<span class="synConstant">34</span>.<span class="synConstant">0</span> on Debian <span class="synConstant">12</span>.<span class="synConstant">7</span> <span class="synPreProc">(</span><span class="synSpecial">amd64</span><span class="synPreProc">)</span>
⨠Using the docker driver based on user configuration
â Exiting due to RSRC_INSUFFICIENT_CONTAINER_MEMORY: docker only has 969MiB available, <span class="synStatement">less</span> than the required 1800MiB <span class="synStatement">for</span> Kubernetes
</pre>
<p>å½è¨äºã§ã¯ã¡ã¢ãªå®¹éã«ããç¨åº¦ä½è£ããããã·ã³ã¿ã¤ãã§ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã</p>
<p>ãã·ã³ã¿ã¤ãã¯ç°¡åã«å¤æ´ãããã¨ãã§ãããããã¾ãã¯å°ããã®ãã·ã³ã¿ã¤ãã§è©¦ãã¦ã¿ã¦ã足ããªããã°ãªã½ã¼ã¹ãå¢ããã¦ãããã§ãããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance?hl=ja#changing_machine_type">ã³ã³ãã¥ã¼ãã£ã³ã° ã¤ã³ã¹ã¿ã³ã¹ã®ãã·ã³ã¿ã¤ãã®ç·¨é - ãã·ã³ã¿ã¤ããå¤æ´ãã</a></li>
</ul>
<h3 id="ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ-1">ã¤ã³ã¹ã¿ã³ã¹ã®ä½æ</h3>
<p>åã®æé ã§ä½æãã VPC ã¨ãµãããããæå®ããCompute Engine ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã</p>
<p>å½è¨äºã§ã¯ä»¥ä¸ã®è¨å®å¤ã§ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã</p>
<table>
<thead>
<tr>
<th> é
ç® </th>
<th> gcloud ã³ãã³ãã®ãã©ã° </th>
<th> å¤ </th>
<th> åè </th>
</tr>
</thead>
<tbody>
<tr>
<td> ã¤ã³ã¹ã¿ã³ã¹å </td>
<td> </td>
<td> vm-${SUFFIX} </td>
<td> </td>
</tr>
<tr>
<td> VPC </td>
<td> <code>--network</code> </td>
<td> vpc-${SUFFIX} </td>
<td> </td>
</tr>
<tr>
<td> ãµãããã </td>
<td> <code>--subnet</code> </td>
<td> subnet-${SUFFIX} </td>
<td> </td>
</tr>
<tr>
<td> OS ã¤ã¡ã¼ã¸ </td>
<td> <code>--image-family</code><br><code>--image-project</code> </td>
<td> debian-12<br>debian-cloud </td>
<td> <strong>以éã®æé ã¯ããã§æå®ãã OS ãåæã¨ããç¹ã«æ³¨æ</strong> </td>
</tr>
<tr>
<td> ãã·ã³ã¿ã¤ã </td>
<td> <code>--machine-type</code> </td>
<td> e2-medium </td>
<td> 2 vCPUãã¡ã¢ãª4GB<br>å¿
è¦ã«å¿ãã¦å¤æ´å¯ï¼<a href="https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance?hl=ja">åè</a>ï¼ </td>
</tr>
<tr>
<td> ãã£ã¹ã¯ãµã¤ãº </td>
<td> --boot-disk-size </td>
<td> 20GB </td>
<td> Minikube ã®ãªã½ã¼ã¹è¦ä»¶ã«æºæ </td>
</tr>
<tr>
<td> ãããã¯ã¼ã¯ã¿ã° </td>
<td> <code>--tags</code> </td>
<td> ssh </td>
<td> å¾ã§ä½æãããã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ãã¤ã³ã¹ã¿ã³ã¹ã«ç´ä»ããéã«ä½¿ç¨ </td>
</tr>
</tbody>
</table>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Compute Engine ã¤ã³ã¹ã¿ã³ã¹ãä½æãã</span>
$ gcloud compute instances create vm-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--network</span><span class="synStatement">=</span>vpc-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--subnet</span><span class="synStatement">=</span>subnet-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--zone</span><span class="synStatement">=</span><span class="synPreProc">${REGION}</span>-a <span class="synStatement">\</span>
<span class="synSpecial">--image-family</span><span class="synStatement">=</span>debian-12 <span class="synStatement">\</span>
<span class="synSpecial">--image-project</span><span class="synStatement">=</span>debian-cloud <span class="synStatement">\</span>
<span class="synSpecial">--machine-type</span><span class="synStatement">=</span>e2-medium <span class="synStatement">\</span>
<span class="synSpecial">--boot-disk-size</span><span class="synStatement">=</span>20GB <span class="synStatement">\</span>
<span class="synSpecial">--tags</span><span class="synStatement">=</span>ssh <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT}</span>
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/gcloud/reference/compute/instances/create">gcloud compute instances createï¼ã³ãã³ããªãã¡ã¬ã³ã¹ï¼</a></li>
</ul>
<h2 id="ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ã®è¨å®">ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ã®è¨å®</h2>
<p>ä½æããã¤ã³ã¹ã¿ã³ã¹ã« SSH ã§ã¢ã¯ã»ã¹ã§ããããã«ãVPC ã«å
åãã®ãã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ãä½æãã¾ãã<code>--target-tags</code> ãã©ã°ã§ã¤ã³ã¹ã¿ã³ã¹ã«è¨å®ãããã®ã¨åãã¿ã°ãæå®ãããã¨ã§ããã®ã«ã¼ã«ãã¤ã³ã¹ã¿ã³ã¹ã«ç´ä»ãããã¨ãã§ãã¾ãã</p>
<p>ãªããå½è¨äºã§ã¯ä¾¿å®ä¸ <code>--source-ranges</code> ãã©ã°ãã¤ã¾ãã¢ã¯ã»ã¹å
ã® IP ã¢ãã¬ã¹ç¯å²ã <strong>0.0.0.0/0</strong>ï¼ä»»æã® IP ã¢ãã¬ã¹ï¼ã«è¨å®ãã¦ãã¾ãããã»ãã¥ãªãã£ãèæ
®ãã¦èªèº«ã® PC ã® IP ã¢ãã¬ã¹çãè¨å®ãããã¨ãã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># SSH ã許å¯ãããã¡ã¤ã¢ã¦ã©ã¼ã«ã«ã¼ã«ãä½æãã</span>
$ gcloud compute firewall-rules create vpc-<span class="synPreProc">${SUFFIX}</span>-allow-ssh <span class="synStatement">\</span>
<span class="synSpecial">--direction</span><span class="synStatement">=</span>INGRESS <span class="synStatement">\</span>
<span class="synSpecial">--source-ranges</span><span class="synStatement">=</span><span class="synConstant">0</span>.<span class="synConstant">0</span>.<span class="synConstant">0</span>.<span class="synConstant">0</span>/<span class="synConstant">0</span> <span class="synStatement">\</span>
<span class="synSpecial">--allow</span><span class="synStatement">=</span>tcp:22 <span class="synStatement">\</span>
<span class="synSpecial">--target-tags</span><span class="synStatement">=</span>ssh <span class="synStatement">\</span>
<span class="synSpecial">--network</span><span class="synStatement">=</span>vpc-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT}</span>
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/gcloud/reference/compute/firewall-rules/create">gcloud compute firewall-rules createï¼ã³ãã³ããªãã¡ã¬ã³ã¹ï¼</a></li>
</ul>
<h2 id="ã¤ã³ã¹ã¿ã³ã¹ã«-SSH-æ¥ç¶">ã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶</h2>
<h3 id="ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶GUI-ã®å ´å">ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶ï¼GUI ã®å ´åï¼</h3>
<p>Minikube ãã¤ã³ã¹ãã¼ã«ãããããä½æããã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ãã¾ãã</p>
<p>Google Cloud ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ããå ´åãã¤ã³ã¹ã¿ã³ã¹ä¸è¦§ç»é¢ã§ã<strong>SSH</strong>ããé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Google Cloud ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241227/20241227090016.png" width="800" height="156" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Google Cloud ã³ã³ã½ã¼ã«ããã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ãã</figcaption></figure></p>
<h3 id="gcloud-ã³ãã³ãã§-SSH-æ¥ç¶CLI-ã®å ´å">gcloud ã³ãã³ã㧠SSH æ¥ç¶ï¼CLI ã®å ´åï¼</h3>
<p>gcloud ã§ã¯ã以ä¸ã®ã³ãã³ãã使ç¨ãã¦ã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã¤ã³ã¹ã¿ã³ã¹ã« SSH æ¥ç¶ãã</span>
$ gcloud compute ssh vm-<span class="synPreProc">${SUFFIX}</span> <span class="synStatement">\</span>
<span class="synSpecial">--zone</span><span class="synStatement">=</span><span class="synPreProc">${REGION}</span>-a <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT}</span>
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/gcloud/reference/compute/ssh">gcloud compute sshï¼ã³ãã³ããªãã¡ã¬ã³ã¹ï¼</a></li>
</ul>
<h1 id="Docker-ã®ã¤ã³ã¹ãã¼ã«">Docker ã®ã¤ã³ã¹ãã¼ã«</h1>
<h2 id="Minikube-ã®-driver-ã«ã¤ãã¦">Minikube ã® driver ã«ã¤ãã¦</h2>
<p>Minikube ã§ã¯åä½ç°å¢ï¼driverï¼ã¨ã㦠Docker ã VirtualBox ãªã©ãããã¤ãã®é¸æè¢ãæä¾ããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://minikube.sigs.k8s.io/docs/drivers/">Drivers</a></li>
</ul>
<p>å½è¨äºã§ã¯æ¨å¥¨ driver ã®1ã¤ã§ãã Docker ã使ç¨ãã¦æ§ç¯ãé²ãã¦ããã¾ãã</p>
<p>以ä¸ã® Docker å
¬å¼ããã¥ã¡ã³ãã®æé ã«æ²¿ã£ã¦ãDocker ãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã</p>
<ul>
<li>åè : <a href="https://docs.docker.com/engine/install/debian/">Install Docker Engine on Debian</a></li>
</ul>
<h2 id="ããã±ã¼ã¸ãªã¹ãã®æ´æ°">ããã±ã¼ã¸ãªã¹ãã®æ´æ°</h2>
<p>以éã®æé ã«ã¤ãã¦ã¯ã<strong>SSH æ¥ç¶ãã Compute Engine VM ä¸ã§ã³ãã³ããå®è¡</strong>ãã¦ãã ããã</p>
<p>ã¾ãã¯ãAPT ã®ããã±ã¼ã¸ãææ°åãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ããã±ã¼ã¸ãªã¹ããææ°ã®ç¶æ
ã«ãã</span>
$ sudo apt update
<span class="synComment"># ããã±ã¼ã¸ã®ææ°åï¼æéããããå¯è½æ§ããï¼</span>
$ sudo apt upgrade <span class="synSpecial">-y</span>
</pre>
<h2 id="ã¤ã³ã¹ãã¼ã«">ã¤ã³ã¹ãã¼ã«</h2>
<h3 id="APT-ãªãã¸ããªã®ã»ããã¢ãã">APT ãªãã¸ããªã®ã»ããã¢ãã</h3>
<p>ã¾ããDocker ããã±ã¼ã¸ã®æ¤è¨¼ã«å¿
è¦ãª GPG Key ãç¨æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Docker ã®ãã¦ã³ãã¼ãã«å¿
è¦ãªããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã</span>
$ sudo apt install ca-certificates curl
<span class="synComment"># keyrings ãã£ã¬ã¯ããªã®ãã¼ããã·ã§ã³ãè¨å®ãã</span>
$ sudo install <span class="synSpecial">-m</span> <span class="synConstant">0755</span> <span class="synSpecial">-d</span> /etc/apt/keyrings
<span class="synComment"># Docker å
¬å¼ã® GPG Key ããã¦ã³ãã¼ãã㦠keyrings ãã£ã¬ã¯ããªã«æ ¼ç´ãã</span>
$ sudo curl <span class="synSpecial">-fsSL</span> https://download.docker.com/linux/debian/gpg <span class="synSpecial">-o</span> /etc/apt/keyrings/docker.asc
<span class="synComment"># GPG Key ã®ãã¼ããã·ã§ã³ãå¤æ´ãã</span>
$ sudo <span class="synStatement">chmod</span> a+<span class="synStatement">r</span> /etc/apt/keyrings/docker.asc
</pre>
<p>apt ã³ãã³ãã®ããã±ã¼ã¸åå¾å
ã®ãªãã¸ããªã¨ã㦠Docker é¢é£ã®ãªãã¸ããªã追å ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Docker ã®ãªãã¸ããªã追å ãã</span>
$ <span class="synStatement">echo</span><span class="synConstant"> \</span>
<span class="synConstant"> </span><span class="synStatement">"</span><span class="synConstant">deb [arch=</span><span class="synPreProc">$(</span><span class="synSpecial">dpkg --print-architecture</span><span class="synPreProc">)</span><span class="synConstant"> signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \</span>
<span class="synConstant"> </span><span class="synPreProc">$(</span><span class="synSpecial">. /etc/os-release </span><span class="synStatement">&&</span><span class="synSpecial"> </span><span class="synStatement">echo</span><span class="synConstant"> </span><span class="synStatement">"</span><span class="synPreProc">$VERSION_CODENAME</span><span class="synStatement">"</span><span class="synPreProc">)</span><span class="synConstant"> stable</span><span class="synStatement">"</span><span class="synConstant"> </span>| <span class="synStatement">\</span>
sudo tee /etc/apt/sources.list.d/docker.list <span class="synStatement">></span> /dev/null
</pre>
<h3 id="Docker-ã®ã¤ã³ã¹ãã¼ã«-1">Docker ã®ã¤ã³ã¹ãã¼ã«</h3>
<p>Docker ã®å®è¡ã«å¿
è¦ãªããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ããã±ã¼ã¸ãªã¹ããæ´æ°ãã</span>
$ sudo apt update
<span class="synComment"># Docker ã®å®è¡ã«å¿
è¦ãªããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã</span>
$ sudo apt install <span class="synSpecial">-y</span> docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
</pre>
<h2 id="Docker-ã®åä½ç¢ºèª">Docker ã®åä½ç¢ºèª</h2>
<p>Docker ã§é©å½ãªã³ã³ãããå®è¡ãã¦ã¿ã¾ããããã§ã¯ Docker å
¬å¼ã³ã³ããã¤ã¡ã¼ã¸ã® <a href="https://hub.docker.com/_/hello-world">hello-world</a> ã使ç¨ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># hello-world ã³ã³ããã®èµ·å</span>
$ sudo docker run <span class="synSpecial">--name</span> hello hello-world
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
Unable to <span class="synStatement">find</span> image <span class="synStatement">'</span><span class="synConstant">hello-world:latest</span><span class="synStatement">'</span> locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull <span class="synStatement">complete</span>
Digest: sha256:d211f485f2dd1dee407a80973c8f129f00d54604d2c90732e8e320e5038a0348
Status: Downloaded newer image <span class="synStatement">for</span> hello-world:latest
Hello from Docker<span class="synStatement">!</span>
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
<span class="synConstant">1</span>. The Docker client contacted the Docker <span class="synStatement">daemon</span>.
<span class="synConstant">2</span>. The Docker <span class="synStatement">daemon</span> pulled the <span class="synStatement">"</span><span class="synConstant">hello-world</span><span class="synStatement">"</span> image from the Docker Hub.
<span class="synPreProc">(</span>amd64<span class="synPreProc">)</span>
<span class="synConstant">3</span>. The Docker <span class="synStatement">daemon</span> created a new container from that image which runs the
executable that produces the output you are currently reading.
<span class="synConstant">4</span>. The Docker <span class="synStatement">daemon</span> streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run <span class="synSpecial">-it</span> ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
</pre>
<h2 id="ã¯ãªã¼ã³ã¢ãã">ã¯ãªã¼ã³ã¢ãã</h2>
<p>åä½ç¢ºèªç¨ã® hello-world ã³ã³ããã¨ããã®ã³ã³ããã¤ã¡ã¼ã¸ãåé¤ãã¦ããã¾ãã</p>
<p>hello-world ã³ã³ããã¯åæ¢ããç¶æ
ã§æ®ã£ã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã³ã³ããä¸è¦§ã確èªãã</span>
$ sudo docker container <span class="synStatement">ls</span> <span class="synSpecial">-a</span>
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0f6492b1ab35 hello-world <span class="synStatement">"</span><span class="synConstant">/hello</span><span class="synStatement">"</span> <span class="synConstant">48</span> seconds ago Exited <span class="synPreProc">(</span><span class="synConstant">0</span><span class="synPreProc">)</span> <span class="synConstant">47</span> seconds ago hello
</pre>
<p>ã¾ããã³ã³ããå®è¡ã«ä½¿ç¨ãããã³ã³ããã¤ã¡ã¼ã¸ããã¼ã«ã«ã«ãã¦ã³ãã¼ãããã¦ããããããããåé¤ãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã³ã³ããã¤ã¡ã¼ã¸ã®ä¸è¦§ã確èªãã</span>
$ sudo docker image <span class="synStatement">ls</span>
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d2c94e258dcb <span class="synConstant">18</span> months ago <span class="synConstant">13</span>.3kB
</pre>
<p>以ä¸ã®ã³ãã³ãã§ãåæ¢ããã³ã³ããã¨ã³ã³ããã¤ã¡ã¼ã¸ãåé¤ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã³ã³ãããåé¤ãã</span>
$ sudo docker container <span class="synStatement">rm</span> hello
<span class="synComment"># hello-world ã³ã³ããã¤ã¡ã¼ã¸ãåé¤ãã</span>
$ sudo docker image <span class="synStatement">rm</span> hello-world:latest
</pre>
<h1 id="Minikube-ã®ã¤ã³ã¹ãã¼ã«">Minikube ã®ã¤ã³ã¹ãã¼ã«</h1>
<h2 id="APT-ãªãã¸ããªã®ã»ããã¢ãã-1">APT ãªãã¸ããªã®ã»ããã¢ãã</h2>
<p>ã¾ããKubernetes ã®ãªãã¸ããªã APT ã®ããã±ã¼ã¸åå¾å
ã¨ãã¦ç»é²ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Kubernetes ã®ãªãã¸ããªãç»é²</span>
$ <span class="synStatement">echo</span><span class="synConstant"> </span><span class="synStatement">"</span><span class="synConstant">deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /</span><span class="synStatement">"</span><span class="synConstant"> </span>| sudo tee /etc/apt/sources.list.d/kubernetes.list
</pre>
<p>ããã±ã¼ã¸ã®æ¤è¨¼ã«ä½¿ç¨ãã GPG Key ããã¦ã³ãã¼ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># GPG Key ã®ãã¦ã³ãã¼ã</span>
curl <span class="synSpecial">-fsSL</span> https://pkgs.k8s.io/core:/stable:/v1.<span class="synConstant">28</span>/deb/Release.key | sudo gpg <span class="synSpecial">--dearmor</span> <span class="synSpecial">-o</span> /etc/apt/keyrings/kubernetes-apt-keyring.gpg
</pre>
<p>æ¹ãã¦ããã±ã¼ã¸ãªã¹ããæ´æ°ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ããã±ã¼ã¸ãªã¹ããæ´æ°ãã</span>
$ sudo apt update
</pre>
<ul>
<li>åè : <a href="https://kubernetes.io/blog/2023/08/15/pkgs-k8s-io-introduction/#how-to-migrate">How to migrate to the Kubernetes community-owned repositories?</a></li>
</ul>
<h2 id="ã¤ã³ã¹ãã¼ã«-1">ã¤ã³ã¹ãã¼ã«</h2>
<p>Minikube ã®ããã±ã¼ã¸ããã¦ã³ãã¼ããã<code>dpkg</code> ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ãå®è¡ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Minikube ã®ããã±ã¼ã¸ããã¦ã³ãã¼ããã</span>
$ curl <span class="synSpecial">-LO</span> https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
<span class="synComment"># Minikube ãã¤ã³ã¹ãã¼ã«ãã</span>
$ sudo dpkg <span class="synSpecial">-i</span> minikube_latest_amd64.deb
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
Selecting previously unselected package minikube.
<span class="synPreProc">(</span><span class="synSpecial">Reading database ... </span><span class="synConstant">73229</span><span class="synSpecial"> files and directories currently installed.</span><span class="synPreProc">)</span>
Preparing to unpack minikube_latest_amd64.deb ...
Unpacking minikube <span class="synPreProc">(</span><span class="synConstant">1</span><span class="synSpecial">.</span><span class="synConstant">34</span><span class="synSpecial">.0-0</span><span class="synPreProc">)</span> ...
Setting up minikube <span class="synPreProc">(</span><span class="synConstant">1</span><span class="synSpecial">.</span><span class="synConstant">34</span><span class="synSpecial">.0-0</span><span class="synPreProc">)</span> ...
</pre>
<h1 id="Minikube-ã®å®è¡">Minikube ã®å®è¡</h1>
<h2 id="Minikube-å®è¡ã¦ã¼ã¶ã¼ã-docker-ã°ã«ã¼ãã«è¿½å ">Minikube å®è¡ã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã«è¿½å </h2>
<p>Minikube ãå®è¡ããã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã«æå±ããã¾ãã</p>
<p>ãã®æé ãã¹ãããããã¨ãMinikube å®è¡æã«ä»¥ä¸ã®ãããªæ¨©éã¨ã©ã¼ãçºçãã¦ãã¾ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>$ minikube <span class="synStatement">start</span> <span class="synSpecial">--driver</span><span class="synStatement">=</span>docker
ð minikube v1.<span class="synConstant">34</span>.<span class="synConstant">0</span> on Debian <span class="synConstant">12</span>.<span class="synConstant">7</span> <span class="synPreProc">(</span><span class="synSpecial">amd64</span><span class="synPreProc">)</span>
⨠Using the docker driver based on user configuration
ð£ Exiting due to PROVIDER_DOCKER_NEWGRP: <span class="synStatement">"</span><span class="synConstant">docker version --format <no value>-<no value>:<no value></span><span class="synStatement">"</span> <span class="synStatement">exit</span> <span class="synStatement">status</span> 1: permission denied <span class="synStatement">while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "</span><span class="synConstant">http://%2Fvar%2Frun%2Fdocker.sock/v1.47/version</span><span class="synStatement">": dial unix /var/run/docker.sock: connect: permission denied</span>
<span class="synStatement">ð¡ Suggestion: Add your user to the '</span><span class="synConstant">docker</span><span class="synStatement">' group: '</span><span class="synConstant">sudo usermod -aG docker $USER && newgrp docker</span><span class="synStatement">'</span>
<span class="synStatement">ð Documentation: https://docs.docker.com/engine/install/linux-postinstall/</span>
</pre>
<p><code>Suggestion:</code> ã®é
ç®ã«è¨è¼ããã¦ããã³ãã³ããå®è¡ããç¾å¨ä»®æ³ãã·ã³ã®ãã°ã¤ã³ã«ä½¿ç¨ãã¦ããã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã«è¿½å ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ç¾å¨ã®ã¦ã¼ã¶ã¼ã docker ã°ã«ã¼ãã«è¿½å ãã</span>
$ sudo usermod <span class="synSpecial">-aG</span> docker <span class="synPreProc">$USER</span> && <span class="synStatement">newgrp</span> docker
</pre>
<h2 id="Minikube-ã®å®è¡-1">Minikube ã®å®è¡</h2>
<p><code>minikube start</code> ã³ãã³ã㧠Minikube ãå®è¡ãã¾ãã<code>--driver</code> ãã©ã°ã§ Docker ããã©ã¤ãã¨ãã¦è¨å®ãã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>$ minikube <span class="synStatement">start</span> <span class="synSpecial">--driver</span><span class="synStatement">=</span>docker
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
ð minikube v1.<span class="synConstant">34</span>.<span class="synConstant">0</span> on Debian <span class="synConstant">12</span>.<span class="synConstant">8</span> <span class="synPreProc">(</span><span class="synSpecial">amd64</span><span class="synPreProc">)</span>
⨠Using the docker driver based on user configuration
ð Using Docker driver with root privileges
ð Starting <span class="synStatement">"</span><span class="synConstant">minikube</span><span class="synStatement">"</span> primary control-plane node <span class="synError">in</span> <span class="synStatement">"</span><span class="synConstant">minikube</span><span class="synStatement">"</span> cluster
ð Pulling base image v0.<span class="synConstant">0</span>.<span class="synConstant">45</span> ...
ð¾ Downloading Kubernetes v1.<span class="synConstant">31</span>.<span class="synConstant">0</span> preload ...
<span class="synStatement">></span> preloaded-images-k8s-v18-v1...: <span class="synConstant">326</span>.<span class="synConstant">69</span> MiB / <span class="synConstant">326</span>.<span class="synConstant">69</span> MiB <span class="synConstant">100</span>.<span class="synConstant">00</span>% <span class="synConstant">37</span>.<span class="synConstant">80</span> M
<span class="synStatement">></span> gcr.io/k8s-minikube/kicbase...: <span class="synConstant">487</span>.<span class="synConstant">90</span> MiB / <span class="synConstant">487</span>.<span class="synConstant">90</span> MiB <span class="synConstant">100</span>.<span class="synConstant">00</span>% <span class="synConstant">46</span>.<span class="synConstant">45</span> M
ð¥ Creating docker container <span class="synPreProc">(</span><span class="synIdentifier">CPUs</span>=<span class="synConstant">2</span><span class="synSpecial">, </span><span class="synIdentifier">Memory</span>=<span class="synSpecial">2200MB</span><span class="synPreProc">)</span> ...
ð³ Preparing Kubernetes v1.<span class="synConstant">31</span>.<span class="synConstant">0</span> on Docker <span class="synConstant">27</span>.<span class="synConstant">2</span>.<span class="synConstant">0</span> ...
⪠Generating certificates and keys ...
⪠Booting up control plane ...
⪠Configuring RBAC rules ...
ð Configuring bridge CNI <span class="synPreProc">(</span><span class="synSpecial">Container Networking Interface</span><span class="synPreProc">)</span> ...
ð Verifying Kubernetes components...
⪠Using image gcr.io/k8s-minikube/storage-provisioner:v5
ð Enabled addons: storage-provisioner, default-storageclass
ð¡ kubectl not found. If you need it, try: <span class="synStatement">'</span><span class="synConstant">minikube kubectl -- get pods -A</span><span class="synStatement">'</span>
ð Done! kubectl is now configured to use <span class="synStatement">"</span><span class="synConstant">minikube</span><span class="synStatement">"</span> cluster and <span class="synStatement">"</span><span class="synConstant">default</span><span class="synStatement">"</span> namespace by default
</pre>
<p>Minikube ã®ç¶æ
㯠<code>minikube status</code> ã³ãã³ãã§ç¢ºèªã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Minikube ã®ç¶æ
ã確èªãã</span>
$ minikube <span class="synStatement">status</span>
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
</pre>
<p>ä¸è¬ã« Kubernetes ã®ç®¡çæä½ã«ã¯ <code>kubectl</code> ã³ãã³ãã使ç¨ãã¾ãããMinikube ã§ã¯ <code>minikube kubectl</code> ã使ç¨ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Minikube ã®ãã¼ãã確èªãã</span>
$ minikube kubectl <span class="synSpecial">--</span> get nodes
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 11m v1.<span class="synConstant">31</span>.<span class="synConstant">0</span>
</pre>
<p>æ¯å minikube ã®é¨åããã³ãã³ããå
¥åããã®ã¯æéãªã®ã§ãã¨ã¤ãªã¢ã¹ãè¨å®ã㦠kubectl ã ãã§ã³ãã³ããå®è¡ã§ããããã«ãã¾ããã¨ã¤ãªã¢ã¹ã¯ <code>.bashrc</code> ãã¡ã¤ã«ã«è¨å®ãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã¨ã¤ãªã¢ã¹ãè¨å®ããï¼.bashrc ã«è¿½è¨ï¼</span>
$ <span class="synStatement">echo</span><span class="synConstant"> </span><span class="synStatement">"</span><span class="synConstant">alias kubectl='minikube kubectl --'</span><span class="synStatement">"</span><span class="synConstant"> </span><span class="synStatement">>></span> .bashrc
<span class="synComment"># .bashrc ã®è¿½è¨å
容ãåæ ãã</span>
$ <span class="synStatement">source</span> .bashrc
<span class="synComment"># ã¨ã¤ãªã¢ã¹ã§å®è¡ã§ãããã¨ã確èªãã</span>
$ kubectl get nodes
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 13m v1.<span class="synConstant">31</span>.<span class="synConstant">0</span>
</pre>
<h2 id="Pod-ã®ä½æ">Pod ã®ä½æ</h2>
<p>Minikube ã®ã¯ã©ã¹ã¿ãå®è¡ã§ããã®ã§ãKubernetes ã§ç®¡çã§ããæå°åä½ã®ã³ã³ãã¥ã¼ãã£ã³ã° ãªã½ã¼ã¹ã§ãã Pod ãä½æãã¦ã¿ã¾ãã</p>
<p>vim çã®ã¨ãã£ã¿ã使ç¨ãã¦ã<code>sample-pod.yaml</code> ã¨ãã¦ä»¥ä¸ã®ãããã§ã¹ããã¡ã¤ã«ãä½æãã¾ãããã® Pod ã¯ãWeb ãµã¼ãã§ãã nginx ã®ã³ã³ãããå®è¡ãã¾ãã</p>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synComment"># sample-pod.yaml</span>
<span class="synIdentifier">apiVersion</span><span class="synSpecial">:</span> v1
<span class="synIdentifier">kind</span><span class="synSpecial">:</span> Pod
<span class="synIdentifier">metadata</span><span class="synSpecial">:</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> nginx
<span class="synIdentifier">labels</span><span class="synSpecial">:</span>
<span class="synIdentifier">app</span><span class="synSpecial">:</span> sample
<span class="synIdentifier">spec</span><span class="synSpecial">:</span>
<span class="synIdentifier">containers</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> nginx
<span class="synIdentifier">image</span><span class="synSpecial">:</span> nginx:1.27
<span class="synIdentifier">ports</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">containerPort</span><span class="synSpecial">:</span> <span class="synConstant">80</span>
</pre>
<p><code>kubectl apply</code> ã³ãã³ãã§ãããã§ã¹ããã¡ã¤ã«ãã¯ã©ã¹ã¿ã«é©ç¨ãã¾ããããã«ãããYAML ãã¡ã¤ã«ã«è¨è¼ããè¨å®å
容㮠Pod ã Minikube ã¯ã©ã¹ã¿ä¸ã§å®è¡ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ãããã§ã¹ããã¡ã¤ã«ãã¯ã©ã¹ã¿ã«é©ç¨ã㦠Pod ãä½æãã</span>
$ kubectl apply <span class="synSpecial">-f</span> sample-pod.yaml
</pre>
<p><code>kubectl get pods</code> 㧠Pod ã®ä¸è¦§ãåå¾ãã¾ããå
ç¨ãããã§ã¹ããã¡ã¤ã«ãé©ç¨ãã Pod ãå®è¡ããã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Pod ã®ä¸è¦§ãåå¾ãã</span>
$ kubectl get pods
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
NAME READY STATUS RESTARTS AGE
nginx <span class="synConstant">1</span>/<span class="synConstant">1</span> Running <span class="synConstant">0</span> 2m15s
</pre>
<h2 id="Pod-ã®å
¬é">Pod ã®å
Ž</h2>
<p>Service ãªã½ã¼ã¹ã¨ã㦠NodePort ãä½æãã¦ãå
ç¨ä½æãã Pod ã® nginx ã³ã³ããã« Minikube ã¯ã©ã¹ã¿ã®å¤é¨ããæ¥ç¶ã§ããããã«ãã¾ãã</p>
<p>Pod åæ§ãService ããããã§ã¹ããã¡ã¤ã«ããä½æã§ãã¾ãããããã§ã¯ç°¡æçã« <code>kubectl expose</code> ã³ãã³ãã§ä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># NodePort ãä½æã㦠Pod ãå
¬éãã</span>
$ kubectl expose pod/nginx <span class="synSpecial">--type</span><span class="synStatement">=</span>NodePort <span class="synSpecial">--port</span><span class="synStatement">=</span><span class="synConstant">80</span>
</pre>
<p><code>kubectl get services</code> ã³ãã³ã㧠Service ãªã½ã¼ã¹ã®ä¸è¦§ã確èªãã¾ããNodePort ã¿ã¤ãã® Service ãä½æããã¦ãã¾ãï¼2è¡ç®ï¼ã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Service ã®ä¸è¦§ãåå¾ãã</span>
$ kubectl get services
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT<span class="synPreProc">(</span><span class="synSpecial">S</span><span class="synPreProc">)</span> AGE
kubernetes ClusterIP <span class="synConstant">10</span>.<span class="synConstant">96</span>.<span class="synConstant">0</span>.<span class="synConstant">1</span> <span class="synStatement"><</span>none<span class="synStatement">></span> <span class="synConstant">443</span>/TCP 49m
nginx NodePort <span class="synConstant">10</span>.<span class="synConstant">110</span>.<span class="synConstant">131</span>.<span class="synConstant">236</span> <span class="synStatement"><</span>none<span class="synStatement">></span> 80:30134/TCP 116s
</pre>
<p><code>minikube service nginx --url</code> 㧠NodePort ã«ã¢ã¯ã»ã¹ããããã® URL ãåå¾ã§ããããããã® URL ã«ã¢ã¯ã»ã¹ãã¦ã¿ã¾ããããã¾ã§æé éãã«ãªã½ã¼ã¹ãä½æãã¦ããã°ãPod å
ã® nginx ã³ã³ããããã¬ã¹ãã³ã¹ãè¿ã£ã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>$ curl <span class="synPreProc">$(</span><span class="synSpecial">minikube service nginx --url</span><span class="synPreProc">)</span>
-------------------- åºåä¾ <span class="synSpecial">--------------------</span>
<span class="synStatement"><</span>!DOCTYPE html<span class="synStatement">></span>
<span class="synStatement"><</span>html<span class="synStatement">></span>
<span class="synStatement"><</span>head<span class="synStatement">></span>
<span class="synStatement"><</span>title<span class="synStatement">></span>Welcome to nginx!<span class="synStatement"><</span>/title<span class="synStatement">></span>
<span class="synStatement"><</span>style<span class="synStatement">></span>
html <span class="synSpecial">{</span> color-scheme: light dark<span class="synStatement">;</span> <span class="synSpecial">}</span>
body <span class="synSpecial">{</span> width: 35em<span class="synStatement">;</span> margin: <span class="synConstant">0</span> auto<span class="synStatement">;</span>
font-family: Tahoma, Verdana, Arial, sans-serif<span class="synStatement">;</span> <span class="synSpecial">}</span>
<span class="synStatement"><</span>/style<span class="synStatement">></span>
<span class="synStatement"><</span>/head<span class="synStatement">></span>
<span class="synStatement"><</span>body<span class="synStatement">></span>
<span class="synStatement"><</span>h<span class="synStatement">1></span>Welcome to nginx!<span class="synStatement"><</span>/h<span class="synStatement">1></span>
<span class="synStatement"><</span>p<span class="synStatement">></span>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.<span class="synStatement"><</span>/p<span class="synStatement">></span>
<span class="synStatement"><</span>p<span class="synStatement">></span>For online documentation and support please refer to
<span class="synStatement"><</span>a <span class="synIdentifier">href</span>=<span class="synStatement">"</span><span class="synConstant">http://nginx.org/</span><span class="synStatement">"></span>nginx.org<span class="synStatement"><</span>/a<span class="synStatement">></span>.<span class="synStatement"><</span>br/<span class="synStatement">></span>
Commercial support is available at
<span class="synStatement"><</span>a <span class="synIdentifier">href</span>=<span class="synStatement">"</span><span class="synConstant">http://nginx.com/</span><span class="synStatement">"></span>nginx.com<span class="synStatement"><</span>/a<span class="synStatement">></span>.<span class="synStatement"><</span>/p<span class="synStatement">></span>
<span class="synStatement"><</span>p<span class="synStatement">><</span>em<span class="synStatement">></span>Thank you <span class="synStatement">for</span> using nginx.<span class="synStatement"><</span>/em<span class="synStatement">><</span>/p<span class="synStatement">></span>
<span class="synStatement"><</span>/body<span class="synStatement">></span>
<span class="synStatement"><</span>/html<span class="synStatement">></span>
</pre>
<h2 id="ã¯ãªã¼ã³ã¢ãã-1">ã¯ãªã¼ã³ã¢ãã</h2>
<p>åä½ç¢ºèªç¨ã«ä½æããåãªã½ã¼ã¹ãåé¤ãã¾ãã</p>
<p>Service ãªã½ã¼ã¹ã <code>kubectl delete</code> ã³ãã³ãã§åé¤ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Service ãåé¤ãã</span>
$ kubectl delete services nginx
</pre>
<p>Pod ã¯ãããã§ã¹ããã¡ã¤ã«ããä½æããã®ã§ã<code>kubectl delete</code> ã³ãã³ã㧠<code>-f</code> ãã©ã°ã使ç¨ãããªã½ã¼ã¹ä½ææã«ä½¿ç¨ãããããã§ã¹ããã¡ã¤ã«ãæå®ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Pod ãåé¤ãã</span>
$ kubectl delete <span class="synSpecial">-f</span> sample-pod.yaml
</pre>
<h1 id="ããã¯ã¢ããã®åå¾">ããã¯ã¢ããã®åå¾</h1>
<p>Minikube ãæ§ç¯ããã¤ã³ã¹ã¿ã³ã¹ã®ããã¯ã¢ãããåå¾ãã¦ããã¨ãå¦ç¿ä¸ã«ç°å¢ãå£ãã¦ãã¾ã£ãå ´åãªã©ã«å®¹æã«å¾©å
ãããã¨ãã§ãã¾ãã</p>
<p>以ä¸ã®è¨äºã§ Compute Engine ã®ãã·ã³ã¤ã¡ã¼ã¸ã®åå¾æ¹æ³ãããã³ãã·ã³ã¤ã¡ã¼ã¸ããã®ã¤ã³ã¹ã¿ã³ã¹ã®å¾©å
æ¹æ³ã解説ãã¦ããã®ã§ããã¡ãã®æé ãåèã«ããã¯ã¢ãããåå¾ãã¦ããã¨ããã§ãããã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/postgresql-on-compute-engine#%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97%E3%81%AE%E5%8F%96%E5%BE%97%E3%81%A8%E3%82%A4%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%B3%E3%82%B9%E3%81%AE%E5%BE%A9%E5%85%83">Compute Engineã¤ã³ã¹ã¿ã³ã¹ã«PostgreSQLãµã¼ããæ§ç¯ãã - ããã¯ã¢ããã®åå¾ã¨ã¤ã³ã¹ã¿ã³ã¹ã®å¾©å
</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
ã³ãã¯ãããã·ã¼ãã®æ½åºæ©è½ã§è¡æ°å¶éã10ä¸è¡ä»¥ä¸ã«ããæ¹æ³
hatenablog://entry/6802418398309303995
2024-12-26T09:00:00+09:00
2024-12-26T09:00:01+09:00 G-gen ã®å åã§ããå½è¨äºã§ã¯ãGoogle ã¹ãã¬ããã·ã¼ãï¼Google Sheetsï¼ã®æ©è½ã§ããã³ãã¯ãããã·ã¼ãã§ããã¼ã¿ã®æ½åºæ©è½ã使ãéãè¡æ°å¶éã10ä¸è¡ã¾ã§ããé¸ã¹ãªãå ´åã®å¯¾å¦æ³ãç´¹ä»ãã¾ãã ã³ãã¯ãããã·ã¼ãã¨ã¯ æ¦è¦ ãã¼ã¿ã®æ½åº äºè±¡ 解決æ¹æ³ ã³ãã¯ãããã·ã¼ãã¨ã¯ æ¦è¦ ã³ãã¯ãããã·ã¼ãï¼Connected Sheetsï¼ã¯ãGoogle ã¹ãã¬ããã·ã¼ãã®æ©è½ã§ããã³ãã¯ãããã·ã¼ããç¨ããã¨ãGoogle Cloudï¼æ§ç§° GCPï¼ã®ãã¼ã¿åæãµã¼ãã¹ã§ãã BigQuery ã®ãã¼ãã«ããã¥ã¼ã Google ã¹ãã¬ããã·ã¼ãä¸ã§å¯è¦åãåæã§ãã¾ãâ¦
<p>G-gen ã®å åã§ããå½è¨äºã§ã¯ã<strong>Google ã¹ãã¬ããã·ã¼ã</strong>ï¼Google Sheetsï¼ã®æ©è½ã§ãã<strong>ã³ãã¯ãããã·ã¼ã</strong>ã§ã<strong>ãã¼ã¿ã®æ½åº</strong>æ©è½ã使ãéãè¡æ°å¶éã<strong>10ä¸è¡ã¾ã§ããé¸ã¹ãªã</strong>å ´åã®å¯¾å¦æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã³ãã¯ãããã·ã¼ãã¨ã¯">ã³ãã¯ãããã·ã¼ãã¨ã¯</a><ul>
<li><a href="#æ¦è¦">æ¦è¦</a></li>
<li><a href="#ãã¼ã¿ã®æ½åº">ãã¼ã¿ã®æ½åº</a></li>
</ul>
</li>
<li><a href="#äºè±¡">äºè±¡</a></li>
<li><a href="#解決æ¹æ³">解決æ¹æ³</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241206/20241206092656.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã³ãã¯ãããã·ã¼ãã¨ã¯">ã³ãã¯ãããã·ã¼ãã¨ã¯</h1>
<h2 id="æ¦è¦">æ¦è¦</h2>
<p><strong>ã³ãã¯ãããã·ã¼ã</strong>ï¼Connected Sheetsï¼ã¯ã<strong>Google ã¹ãã¬ããã·ã¼ã</strong>ã®æ©è½ã§ããã³ãã¯ãããã·ã¼ããç¨ããã¨ãGoogle Cloudï¼æ§ç§° GCPï¼ã®ãã¼ã¿åæãµã¼ãã¹ã§ãã <strong>BigQuery</strong> ã®ãã¼ãã«ããã¥ã¼ã Google ã¹ãã¬ããã·ã¼ãä¸ã§å¯è¦åãåæã§ãã¾ãã</p>
<p>詳ããã¯ä»¥ä¸ã®è¨äºããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fconnected-sheets" title="Connected Sheets ã§å§ãããã¼ã¿åæ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/connected-sheets">blog.g-gen.co.jp</a></cite></p>
<h2 id="ãã¼ã¿ã®æ½åº">ãã¼ã¿ã®æ½åº</h2>
<p><strong>ãã¼ã¿ã®æ½åº</strong>ã¯ãBigQuery ã®ãã¼ã¿ã<strong>ã¹ãã¬ããã·ã¼ãã«åãè¾¼ã</strong>æ©è½ã§ãããã¼ã¿ã®æ½åºãè¡ãã¨<strong>ãã¼ã¿ã®å¦çãã¹ãã¬ããã·ã¼ãä¸ã§å®çµãã</strong>ãããBigQuery ã®æéãæãããã¨ãåºæ¥ã¾ããå対ã«ãã¼ã¿ã®æ½åºãè¡ããªãã¨ãé¢æ°ãç¨ãã¦ãã¼ã¿ãè¨ç®ããã¨ãçã«é½åº¦ BigQuery ã«ãªã¯ã¨ã¹ããçºè¡ããããããBigQuery ã®ã¹ãã£ã³æéãçºçãã¾ãã</p>
<p>ãã¼ã¿ã®æ½åºæ©è½ã§ã¯ã<strong>æ大 500,000 è¡</strong>ã®ãã¼ã¿ãæ½åºãããã¨ãå¯è½ã§ãããã ãããã¼ã¿ãµã¤ãºã¯ 10 MB 以ä¸ãç·ã»ã«æ°ã¯ 5,000,000 以ä¸ã¨ããå¶éãããã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/docs/answer/9703214?hl=en&sjid=14484867265077306784-AP#zippy=%2C%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92%E6%8A%BD%E5%87%BA%E3%81%99%E3%82%8B%2Cpull-data-into-an-extract:~:text=Pull%20data%20into%20an%20extract">Analyze & refresh BigQuery data in Google Sheets using Connected Sheets > Pull data into an extract</a></li>
</ul>
<h1 id="äºè±¡">äºè±¡</h1>
<p>ãã¼ã¿ã®æ½åºæ©è½ã¯ãå
è¿°ã®éãæ大 500,000 è¡ã®ãã¼ã¿æ½åºãå¯è½ã§ãã</p>
<p>ããã2024å¹´12æç¾å¨ãGoogle ã¹ãã¬ããã·ã¼ãã®è¨å®ç»é¢ã§ãã¼ã¿ã®æ½åºãè¨å®ãããã¨ããã¨ãè¡æ°å¶éã <strong>100,000 è¡ã¾ã§ããé¸æã§ãã¾ãã</strong>ã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241226/20241226090003.png" width="800" height="427" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ãã¡ããããã®ç¶æ
ã§è¨å®ãé©ç¨ãã¦ãã100,000 è¡ã¾ã§ãããã¼ã¿ã¯åºåããã¾ããããªãå½è¨äºã®æ¤è¨¼ã§ã¯ kaggle ã§å
¬éããã¦ãã <a href="https://www.kaggle.com/datasets/sdolezel/black-friday">Black Friday</a> ã®ãã¼ã¿ã»ãããç¨ãã¦ãããã¬ã³ã¼ãæ°ã¯ 550,068 è¡ã§ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241226/20241226090008.png" width="800" height="273" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>å
¨ã¦ã® Google Workspace ç°å¢ã§ãã®ãããªç¶æ³ãè¦ããããã¯æªç¢ºèªã§ãããå½ç¤¾ãææããè¤æ°ã® Google Workspace ã¢ã«ã¦ã³ãã§ã¯ã2024å¹´12æç¾å¨ãããããåæ§ã®äºè±¡ãçºçãã¾ããã</p>
<h1 id="解決æ¹æ³">解決æ¹æ³</h1>
<p>åé¡ã¨ãªã£ã¦ããè¡æ°å¶éã®è¨å®ç®æã«ã¯ãå®ã¯<strong>ç´æ¥æ°åãæ¸ãè¾¼ããã¨ãã§ãã¾ã</strong>ã</p>
<p><figure class="figure-image figure-image-fotolife" title="æåã§ã123,456ããæ¸ãè¾¼ãã ä¾"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241226/20241226090012.png" width="334" height="507" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æåã§ã123,456ããæ¸ãè¾¼ãã ä¾</figcaption></figure></p>
<p>ãã®ããã<strong>100,000 è¡ä»¥ä¸ã®ã¬ã³ã¼ãã表示ããããå ´åã¯æåã§æ°åãæ¸ãæãã</strong>å¿
è¦ãããã¾ãããã®ä¾ã§ã¯ç´æ¥ã500,000ãã¨æ¸ãè¾¼ããã¨ã§ãä¸å³ã®ããã« 500,000 è¡ã¾ã§ã¬ã³ã¼ãã表示ããããã¨ãã§ãã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241226/20241226090015.png" width="800" height="604" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ãã ãå
è¿°ã®éãããã¼ã¿ãµã¤ãºã¯ 10 MB 以ä¸ãç·ã»ã«æ°ã¯ 5,000,000 以ä¸ã¨ããå¶éãåæã«é©ç¨ããããããã©ããã«æµè§¦ããå ´åã¯ãããä¸éã¨ãªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã»ã«æ°ã 5,000,000 ãè¶
ããéã®ã¨ã©ã¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241226/20241226090019.png" width="695" height="400" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã»ã«æ°ã 5,000,000 ãè¶
ããéã®ã¨ã©ã¼</figcaption></figure></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-ryu-dohara/profile_256x256.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">å å ç«å¸<a href="https://blog.g-gen.co.jp/archive/author/ggen-ryu-dohara">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ãã¼ã¿ã¢ããªãã£ã¯ã¹èª²ã2023å¹´4æãããG-genã«ã¸ã§ã¤ã³ã</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2023, 2024, 2025ã«é¸åº (2024å¹´ã¯Rookie of the yearã2025å¹´ã¯Fellowã«ãé¸åº)ãä¼ã¿ã®æ¥ã¯ã ãããã²ã¼ã ããã¦ããããæã
èªè»¢è»ã§é åºããã¦ãã¾ãã</p>
<a href="https://twitter.com/ryu_dohara?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ryu_dohara</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-ryu-dohara
Direct VPC Egressçµç±ã§Cloud NATãå©ç¨ããã¨Cloud NATã®ã¢ãã¿ãªã³ã°ææ¨ãè¨é²ãããªã
hatenablog://entry/6802418398305516993
2024-12-25T09:00:00+09:00
2024-12-25T09:00:02+09:00 G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãDirect VPC Egress ãçµç±ã㦠Cloud NAT ãå©ç¨ããéã®æ³¨æç¹ã¨ãã¦ãCloud NAT ã®ã¢ãã¿ãªã³ã°ææ¨ã Cloud Monitoring ã«è¨é²ãããªãä»æ§ã«ã¤ãã¦è§£èª¬ãã¾ãã Direct VPC Egress çµç±ã® Cloud NAT å©ç¨ å¶éäºé
æ³å®ãããåé¡ å¯¾ç Cloud NAT ã®ãã°ãæå¹ã«ãã Cloud NAT ã®ãã¼ãå²ãå½ã¦æ°ã«ä½è£ããããã ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹ãå©ç¨ãã Direct VPC Egress çµç±ã® Cloud NAT å©ç¨ Cloud Run ã Cloud Ruâ¦
<p>G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãDirect VPC Egress ãçµç±ã㦠Cloud NAT ãå©ç¨ããéã®æ³¨æç¹ã¨ãã¦ã<strong>Cloud NAT ã®ã¢ãã¿ãªã³ã°ææ¨ã Cloud Monitoring ã«è¨é²ãããªãä»æ§</strong>ã«ã¤ãã¦è§£èª¬ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#Direct-VPC-Egress-çµç±ã®-Cloud-NAT-å©ç¨">Direct VPC Egress çµç±ã® Cloud NAT å©ç¨</a></li>
<li><a href="#å¶éäºé
">å¶éäºé
</a></li>
<li><a href="#æ³å®ãããåé¡">æ³å®ãããåé¡</a></li>
<li><a href="#対ç">対ç</a><ul>
<li><a href="#Cloud-NAT-ã®ãã°ãæå¹ã«ãã">Cloud NAT ã®ãã°ãæå¹ã«ãã</a></li>
<li><a href="#Cloud-NAT-ã®ãã¼ãå²ãå½ã¦æ°ã«ä½è£ããããã">Cloud NAT ã®ãã¼ãå²ãå½ã¦æ°ã«ä½è£ããããã</a></li>
<li><a href="#ãµã¼ãã¼ã¬ã¹-VPC-ã¢ã¯ã»ã¹ãå©ç¨ãã">ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹ãå©ç¨ãã</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241225/20241225090011.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="Direct-VPC-Egress-çµç±ã®-Cloud-NAT-å©ç¨">Direct VPC Egress çµç±ã® Cloud NAT å©ç¨</h1>
<p>Cloud Run ã Cloud Run functionsï¼æ§ç§° Cloud Functiionsï¼ãªã©ã®ãµã¼ãã¼ã¬ã¹ ã³ã³ãã¥ã¼ãã£ã³ã° ãµã¼ãã¹ã§ã¯ãå¦çãè¡ãéã«ã ãå®è¡ç°å¢ãèµ·åããå¦çãããªãã¨ãã¯å®è¡ç°å¢ãåæ¢ãããã¨ãã§ãã¾ãããã®ããå®è¡ç°å¢ãèµ·åãããã³ã«ãå®è¡ç°å¢ã® <strong>IP ã¢ãã¬ã¹ã¯å¤ãã£ã¦ãã¾ãã¾ã</strong>ã</p>
<p>ãããã®å®è¡ç°å¢ãããæ¥ç¶å
IP ã¢ãã¬ã¹ãå¶éããã¦ããå¤é¨ã® Web API çã¸ãªã¯ã¨ã¹ããéä¿¡ããå ´åãå®è¡ç°å¢ã®å¤é¨ IP ã¢ãã¬ã¹ãåºå®ããå¿
è¦ãã§ã¦ãã¾ãããã®ã¨ãã<strong>Cloud NAT</strong> ã使ç¨ãããã¨ã§ãå¤é¨ã¢ã¯ã»ã¹ã«ä½¿ç¨ããã IP ã¢ãã¬ã¹ãåºå®ãããã¨ãã§ãã¾ããCloud NAT 㯠VPC ã«ç´ä»ãããªã½ã¼ã¹ã§ãããããCloud Run çãã VPC ã«æ¥ç¶ããããã«ã¯ <strong>Direct VPC Egress</strong> ã使ç¨ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/nat/docs/overview?hl=ja">Cloud NAT ã®æ¦è¦</a></li>
<li>åè : <a href="https://cloud.google.com/run/docs/configuring/connecting-vpc?hl=ja#direct-vpc">ãã¤ã¬ã¯ã VPC ä¸ãï¼å¤åãï¼</a></li>
</ul>
<p>Cloud Run 㧠Direct VPC Egress ã使ç¨ã㦠Cloud NAT ã§å¤é¨ IP ã¢ãã¬ã¹ãåºå®ããæ¹æ³ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-run-using-static-ip-via-direct-vpc-egress" title="Cloud Runããåºå®IPã§ã¤ã³ã¿ã¼ãããæ¥ç¶ããï¼Direct VPC Egressç·¨ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-run-using-static-ip-via-direct-vpc-egress">blog.g-gen.co.jp</a></cite></p>
<p>ã¾ããDirect VPC Egress ã®è©³ç´°ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloudrun-direct-vpc-egress" title="Cloud Runã®Direct VPC Egressã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloudrun-direct-vpc-egress">blog.g-gen.co.jp</a></cite></p>
<h1 id="å¶éäºé
">å¶éäºé
</h1>
<p>Cloud Run ã®å
¬å¼ããã¥ã¡ã³ãã«ã¯ Direct VPC Egress ã®å¶éäºé
ãè¨è¼ããã¦ããã»ããCloud NAT ã®ããã¥ã¡ã³ãã«ãå¶éãè¨è¼ããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations">Direct VPC egress with a VPC network - Limitations</a></li>
<li>åè : <a href="https://cloud.google.com/run/docs/configuring/vpc-direct-vpc#limitations">Cloud NAT product interactions - Direct VPC egress interactions</a></li>
</ul>
<p>å¾è
ã®ããã¥ã¡ã³ãã«ã¯ã以ä¸ã®ãããªå¶éãè¨è¼ããã¦ãã¾ãã</p>
<ol>
<li>Direct VPC Egress ã® <a href="https://cloud.google.com/nat/docs/monitoring?hl=ja#gateway-metrics">Cloud NAT ææ¨</a>㯠Cloud Monitoring ã«ã¨ã¯ã¹ãã¼ããããªã</li>
<li>Direct VPC Egress ã® Cloud NAT ãã°ã«ã¯ãçºä¿¡å
ã® Cloud Run ãµã¼ãã¹ããªãã¸ã§ã³ãã¸ã§ãã®ååã¯è¡¨ç¤ºãããªã</li>
<li>Direct VPC Egress ã§ã¯<a href="https://cloud.google.com/nat/docs/private-nat?hl=ja">ãã©ã¤ãã¼ã NAT</a> ã使ç¨ã§ããªã</li>
</ol>
<p>å½è¨äºã§ã¯ãããã®3ã¤ã®å¶éã®ãã¡ã<strong>1</strong> ã®ã¢ãã¿ãªã³ã°ã«é¢ããå¶éã«ã¤ãã¦æãä¸ãã¾ãã</p>
<h1 id="æ³å®ãããåé¡">æ³å®ãããåé¡</h1>
<p>åè¿°ã® 1 ã®å¶éã¯ãDirect VPC Egress çµç±ã§ Cloud Run ã Cloud Run functions ãã Cloud NAT ãå©ç¨ãããå ´åããã®å©ç¨ç¶æ³ã Cloud Monitoring ã§å¯è¦åã§ããªããã¨ãæå³ãã¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Direct VPC Egressçµç±ã§Cloud NATã使ç¨ããã¨ãCloud NATã®ã¢ãã¿ãªã³ã°ææ¨ã表示ãããªã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241225/20241225090005.png" width="800" height="362" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Direct VPC Egressçµç±ã§Cloud NATã使ç¨ããã¨ãCloud NATã®ã¢ãã¿ãªã³ã°ææ¨ã表示ãããªã</figcaption></figure></p>
<p>ãã®å ´åãCloud NAT ã«é«è² è·ãåå ã§åé¡ãçããã¨ãã®åå 調æ»ãé£ãããªãã¾ãããã¨ãã°ä»¥ä¸ã®è¨äºã§ç´¹ä»ãã¦ããã±ã¼ã¹ã§ã¯ãCloud Run ããã®å
¨ã¦ã®ã¢ã¦ããã¦ã³ã ãã©ãã£ãã¯ãæå³ãã Cloud NAT ã«åãã£ã¦ãã¾ã£ããã¨ã§ã<strong>Cloud NAT ãå©ç¨ã§ãããã¼ãæ°ãä¸éã«éãã¦ãã¾ã</strong>ãæ¥ç¶ã¨ã©ã¼ãå¤çºããç¶æ³ã«ãªãã¾ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-run-to-sql-access-failed-via-nat" title="Cloud RunããCloud SQLã¸ã®éä¿¡ãCloud NATãçµç±ãã¦ãã¾ãäºè±¡ã¨ãã®è§£æ±ºç - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-run-to-sql-access-failed-via-nat">blog.g-gen.co.jp</a></cite></p>
<p>ãã®ã±ã¼ã¹ã«ããã Cloud NAT ã®é«è² è·ã¯è¨å®ãã¹ã«ãã£ã¦èµ·ãã£ããã®ã§ããããªã¯ã¨ã¹ãã®æ¥å¢ã«ãã Cloud Run ãã¹ã±ã¼ã«ããå ´åãªã©ãé常ã®å©ç¨æã«ãçºçããå¯è½æ§ã¯ããã¾ããæ¬æ¥ Cloud NAT ã®ãã¼ã使ç¨ç¶æ³ã¯ Cloud Monitoring ã§å¯è¦åã§ãã¾ãããDirect VPC Egress çµç±ã®ãã©ãã£ãã¯ã«ã¤ãã¦ã¯ããã®ææ¨ãè¨é²ããã¾ããã</p>
<h1 id="対ç">対ç</h1>
<h2 id="Cloud-NAT-ã®ãã°ãæå¹ã«ãã">Cloud NAT ã®ãã°ãæå¹ã«ãã</h2>
<p>Cloud NAT ã®ãã°ã¯ä½ææã®ããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ã¦ãã¾ããããããæå¹åãããã¨ã§ãã¨ã©ã¼ãã°ãã Cloud NAT ã®ç°å¸¸ãæ¤ç¥ã§ããå¯è½æ§ãããã¾ãã</p>
<p>ãã ããåè¿°ã®å¶éäºé
ã«è¨è¼ããããã«ãDirect VPC Egress ã® Cloud NAT ãã°ã«ã¯çºä¿¡å
ã®æ
å ±ãè¨é²ãããªãç¹ã«ã¯æ³¨æãå¿
è¦ã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Cloud NATã®ãã°ãæå¹åãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241225/20241225090008.png" width="413" height="280" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Cloud NATã®ãã°ãæå¹åãã</figcaption></figure></p>
<h2 id="Cloud-NAT-ã®ãã¼ãå²ãå½ã¦æ°ã«ä½è£ããããã">Cloud NAT ã®ãã¼ãå²ãå½ã¦æ°ã«ä½è£ããããã</h2>
<p>Cloud NAT ã«ã¯å©ç¨ã§ãããã¼ãæ°ãåçã«å¤æ´ãã<strong>åçãã¼ãã®å²ãå½ã¦</strong>æ©è½ãããã¾ããããããåçãã¼ãã®å²ãå½ã¦ã使ãã¨ããã¼ãæ°ãã¹ã±ã¼ã«ã¢ã¦ãããã¿ã¤ãã³ã°ã§ãã±ããããããããã¦ãã¾ãåé¡ãããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/nat/docs/ports-and-addresses?hl=ja#dynamic-port">åçãã¼ãã®å²ãå½ã¦</a></li>
<li>åè : <a href="https://cloud.google.com/nat/docs/troubleshooting?hl=ja#dpa-drops">åçãã¼ãå²ãå½ã¦ãæ§æããã¦ããã¨ãã«ãã±ãããããããããã</a></li>
</ul>
<p>åçãã¼ãã®å²ãå½ã¦ã使ç¨ããªãå ´åãéçã«ãã¼ãã®å²ãå½ã¦ãè¡ããã¾ããããã©ã«ãã§ã¯<strong>64</strong>åã®ãã¼ããå©ç¨ã§ãã¾ãããæåã§å¤æ´ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/nat/docs/ports-and-addresses?hl=ja#static-port">éçãã¼ãã®å²ãå½ã¦</a></li>
</ul>
<p>Direct VPC Egress ã使ç¨ãã¦ããã¨ã㯠Cloud NAT ã®ææ¨ãå©ç¨ã§ããªããããé©åãªãã¼ãæ°ãæ¤è¨ãããã¨ãé£ããã§ãããåé¡ãèµ·ãã£ãã¨ãã«ãã¼ãæ°ãå¢ããé¸æè¢ããããã¨ã¯ç解ãã¦ããã¨ããã§ãããã</p>
<h2 id="ãµã¼ãã¼ã¬ã¹-VPC-ã¢ã¯ã»ã¹ãå©ç¨ãã">ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹ãå©ç¨ãã</h2>
<p><strong>ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹</strong>çµç±ã§ Cloud NAT ã使ç¨ããå ´åãDirect VPC Egress ã¨æ¯è¼ãã¦æéãããã©ã¼ãã³ã¹é¢ã®ãã¡ãªããã¯ããã¾ãããå½è¨äºã§è§£èª¬ããã¢ãã¿ãªã³ã°ã«é¢ããåé¡ã¯çºçãã¾ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vpc/docs/serverless-vpc-access?hl=ja">ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹</a></li>
</ul>
<p>Cloud Run ã§ãµã¼ãã¼ã¬ã¹ VPC ã¢ã¯ã»ã¹ã使ç¨ã㦠Cloud NAT ã§å¤é¨ IP ã¢ãã¬ã¹ãåºå®ããæ¹æ³ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloudrun-using-static-ip" title="Cloud Runããåºå®IPã§ã¤ã³ã¿ã¼ãããæ¥ç¶ããï¼ãµã¼ãã¼ã¬ã¹VPCã¢ã¯ã»ã¹ç·¨ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloudrun-using-static-ip">blog.g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
å
¨Geminiãããã¯ããå¾¹åºè§£èª¬ï¼
hatenablog://entry/6802418398309377607
2024-12-24T09:00:00+09:00
2024-12-24T09:20:15+09:00 G-gen ã®ç±³å·ã§ããGoogle ãéçºãã大è¦æ¨¡è¨èªã¢ãã« Gemini ã¯ããã®é«ãæ§è½ã¨å¤å²ã«ããããããã¯ãå±éã§æ³¨ç®ãéãã¦ãã¾ããå½è¨äºã§ã¯ãGemini ãããã¯ãã®å
¨è²ã網ç¾
çã«è§£èª¬ãã¾ãã ã¯ããã« çæ AI åºç¤ã¢ãã« ã¨ãã¦ã® Gemini ã¢ãã«ã¨ã¯ Gemini ã®ã¢ãã«ãã¡ããªã¼ Gemini ã¢ãã«ã®ãã¼ã¸ã§ã³ Gemini ãããã¯ã Gemini ã¢ã㪠Gemini ã¢ããªã¨ã¯ ãã¼ã¿ä¿è· Gemini Advanced Gems Gemini for Google Workspace Gemini for Google Workspace ã¨ã¯ ãµã¤â¦
<p>G-gen ã®ç±³å·ã§ããGoogle ãéçºãã大è¦æ¨¡è¨èªã¢ãã« <strong>Gemini</strong> ã¯ããã®é«ãæ§è½ã¨å¤å²ã«ããããããã¯ãå±éã§æ³¨ç®ãéãã¦ãã¾ããå½è¨äºã§ã¯ãGemini ãããã¯ãã®å
¨è²ã網ç¾
çã«è§£èª¬ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#çæ-AI-åºç¤ã¢ãã«-ã¨ãã¦ã®-Gemini">çæ AI åºç¤ã¢ãã« ã¨ãã¦ã® Gemini</a><ul>
<li><a href="#ã¢ãã«ã¨ã¯">ã¢ãã«ã¨ã¯</a></li>
<li><a href="#Gemini-ã®ã¢ãã«ãã¡ããªã¼">Gemini ã®ã¢ãã«ãã¡ããªã¼</a></li>
<li><a href="#Gemini-ã¢ãã«ã®ãã¼ã¸ã§ã³">Gemini ã¢ãã«ã®ãã¼ã¸ã§ã³</a></li>
</ul>
</li>
<li><a href="#Gemini-ãããã¯ã">Gemini ãããã¯ã</a><ul>
<li><a href="#Gemini-ã¢ããª">Gemini ã¢ããª</a><ul>
<li><a href="#Gemini-ã¢ããªã¨ã¯">Gemini ã¢ããªã¨ã¯</a></li>
<li><a href="#ãã¼ã¿ä¿è·">ãã¼ã¿ä¿è·</a></li>
<li><a href="#Gemini-Advanced">Gemini Advanced</a></li>
<li><a href="#Gems">Gems</a></li>
</ul>
</li>
<li><a href="#Gemini-for-Google-Workspace">Gemini for Google Workspace</a><ul>
<li><a href="#Gemini-for-Google-Workspace-ã¨ã¯">Gemini for Google Workspace ã¨ã¯</a></li>
<li><a href="#ãµã¤ãããã«">ãµã¤ãããã«</a></li>
<li><a href="#Gemini-for-Google-Workspace-ã¢ããªã³">Gemini for Google Workspace ã¢ããªã³</a></li>
</ul>
</li>
<li><a href="#Gemini-for-Google-Cloud">Gemini for Google Cloud</a><ul>
<li><a href="#Gemini-for-Google-Cloud-ã¨ã¯">Gemini for Google Cloud ã¨ã¯</a></li>
<li><a href="#æ©è½ä¸è¦§">æ©è½ä¸è¦§</a></li>
<li><a href="#æé">æé</a></li>
</ul>
</li>
<li><a href="#Generative-AI-on-Vertex-AI">Generative AI on Vertex AI</a><ul>
<li><a href="#Generative-AI-on-Vertex-AI-ã¨ã¯">Generative AI on Vertex AI ã¨ã¯</a></li>
<li><a href="#ãã¼ã¿ã®ä¿è·">ãã¼ã¿ã®ä¿è·</a></li>
<li><a href="#ã¦ã¼ã¹ã±ã¼ã¹">ã¦ã¼ã¹ã±ã¼ã¹</a></li>
<li><a href="#ãã®ä»ã®ãããã¯ã">ãã®ä»ã®ãããã¯ã</a></li>
<li><a href="#æé-1">æé</a></li>
</ul>
</li>
<li><a href="#Gemini-API">Gemini API</a><ul>
<li><a href="#Gemini-API-ã¨ã¯">Gemini API ã¨ã¯</a></li>
<li><a href="#ãã¼ã¿ã®ä¿è·-1">ãã¼ã¿ã®ä¿è·</a></li>
<li><a href="#æé-2">æé</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#å°å
¥ãã¹ã-Gemini-ãããã¯ã">å°å
¥ãã¹ã Gemini ãããã¯ã</a><ul>
<li><a href="#çæ-AI-ã§ç¤¾å
æ¥åãå¹çåãããå ´å">çæ AI ã§ç¤¾å
æ¥åãå¹çåãããå ´å</a></li>
<li><a href="#èªç¤¾ãã¼ã¿ãå¹ççã«æ¤ç´¢ãããçæ-AI-ã«è³ªåã«çãããããå ´å">èªç¤¾ãã¼ã¿ãå¹ççã«æ¤ç´¢ãããçæ AI ã«è³ªåã«çãããããå ´å</a></li>
<li><a href="#èªç¤¾ã®æ°ãµã¼ãã¹ã«çæ-AI-ãçµã¿è¾¼ãå ´å">èªç¤¾ã®æ°ãµã¼ãã¹ã«çæ AI ãçµã¿è¾¼ãå ´å</a></li>
<li><a href="#ã·ã¹ãã éçºãå¹çåãããå ´å">ã·ã¹ãã éçºãå¹çåãããå ´å</a></li>
</ul>
</li>
<li><a href="#ãã¸ãã¹å°å
¥ã«ããã注æç¹">ãã¸ãã¹å°å
¥ã«ããã注æç¹</a><ul>
<li><a href="#çæ-AI-ã®ãã¸ãã¹é©ç¨">çæ AI ã®ãã¸ãã¹é©ç¨</a></li>
<li><a href="#çæ-AI-ã¯ç¢ºçã¨ã³ã¸ã³ã§ãããã¨ãç解ãã">çæ AI ã¯ç¢ºçã¨ã³ã¸ã³ã§ãããã¨ãç解ãã</a></li>
<li><a href="#çæ-AI-ã«åãã¦ãæ¥å--åãã¦ãªãæ¥å">çæ AI ã«åãã¦ãæ¥å / åãã¦ãªãæ¥å</a><ul>
<li><a href="#åãã¦ããæ¥å">åãã¦ããæ¥å</a></li>
<li><a href="#åãã¦ããªãæ¥å">åãã¦ããªãæ¥å</a></li>
</ul>
</li>
<li><a href="#ã»ãã¥ãªãã£">ã»ãã¥ãªãã£</a><ul>
<li><a href="#ãã¼ã¿ä¿è·-1">ãã¼ã¿ä¿è·</a></li>
<li><a href="#çæ-AI-ã¢ããªã¸ã®æ»æ">çæ AI ã¢ããªã¸ã®æ»æ</a></li>
<li><a href="#ä¸é©åãªçæã³ã³ãã³ã">ä¸é©åãªçæã³ã³ãã³ã</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#å°å
¥äºä¾">å°å
¥äºä¾</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241224/20241224074638.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p><strong>Gemini</strong> ã¯ãGoogle ãéçºããçæ AI åºç¤ã¢ãã«ãããã³ãããå©ç¨ããçæ AI ãããã¯ã群ã§ããGemini ãç¨ãããããã¯ãã«ã¯ã以ä¸ãããã¾ãã</p>
<table>
<thead>
<tr>
<th> ãããã¯ãå </th>
<th> æ¦è¦ </th>
</tr>
</thead>
<tbody>
<tr>
<td> <strong>Gemini ã¢ããª</strong> </td>
<td> ãã©ã¦ã¶ãã¢ãã¤ã«ã¢ããªããå©ç¨ãªçæ AI ãã£ããã¢ã㪠</td>
</tr>
<tr>
<td> <strong>Gemini for Google Workspace</strong> </td>
<td> Google Workspace ã«çµã¿è¾¼ã¾ããæ¥åè£å© AI </td>
</tr>
<tr>
<td> <strong>Gemini for Google Cloud</strong> </td>
<td> Google Cloud ä¸ã®éçºãå¹çåãããã¼ã«ç¾¤ </td>
</tr>
<tr>
<td> <strong>Generative AI on Vertex AI</strong> </td>
<td> Google Cloud ã® Vertex AI API çµç±ã§ Gemini ã¢ãã«ãå¼ã³åºã </td>
</tr>
<tr>
<td> <strong>Gemini API</strong> </td>
<td> Google AI Studio ã® API çµç±ã§ Gemini ã¢ãã«ãå¼ã³åºã </td>
</tr>
</tbody>
</table>
<p>ããããã«ç°ãªãæ©è½ãç¹å¾´ãããããã¸ãã¹ã·ã¼ã³ã«åããã¦æé©ãªãããã¯ããé¸æã§ãã¾ããå½è¨äºã§ã¯ãããã <strong>Gemini ãããã¯ã</strong>ã¨å¼ç§°ãã¦ãããããç´¹ä»ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Gemini ãããã¯ãä¸è¦§"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221140556.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini ãããã¯ãä¸è¦§</figcaption></figure></p>
<h1 id="çæ-AI-åºç¤ã¢ãã«-ã¨ãã¦ã®-Gemini">çæ AI åºç¤ã¢ãã« ã¨ãã¦ã® Gemini</h1>
<h2 id="ã¢ãã«ã¨ã¯">ã¢ãã«ã¨ã¯</h2>
<p>ã¾ããæ©æ¢°å¦ç¿ã«ããã<strong>ã¢ãã«</strong>ã¨ã¯ã大éã®ãã¼ã¿ãããã¿ã¼ã³ãã«ã¼ã«ãå¦ç¿ããç¹å®ã®ã¿ã¹ã¯ãå®è¡ã§ããããã«ãªã£ãä»çµã¿ã®ãã¨ãæãã¾ãã</p>
<p>ä¾ãã°ç»åèªèã¢ãã«ã¯ãããããã®ç«ã®ç»åãã¼ã¿ãããâç«ãããâ ãå¦ç¿ãããã¨ã§ã人ãæãããã¨ãªãåãã¦è¦ãç«ã®ç»åã§ããããã¯ç«ã ãã¨èªèã§ãã¾ãã</p>
<p>Gemini ãæ©æ¢°å¦ç¿ã¢ãã«ã®1ã¤ã§ããGemini ã¯<strong>ãã«ãã¢ã¼ãã«</strong>ãªçæ AI ã¢ãã«ã§ãããã«ãã¢ã¼ãã«ãªã¢ãã«ã¨ã¯ãããã¹ããç»åãé³å£°ãåç»ãªã©ã<strong>è¤æ°ã®ç¨®é¡ã®æ
å ±ãç解ããã³ã³ãã³ããçæãã</strong>ãã¨ãã§ãããã¨ãæãã¾ãã</p>
<p>å½è¨äºã§ç´¹ä»ãã Gemini ãããã¯ãã¯ããã® Gemini ã¢ãã«ãç¨ãã¦ãã¾ãã</p>
<h2 id="Gemini-ã®ã¢ãã«ãã¡ããªã¼">Gemini ã®ã¢ãã«ãã¡ããªã¼</h2>
<p><figure class="figure-image figure-image-fotolife" title="Gemini ã¢ãã«ãã¡ããªã¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221141608.png" width="841" height="333" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini ã¢ãã«ãã¡ããªã¼</figcaption></figure></p>
<p>Gemini ã®ã¢ãã«ã«ã¯è¤æ°ã®ç¨®é¡ããããããããå¾æãªã¿ã¹ã¯ãè½åãç°ãªãã¾ããGemini ã¢ããªã Gemini for Google Workspace ã«çµã¿è¾¼ã¾ãã¦ããã¢ãã«ããGoogle Cloud ãã API çµç±ã§å©ç¨ã§ããã¢ãã«ã«ã¯ã以ä¸ã®ãããªãã®ãããã¾ãã</p>
<p><strong>Gemini Ultra</strong><br/>
Gemini ãã¡ããªã¼ã®ä¸ã§ãæãé«æ§è½ãªã¢ãã«ã§ããè¤éãªæ¨è«ãé«åº¦ãªã³ã¼ãã£ã³ã°ãªã©ãå°éçãªç¥èãå¿
è¦ã¨ããã¿ã¹ã¯ã«åªãã¦ãã¾ãã</p>
<p><strong>Gemini Pro</strong><br/>
å¹
åºãã¿ã¹ã¯ã«å¯¾å¿ã§ããæ±ç¨æ§ã®é«ãã¢ãã«ã§ããæç« çæã翻訳ã質çå¿çãªã©ãæ§ã
ãªç¨éã§å©ç¨ã§ãã¾ãã</p>
<p><strong>Gemini Flash</strong><br/>
é«éãªå¿çé度ãèªãã¢ãã«ã§ããã¬ã¤ãã³ã·ãéè¦ãªã¢ããªã±ã¼ã·ã§ã³ã«æé©ã§ãã</p>
<p><strong>Gemini Nano</strong><br/>
軽éãªã¢ãã«ã§ããã¹ãã¼ããã©ã³ãªã©ã®ããã¤ã¹ä¸ã§åä½ããããã«è¨è¨ããã¦ãããéãããè¨ç®è³æºã§ãå¹ççã«åä½ãã¾ãã</p>
<p>ãããã®ã¢ãã«ã¯ãGemini ãããã¯ãã«çµã¿è¾¼ã¾ãã¦ãã¾ããç§ãã¡ã¦ã¼ã¶ã¼ããæ示çã«ã¢ãã«ã®ç¨®é¡ãé¸æã§ãããããã¯ããããã°ãGoogle ãæé©ãªã¢ãã«ãé¸æãã¦çµã¿è¾¼ã¿æ¸ã¿ã®ãã¨ãããã¾ãã</p>
<h2 id="Gemini-ã¢ãã«ã®ãã¼ã¸ã§ã³">Gemini ã¢ãã«ã®ãã¼ã¸ã§ã³</h2>
<p>ä¸è¨ã®ã¢ãã«ã«å ãã¦ãGemini ã«ã¯<strong>ãã¼ã¸ã§ã³</strong>ã¨ããæ¦å¿µãããã¾ãããã¼ã¸ã§ã³ã¯ãã¢ãã«ã®æ¹åãæ©è½è¿½å ãè¡ããããã³ã«æ´æ°ããã¦ããã¾ãã</p>
<p>ä¾ãã°2024å¹´12æç¾å¨ãGemini Pro ã®ä¸è¬å©ç¨å¯è½ãªãã¼ã¸ã§ã³ã¯ Gemini 1.0 Pro 㨠Gemini 1.5 Pro ã®2ã¤ã§ãã</p>
<p>1.0 ãã 1.5 ã¸ã®ã¢ãããã¼ãã«ãããã³ã³ããã¹ãã¦ã£ã³ãã¦ï¼ä¸åº¦ã«å¦çã§ããæ
å ±éãåä½ã¯<strong>ãã¼ã¯ã³</strong>ï¼ããã大ãããªã£ãããæ¨è«è½åãã³ã¼ãçæè½åãåä¸ãã¾ããã</p>
<p>2024å¹´12æã«ã¯ã<strong>Gemini 2.0</strong> ãçºè¡¨ããã¾ããã2024å¹´12æç¾å¨ãGoogle Cloudï¼Vertex AIï¼ç㧠Gemini 2.0 Flash ã®è©¦é¨éç¨çãå©ç¨å¯è½ã§ããã»ããGemini ã¢ããªã§ã 2.0 ã®è©¦é¨éç¨çãæ¢ã«å©ç¨å¯è½ã«ãªã£ã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://blog.google/intl/ja-jp/company-news/technology/google-gemini-ai-update-december-2024/">Gemini 2.0: ã¨ã¼ã¸ã§ã³ãæ代ã«åããæ°ãã AI ã¢ãã«</a></li>
<li>åè : <a href="https://developers.googleblog.com/en/the-next-chapter-of-the-gemini-era-for-developers/">The next chapter of the Gemini era for developers</a></li>
</ul>
<h1 id="Gemini-ãããã¯ã">Gemini ãããã¯ã</h1>
<h2 id="Gemini-ã¢ããª">Gemini ã¢ããª</h2>
<p><figure class="figure-image figure-image-fotolife" title="Gemini ã¢ããªã¯ãã£ãããã¼ã«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221142026.png" width="1200" height="696" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini ã¢ããªã¯ãã£ãããã¼ã«</figcaption></figure></p>
<h3 id="Gemini-ã¢ããªã¨ã¯">Gemini ã¢ããªã¨ã¯</h3>
<p><strong>Gemini ã¢ããª</strong>ï¼Gemini appï¼ã¨ã¯ã以ä¸ã®2ã¤ã®ãã£ãããããã¯ãã®ç·ç§°ã§ãã</p>
<ol>
<li>Gemini ã¦ã§ãã¢ããªï¼<code>gemini.google.com</code> ã®ãã¨ããã¤ã¦ Bard ã¨å¼ã°ãã¦ãã Web ãã©ã¦ã¶åãçæ AI ãã£ããï¼</li>
<li>ã¹ãã¼ããã©ã³åãçæ AI ãã£ããã¢ããªï¼Android ããã³ iOS åãï¼</li>
</ol>
<p>ãããããGoogle ã®çæ AI åºç¤ã¢ãã«ã§ãã Gemini ãåºç¤ã¨ãããã£ããã¢ããªã±ã¼ã·ã§ã³ã§ãGoogle ã¢ã«ã¦ã³ãããããã°<strong>ç¡æã§å©ç¨ã§ãã¾ã</strong>ã</p>
<ul>
<li>åè : <a href="https://gemini.google.com/">gemini.google.com</a></li>
<li>åè : <a href="https://support.google.com/gemini">Gemini ã¢ã㪠ãã«ã</a></li>
</ul>
<h3 id="ãã¼ã¿ä¿è·">ãã¼ã¿ä¿è·</h3>
<p>Gemini ã¢ããªã¯ãGoogle ã¢ã«ã¦ã³ããããã°èª°ã§ãç¡æã§å©ç¨ã§ãã¾ãããã ããç¡åã® Google ã¢ã«ã¦ã³ã㧠Gemini ã¢ããªã使ãå ´åãå
¥åãããã¼ã¿ã¯ Google ã«ãã£ã¦<strong>ãµã¼ãã¹æ¹åã®ããã«å©ç¨ããã</strong>å ´åãããã¾ãã</p>
<p>ä¸æ¹ã§ä»¥ä¸ã®ã¨ãã£ã·ã§ã³ã® Google Workspace ã§ç®¡çãããã¢ã«ã¦ã³ãã§ããã°ã<strong>ã¨ã³ã¿ã¼ãã©ã¤ãºã°ã¬ã¼ãã®ãã¼ã¿ä¿è·</strong>ããé©ç¨ããã¾ãããã®å ´åããã¼ã¿ã¯ Google ã«ãã£ã¦<strong>ãµã¼ãã¹æ¹åã®ããã«å©ç¨ããããã¨ã¯ãªã</strong>ã人éã®ã¬ãã¥ã¯ã¼ã«ãã£ã¦è¦ããããã¨ãããã¾ããã</p>
<ul>
<li>Business Starter / Business Standard / Business Plus</li>
<li>Enterprise Starter / Enterprise Standard / Enterprise Plus</li>
<li>Essentials</li>
<li>Enterprise Essentials / Enterprise Essentials Plus</li>
<li>Frontline Starter / Frontline Standard</li>
<li>Nonprofits</li>
</ul>
<p>ããã« Google Workspace ã§ã¯ãGemini ã¢ããªãå©ç¨ã§ããã¦ã¼ã¶ã¼ãéå®ããããéã«çµç¹å
¨ä½ã§å©ç¨å¯è½ã«ãããªã©ãå©ç¨å¯å¦ã®ã³ã³ããã¼ã«ãå¯è½ã§ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/14130944#zippy=%2Cgemini%2Cgemini-%E3%82%A2%E3%83%97%E3%83%AA%E3%81%A8%E3%81%AF%E4%BD%95%E3%81%A7%E3%81%99%E3%81%8B">Gemini for Google Workspace ã«é¢ãããããã質å - Gemini ã¢ããªã¨ã¯ä½ã§ããï¼</a></li>
<li>åè : <a href="https://support.google.com/a/answer/14571493">Gemini ã¢ããªããªã³ã¾ãã¯ãªãã«ãã</a></li>
</ul>
<h3 id="Gemini-Advanced">Gemini Advanced</h3>
<p><strong>Gemini Advanced</strong> ã¯ãæ§ã
ãªè¿½å æ©è½ãå«ããGemini ã®æåçã§ããGemini Advanced ã§ã¯ãGemini ã¢ããªã§ææ°çã® Gemini ã¢ãã«ãé¸æã§ããããã«ãªã£ãããæ
å ±ã¬ãã¼ããç°¡åã«ä½æã§ãã Deep Researchãé·æããã¹ãããã¡ã¤ã«ã®åæãGmail ã Google ããã¥ã¡ã³ãã¨ã®ã·ã¼ã ã¬ã¹ãªé£æºãªã©ãå©ç¨å¯è½ã§ãã</p>
<p>å人ã®å ´åãå人åãã®æå Google ãµã¼ãã¹ã§ãã Google One AI ãã¬ãã¢ã ãã©ã³ã«å å
¥ãããã¨ã§å©ç¨å¯è½ã«ãªãã¾ããGoogle Workspace ã®å ´åãGemini for Google Workspace ã¢ããªã³ãè³¼å
¥ããã¨å©ç¨å¯è½ã«ãªãã¾ãã</p>
<ul>
<li>åè : <a href="https://gemini.google/advanced/">Gemini Advanced</a></li>
<li>åè : <a href="https://support.google.com/gemini/answer/14517446">Gemini Advanced ã«ã¢ããã°ã¬ã¼ããã</a></li>
</ul>
<h3 id="Gems">Gems</h3>
<p>Gemini ã¦ã§ãã¢ããªã®æ¡å¼µæ©è½ã¨ãã¦ã<strong>Gems</strong> ãããã¾ããGems 㯠Gemini ã¦ã§ãã¢ããªãã«ã¹ã¿ãã¤ãºããããã®æ©è½ã§ãã2024å¹´8æ28æ¥ã«ãGemini Advanced ã¦ã¼ã¶ã¼åãã«å
¬éããã¾ããã</p>
<p>ä¾ãã°ãYouTube åç»ã®è¦ç´ã表示ããã®ã«ç¹åãã Gems ããç»åããããã¹ããæ½åºãããã¨ã«ç¹åãã Gems ãªã©ãä½æãããã¨ãã§ãã¾ãã</p>
<p>詳細ã¯ä»¥ä¸ã®è¨äºãåèã«ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fgems-explained" title="Geminiã¦ã§ãã¢ããªã®ã«ã¹ã¿ãã¤ãºæ©è½ãGemsããå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/gems-explained">blog.g-gen.co.jp</a></cite></p>
<h2 id="Gemini-for-Google-Workspace">Gemini for Google Workspace</h2>
<p><figure class="figure-image figure-image-fotolife" title="Gemini for Google Workspace ã¯æ¥åè£å©ãã¼ã«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221142448.png" width="1142" height="292" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini for Google Workspace ã¯æ¥åè£å©ãã¼ã«</figcaption></figure></p>
<h3 id="Gemini-for-Google-Workspace-ã¨ã¯">Gemini for Google Workspace ã¨ã¯</h3>
<p><strong>Gemini for Google Workspace</strong> ã¨ã¯ãGoogle Workspace ã«ã¢ããªã³ãã¦å©ç¨ãã AI ã¢ã·ã¹ã¿ã³ãæ©è½ã§ããå©ç¨ã«ã¯ãGemini for Google Workspace ã¢ããªã³ã®è¿½å è³¼å
¥ãå¿
è¦ã§ãã</p>
<p>Gemini ã®å¼·å㪠AI æè¡ã GmailãGoogle ããã¥ã¡ã³ããGoogle ã¹ã©ã¤ããGoogle ã¹ãã¬ããã·ã¼ããªã©ãæ®æ®µä½¿ãæ
£ãã Google Workspace ã¢ããªã«çµ±åããããã¨ã§ãæ¥åãå¹çåããã¾ãã</p>
<p>ã¾ã Gemini for Google Workspace ã§ã¯<strong>ã¨ã³ã¿ã¼ãã©ã¤ãºã°ã¬ã¼ãã®ãã¼ã¿ä¿è·</strong>ãé©ç¨ããã¦ããããã¼ã¿ã¯ Google ã«ãã£ã¦<strong>ãµã¼ãã¹æ¹åã®ããã«å©ç¨ããããã¨ã¯ãªã</strong>ã人éã®ã¬ãã¥ã¯ã¼ã«ãã£ã¦<strong>è¦ããããã¨ããªã</strong>ãããå®å¿ãã¦æ¥åã«å©ç¨ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/13623623">Gemini for Google Workspace</a></li>
<li>åè : <a href="https://support.google.com/a/answer/14130944">Gemini for Google Workspace ã«é¢ãããããã質å</a></li>
</ul>
<h3 id="ãµã¤ãããã«">ãµã¤ãããã«</h3>
<p>Gemini for Google Workspace ã§ã¯ã<strong>ãµã¤ãããã«</strong>ãéã㦠Gemini ãå©ç¨ã§ãã¾ãã</p>
<p>Gemini ãçµ±åããã¦ãã Google Workspace ã¢ããªï¼Google ããã¥ã¡ã³ããGoogle ã¹ãã¬ããã·ã¼ããªã©ï¼ã§ã¯ãGemini ã¢ã¤ã³ã³ã表示ããã¾ããä¾ãã° Google ããã¥ã¡ã³ãã®å ´åãç»é¢å³ä¸ã« Gemini ã¢ã¤ã³ã³ãããã¾ãããã®ã¢ã¤ã³ã³ãã¯ãªãã¯ããã¨ããµã¤ãããã«ã«ããã³ããå
¥åç»é¢ã表示ãããGemini ã«æ示ãåºããã¨ãã§ãã¾ããGemini ã¯æ示ãåãåãã¨ãæ°ç§ã§ã³ã³ãã³ããçæãã¦ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Google ããã¥ã¡ã³ãä¸ã® Gemini"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241224/20241224090007.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Google ããã¥ã¡ã³ãä¸ã® Gemini ãµã¤ãããã«</figcaption></figure></p>
<h3 id="Gemini-for-Google-Workspace-ã¢ããªã³">Gemini for Google Workspace ã¢ããªã³</h3>
<p>Gemini for Google Workspace ã®å©ç¨ã«ã¯ã<strong>Gemini for Google Workspace ã¢ããªã³</strong>ã®è¿½å è³¼å
¥ãå¿
è¦ã§ããGemini for Google Workspace ã¢ããªã³ã¯ Gemini ã¢ããªã³ã¨ãå¼ã°ãã以ä¸ã®ç¨®é¡ãããã¾ãï¼ä¾¡æ ¼ã¯2024å¹´12æç¾å¨ï¼ã</p>
<table>
<thead>
<tr>
<th> Gemini for GWS<br>ã¨ãã£ã·ã§ã³ </th>
<th> æéï¼ã¦ã¼ã¶ã¼/æï¼ </th>
<th> 主ãªæ©è½ </th>
<th> ã¦ã¼ã¹ã±ã¼ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> <strong>Gemini Business </strong> </td>
<td> å¹´éå¥ç´ : 2,260å<br>ãã¬ãã·ãã« : 2,712å </td>
<td> - Gmailãããã¥ã¡ã³ããã¹ãã¬ããã·ã¼ããã¹ã©ã¤ãã§ã®AIæ¯æ´<br> - ä¼æ¥åã Gemini ã¢ããªã®å©ç¨<br> </td>
<td> - æ
å ±åéããã¬ã¹ããã³ã³ãã³ãä½æããã¶ã¤ã³ä½æãªã©æ¥å¸¸çãªæ¥åå¹çå<br> - ç°¡åãªãã¼ã¿åæ </td>
</tr>
<tr>
<td> <strong>Gemini Enterprise</strong> </td>
<td> å¹´éå¥ç´ : 3,400å<br>ãã¬ãã·ãã« : 4,080å </td>
<td> - Gemini Business ã®å
¨æ©è½ã«å ããé«åº¦ãªæ©è½<br> - Meet ã®è°äºé²ä½æããªã¢ã«ã¿ã¤ã 翻訳<br> - Chat ã®ä¼è©±è¦ç´ </td>
<td> - é«åº¦ãªæ¥åå¹çå<br> - 大è¦æ¨¡ãªãã¼ã¿åæã¨å¯è¦å<br> - å°éçãªã¬ãã¼ãä½æ<br> - è¤éãªã¿ã¹ã¯ã®èªåå<br> - çµç¹å
¨ä½ã®çç£æ§åä¸ </td>
</tr>
<tr>
<td> <strong>AI Security</strong> </td>
<td> å¹´éå¥ç´ : 1,356å<br>ãã¬ãã·ãã« : 1,130å </td>
<td> - AI ãæ´»ç¨ããã»ãã¥ãªãã£å¼·åï¼æ©å¯ä¿æã®ããã®èªåã©ãã«ä»ãï¼ã«éå® </td>
<td> - ãµã¤ãã¼ã»ãã¥ãªãã£è
å¨ã®æ¤ç¥ã¨é²å¾¡<br> - ãã£ãã·ã³ã°ã¡ã¼ã«ã®æ¤åº<br> - ãã«ã¦ã§ã¢ã®æ¤ç¥<br> - ä¸æ£ã¢ã¯ã»ã¹ã®é²æ¢<br> - ãã¼ã¿æ¼æ´©ã®é²æ¢ </td>
</tr>
<tr>
<td> <strong>AI Meetings and Messaging</strong> </td>
<td> å¹´éå¥ç´ : 1,356å<br>ãã¬ãã·ãã« : 1,130å </td>
<td> - AI ãæ´»ç¨ããä¼è°ã¨ã¡ãã»ã¼ã¸ã³ã°ã®å¹çåã«éå® </td>
<td> - ä¼è°ã®èªåè¦ç´<br> - ä¼è°ä¸ã®ãªã¢ã«ã¿ã¤ã 翻訳<br> - ä¼è°å¾ã®ã¢ã¯ã·ã§ã³ã¢ã¤ãã ã®èªåçæ<br> - ãã£ããã®è¦ç´ã»èªåè¦ç´ </td>
</tr>
</tbody>
</table>
<p>ã¢ããªã³ã®éãã詳細ã«ã¤ãã¦ã¯ã以ä¸ãåèã«ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/14700766">Gemini for Google Workspace ã¢ããªã³ã®æ¯è¼</a></li>
</ul>
<h2 id="Gemini-for-Google-Cloud">Gemini for Google Cloud</h2>
<p><figure class="figure-image figure-image-fotolife" title="Gemini for Google Cloud ã¯éçºè£å©ãã¼ã«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221143037.png" width="1200" height="260" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini for Google Cloud ã¯éçºè£å©ãã¼ã«</figcaption></figure></p>
<h3 id="Gemini-for-Google-Cloud-ã¨ã¯">Gemini for Google Cloud ã¨ã¯</h3>
<p><strong>Gemini for Google Cloud</strong> ã¯ãGoogle Cloud ä¸ã§ã®éçºã«å½¹ã«ç«ã¤ãéçºè
åãã® AI ã¢ã·ã¹ã¿ã³ãæ©è½ã§ããã½ã¼ã¹ã³ã¼ãã®èªåçæããã¼ã¿åæã®å¹çåãã»ãã¥ãªãã£ã®å¼·åãªã©ãå¯è½ã§ãã</p>
<p>ã¢ããªã±ã¼ã·ã§ã³éçºè
ã¯ãã¡ããããã¼ã¿ãµã¤ã¨ã³ãã£ã¹ãããã¸ãã¹ã¢ããªã¹ããã»ãã¥ãªãã£æ
å½è
ãªã©ãæ§ã
㪠Google Cloud ã¦ã¼ã¶ã¼ã®ãªãã¬ã¼ã·ã§ã³ã»éçºãæ¯æ´ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/gemini/docs/overview?hl=ja">Gemini for Google Cloud ã®æ¦è¦</a></li>
</ul>
<h3 id="æ©è½ä¸è¦§">æ©è½ä¸è¦§</h3>
<p>Gemini for Google Cloud ã«ã¯ä»¥ä¸ã®æ©è½ãå«ã¾ãã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th> æ©è½å </th>
<th> æ¦è¦ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Gemini in BigQuery </td>
<td> ãã¼ã¿åæãå¯è¦åãSQL ã Python ã®ã³ã¼ãçæãªã©ãæ¯æ´</td>
</tr>
<tr>
<td> Gemini Code Assist </td>
<td> IDE ã¨é£æºãã¦å©ç¨ãã½ã¼ã¹ã³ã¼ãéçºããããã¤ããã©ãã«ã·ã¥ã¼ãã£ã³ã°ãæ¯æ´</td>
</tr>
<tr>
<td> Gemini in Colab Enterprise </td>
<td> Colab Enterpriseãã¼ãããã¯ã§ã®Pythonã³ã¼ãçæãæ¯æ´</td>
</tr>
<tr>
<td> Gemini in Databases </td>
<td> ãã¼ã¿ãã¼ã¹ç®¡çãã»ãã¥ãªãã£åä¸ãªã©ãæ¯æ´</td>
</tr>
<tr>
<td> Gemini in Looker </td>
<td> Lookerï¼Google Cloud ã³ã¢ï¼ã Looker Studio Pro ã§ãã¼ã¿å¯è¦åã解éãæ¯æ´</td>
</tr>
<tr>
<td> Gemini in Security Command Center </td>
<td> ã»ãã¥ãªãã£ã«é¢ããæ¤ç´¢ã¯ã¨ãªçæãã±ã¼ã¹è§£éãæ»æãã¹ææ¡ãæ¯æ´</td>
</tr>
</tbody>
</table>
<p>以ä¸ã®å½ç¤¾è¨äºãåèã«ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Ftrial-for-gemini-in-bigquery" title="èªç¶è¨èªã§ãã¼ã¿åæãã§ããGemini in BigQuery(ãã¼ã¿ãã£ã³ãã¹)ã試ãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/trial-for-gemini-in-bigquery">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Ftrial-for-gemini-in-database" title="Gemini in Databaseã使ã£ã¦ã¿ã(Cloud SQL Studioç·¨) - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/trial-for-gemini-in-database">blog.g-gen.co.jp</a></cite></p>
<h3 id="æé">æé</h3>
<p>Gemini for Google Cloud ãå©ç¨ããã«ã¯ã<strong>Gemini Code Assist ãµãã¹ã¯ãªãã·ã§ã³</strong>ãè³¼å
¥ãã¦ãã¦ã¼ã¶ã¼ã«å²ãå½ã¦ã¾ããã©ã¤ã»ã³ã¹ãå²ãå½ã¦ãããã¦ã¼ã¶ã¼ã¯ãGemini in BigQueryãGemini in DatabasesãGemini in Colab Enterprise ãªã©ã®æ©è½ãå©ç¨å¯è½ã«ãªãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/gemini/docs/discover/set-up-gemini?hl=ja">Gemini Code Assist ãè¨å®ãã</a></li>
</ul>
<p>Gemini Code Assist ãµãã¹ã¯ãªãã·ã§ã³ã«ã¯ Standard 㨠Enterprise ã®2ã¨ãã£ã·ã§ã³ããããã©ã¡ããé¸ã¶ãã«ãã£ã¦ä»éããæ©è½ãç°ãªãã¾ãã以ä¸ã¯ã2024å¹´12æç¾å¨ã®ä¾¡æ ¼ã§ããææ°ã®ä¾¡æ ¼ã¯ãå¿
ãå
¬å¼ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<table>
<thead>
<tr>
<th> ã¨ãã£ã·ã§ã³ </th>
<th> æéï¼æé¡ï¼ </th>
<th> æéï¼12ã¶æã³ãããï¼ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Standard </td>
<td> $22.80 / æ / 人 </td>
<td> $19.0 / æ / 人 </td>
</tr>
<tr>
<td> Enterprise </td>
<td> $54.0 / æ / 人 </td>
<td> $45.0 / æ / 人 </td>
</tr>
</tbody>
</table>
<ul>
<li>åèï¼<a href="https://cloud.google.com/products/gemini/pricing?hl=ja">Gemini for Google Cloud ã®æé</a></li>
</ul>
<p>ã¾ããGemini in BigQuery ã®ã¿å©ç¨ãããå ´åã<strong>BigQuery Editions ã® Enterprise Plus ã¨ãã£ã·ã§ã³</strong>ãæå¹åãããã¨ã§å©ç¨å¯è½ã«ãªãã¾ãã</p>
<p>ãã¡ãã®å ´åãGemini Code Assist ããµãã¹ã¯ã©ã¤ãããå¿
è¦ã¯ããã¾ãããã¾ããã¡ãã®å©ç¨æ¹æ³ã®å ´åãSQL ã Python ã®ã³ã¼ãçæãå¯è¦åè£å©ãªã© Gemini Code Assist ã«å«ã¾ãã Gemini in BigQuery ã®ãã¹ã¦ã®æ©è½ã«å ãã¦ããã¼ãã£ã·ã§ãã³ã°ã¨ã¯ã©ã¹ã¿ãªã³ã°ã®ã¬ã³ã¡ã³ãã¼ã·ã§ã³ããããªã¢ã©ã¤ãºãã»ãã¥ã¼ã®ã¬ã³ã¡ã³ãã¼ã·ã§ã³ãªã©ã追å ã®çæ AI æ©è½ãå©ç¨å¯è½ã«ãªãã¾ãã</p>
<h2 id="Generative-AI-on-Vertex-AI">Generative AI on Vertex AI</h2>
<p><figure class="figure-image figure-image-fotolife" title="Generative AI on Vertex AI ã§ã¯ Google Cloud çµç±ã§ Gemini ãå©ç¨"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221143829.png" width="1014" height="294" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Generative AI on Vertex AI ã§ã¯ Google Cloud çµç±ã§ Gemini ãå©ç¨</figcaption></figure></p>
<h3 id="Generative-AI-on-Vertex-AI-ã¨ã¯">Generative AI on Vertex AI ã¨ã¯</h3>
<p><strong>Generative AI on Vertex AI</strong> ã¨ã¯ãGoogle Cloud ã® AI/ML ãã©ãããã©ã¼ã ãããã¯ãã§ãã <strong>Vertex AI</strong> ã® REST API ãéãã¦ãGemini ãªã©ã®çæ AI ã¢ãã«ãå©ç¨ããææ³ã®ãã¨ã§ããã¢ããªã±ã¼ã·ã§ã³éçºè
㯠Vertex AI API ãéã㦠Gemini ã¢ãã«ã«ããã³ãããå
¥åããã¬ã¹ãã³ã¹ãå¾ããã¨ãã§ãã¾ãã</p>
<p>ããã«ãããGemini ãèªç¤¾éçºã®ã¢ããªã±ã¼ã·ã§ã³ã«çµã¿è¾¼ããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview?hl=ja">Generative AI on Vertex AI</a></li>
</ul>
<p>Vertex AI API ã¯ãHTTPS ã§ã®å¼ã³åºãããPython ã Java ãªã©ã®åããã°ã©ãã³ã°è¨èªç¨ã®å
¬å¼ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªãã¾ã BigQuery ML ãªã©ããå©ç¨ã§ãã¾ãã</p>
<p>Google Cloud ãããã¯ãã§ãã®ã§ãèªè¨¼ã»èªå¯ã¯ IAM ã«ãã£ã¦ç®¡çããã¦ãããã¾ã課éã Google Cloud å©ç¨æã¨ãã¦è«æ±ããã¾ãã</p>
<h3 id="ãã¼ã¿ã®ä¿è·">ãã¼ã¿ã®ä¿è·</h3>
<p>Vertex AI API çµç±ã§ Gemini ã«å
¥åãããããã³ããããã¥ã¼ãã³ã°ãã¼ã¿ã¯ä¿è·ããã¦ããããã¼ã¿ã Google ã«ãã£ã¦ãµã¼ãã¹æ¹åã«å©ç¨ããããã¨ã¯ããã¾ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance?hl=ja">çæ AI ã¨ãã¼ã¿ ã¬ããã³ã¹</a></li>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/multimodal-faqs?hl=ja">Gemini API ã«é¢ãããããã質å</a></li>
</ul>
<h3 id="ã¦ã¼ã¹ã±ã¼ã¹">ã¦ã¼ã¹ã±ã¼ã¹</h3>
<p>以ä¸ã®å½ç¤¾è¨äºã§ã¯ãVertex AI API çµç±ã§ Gemini ãå¼ã³åºããã¨ã§çæ AI ã¢ããªã±ã¼ã·ã§ã³ãéçºããäºä¾ãç´¹ä»ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fmultimodal-chat-app-with-gemini" title="Geminiã§ãã«ãã¢ã¼ãã«å¯¾å¿ã®çæAIãã£ããã¢ããªãçéã§ä½ã£ã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/multimodal-chat-app-with-gemini">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fgoogle-maps-gemini-review-analysis" title="BigQueryã¨Gemini 1.5 Proã«ããã©ã¼ã¡ã³åºã¯ãã³ãã®å®éåæ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/google-maps-gemini-review-analysis">blog.g-gen.co.jp</a></cite></p>
<h3 id="ãã®ä»ã®ãããã¯ã">ãã®ä»ã®ãããã¯ã</h3>
<p>Google Cloud ã«ã¯ Vertex AI API çµç±ã§ã® Gemini å¼ã³åºãã®ã»ããGemini ãå©ç¨ããå種ãããã¯ããããã¾ãã</p>
<p><strong>Vertex AI Agent Builder</strong> 㯠Vertex AI ã®æ´¾çãããã¯ãã®1ã¤ã§ãããã®ãããã¯ãã® Vertex AI Search æ©è½ã«ãããRAG æ§æï¼çæ AI ã«ããçæãããã³ã³ãã³ãããã¼ã¿ã«ããæ ¹æ ã¥ãããã¢ã¼ããã¯ãã£ï¼ãç°¡åã«æ§æããããGoogle ã¯ãªãªãã£ã®ä¼æ¥ãã¼ã¿æ¤ç´¢ï¼ã¨ã³ã¿ã¼ãã©ã¤ãºãµã¼ãï¼ã容æã«æ§ç¯ã§ãã¾ãã</p>
<p>以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fvertex-ai-search-and-conversation-explained" title="Vertex AI Agent Builderãå¾¹åºè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/vertex-ai-search-and-conversation-explained">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcomparing-rag-architecture-across-cloud-vendors" title="çæAIã®RAGæ§æã大æ3社ï¼AWSãAzureãGoogle Cloudï¼ã§å¾¹åºæ¯è¼ãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/comparing-rag-architecture-across-cloud-vendors">blog.g-gen.co.jp</a></cite></p>
<h3 id="æé-1">æé</h3>
<p>Generative AI on Vertex AI ã§ã® Gemini å©ç¨ã®æéã¯ãå
¥åãããã¼ã¿ã¨åºåãããã¼ã¿ã®ããªã¥ã¼ã ã«å¿ããå¾é課éã§ããåºå®æéã¯çºçãã¾ããã</p>
<p>以ä¸ã¯ãæéå価ã®ä¸é¨æç²ã§ããæ
å ±ã¯2024å¹´12æç¾å¨ã®ãã®ã§ãã®ã§ãå¿
ãææ°ã®å
¬å¼ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<table>
<thead>
<tr>
<th> ã¢ãã« </th>
<th> ã¿ã¤ã </th>
<th> å価ï¼å
¥åãã¼ã¯ã³ã128K以ä¸ã®å ´åï¼</th>
</tr>
</thead>
<tbody>
<tr>
<td> Gemini 1.5 Flash </td>
<td> ããã¹ãå
¥å </td>
<td> $0.00001875 / 1,000 æå </td>
</tr>
<tr>
<td> Gemini 1.5 Flash </td>
<td> ç»åå
¥å </td>
<td> $0.00002 / ç»å </td>
</tr>
<tr>
<td> Gemini 1.5 Flash </td>
<td> ããã¹ãåºå </td>
<td> $0.000075 / 1,000 æå </td>
</tr>
</tbody>
</table>
<ul>
<li>åèï¼<a href="https://cloud.google.com/vertex-ai/generative-ai/pricing?hl=ja#google_models">Vertex AI ã®æé</a></li>
</ul>
<p>ãªããä¸è¬çãªçæ AI åºç¤ã¢ãã«ãµã¼ãã¹ã§ã¯å
¥åãã¼ã¿ã®éããã¼ã¯ã³ã¨ããåä½ã§è¨æ¸¬ãããã¼ã¯ã³åä½ã§ã®èª²éã¨ãªãã¾ããä¸æ¹ã® Gemini ã§ã¯ãå
¥åæåæ°ãç»åã®ææ°ãªã©ã§è¨æ¸¬ããããè¦ç©ããã容æãªã»ããç¹ã«æ¥æ¬èªã«ããã¦ã¯ãã¼ã¯ã³æ°ã§ã®è¨æ¸¬ãããå®ä¾¡ã«ãªãå¾åã«ããã¾ãã</p>
<h2 id="Gemini-API">Gemini API</h2>
<p><figure class="figure-image figure-image-fotolife" title="Gemini API ã§ã¯ Google AI Studio çµç±ã§ Gemini ãå©ç¨"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241221/20241221144043.png" width="1014" height="294" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Gemini API ã§ã¯ Google AI Studio çµç±ã§ Gemini ãå©ç¨</figcaption></figure></p>
<h3 id="Gemini-API-ã¨ã¯">Gemini API ã¨ã¯</h3>
<p><strong>Gemini API</strong> ã¯ãå人å©ç¨ãå°è¦æ¨¡ãããããã¼åãã®ãAPI çµç±ã§ Gemini ã¢ãã«ãå¼ã³åºãå¯è½ãªãããã¯ãã§ããGoogle Cloud ã¨ã¯ç¬ç«ãã¦ãããåä¸ãµã¼ãã¹ã¨ãã¦æä¾ããã¦ãã¾ããGemini API ã¯å©ç¨è¦ç´ã«å¾ããåç¨å©ç¨ãããã¨ãã§ãã¾ãã</p>
<p>Gemini API 㯠<strong>Google AI Studio</strong> ã¨ãã AI éçºç¨ãã©ãããã©ã¼ã çµç±ã§æä¾ããã¦ãããGoogle Cloud ã® Generative AI on Vertex AI ã¨åãã REST API ãã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªçµç±ã§å©ç¨ã§ãã¾ãã</p>
<p>Gemini API ã«ã¯ç¡ææ ããããä¸å®ã®ã¬ã¼ãå¶éã®ãã¨å©ç¨å¯è½ã§ããæåçã¯ããªã¯ã¨ã¹ããçæã³ã³ãã³ãã®ããªã¥ã¼ã ã«åºã¥ããå¾é課éã§ãã</p>
<p>Google Cloud ã¨ã¯ç¬ç«ãã¦ãããããèªè¨¼ã¯ IAM ã§ã¯ãªããGoogle AI Studio ããçºè¡ãã API ãã¼ã§è¡ããã¾ãã</p>
<ul>
<li>åè : <a href="https://ai.google.dev/gemini-api/docs?hl=ja">Gemini API ã使ã£ã¦ã¿ã</a></li>
<li>åè : <a href="https://ai.google.dev/aistudio">Google AI Studio</a></li>
</ul>
<h3 id="ãã¼ã¿ã®ä¿è·-1">ãã¼ã¿ã®ä¿è·</h3>
<p>Gemini API ãç¡ææ ã§å©ç¨ããå ´åãå
¥åãããã¼ã¿ãçæãããã³ã³ãã³ãã¯ãGoogle ã®<strong>ãµã¼ãã¹æ¹åã«å©ç¨ãããã</strong>ã<strong>人éã®ã¬ãã¥ã¯ã¼ã«è¦ããã</strong>å¯è½æ§ãããã¾ããGoogle ã¯ãããå©ç¨è¦ç´ã«æè¨ãã¦ãããæ©å¯æ
å ±ãå人æ
å ±ãéä¿¡ããªããã¨ãæ±ãã¦ãã¾ãã</p>
<p>Gemini API ã®æåçãå©ç¨ããå ´åã¯ãã¼ã¿ãä¿è·ããããµã¼ãã¹æ¹åã«å©ç¨ããããã人éã®ã¬ãã¥ã¯ã¼ã«è¦ããããã¨ã¯ããã¾ããã</p>
<ul>
<li>åè : <a href="https://ai.google.dev/gemini-api/terms?hl=ja">Gemini API 追å å©ç¨è¦ç´</a></li>
</ul>
<h3 id="æé-2">æé</h3>
<p>Google AI Studio çµç±ã§ã® Gemini API ã¯ãå
¥åãããã¼ã¿ã¨åºåãããã¼ã¿ã®ããªã¥ã¼ã ã«å¿ããå¾é課éã§ãããã ããGoogle Cloud ã® Generative AI on Vertex AI ã§å©ç¨ããå ´åã¨ã¯ç°ãªãæéè¨å®ãããã¦ãããæåæ°ãç»åã®ææ°ã§ã¯ãªãããã¼ã¯ã³éã«å¿ãã課éã§ãã</p>
<ul>
<li>åè : <a href="https://ai.google.dev/pricing">æéã¢ãã«</a></li>
</ul>
<h1 id="å°å
¥ãã¹ã-Gemini-ãããã¯ã">å°å
¥ãã¹ã Gemini ãããã¯ã</h1>
<h3 id="çæ-AI-ã§ç¤¾å
æ¥åãå¹çåãããå ´å">çæ AI ã§ç¤¾å
æ¥åãå¹çåãããå ´å</h3>
<p>社å
æ¥åãå¹çåãããå ´åã¯ã<strong>Gemini ã¢ããª</strong>ã <strong>Gemini for Google Workspace</strong> ã®å°å
¥ãæ¤è¨ãã¾ãã</p>
<p>ãããã®ãããã¯ãã«ããã以ä¸ã®ãããªå¹æãæå¾
ã§ãã¾ãã</p>
<ul>
<li>å人ããã¼ã ã®çç£æ§åä¸</li>
<li>ã¡ã¼ã«ãããã¥ã¡ã³ãä½æããã¬ã¼ã³ãã¼ã·ã§ã³ä½æãæ
å ±åéãªã©ãå¹çå</li>
</ul>
<p>ã»ã¨ãã©ã® Google Workspace ã®ã¨ãã£ã·ã§ã³ã§ã¯ Gemini ã¢ããªããã¼ã¿ä¿è·ä»ãã§å©ç¨å¯è½ã«ãªã£ã¦ããã<a href="https://gemini.google.com/">gemini.google.com</a> ã«ã¢ã¯ã»ã¹ãããã¨ã§ããã«æ¥åå©ç¨ãããã¨ãã§ãã¾ãã</p>
<h3 id="èªç¤¾ãã¼ã¿ãå¹ççã«æ¤ç´¢ãããçæ-AI-ã«è³ªåã«çãããããå ´å">èªç¤¾ãã¼ã¿ãå¹ççã«æ¤ç´¢ãããçæ AI ã«è³ªåã«çãããããå ´å</h3>
<p>èªç¤¾ã®å¤§éã®ããã¥ã¡ã³ãé¡ã®ä¸ããå¿
è¦ãªãã¼ã¿ãå¹ççã«æ¤ç´¢ããããçæ AI ã«è¦ç´ããããå ´åãGoogle Cloud ãããã¯ãã®1ã¤ã§ãã<strong>Vertex AI Agent Builder</strong>ï¼Vertex AI Searchï¼ã使ãã¾ãã</p>
<p>èç©ããã大éã®èªç¤¾ãã¼ã¿ããã¨ã«çæ AI ã«ã³ã³ãã³ããçæãããããæ¥æ¬èªã§ã®è³ªåã«çããããããããã¨ãã§ãã¾ãã</p>
<h3 id="èªç¤¾ã®æ°ãµã¼ãã¹ã«çæ-AI-ãçµã¿è¾¼ãå ´å">èªç¤¾ã®æ°ãµã¼ãã¹ã«çæ AI ãçµã¿è¾¼ãå ´å</h3>
<p>èªç¤¾ã®ã¢ããªã«çæ AI ãçµã¿è¾¼ãã ãã顧客ã¸æä¾ãããµã¼ãã¹ã«çæ AI ãæ´»ç¨ãããå ´åã<strong>Generative AI on Vertex AI</strong> ã使ãã¾ãã</p>
<p>èªç¤¾ã¢ããªãã Vertex AI çµç±ã§ Gemini ãå¼ã³åºããããã³ãããå
¥åãã¦ãçæçµæãå¾ããã¨ãã§ãã¾ããã·ã¹ãã éçºã®ç¥èããããã°ãæ©æ¢°å¦ç¿ã®ç¥èããªãã¨ããVertex AI ã Vertex AI Agent Builderï¼Vertex AI Searchï¼ã® API å¼ã³åºãã«ããé«å質ãªæ¤ç´¢ã RAG ãå®ç¾ãããã¨ãã§ãã¾ãã</p>
<h3 id="ã·ã¹ãã éçºãå¹çåãããå ´å">ã·ã¹ãã éçºãå¹çåãããå ´å</h3>
<p>ã·ã¹ãã éçºãå¹çåãããå ´åãã³ã¼ãçæè£å©æ©è½ãªã©ãåãã <strong>Gemini for Google Cloud</strong> ã使ãã¾ãã</p>
<p>Gemini for Google Cloud ã®1æ©è½ã§ãã Gemini Code Assist ã¯ãæé¡ãµãã¹ã¯ãªãã·ã§ã³å¶ã§ãããé«åº¦ãªéçºè£å©æ©è½ãåãã¦ãã¾ãã</p>
<h1 id="ãã¸ãã¹å°å
¥ã«ããã注æç¹">ãã¸ãã¹å°å
¥ã«ããã注æç¹</h1>
<h2 id="çæ-AI-ã®ãã¸ãã¹é©ç¨">çæ AI ã®ãã¸ãã¹é©ç¨</h2>
<p>OpenAI 社ã2022å¹´11æã«çæ AI ãã£ããããã Chat GPT ãå
¬éãã¦ãããç¬ãéã«çæ AI ãã¼ã ãå·»ãèµ·ããã¾ããã2023å¹´ã«ã¯å¤ãã®ä¼æ¥ããçæ AI ã®ãã¸ãã¹å©ç¨ã試ã¿ã PoCï¼Proof of Conceptï¼ãè¡ãã2024å¹´ã«ã¯å®éã«æ¥åã§å©ç¨ããä¼æ¥ãå¢ãã¾ããã</p>
<p>çæ AI ãã¼ã ã«ä¹ãé
ãã¾ãã¨ã2025å¹´ãå¤ãã®ä¼æ¥ãçæ AI ã® PoC ããæ¥åã¸ã®é©ç¨ã試ã¿ããã®ã¨èãããã¾ããããããçæ AI ã¯éã®å¼¾ä¸¸ï¼ä¸è½è¬ï¼ã§ã¯ããã¾ããã以ä¸ã«èª¬æããæ§è³ªãé©åã«ç解ãããã¸ãã¹ã«é©ç¨ãããã¨ãæ¤è¨ãã¦ãã ããã</p>
<h2 id="çæ-AI-ã¯ç¢ºçã¨ã³ã¸ã³ã§ãããã¨ãç解ãã">çæ AI ã¯ç¢ºçã¨ã³ã¸ã³ã§ãããã¨ãç解ãã</h2>
<p>Gemini ãå«ãçæ AI ã¯ã大éã®ãã¼ã¿ããå¦ç¿ãã確ççã«<strong>æããããããåçãçæ</strong>ããã確çã¨ã³ã¸ã³ãã§ãããã®ãããå®ç§ãªåçãè¿ãã¨ã¯éãã¾ããããæ¯ååãã³ã³ãã³ããçæãããã¨ãéãã¾ããã</p>
<p>ãã®ç¹ãç解ããä¸ã§ãGemini ãæ´»ç¨ããæ¥åã¨ããã§ãªãæ¥åãè¦æ¥µããå¿
è¦ãããã¾ãããããç解ãã¦ããªãã¨ã精度åä¸ã«å ±ãããªãå´åã注ãç¶ãããã¨ã«ãªã£ã¦ãã¾ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/transform/ja/prompt-probability-data-and-the-gen-ai-mindset">The Prompt: 確çããã¼ã¿ãããã¦çæ AI ã«åãåããã¤ã³ãã»ããã¨ã¯</a></li>
</ul>
<h2 id="çæ-AI-ã«åãã¦ãæ¥å--åãã¦ãªãæ¥å">çæ AI ã«åãã¦ãæ¥å / åãã¦ãªãæ¥å</h2>
<h3 id="åãã¦ããæ¥å">åãã¦ããæ¥å</h3>
<p>åè¿°ã®æ§è³ªãããçæ AI ã¯ä»¥ä¸ã®ãããªæ¥åé åãå¾æã¨ãã¦ãã¾ãã</p>
<p><strong>åµé çãªä½æ¥</strong><br/>
æ°ããã¢ã¤ãã¢ã®åµåºãæç« ãã³ã¼ãã®ä½æããã¶ã¤ã³ã翻訳ãªã©</p>
<p><strong>æ
å ±åéãåæ</strong><br/>
大éã®ãã¼ã¿ã®è¦ç´ããã¬ã³ãåæãã¬ãã¼ãä½æãªã©</p>
<p><strong>ã³ãã¥ãã±ã¼ã·ã§ã³</strong><br/>
é«åº¦ãªæ£ç¢ºæ§ãæ±ããããªã顧客対å¿ã社å
ã³ãã¥ãã±ã¼ã·ã§ã³ãæè²ãªã©</p>
<p><strong>å復çãªä½æ¥</strong><br/>
ãã¼ã¿å
¥åãè°äºé²ä½æãåç´ãªè³ªåã¸ã®åçãªã©</p>
<h3 id="åãã¦ããªãæ¥å">åãã¦ããªãæ¥å</h3>
<p>å対ã«ã以ä¸ã®ãããªæ¥åã«ã¯åãã¦ãã¾ããã</p>
<p><strong>é«åº¦ãªå¤æãææ決å®</strong><br/>
å°éç¥èãå«ç観ãæ±ããããæ¥å</p>
<p><strong>æ£ç¢ºæ§ãæ±ããããæ¥å</strong><br/>
å»ç診æãéèåå¼ãæ³å¾ç¸è«ãªã©</p>
<p><strong>ã»ãã¥ãªãã£ä¸ãé«åº¦ã«ã»ã³ã·ãã£ããªæ¥å</strong><br/>
éè¦ãªå人æ
å ±ãæ©å¯æ
å ±ãå«ã¿ãé常ã«é«åº¦ãªã»ãã¥ãªãã£ä¸ã®èæ
®ãå¿
è¦ãªæ¥å</p>
<h2 id="ã»ãã¥ãªãã£">ã»ãã¥ãªãã£</h2>
<h3 id="ãã¼ã¿ä¿è·-1">ãã¼ã¿ä¿è·</h3>
<p>çæ AI ã®æ¥åå©ç¨ã§ã¯ãå
¥åããããã³ãããçæãããã³ã³ãã³ãããçæ AI ãµã¼ãã¹æä¾äºæ¥è
ã«ãã£ã¦ã©ãæ±ããããã«åå注æããå¿
è¦ãããã¾ãã</p>
<p>å¤ãã®å ´åãç¡åã®çæ AI ãããã¯ãã§ã¯ãå
¥åºåãã¼ã¿ãäºæ¥è
ã®<strong>ãµã¼ãã¹æ¹åã®ããã«å©ç¨ããã¾ã</strong>ããããé²ãã«ã¯ãæåçãè³¼å
¥ãã<strong>ãªããã¢ã¦ã</strong>ã¨å¼ã°ãããäºæ¥è
ã«ãã£ã¦å
¥åºåãã¼ã¿ããµã¼ãã¹æ¹åã«ç¨ããããªãããã«ããããªãã·ã§ã³ãæå¹åããå¿
è¦ãããã¾ãã</p>
<p>Gemini ã®å ´åãç¡åçã® Gemini ã¢ããªãç¡åçã® Gemini APIï¼Google AI Studioï¼ã§ã¯ãå
¥åºåãã¼ã¿ããµã¼ãã¹æ¹åã«å©ç¨ããããã¨ãå©ç¨è¦ç´ã«æè¨ããã¦ãã¾ãã</p>
<p>ä¸æ¹ã§ãGemini for Google Workspace ã Generative AI on Vertex AIï¼Google Cloudï¼ã§ã¯ãå
¥åºåãã¼ã¿ã«ã¨ã³ã¿ã¼ãã©ã¤ãºã°ã¬ã¼ãã®ãã¼ã¿ä¿è·ãé©ç¨ããããµã¼ãã¹æ¹åãªã©ã«ã¯å©ç¨ããã¾ããã</p>
<p>ãã®ç¹ãããç解ããå©ç¨è¦ç´ãªã©ã確èªãã¦ãã ããã</p>
<h3 id="çæ-AI-ã¢ããªã¸ã®æ»æ">çæ AI ã¢ããªã¸ã®æ»æ</h3>
<p>ç¹ã«èªç¤¾ã¢ããªã«çæ AI ãçµã¿è¾¼ãã§ä¸è¬ã¦ã¼ã¶ã¼åãã«å
¬éããå ´åãçæ AI ã®èå¼±æ§ãçªãæ»æææ³ã§ãã<strong>ããã³ããã¤ã³ã¸ã§ã¯ã·ã§ã³</strong>ãªã©ã«åå注æããå¿
è¦ãããã¾ãã</p>
<p>ããã³ããã¤ã³ã¸ã§ã¯ã·ã§ã³ã¯ãçæ AI ã«æªæãæã£ã¦å·¥å¤«ããããã³ãããæå
¥ããæ¬æ¥ã¦ã¼ã¶ã¼ãããã¹ãã§ã¯ãªãæ
å ±çãçããããææ³ã§ããããã«ãããæ©å¯æ
å ±ãã·ã¹ãã ã®å
é¨æ§é ãæ¼æ´©ãããªã¹ã¯ãããã¾ãã</p>
<p>ãã¢ããªã±ã¼ã·ã§ã³å
é¨æ§é ã«ããããã¼ã¿ã®ã¢ã¯ã»ã¹æ¨©éè¨è¨ããã·ã¹ãã å´ããã³ããã®å·¥å¤«ããã¬ã¹ãã³ã¹ã¸ã®ãã£ã«ã¿è¨å®ããçæ AI ãæ
å½ããæ©è½ç¯å²ã®èª¿æ´ããªã©ãé©åãªå¯¾å¦ãè¡ããã¨ã§ãªã¹ã¯ãä½æ¸ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/responsible-ai?hl=ja">Generative AI on Vertex AI - å®å
¨ã«ä½¿ç¨ããããã®ãã¹ã ãã©ã¯ãã£ã¹</a></li>
<li>åè : <a href="https://ai.google.dev/gemini-api/docs/safety-guidance?hl=ja">Google AI Studio - å®å
¨ã«é¢ããã¬ã¤ãã³ã¹</a></li>
</ul>
<h3 id="ä¸é©åãªçæã³ã³ãã³ã">ä¸é©åãªçæã³ã³ãã³ã</h3>
<p>çæ AI ã¯ç¢ºçè«çãªä»çµã¿ã§ãããããä¸é©åãªçæã³ã³ãã³ããçæãããå¯è½æ§ãå¦å®ã§ãã¾ãããç¹ã«å¤é¨ã«å
¬éããå¯è½æ§ã®ããçæ AI ãçµã¿è¾¼ãã èªç¤¾ã¢ããªã§ã¯ãæ¿æ²»ãå®æãæ§çãªã³ã³ãã³ããå·®å¥çãªçºè¨ããã©ã³ãã¤ã¡ã¼ã¸ãæ¯æãããããªã³ã³ãã³ããªã©ãçæããããªã¹ã¯ãä½æ¸ããå¿
è¦ãããã¾ãã</p>
<p>ã·ã¹ãã ããã³ããã工夫ãããã¨ã§ãããã£ãçæãææ¢ããããGemini ã§ã¯<strong>å®å
¨ãã£ã«ã¿</strong>ã«ãã£ã¦ãã®ãããªã³ã³ãã³ããè¿çããããã¨ãé²ããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/safety-system-instructions?hl=ja">å®å
¨ã«é¢ããã·ã¹ãã æ示</a></li>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters?hl=ja">å®å
¨ãã£ã«ã¿ãæ§æãã</a></li>
</ul>
<h1 id="å°å
¥äºä¾">å°å
¥äºä¾</h1>
<p>æ¥ç¨®ãæ¥æ
ãåãããæ§ã
ãªä¼æ¥ã Gemini ãå°å
¥ããæ¥åå¹çåã顧客æºè¶³åº¦ãåä¸ãã¦ãã¾ããå
·ä½çãªå°å
¥äºä¾ã¯ã以ä¸ã®è¨äºãåèã«ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fg-gen.co.jp%2Fcase-studies%2F21%2F" title="åå¤å±ééæ ªå¼ä¼ç¤¾æ§ - å°å
¥äºä¾ - æ ªå¼ä¼ç¤¾G-genï¼ã¸ã¼ã¸ã§ã³ï¼" class="embed-card embed-webcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://g-gen.co.jp/case-studies/21/">g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fg-gen.co.jp%2Fcase-studies%2F22%2F" title="æ±æ´å»ºè¨æ ªå¼ä¼ç¤¾æ§ - å°å
¥äºä¾ - æ ªå¼ä¼ç¤¾G-genï¼ã¸ã¼ã¸ã§ã³ï¼" class="embed-card embed-webcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://g-gen.co.jp/case-studies/22/">g-gen.co.jp</a></cite></p>
<p>G-gen 社ã®æä¾ãããGenerative AI æ´»ç¨æ¯æ´ã½ãªã¥ã¼ã·ã§ã³ãã§ã¯ãGoogle Cloud ã®ã¹ãã·ã£ãªã¹ãã¨ã³ã¸ãã¢ãã貴社㮠Gemini æ´»ç¨ãæ¯æ´ãã¾ããéçºãå
製åããå ´åã¨ãå¤æ³¨ããå ´åã®ä¸¡æ¹ã§æ´»ç¨ããã ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fg-gen.co.jp%2Fservices%2Fgenerative-ai-utilization-support-solution.html" title="Google Cloud ã§ã¯ããã Generative AI æ´»ç¨æ¯æ´ã½ãªã¥ã¼ã·ã§ã³ - æ ªå¼ä¼ç¤¾G-genï¼ã¸ã¼ã¸ã§ã³ï¼" class="embed-card embed-webcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://g-gen.co.jp/services/generative-ai-utilization-support-solution.html">g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-s-yonekawa/20240109/20240109102504.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ç±³å· ä½æºäºº <a href="https://blog.g-gen.co.jp/archive/author/ggen-s-yonekawa">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ãã©ãããã©ã¼ã ã¨ã³ã¸ãã¢ãªã³ã°æ¬é¨ å¶æ¥é¨ å¶æ¥2課 å
¼ ç²ããäºæ¥æ</p>
<p class="sw-profile__txt">2022å¹´7æã«G-genã«ã¸ã§ã¤ã³ã
<p class="sw-profile__txt">ã¢ããã¼ã¯ãã¯ã©ã¦ãã§ãé¢è¥¿ãããã£ã¨åããããã</p>
<p class="sw-profile__txt">課é¡è§£æ±ºã«åããææ¡ï¼ã客æ§ã¨ã®ä¼´èµ°ããã¸ã§ã¯ãã«ã¢ããã¼ã·ã§ã³ãæããæ¥ã
ãç¾å¨ Google Cloud å
¨è³æ ¼ã³ã³ããªã¼ãç®æãã¦å¥®éä¸ï¼ãã¨1ã¤ï¼ãã§ãããæ¬è·ã¯ å
ã®æ¦å£«@FFXIV ã§ãã</p>
</div>
</div>
</div>
</div>
ggen-s-yonekawa
Microsoft TeamsããGoogle Chatã¸ã®ãã¼ã¿ç§»è¡ãæ¤è¨¼ãã¦ã¿ã
hatenablog://entry/6802418398313085167
2024-12-23T09:00:00+09:00
2024-12-23T09:32:03+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯2024å¹´12æ17æ¥ã«ãã¼ã¿çã¨ãã¦å
¬éããã Microsoft Teams ãã Google Chat ã¸ã®ç§»è¡ãã¼ã«ã®æ¤è¨¼çµæããç´¹ä»ãã¾ãã æ¦è¦ Microsoft Teams ããã®ãã¼ã¿ç§»è¡ ã¨ã¯ åææ¡ä»¶ å¶ç´ æ¤è¨¼æ¦è¦ æ¤è¨¼ç°å¢ æ¤è¨¼ã®æµã è¨å®æé [Microsoft 365] Teams ã®ã°ã«ã¼ã ID ãç¢ºèª [Google Workspace] 移è¡ç¨ã® csv ãã¡ã¤ã«ã®æºå [Google Workspace] ãã¼ã¿ç§»è¡ã®å®æ½ [Microsoft 365] 移è¡å¾ã«ãTeams ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡ [Googleâ¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯2024å¹´12æ17æ¥ã«ãã¼ã¿çã¨ãã¦å
¬éããã Microsoft Teams ãã Google Chat ã¸ã®ç§»è¡ãã¼ã«ã®æ¤è¨¼çµæããç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a><ul>
<li><a href="#Microsoft-Teams-ããã®ãã¼ã¿ç§»è¡-ã¨ã¯">Microsoft Teams ããã®ãã¼ã¿ç§»è¡ ã¨ã¯</a></li>
<li><a href="#åææ¡ä»¶">åææ¡ä»¶</a></li>
<li><a href="#å¶ç´">å¶ç´</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼æ¦è¦">æ¤è¨¼æ¦è¦</a><ul>
<li><a href="#æ¤è¨¼ç°å¢">æ¤è¨¼ç°å¢</a></li>
<li><a href="#æ¤è¨¼ã®æµã">æ¤è¨¼ã®æµã</a></li>
</ul>
</li>
<li><a href="#è¨å®æé ">è¨å®æé </a><ul>
<li><a href="#Microsoft-365-Teams-ã®ã°ã«ã¼ã-ID-ã確èª">[Microsoft 365] Teams ã®ã°ã«ã¼ã ID ã確èª</a></li>
<li><a href="#Google-Workspace-移è¡ç¨ã®-csv-ãã¡ã¤ã«ã®æºå">[Google Workspace] 移è¡ç¨ã® csv ãã¡ã¤ã«ã®æºå</a></li>
<li><a href="#Google-Workspace-ãã¼ã¿ç§»è¡ã®å®æ½">[Google Workspace] ãã¼ã¿ç§»è¡ã®å®æ½</a></li>
<li><a href="#Microsoft-365-移è¡å¾ã«Teams-ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡">[Microsoft 365] 移è¡å¾ã«ãTeams ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡</a></li>
<li><a href="#Google-Workspace-å·®å移è¡ã®å®æ½">[Google Workspace] å·®å移è¡ã®å®æ½</a></li>
<li><a href="#Google-Workspace-移è¡ãå®äºãã¹ãã¼ã¹ãå±é">[Google Workspace] 移è¡ãå®äºããã¹ãã¼ã¹ãå±é</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223093150.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<h2 id="Microsoft-Teams-ããã®ãã¼ã¿ç§»è¡-ã¨ã¯">Microsoft Teams ããã®ãã¼ã¿ç§»è¡ ã¨ã¯</h2>
<p><strong>Teams ããã®ã¡ãã»ã¼ã¸ã®ç§»è¡</strong>æ©è½ã¯ãGoogle Workspace ã®ç®¡çæ©è½ã§ãããMicrosoft Teamsï¼ä»¥ä¸ãTeamsï¼ã®ãã£ã³ãã«ã®ã¡ãã»ã¼ã¸ã Google Chatï¼ä»¥ä¸ãChatï¼ã®ã¹ãã¼ã¹ã«ç§»è¡ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15010566?hl=ja">Teams ããã®ã¡ãã»ã¼ã¸ã®ç§»è¡ã«ã¤ãã¦ï¼ãã¼ã¿çï¼</a></li>
</ul>
<h2 id="åææ¡ä»¶">åææ¡ä»¶</h2>
<p>2024å¹´12æç¾å¨ãæ¬æ©è½ã¯ãã¼ã¿çã§ãããæ£å¼ãªãªã¼ã¹ããã¦ãã¾ããããã¼ã¿çæ©è½ã®<strong>æ¬çªç°å¢ã§ã®å©ç¨ã¯éæ¨å¥¨</strong>ã®ããããã¹ããæ¤è¨¼ã§ä½¿ç¨ãã¦ãã ããã詳細ã¯ä»¥ä¸ã®å©ç¨è¦ç´ãã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://workspace.google.com/terms/service-terms">Google Workspace ãµã¼ãã¹åºæã®å©ç¨è¦ç´</a></li>
</ul>
<p>å½æ©è½ã§ç§»è¡ãå®æ½ããã«ã¯ãGoogle Workspace å´ã§ã¯ç¹æ¨©ç®¡çè
ãã¼ã«ããTeams å´ã§ã¯ã°ãã¼ãã«ç®¡çè
ãã¼ã«ãå¿
è¦ã§ãã</p>
<h2 id="å¶ç´">å¶ç´</h2>
<p>å½æ©è½ã«ã¯ä»¥ä¸ã®ãããªå¶éãããã¾ãã</p>
<ul>
<li>ãã¼ã å
ã®ã¡ãã»ã¼ã¸ã®ã¿ç§»è¡å¯è½ã§ããã¦ã¼ã¶ã¼éã®åå¥ãã£ããããã¤ã¬ã¯ãã¡ãã»ã¼ã¸ã¯ç§»è¡ã§ãã¾ããã</li>
<li>Teams ã®ããã¼ã ã㯠Chat ã®ãã¹ãã¼ã¹ãã«å¤æããã¾ãããã ããå
ã®æ¨©éï¼æ¨æºããã©ã¤ãã¼ãï¼ã¯ãã¹ã¦å¶éä»ãã¹ãã¼ã¹ã«å¤æããã¾ããå¶éä»ãã¹ãã¼ã¹ã¯å¾ããå¤æ´å¯è½ã§ãã</li>
</ul>
<p>移è¡ã«é¢ããå¶éã®è©³ç´°ã¯ã以ä¸å
¬å¼ããã¥ã¡ã³ããã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15011136?hl=ja">ãã£ããã®ç§»è¡ã§ç§»è¡ããããã¼ã¿ï¼ãã¼ã¿çï¼</a></li>
</ul>
<h1 id="æ¤è¨¼æ¦è¦">æ¤è¨¼æ¦è¦</h1>
<h2 id="æ¤è¨¼ç°å¢">æ¤è¨¼ç°å¢</h2>
<p>æ¤è¨¼ç°å¢ã¯ä»¥ä¸ã®ã¨ããã§ããå®éã®ç§»è¡ã±ã¼ã¹ãæ³å®ããTeams 㨠Chat ã®ãã¡ã¤ã³ããã³ã¦ã¼ã¶ã¼æ
å ±ãçµ±ä¸ããç°å¢ã§æ¤è¨¼ãã¾ããã</p>
<table>
<thead>
<tr>
<th> ãã©ãããã©ã¼ã </th>
<th> ãã¡ã¤ã³å </th>
<th> ã¦ã¼ã¶ã¼å </th>
<th> ã©ã¤ã»ã³ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Google Workspace </td>
<td> miurak-test.com </td>
<td> [email protected] </td>
<td> Google Workspace Business Standard </td>
</tr>
<tr>
<td> Microsoft 365 </td>
<td> miurak-test.com </td>
<td> [email protected] </td>
<td> Microsoft 365 Business Basic </td>
</tr>
</tbody>
</table>
<p>Teams ã®ãã¼ã ã¯ä»¥ä¸ã®ã¨ããã§ãã</p>
<table>
<thead>
<tr>
<th> 親ãã£ã¬ã¯ã㪠</th>
<th> ãã¼ã å </th>
<th> ç¨®é¡ </th>
<th> ææè
</th>
</tr>
</thead>
<tbody>
<tr>
<td> æ¢å®ã®ãã£ã¬ã¯ã㪠</td>
<td> ä¸è¬ </td>
<td> æ¨æº </td>
<td> [email protected] </td>
</tr>
<tr>
<td> æ¢å®ã®ãã£ã¬ã¯ã㪠</td>
<td> teams-channel-private </td>
<td> ãã©ã¤ãã¼ã </td>
<td> [email protected] </td>
</tr>
<tr>
<td> æ¢å®ã®ãã£ã¬ã¯ã㪠</td>
<td> teams-channel-public </td>
<td> æ¨æº </td>
<td> [email protected] </td>
</tr>
</tbody>
</table>
<p><figure class="figure-image figure-image-fotolife" title="ãã¼ã è¨å®"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090005.png" width="566" height="469" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¼ã è¨å®</figcaption></figure></p>
<h2 id="æ¤è¨¼ã®æµã">æ¤è¨¼ã®æµã</h2>
<p>以ä¸ã®æé ã§ãã¼ã¿ã®ç§»è¡ãå®æ½ãã¾ãã</p>
<table>
<thead>
<tr>
<th> é
ç® </th>
<th> ä½æ¥ </th>
<th> ãã©ãããã©ã¼ã </th>
</tr>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td> Teams ã®ã°ã«ã¼ã ID ãç¢ºèª </td>
<td> Microsoft 365 </td>
</tr>
<tr>
<td> 2 </td>
<td> 移è¡ç¨ã® csv ãã¡ã¤ã«ã®æºå </td>
<td> Google Workspace </td>
</tr>
<tr>
<td> 3 </td>
<td> ãã¼ã¿ç§»è¡ã®å®æ½ </td>
<td> Google Workspace </td>
</tr>
<tr>
<td> 4 </td>
<td> 移è¡å¾ã«ãTeams ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡ </td>
<td> Microsoft 365 </td>
</tr>
<tr>
<td> 5 </td>
<td> å·®å移è¡ã®å®æ½ </td>
<td> Google Workspace </td>
</tr>
<tr>
<td> 6 </td>
<td> 移è¡ãå®äºããã¹ãã¼ã¹ãå±é </td>
<td> Google Workspace </td>
</tr>
</tbody>
</table>
<h1 id="è¨å®æé ">è¨å®æé </h1>
<h2 id="Microsoft-365-Teams-ã®ã°ã«ã¼ã-ID-ã確èª">[Microsoft 365] Teams ã®ã°ã«ã¼ã ID ã確èª</h2>
<p>Microsoft Teams 管çã»ã³ã¿ã¼ï¼<a href="https://admin.teams.microsoft.com">https://admin.teams.microsoft.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://learn.microsoft.com/ja-jp/microsoftteams/manage-teams-in-modern-portal">Microsoft Teams 管çã»ã³ã¿ã¼ã§ãã¼ã ã管çãã</a></li>
</ul>
<p>[Teams] > [ãã¼ã ã管ç] > [ã¨ã¯ã¹ãã¼ã] ããããã¼ã æ
å ±ã csv å½¢å¼ã§ã¨ã¯ã¹ãã¼ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¨ã¯ã¹ãã¼ããé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090011.png" width="800" height="232" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¨ã¯ã¹ãã¼ããé¸æ</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ã¨ã¯ã¹ãã¼ããå®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090014.png" width="375" height="144" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¨ã¯ã¹ãã¼ããå®è¡</figcaption></figure></p>
<p>csv ã確èªãã<strong>Groups Id</strong> ãæ§ãã¦ãã ããã
<figure class="figure-image figure-image-fotolife" title="ã°ã«ã¼ãIDã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090017.png" width="800" height="243" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã°ã«ã¼ãIDã®ç¢ºèª</figcaption></figure></p>
<h2 id="Google-Workspace-移è¡ç¨ã®-csv-ãã¡ã¤ã«ã®æºå">[Google Workspace] 移è¡ç¨ã® csv ãã¡ã¤ã«ã®æºå</h2>
<p>Google Workspace ã®ç®¡çã³ã³ã½ã¼ã«ï¼<a href="https://admin.google.com">https://admin.google.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/182076?hl=ja">管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãã</a></li>
</ul>
<p>[ãã¼ã¿] > [ãã¼ã¿ã®ã¤ã³ãã¼ãã¨ã¨ã¯ã¹ãã¼ã] > [ãã¼ã¿ç§»è¡ï¼æ°è¦ï¼] ã¸ç§»åããã¹ããã 2 ã® [ãµã³ãã« csv ããã¦ã³ãã¼ã] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="移è¡ç¨ã®ãµã³ãã« csv ã®ãã¦ã³ãã¼ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090020.png" width="701" height="539" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>移è¡ç¨ã®ãµã³ãã« csv ã®ãã¦ã³ãã¼ã</figcaption></figure></p>
<p>ãã¦ã³ãã¼ããã csv ãéãã<strong>Source MicrosoftTeamsID</strong> ã®ç®æã«ãåã®æé ã§ç¢ºèªãã Teams ã® <strong>Groups Id</strong> ãå
¥åããä¿åãã¾ãã
<figure class="figure-image figure-image-fotolife" title="移è¡ç¨ã® csv ãã¡ã¤ã«ã®ç·¨é"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090024.png" width="453" height="335" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>移è¡ç¨ã® csv ãã¡ã¤ã«ã®ç·¨é</figcaption></figure></p>
<h2 id="Google-Workspace-ãã¼ã¿ç§»è¡ã®å®æ½">[Google Workspace] ãã¼ã¿ç§»è¡ã®å®æ½</h2>
<p>ãã£ããã®ç§»è¡ã® [ã¹ããã 1] 㧠[Microsoft ã¢ã«ã¦ã³ãã«æ¥ç¶] ãé¸æãã移è¡ãã¼ã«ã«æ¨©éãä»ä¸ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Microsoftã¢ã«ã¦ã³ãã«æ¥ç¶"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090026.png" width="511" height="246" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Microsoftã¢ã«ã¦ã³ãã«æ¥ç¶</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="Microsoftã¢ã«ã¦ã³ããé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090029.png" width="315" height="277" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Microsoftã¢ã«ã¦ã³ããé¸æ</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ã¯ã»ã¹è¨±å¯å
容ã確èªãã¦æ¿è«¾"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090032.png" width="326" height="531" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹è¨±å¯å
容ã確èªãã¦æ¿è«¾</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="æ¥ç¶ã確èª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090035.png" width="468" height="194" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¥ç¶ã確èª</figcaption></figure></p>
<p>[ã¹ããã 2] ã® [移è¡ãããã® csv ãã¢ãããã¼ã] ãé¸æããåã®æé ã§ä½æãã csv ãã¡ã¤ã«ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ä½æããcsvã®ã¢ãããã¼ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090038.png" width="620" height="505" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ä½æããcsvã®ã¢ãããã¼ã</figcaption></figure></p>
<p>[ã¹ããã 3] ã¯ãTeams 㨠Chat ã®ã¦ã¼ã¶ã¼åãç°ãªãå ´åã®ã¿å®æ½ãã¾ããä»åã¯åããããçç¥ãã¾ãã</p>
<p>ä¾: Microsoft 365 ã®ã¦ã¼ã¶ã¼ã <code>[email protected]</code> ã§ããã®ã¦ã¼ã¶ã¼ã Google Workspace ã® <code>[email protected]</code> ã«é¢é£ä»ãããå ´åã«å®æ½ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¦ã¼ã¶ã¼IDã®é¢é£ä»ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090049.png" width="800" height="236" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¦ã¼ã¶ã¼IDã®é¢é£ä»ã</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15009958?hl=ja#zippy=%2C%E3%82%B9%E3%83%86%E3%83%83%E3%83%97-id-%E3%83%9E%E3%83%83%E3%83%97%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%A6%E3%82%A2%E3%83%83%E3%83%97%E3%83%AD%E3%83%BC%E3%83%89%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%AA%E5%A0%B4%E5%90%88">ã¹ããã 4: ID ããããä½æãã¦ã¢ãããã¼ãããï¼å¿
è¦ãªå ´åï¼</a></li>
</ul>
<p>[ã¹ããã 4] ã§ä»¥ä¸ãé¸æã㦠[ä¿å] ãã¦ãã ããã</p>
<ul>
<li>ã¡ãã»ã¼ã¸ã®ç§»è¡éå§æ¥ï¼Teams ã®ã¡ãã»ã¼ã¸ã Chat ã¸ç§»è¡ããéå§æ¥ãé¸æãã¾ãã</li>
<li>ãããã³ã°ããã¦ããªã IDï¼æå¹å
<ul>
<li>ID ã®ç§»è¡å
ãã¡ã¤ã³ãä¿æããï¼Teams 㨠Chat ã®ãã¡ã¤ã³ãåãå ´åã¯ãã¡ããé¸æ</li>
<li>ID ã«ã¿ã¼ã²ãããã¡ã¤ã³ã使ç¨ããï¼Teams 㨠Chat ã®ãã¡ã¤ã³ãç°ãªãå ´åã¯ãã¡ããé¸æ</li>
</ul>
</li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="移è¡è¨å®ã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090041.png" width="800" height="406" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>移è¡è¨å®ã®é¸æ</figcaption></figure></p>
<p>[ã¹ããã 5] ã® [移è¡ãéå§] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="移è¡ã®éå§"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090045.png" width="800" height="186" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>移è¡ã®éå§</figcaption></figure></p>
<p>移è¡ãå®äºãããã¨ã確èªãã¾ãã詳細㯠[移è¡ã¬ãã¼ã] ã¾ã㯠[æ¦è¦ã¬ãã¼ã] ãã¨ã¯ã¹ãã¼ããããã¨ã§ç¢ºèªã§ãã¾ãã</p>
<p>â» ãã®æç¹ã§ã¯ãã¦ã¼ã¶ã¼å´ã«ç§»è¡ããã¹ãã¼ã¹ã¯è¡¨ç¤ºããã¾ãããå·®åãå«ãã移è¡ä½æ¥ããã¹ã¦å®äºããæå¾ã« [ã¹ãã¼ã¹ããã¼ã«ã¢ã¦ã] ãããã¨ã§è¡¨ç¤ºããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="移è¡å®äºç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090052.png" width="800" height="386" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>移è¡å®äºç¢ºèª</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="æ¦è¦ã¬ãã¼ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090055.png" width="800" height="161" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¦è¦ã¬ãã¼ã</figcaption></figure></p>
<h2 id="Microsoft-365-移è¡å¾ã«Teams-ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡">[Microsoft 365] 移è¡å¾ã«ãTeams ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡</h2>
<p>ãã¼ã¿ã®ç§»è¡å¾ã« Teams ã®ãã£ã³ãã«ã§æ°è¦ã®ã¡ãã»ã¼ã¸ãéä¿¡ãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å·®åæ¤ç¥ç¨ã®ã¡ãã»ã¼ã¸"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090058.png" width="662" height="385" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å·®åæ¤ç¥ç¨ã®ã¡ãã»ã¼ã¸</figcaption></figure></p>
<h2 id="Google-Workspace-å·®å移è¡ã®å®æ½">[Google Workspace] å·®å移è¡ã®å®æ½</h2>
<p>ãã£ããã®ç§»è¡ãã [ã¹ããã 5] ã® [å·®å移è¡ãå®è¡] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å·®å移è¡ãå®æ½"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090102.png" width="800" height="101" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å·®å移è¡ãå®æ½</figcaption></figure></p>
<p>å¦çãæåãããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å·®å移è¡ã®æå"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090114.png" width="800" height="328" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å·®å移è¡ã®æå</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="æ¦è¦ã¬ãã¼ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090117.png" width="800" height="162" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¦è¦ã¬ãã¼ã</figcaption></figure></p>
<h2 id="Google-Workspace-移è¡ãå®äºãã¹ãã¼ã¹ãå±é">[Google Workspace] 移è¡ãå®äºããã¹ãã¼ã¹ãå±é</h2>
<p>ãã¹ã¦ã®ç§»è¡ãå®äºãããã[ã¹ãã¼ã¹ããã¼ã«ã¢ã¦ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¹ãã¼ã¹ã®ãã¼ã«ã¢ã¦ããå®æ½"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090105.png" width="800" height="126" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¹ãã¼ã¹ã®ãã¼ã«ã¢ã¦ããå®æ½</figcaption></figure></p>
<p>注æäºé
ã確èªããããã§ã[ã¹ãã¼ã¹ããã¼ã«ã¢ã¦ã] ãå®è¡ãã¾ãããã®æä½ãè¡ãã¨ãTeams å´ã§æ°ãã«è¿½å ãããã¡ãã»ã¼ã¸ãå¤æ´å
容㯠Chat ã«ç§»è¡ããã¾ãããäºåã«ååã«ç¢ºèªããããã§é²ãã¦ãã ããã</p>
<p>注æäºé
ã確èªããããã§ã[ã¹ãã¼ã¹ããã¼ã«ã¢ã¦ã] ãå®è¡ãã¾ããç¹ã«ä»¥ä¸ã®ç¹ã«ã注æãã ãã</p>
<ul>
<li>ãã®æä½ã¯ã移è¡éå§ãã30æ¥ä»¥å
ã«å®äºããå¿
è¦ãããã¾ãã
<ul>
<li>30æ¥ãéããã¨ã移è¡ãæåããããç´ãå¿
è¦ãããã¾ãã</li>
</ul>
</li>
<li>ãã¼ã«ã¢ã¦ãå¾ãTeams å´ã§ã®ã¡ãã»ã¼ã¸ãå¤æ´ã¯å移è¡ã§ãã¾ããã</li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="注æäºé
ã®ç¢ºèªã¨ãã¼ã«ã¢ã¦ãå®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090108.png" width="533" height="300" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>注æäºé
ã®ç¢ºèªã¨ãã¼ã«ã¢ã¦ãå®è¡</figcaption></figure></p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15064266?hl=ja&ref_topic=15316138&sjid=8562262943053197089-AP#zippy=%2C%E6%89%8B%E9%A0%86-%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%8C%E3%82%B9%E3%83%9A%E3%83%BC%E3%82%B9%E3%81%A8%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%82%92%E5%88%A9%E7%94%A8%E3%81%A7%E3%81%8D%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B">æé 3: ã¦ã¼ã¶ã¼ãã¹ãã¼ã¹ã¨ã¡ãã»ã¼ã¸ãå©ç¨ã§ããããã«ãã</a></li>
</ul>
<p>ã¹ãã¼ã¹ã®å
¬éãå®äºãããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å
¬é確èª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090111.png" width="800" height="128" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å
¬é確èª</figcaption></figure></p>
<p>Chat ã確èªããå·®åç¨ã®ã¡ãã»ã¼ã¸ãå«ãã¦ç§»è¡ã§ãããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="Google Chat ã§ã®ãã¼ã¿ç§»è¡ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223090120.png" width="800" height="461" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Google Chat ã§ã®ãã¼ã¿ç§»è¡ç¢ºèª</figcaption></figure></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
ã¤ã³ãã³ããªã¬ãã¼ãã使ã£ãGoogle ãã©ã¤ãã®ã»ãã¥ãªãã£ãªã¹ã¯ç®¡ç
hatenablog://entry/6802418398306504165
2024-12-20T09:00:00+09:00
2024-12-23T09:33:30+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãGoogle ãã©ã¤ãã®ã¤ã³ãã³ããªã¬ãã¼ãæ©è½ã使ã£ãã»ãã¥ãªãã£ãªã¹ã¯ã®ç®¡çæ¹æ³ãç´¹ä»ãã¾ãã æ¦è¦ ãã©ã¤ãã¤ã³ãã³ããªã¨ã¯ åææ¡ä»¶ è¨å®ã®æ¦è¦ è¨å®æé [Google Cloud] BigQuery ãã¼ã¿ã»ããã®ä½æ [Google Workspace] ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å [Google Cloud] ã¬ãã¼ããã¼ã¿ã®ç¢ºèª ãã¼ã¿æ½åºä¾ ãµã³ãã«ã¯ã¨ãªâ ï¼ã¢ã¯ã»ã¹æ¨©ãããªã³ã¯ãç¥ã£ã¦ããã¤ã³ã¿ã¼ãããä¸ã®èª°ããã¢ã¯ã»ã¹ã§ããããã¡ã¤ã«ã®æ½åº ãµã³ãã«ã¯ã¨ãªâ¡ï¼ç¹å®ã®ã¦ã¼ã¶ã¼ããªã¼ãã¼ã¨ãªã£ã¦ãããã¡ã¤ã«ãæ½åºï¼ãã¤ãã©ã¤ããå«ãï¼ â¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãGoogle ãã©ã¤ãã®ã¤ã³ãã³ããªã¬ãã¼ãæ©è½ã使ã£ãã»ãã¥ãªãã£ãªã¹ã¯ã®ç®¡çæ¹æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a><ul>
<li><a href="#ãã©ã¤ãã¤ã³ãã³ããªã¨ã¯">ãã©ã¤ãã¤ã³ãã³ããªã¨ã¯</a></li>
<li><a href="#åææ¡ä»¶">åææ¡ä»¶</a></li>
</ul>
</li>
<li><a href="#è¨å®ã®æ¦è¦">è¨å®ã®æ¦è¦</a></li>
<li><a href="#è¨å®æé ">è¨å®æé </a><ul>
<li><a href="#Google-Cloud-BigQuery-ãã¼ã¿ã»ããã®ä½æ">[Google Cloud] BigQuery ãã¼ã¿ã»ããã®ä½æ</a></li>
<li><a href="#Google-Workspace-ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å">[Google Workspace] ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å</a></li>
<li><a href="#Google-Cloud-ã¬ãã¼ããã¼ã¿ã®ç¢ºèª">[Google Cloud] ã¬ãã¼ããã¼ã¿ã®ç¢ºèª</a></li>
</ul>
</li>
<li><a href="#ãã¼ã¿æ½åºä¾">ãã¼ã¿æ½åºä¾</a><ul>
<li><a href="#ãµã³ãã«ã¯ã¨ãªã¢ã¯ã»ã¹æ¨©ããªã³ã¯ãç¥ã£ã¦ããã¤ã³ã¿ã¼ãããä¸ã®èª°ããã¢ã¯ã»ã¹ã§ãããã¡ã¤ã«ã®æ½åº">ãµã³ãã«ã¯ã¨ãªâ ï¼ã¢ã¯ã»ã¹æ¨©ãããªã³ã¯ãç¥ã£ã¦ããã¤ã³ã¿ã¼ãããä¸ã®èª°ããã¢ã¯ã»ã¹ã§ããããã¡ã¤ã«ã®æ½åº</a></li>
<li><a href="#ãµã³ãã«ã¯ã¨ãªç¹å®ã®ã¦ã¼ã¶ã¼ããªã¼ãã¼ã¨ãªã£ã¦ãããã¡ã¤ã«ãæ½åºãã¤ãã©ã¤ããå«ã">ãµã³ãã«ã¯ã¨ãªâ¡ï¼ç¹å®ã®ã¦ã¼ã¶ã¼ããªã¼ãã¼ã¨ãªã£ã¦ãããã¡ã¤ã«ãæ½åºï¼ãã¤ãã©ã¤ããå«ãï¼</a></li>
<li><a href="#ãµã³ãã«ã¯ã¨ãªçµç¹å¤ã®ãã¡ã¤ã³ã¨å
±æããã¦ãããã¡ã¤ã«ãæ½åº">ãµã³ãã«ã¯ã¨ãªâ¢ï¼çµç¹å¤ã®ãã¡ã¤ã³ã¨å
±æããã¦ãããã¡ã¤ã«ãæ½åº</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241223/20241223093312.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<h2 id="ãã©ã¤ãã¤ã³ãã³ããªã¨ã¯">ãã©ã¤ãã¤ã³ãã³ããªã¨ã¯</h2>
<p>Google ãã©ã¤ãã®<strong>ã¤ã³ãã³ããªã¬ãã¼ãæ©è½</strong>ã¯ãçµç¹å
ã® Google ãã©ã¤ããå
±æãã©ã¤ãã®å©ç¨ç¶æ³ãææ¡ãã管çè
ããã¼ã¿ãç£æ»ã»ç®¡çããããã®æ©è½ã§ãã</p>
<p>ãã®æ©è½ã使ãã°ããã©ã¤ãå
ã®ãã¡ã¤ã«æ
å ±ãã¢ã¯ã»ã¹æ¨©ãæ´æ°æ¥æãé±æ¬¡ã§ BigQuery ã«ã¨ã¯ã¹ãã¼ãã§ãã¾ããããã«ããã<strong>ãã¼ã¿æ¼æ´©ãªã¹ã¯ã®è»½æ¸</strong>ã<strong>å©ç¨ç¶æ³ã®å¯è¦å</strong>ãå¯è½ã§ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/topic/15486865?hl=ja">BigQuery ã®ãã©ã¤ã ã¤ã³ãã³ããª</a></li>
<li>åè : <a href="https://support.google.com/a/answer/15485686?hl=ja#zippy=%2C%E3%82%B9%E3%82%AD%E3%83%BC%E3%83%9E%E3%81%A8%E5%AE%9A%E7%BE%A9">ãã©ã¤ãã®ã¤ã³ãã³ããªã®ã¨ã¯ã¹ãã¼ã ã¹ãã¼ã</a></li>
</ul>
<h2 id="åææ¡ä»¶">åææ¡ä»¶</h2>
<p>ãã©ã¤ãã¤ã³ãã³ããªã¬ãã¼ãæ©è½ã¯ã以ä¸ã® Google Workspace ã¨ãã£ã·ã§ã³ã§ä½¿ç¨ã§ãã¾ãã</p>
<ul>
<li>Enterprise Standard</li>
<li>Enterprise Plus</li>
<li>Education Standard</li>
<li>Education Plus</li>
<li>Enterprise Essentials Plus</li>
<li>Cloud Identity Premium</li>
</ul>
<p>詳細ã¯ä»¥ä¸ã®ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15141054?hl=ja">çµç¹ã®ãã©ã¤ãã®ã¤ã³ãã³ããªãã¨ã¯ã¹ãã¼ããã</a></li>
</ul>
<h1 id="è¨å®ã®æ¦è¦">è¨å®ã®æ¦è¦</h1>
<p>以ä¸ã®æé ã§ã¤ã³ãã³ããªã¬ãã¼ããè¨å®ããåä½ã確èªãã¾ãã</p>
<table>
<thead>
<tr>
<th> é çª </th>
<th> ä½æ¥å ´æ </th>
<th> ä½æ¥å </th>
<th> å
容 </th>
</tr>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td> Google Cloud </td>
<td> BigQuery ãã¼ã¿ã»ããä½æ </td>
<td> ã¤ã³ãã³ããªã¬ãã¼ããã¨ã¯ã¹ãã¼ããã BigQuery ãã¼ã¿ã»ãããä½æãã¾ãã </td>
</tr>
<tr>
<td> 2 </td>
<td> Google Workspace </td>
<td> ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å </td>
<td> ã¤ã³ãã³ããªã¬ãã¼ããæå¹åãã¾ãã </td>
</tr>
<tr>
<td> 3 </td>
<td> Google Cloud </td>
<td> ã¬ãã¼ããã¼ã¿ã®ç¢ºèª </td>
<td> BigQuery ã«ã¨ã¯ã¹ãã¼ãããããã¼ã¿ã確èªãã¾ãã </td>
</tr>
</tbody>
</table>
<h1 id="è¨å®æé ">è¨å®æé </h1>
<h2 id="Google-Cloud-BigQuery-ãã¼ã¿ã»ããã®ä½æ">[Google Cloud] BigQuery ãã¼ã¿ã»ããã®ä½æ</h2>
<p>BigQuery ã®ãã¼ã¿ã»ãããä½æãã¾ããGoogle Workspace ã§<strong>ãã¼ã¿ ãªã¼ã¸ã§ã³ ããªã·ã¼</strong>ã使ç¨ãã¦ããå ´åã¯ãBigQuery ã®ãªã¼ã¸ã§ã³ãããªã·ã¼ã§æå®ãããªã¼ã¸ã§ã³ã¨åä¸ã«ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/14310028?hl=ja">ãã¼ã¿ã®å°ççãªå ´æãé¸æãã</a></li>
</ul>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ç°å¢å¤æ°ãè¨å®</span>
<span class="synIdentifier">PROJECT_ID</span>=<span class="synStatement">"</span><span class="synConstant">my_project</span><span class="synStatement">"</span> <span class="synComment"># Google Cloud ããã¸ã§ã¯ã ID ãè¨å®</span>
<span class="synIdentifier">BQ_DATASET</span>=<span class="synStatement">"</span><span class="synConstant">my_dataset</span><span class="synStatement">"</span> <span class="synComment"># BigQuery ã®ãã¼ã¿ã»ããåãè¨å®</span>
<span class="synIdentifier">BQ_LOCATION</span>=<span class="synStatement">"</span><span class="synConstant">US</span><span class="synStatement">"</span> <span class="synComment"># BigQuery ã®ãªã¼ã¸ã§ã³ãè¨å®</span>
<span class="synIdentifier">GWS_USER</span>=<span class="synStatement">"</span><span class="synConstant">[email protected]</span><span class="synStatement">"</span> <span class="synComment"># Google Workspace 管çè
ã¢ã«ã¦ã³ããè¨å®</span>
ã
<span class="synComment"># BigQuery ãã¼ã¿ã»ãããä½æ</span>
bq <span class="synSpecial">--project_id</span><span class="synStatement">=</span><span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
mk <span class="synSpecial">--location</span><span class="synStatement">=</span><span class="synPreProc">$BQ_LOCATION</span> <span class="synStatement">\</span>
<span class="synPreProc">$BQ_DATASET</span>
ã
<span class="synComment"># Google Workspace 管çè
ã¢ã«ã¦ã³ãã« BigQuery ã®ç·¨é権éãä»ä¸</span>
gcloud projects add-iam-policy-binding <span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">user:</span><span class="synPreProc">$GWS_USER</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synConstant">roles/bigquery.dataEditor</span><span class="synStatement">"</span>
ã
<span class="synComment"># Google Workspace 管çè
ã¢ã«ã¦ã³ãã« IAM ã®ç®¡ç権éãä»ä¸</span>
gcloud projects add-iam-policy-binding <span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">user:</span><span class="synPreProc">$GWS_USER</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synConstant">roles/resourcemanager.projectIamAdmin</span><span class="synStatement">"</span>
</pre>
<h2 id="Google-Workspace-ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å">[Google Workspace] ã¤ã³ãã³ããªã¬ãã¼ãã®æå¹å</h2>
<p>Google Workspace ã®ç®¡çã³ã³ã½ã¼ã«ï¼<a href="https://admin.google.com">https://admin.google.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/182076?hl=ja">管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãã</a></li>
</ul>
<p>[ã¬ãã¼ã] > [ãã¼ã¿çµ±å] ã¸ç§»åãã[ãã©ã¤ãã®ã¤ã³ãã³ããªã®ã¨ã¯ã¹ãã¼ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã¼ã¿çµ±å"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090012.png" width="800" height="416" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¼ã¿çµ±å</figcaption></figure></p>
<p>以ä¸ãè¨å®ãã[ä¿å] ãé¸æãã¾ãã</p>
<ul>
<li>ãã©ã¤ãã®ã¤ã³ãã³ã㪠ã¬ãã¼ãã® Google BigQuery ã¸ã®ã¨ã¯ã¹ãã¼ããæå¹ã«ããï¼<code>æå¹å</code></li>
<li>BigQuery ã®ããã¸ã§ã¯ã IDï¼<code>ããã¸ã§ã¯ã ID</code></li>
<li>ããã¸ã§ã¯ãå
ã®æ¢åã®ãã¼ã¿ã»ããï¼<code>ãã¼ã¿ã»ããå</code></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="ã¨ã¯ã¹ãã¼ãå
ã®è¨å®"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090015.png" width="800" height="281" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¨ã¯ã¹ãã¼ãå
ã®è¨å®</figcaption></figure></p>
<p>ã¨ã¯ã¹ãã¼ãã®æå¹åããååã®ã¨ã¯ã¹ãã¼ãã¾ã§ã¯1ï½2é±éãããã¾ãã2åç®ä»¥éã¯é±æ¬¡ã§ãã¼ã¿ãæ´æ°ããã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15141054?hl=ja">çµç¹ã®ãã©ã¤ãã®ã¤ã³ãã³ããªãã¨ã¯ã¹ãã¼ããã</a></li>
</ul>
<p>ã¨ã¯ã¹ãã¼ããå®äºããªãå ´åã管çè
ã®ãã°ã¤ãã³ãã確èªããã¨ã©ã¼ã®æç¡ãã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15141054?hl=ja&ref_topic=15486865#zippy=%2C%E3%83%89%E3%83%A9%E3%82%A4%E3%83%96%E3%81%AE%E3%82%A4%E3%83%B3%E3%83%99%E3%83%B3%E3%83%88%E3%83%AA%E3%81%AE%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AB%E9%96%A2%E9%80%A3%E3%81%99%E3%82%8B%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88">ãã©ã¤ãã®ã¤ã³ãã³ããªã®ã¨ã¯ã¹ãã¼ãã«é¢é£ããã¤ãã³ã</a></li>
</ul>
<h2 id="Google-Cloud-ã¬ãã¼ããã¼ã¿ã®ç¢ºèª">[Google Cloud] ã¬ãã¼ããã¼ã¿ã®ç¢ºèª</h2>
<p>Google Cloud ã³ã³ã½ã¼ã«ãããã°ã¤ã³ããæ¤ç´¢ãã¼ã«<code>BigQuery</code>ã¨å
¥åãã[BigQuery] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="BigQueryæ¤ç´¢"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090018.png" width="711" height="181" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>BigQueryæ¤ç´¢</figcaption></figure></p>
<p>ãã¼ã¿ã»ããã¢ã¤ã³ã³ãé¸æãã<code>[inventory]</code> ã¨ããååã®ãã¼ãã«ã表示ããããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¤ã³ãã³ããªã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090022.png" width="514" height="389" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¤ã³ãã³ããªã®ç¢ºèª</figcaption></figure></p>
<h1 id="ãã¼ã¿æ½åºä¾">ãã¼ã¿æ½åºä¾</h1>
<h2 id="ãµã³ãã«ã¯ã¨ãªã¢ã¯ã»ã¹æ¨©ããªã³ã¯ãç¥ã£ã¦ããã¤ã³ã¿ã¼ãããä¸ã®èª°ããã¢ã¯ã»ã¹ã§ãããã¡ã¤ã«ã®æ½åº"><strong>ãµã³ãã«ã¯ã¨ãªâ </strong>ï¼ã¢ã¯ã»ã¹æ¨©ãããªã³ã¯ãç¥ã£ã¦ããã¤ã³ã¿ã¼ãããä¸ã®èª°ããã¢ã¯ã»ã¹ã§ããããã¡ã¤ã«ã®æ½åº</h2>
<ul>
<li><strong>æ³å®ã¦ã¼ã¹ã±ã¼ã¹</strong>
<ul>
<li>誤ã£ã¦å¤é¨å
±æããã¦ãããã¡ã¤ã«ã®æ¤åº</li>
<li>ãã¼ã¿æ¼æ´©ãªã¹ã¯ã®é«ããã¡ã¤ã«ã®ç¹å®</li>
<li>ç£æ»å¯¾å¿ã®ããã®å¤é¨å
±æãã¡ã¤ã«ã®ä¸è¦§ä½æ</li>
</ul>
</li>
</ul>
<pre class="code lang-sql" data-lang="sql" data-unlink><span class="synStatement">SELECT</span>
id <span class="synSpecial">AS</span> file_id,
<span class="synIdentifier">CONCAT</span>(<span class="synSpecial">'</span><span class="synConstant">https://drive.google.com/file/d/</span><span class="synSpecial">'</span>, id, <span class="synSpecial">'</span><span class="synConstant">/view</span><span class="synSpecial">'</span>) <span class="synSpecial">AS</span> file_url, <span class="synComment">-- ãã¡ã¤ã«ã®URLãçæ</span>
title <span class="synSpecial">AS</span> file_name, <span class="synComment">-- ãã¡ã¤ã«å</span>
owner.<span class="synIdentifier">user</span>.email <span class="synSpecial">AS</span> owner_email, <span class="synComment">-- ãªã¼ãã¼ã®ã¡ã¼ã«ã¢ãã¬ã¹</span>
perm.email <span class="synSpecial">AS</span> shared_with_email, <span class="synComment">-- å
±æç¸æã®ã¡ã¼ã«ã¢ãã¬ã¹ï¼anyone ã®å ´å㯠nullï¼</span>
perm.role <span class="synSpecial">AS</span> shared_role, <span class="synComment">-- å
±æå½¹å²ï¼anyone ã®å ´å㯠nullï¼</span>
perm.<span class="synSpecial">type</span> <span class="synSpecial">AS</span> shared_type <span class="synComment">-- å
±æã¿ã¤ã</span>
<span class="synSpecial">FROM</span>
`my_project.my_dataset.inventory`, <span class="synComment">-- ãã¼ã¿ã»ãããæå®</span>
UNNEST(<span class="synSpecial">access</span>.permissions) <span class="synSpecial">AS</span> perm <span class="synComment">-- permissions ãå±é</span>
<span class="synSpecial">WHERE</span> perm.<span class="synSpecial">type</span> = <span class="synSpecial">'</span><span class="synConstant">ANYONE</span><span class="synSpecial">'</span> <span class="synComment">-- å
±æã¿ã¤ãã anyone ã®ãã¡ã¤ã«ãæ½åº</span>
<span class="synSpecial">ORDER</span> <span class="synSpecial">BY</span> id; <span class="synComment">-- file_id ã§ã½ã¼ã</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="å®è¡çµæ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090025.png" width="800" height="257" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å®è¡çµæ</figcaption></figure></p>
<h2 id="ãµã³ãã«ã¯ã¨ãªç¹å®ã®ã¦ã¼ã¶ã¼ããªã¼ãã¼ã¨ãªã£ã¦ãããã¡ã¤ã«ãæ½åºãã¤ãã©ã¤ããå«ã"><strong>ãµã³ãã«ã¯ã¨ãªâ¡</strong>ï¼ç¹å®ã®ã¦ã¼ã¶ã¼ããªã¼ãã¼ã¨ãªã£ã¦ãããã¡ã¤ã«ãæ½åºï¼ãã¤ãã©ã¤ããå«ãï¼</h2>
<ul>
<li><strong>æ³å®ã¦ã¼ã¹ã±ã¼ã¹</strong>
<ul>
<li>éè·è
ã®ãã¼ã¿æ´çã¨å¼ç¶ã</li>
<li>ç¹å®ã¦ã¼ã¶ã¼ã®ãã¡ã¤ã«ã¢ã¯ã»ã¹ç¶æ³ã®ç¢ºèª</li>
<li>éè¦ãã¼ã¿ã®ã¦ã¼ã¶ã¼åä½ã§ã®ç®¡ç</li>
</ul>
</li>
</ul>
<pre class="code lang-sql" data-lang="sql" data-unlink><span class="synStatement">SELECT</span>
child.id <span class="synSpecial">AS</span> file_id, <span class="synComment">-- ãã¡ã¤ã«ID</span>
child.title <span class="synSpecial">AS</span> file_name, <span class="synComment">-- ãã¡ã¤ã«å</span>
child.owner.<span class="synIdentifier">user</span>.email <span class="synSpecial">AS</span> owner_email, <span class="synComment">-- ãªã¼ãã¼ã®ã¡ã¼ã«ã¢ãã¬ã¹</span>
child.org_unit_path <span class="synSpecial">AS</span> org_unit, <span class="synComment">-- æå±çµç¹åä½</span>
parent.title <span class="synSpecial">AS</span> parent_folder_name, <span class="synComment">-- 親ãã©ã«ãå</span>
child.trashed <span class="synSpecial">AS</span> is_trashed, <span class="synComment">-- ã´ãç®±ã«å
¥ã£ã¦ããã (true:ã´ãç®±å
¥ã)</span>
child.mime_type, <span class="synComment">-- MIMEã¿ã¤ã</span>
child.size_bytes / (<span class="synConstant">1024</span> * <span class="synConstant">1024</span>) <span class="synSpecial">AS</span> file_size_mb, <span class="synComment">-- ãã¡ã¤ã«ãµã¤ãºï¼MBï¼</span>
child.create_time_micros <span class="synSpecial">AS</span> created_time, <span class="synComment">-- ä½ææ¥æï¼ãã¤ã¯ãç§ï¼</span>
child.last_modified_time_micros <span class="synSpecial">AS</span> last_modified_time <span class="synComment">-- æçµæ´æ°æ¥æï¼ãã¤ã¯ãç§ï¼</span>
<span class="synSpecial">FROM</span>
`my_project.my_dataset.inventory` <span class="synSpecial">AS</span> child <span class="synComment">-- ãã¼ã¿ã»ãããæå®</span>
<span class="synSpecial">LEFT</span> <span class="synSpecial">JOIN</span>
`my_project.my_dataset.inventory` <span class="synSpecial">AS</span> parent <span class="synComment">-- 親ãã©ã«ãæ
å ±ãåå¾ããããã«èªå·±çµå</span>
<span class="synSpecial">ON</span> child.parent = parent.id <span class="synComment">-- 親ãã©ã«ãã®IDã§çµå</span>
<span class="synSpecial">WHERE</span> child.owner.<span class="synIdentifier">user</span>.email = <span class="synSpecial">'</span><span class="synConstant">[email protected]</span><span class="synSpecial">'</span> <span class="synComment">-- æ½åºãããã¦ã¼ã¶ã¼ã®ã¡ã¼ã«ã¢ãã¬ã¹ãæå®</span>
<span class="synSpecial">ORDER</span> <span class="synSpecial">BY</span>
child.last_modified_time_micros <span class="synSpecial">DESC</span>; <span class="synComment">-- æçµæ´æ°æ¥æã§éé ã½ã¼ã</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="å®è¡çµæ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090028.png" width="800" height="285" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å®è¡çµæ</figcaption></figure></p>
<h2 id="ãµã³ãã«ã¯ã¨ãªçµç¹å¤ã®ãã¡ã¤ã³ã¨å
±æããã¦ãããã¡ã¤ã«ãæ½åº"><strong>ãµã³ãã«ã¯ã¨ãªâ¢</strong>ï¼çµç¹å¤ã®ãã¡ã¤ã³ã¨å
±æããã¦ãããã¡ã¤ã«ãæ½åº</h2>
<ul>
<li><strong>æ³å®ã¦ã¼ã¹ã±ã¼ã¹</strong>
<ul>
<li>çµç¹å¤ã¨ã®ãã¡ã¤ã«å
±æç¶æ³ã®ææ¡</li>
<li>ãã¡ã¤ã«å
±æããªã·ã¼éåã®æ¤åº</li>
<li>å¤é¨ãã¡ã¤ã³ã¨ã®ãã¼ã¿å
±æç¯å²ã®ç£è¦</li>
</ul>
</li>
</ul>
<pre class="code lang-sql" data-lang="sql" data-unlink><span class="synStatement">SELECT</span>
id <span class="synSpecial">AS</span> file_id, <span class="synComment">-- ãã¡ã¤ã«ID</span>
title <span class="synSpecial">AS</span> file_name, <span class="synComment">-- ãã¡ã¤ã«å</span>
owner.<span class="synIdentifier">user</span>.email <span class="synSpecial">AS</span> owner_email, <span class="synComment">-- ãªã¼ãã¼ã®ã¡ã¼ã«ã¢ãã¬ã¹</span>
perm.email <span class="synSpecial">AS</span> shared_with_email, <span class="synComment">-- å
±æç¸æã®ã¡ã¼ã«ã¢ãã¬ã¹</span>
perm.domain <span class="synSpecial">AS</span> shared_with_domain, <span class="synComment">-- å
±æç¸æã®ãã¡ã¤ã³</span>
perm.role <span class="synSpecial">AS</span> shared_role <span class="synComment">-- å
±æå½¹å²</span>
<span class="synSpecial">FROM</span>
`my_project.my_dataset.inventory`, <span class="synComment">-- ãã¼ã¿ã»ãããæå®</span>
UNNEST(<span class="synSpecial">access</span>.permissions) <span class="synSpecial">AS</span> perm <span class="synComment">-- permissions ãå±é</span>
<span class="synSpecial">WHERE</span> perm.domain <span class="synStatement">NOT</span> <span class="synStatement">IN</span> (<span class="synSpecial">'</span><span class="synConstant">example.com</span><span class="synSpecial">'</span>) <span class="synComment">-- èªç¤¾ãã¡ã¤ã³ä»¥å¤ã¨å
±æããã¦ãããã¡ã¤ã«ãæ½åº</span>
<span class="synSpecial">ORDER</span> <span class="synSpecial">BY</span>
shared_with_domain, file_name; <span class="synComment">-- ãã¡ã¤ã³ããã¡ã¤ã«åã§ã½ã¼ã</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="å®è¡çµæ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241220/20241220090031.png" width="800" height="317" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å®è¡çµæ</figcaption></figure></p>
<p>ä¸è¨ä»¥å¤ã«ãå
¬å¼ããã¥ã¡ã³ãã«ãµã³ãã«ã¯ã¨ãªãããã¾ãã®ã§ãã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/15485686?hl=ja#findable&label&storage&largest&cse&sharing">ã¯ã¨ãªã®ä¾</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
æ°ãã追å ãããCloud Runå®è¡ç¨ã®äºåå®ç¾©ãã¼ã«ã解説
hatenablog://entry/6802418398312677366
2024-12-19T09:00:00+09:00
2024-12-19T09:05:20+09:00 2024å¹´12æ17æ¥ãããCloud Run ãå¼ã³åºãããã®æ¨©éãæã¤3ã¤ã®äºåå®ç¾©ãã¼ã«ãæ°ãã«å©ç¨å¯è½ã¨ãªãã¾ãããå½è¨äºã§ã¯ãã¼ã«ã®è©³ç´°ããå¾æ¥ããå©ç¨ããã¦ããäºåå®ç¾©ãã¼ã«ã¨ã®éããªã©ã解説ãã¾ãã ã¯ããã« æ°ããªäºåå®ç¾©ãã¼ã« Cloud Run ãµã¼ãã¹èµ·åå
Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ ãªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ Cloud Run èµ·åå
ãã¼ã«ã¨ã®æ¯è¼ 権éå
容ã®æ¯è¼ Cloud Run jobs ã®ãã£ã³ã»ã«ããªã¼ãã¼ã©ã¤ãã«é¢ã㦠åèãªã³ã¯ ã¯ããã« 2024å¹´12æ17æ¥ãããCloud Run ãå¼ã³åºâ¦
<p>2024å¹´12æ17æ¥ãããCloud Run ãå¼ã³åºãããã®æ¨©éãæã¤3ã¤ã®äºåå®ç¾©ãã¼ã«ãæ°ãã«å©ç¨å¯è½ã¨ãªãã¾ãããå½è¨äºã§ã¯ãã¼ã«ã®è©³ç´°ããå¾æ¥ããå©ç¨ããã¦ããäºåå®ç¾©ãã¼ã«ã¨ã®éããªã©ã解説ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#æ°ããªäºåå®ç¾©ãã¼ã«">æ°ããªäºåå®ç¾©ãã¼ã«</a><ul>
<li><a href="#Cloud-Run-ãµã¼ãã¹èµ·åå
">Cloud Run ãµã¼ãã¹èµ·åå
</a></li>
<li><a href="#Cloud-Run-ã¸ã§ã-ã¨ã°ã¼ãã¥ã¼ã¿">Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</a></li>
<li><a href="#ãªã¼ãã¼ã©ã¤ãã使ç¨ãã-Cloud-Run-ã¸ã§ã-ã¨ã°ã¼ãã¥ã¼ã¿">ãªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</a></li>
</ul>
</li>
<li><a href="#Cloud-Run-èµ·åå
ãã¼ã«ã¨ã®æ¯è¼">Cloud Run èµ·åå
ãã¼ã«ã¨ã®æ¯è¼</a><ul>
<li><a href="#権éå
容ã®æ¯è¼">権éå
容ã®æ¯è¼</a></li>
<li><a href="#Cloud-Run-jobs-ã®ãã£ã³ã»ã«ãªã¼ãã¼ã©ã¤ãã«é¢ãã¦">Cloud Run jobs ã®ãã£ã³ã»ã«ããªã¼ãã¼ã©ã¤ãã«é¢ãã¦</a></li>
</ul>
</li>
<li><a href="#åèãªã³ã¯">åèãªã³ã¯</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241219/20241219090521.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p>2024å¹´12æ17æ¥ãããCloud Run ãå¼ã³åºãããã®æ¨©éãæã¤ä»¥ä¸ã®3ã¤ã®äºåå®ç¾©ãã¼ã«ãæ°ãã«å©ç¨å¯è½ã¨ãªãã¾ããã</p>
<ol>
<li>Cloud Run ãµã¼ãã¹èµ·åå
ï¼<code>roles/run.servicesInvoker</code>ï¼</li>
<li>Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ï¼<code>roles/run.jobsExecutor</code>ï¼</li>
<li>ãªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ï¼<code>roles/run.jobsExecutorWithOverrides</code>ï¼</li>
</ol>
<p>å½è¨äºã§ã¯ãã¼ã«ã®è©³ç´°ããå¾æ¥ããå©ç¨ããã¦ããäºåå®ç¾©ãã¼ã«ã¨ã®éããªã©ã解説ãã¾ãã</p>
<h1 id="æ°ããªäºåå®ç¾©ãã¼ã«">æ°ããªäºåå®ç¾©ãã¼ã«</h1>
<h2 id="Cloud-Run-ãµã¼ãã¹èµ·åå
">Cloud Run ãµã¼ãã¹èµ·åå
</h2>
<p><strong>Cloud Run ãµã¼ãã¹èµ·åå
</strong>ï¼<code>roles/run.servicesInvoker</code>ãè±å Cloud Run Service Invokerï¼ãã¼ã«ã¯ä»¥ä¸ã®æ¨©éã®ã¿ãä»ä¸ãããäºåå®ç¾©ãã¼ã«ã§ãCloud Run services ã®ãµã¼ãã¹å¼ã³åºããããã³ Cloud Run functions ã®é¢æ°å¼ã³åºããå¯è½ã«ãã¾ãããã®ãã¼ã«ãæã£ã¦ãã¦ã Cloud Run jobs ã®ã¸ã§ãå®è¡ã¯ã§ãã¾ããã</p>
<ul>
<li>run.routes.invoke</li>
</ul>
<h2 id="Cloud-Run-ã¸ã§ã-ã¨ã°ã¼ãã¥ã¼ã¿">Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</h2>
<p><strong>Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</strong>ï¼<code>roles/run.jobsExecutor</code>ãè±å Cloud Run Jobs Executorï¼ãã¼ã«ã¯ä»¥ä¸ã®2ã¤ã®æ¨©éãä»ä¸ãããäºåå®ç¾©ãã¼ã«ã§ãCloud Run jobs ã®ã¸ã§ãå®è¡ã¨ã¸ã§ãã®ãã£ã³ã»ã«ãå¯è½ã«ãã¾ãããã®ãã¼ã«ãæã£ã¦ãã¦ããCloud Run services ã®ãµã¼ãã¹å¼ã³åºããããã³ Cloud Run functions ã®é¢æ°å¼ã³åºãã¯ã§ãã¾ããã</p>
<ul>
<li>run.jobs.run</li>
<li>run.executions.cancel</li>
</ul>
<h2 id="ãªã¼ãã¼ã©ã¤ãã使ç¨ãã-Cloud-Run-ã¸ã§ã-ã¨ã°ã¼ãã¥ã¼ã¿">ãªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</h2>
<p><strong>ãªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿</strong>ï¼<code>roles/run.jobsExecutorWithOverrides</code>ãè±å Cloud Run Jobs Executor With Overridesï¼ãã¼ã«ã¯ä»¥ä¸ã®3ã¤ã®æ¨©éãä»ä¸ãããäºåå®ç¾©ãã¼ã«ã§ãCloud Run jobs ã®ã¸ã§ãå®è¡ãã¸ã§ãã®ãã£ã³ã»ã«ã®ã»ãã<strong>ã¸ã§ãæ§æããªã¼ãã¼ã©ã¤ãããã¸ã§ãã®å®è¡</strong>ãå¯è½ã§ãã</p>
<ul>
<li>run.jobs.run</li>
<li>run.executions.cancel</li>
<li>run.jobs.runWithOverrides</li>
</ul>
<p>ã¸ã§ãæ§æããªã¼ãã¼ã©ã¤ãããå®è¡ã®è©³ç´°ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloudrun-jobs-override-job-configuration" title="Cloud Run jobsã§ã¸ã§ãæ§æããªã¼ãã¼ã©ã¤ããã¦ã¸ã§ããå®è¡ãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloudrun-jobs-override-job-configuration">blog.g-gen.co.jp</a></cite></p>
<h1 id="Cloud-Run-èµ·åå
ãã¼ã«ã¨ã®æ¯è¼">Cloud Run èµ·åå
ãã¼ã«ã¨ã®æ¯è¼</h1>
<h2 id="権éå
容ã®æ¯è¼">権éå
容ã®æ¯è¼</h2>
<p>å¾æ¥ãCloud Run ã®ãµã¼ãã¹ã»é¢æ°ã»ã¸ã§ãã®å®è¡ã«ã¤ãã¦ã¯ã<strong>Cloud Run èµ·åå
</strong>ï¼<code>roles/run.invoker</code>ï¼ãã¼ã«ã®ä½¿ç¨ãæ¨å¥¨ããã¦ãã¾ããããã®äºåå®ç¾©ãã¼ã«ã«ã¯ã以ä¸ã®2ã¤ã®æ¨©éãä»ä¸ããã¦ãã¾ãããããã®æ¨©éã«ããããµã¼ãã¹ã»é¢æ°ã»ã¸ã§ãã®ããããå®è¡ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>run.routes.invoke</li>
<li>run.jobs.run</li>
</ul>
<p>æ°ããäºåå®ç¾©ãã¼ã«ãç¹ã«ãCloud Run ãµã¼ãã¹èµ·åå
ãã¨ãCloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ãã®2ã¤ã¯ãå¾æ¥ãããã Cloud Run èµ·åå
ãã¼ã«ã®å½¹å²ãåå²ãããããªå½¢ã«ãªã£ã¦ãã¾ããããã«ãããããµã¼ãã¹ã»é¢æ°ã®å¼ã³åºãã®ã¿ãã§ããããªã³ã·ãã«ãã¨ãã¸ã§ãã®å®è¡ã®ã¿ãã§ããããªã³ã·ãã«ãã¨ãã£ã<strong>æå°æ¨©éã®åå</strong>ãæèãã権é管çãã§ããããã«ãªãã¾ãã</p>
<h2 id="Cloud-Run-jobs-ã®ãã£ã³ã»ã«ãªã¼ãã¼ã©ã¤ãã«é¢ãã¦">Cloud Run jobs ã®ãã£ã³ã»ã«ããªã¼ãã¼ã©ã¤ãã«é¢ãã¦</h2>
<p>å¾æ¥ã® Cloud Run èµ·åå
ãã¼ã«ã«ã¯ãCloud Run jobs ã®ã¸ã§ãå®è¡ããã£ã³ã»ã«ããããã®æ¨©éï¼run.executions.cancelï¼ããã¸ã§ãæ§æããªã¼ãã¼ã©ã¤ãããããã®æ¨©éï¼run.jobs.runWithOverridesï¼ãããã¾ããããã®ãããã¸ã§ãã®ãã£ã³ã»ã«ããªã¼ãã¼ã©ã¤ããè¡ãããå ´å㯠<strong>Cloud Run éçºè
</strong>ï¼roles/run.developerï¼ãã¼ã«ãå¿
è¦ã§ããã</p>
<p>ããããCloud Run éçºè
ãã¼ã«ã¯ Cloud Run ã®ä½æãæ´æ°ãåé¤ã®æ¨©éãæã£ã¦ãããããããªã³ã·ãã«ã«ã¸ã§ãã®å®è¡ã«é¢ãããã¨ã ããããããå ´åãéå°ãªæ¨©éãä¸ãã¦ãã¾ããã¨ã«ãªãã¾ãã</p>
<p>æ°ãã«è¿½å ããããCloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ãããã³ããªã¼ãã¼ã©ã¤ãã使ç¨ãã Cloud Run ã¸ã§ã ã¨ã°ã¼ãã¥ã¼ã¿ããã¼ã«ã§ã¯ãã¸ã§ãã®å®è¡æã«å¿
è¦ã¨ãªã権é<strong>ã®ã¿</strong>ãä»ä¸ããã¦ãã¾ãã</p>
<p>ãã®ããããã¨ãã°ã¯ã¼ã¯ããã¼ããç°å¢ã«ãã£ã¦æ§æããªã¼ãã¼ã©ã¤ãããã¸ã§ããå®è¡ãããããªã±ã¼ã¹ã§ãã¯ã¼ã¯ããã¼ã使ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ããªã©ã®ããªã³ã·ãã«ã«å¯¾ãã¦éå°ãªæ¨©éãæãããã«æ¸ã¿ã¾ãã</p>
<h1 id="åèãªã³ã¯">åèãªã³ã¯</h1>
<ul>
<li><a href="https://cloud.google.com/run/docs/reference/iam/roles">Cloud Run IAM rolesï¼å
¬å¼ããã¥ã¡ã³ãï¼</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
Google WorkspaceãIdPã¨ãã¦Slackã«SSOããæ¹æ³
hatenablog://entry/6802418398305013187
2024-12-18T09:00:00+09:00
2024-12-18T09:00:07+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ Google Workspaceï¼Cloud Identityï¼ã使ç¨ãã¦ãSlack ã«ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼ä»¥ä¸ãSSOï¼ãè¨å®ããæ¹æ³ãç´¹ä»ãã¾ãã åºç¤ç¥è ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯ SAML èªè¨¼ã¨ã¯ SAML èªè¨¼ã®æµã Google Workspace ã® SSO 対å¿ããã¢ã㪠Google Workspace ã IdP ã¨ããã¡ãªãã 対å¿ã¨ãã£ã·ã§ã³ æ¤è¨¼ã®æ¦è¦ æ¤è¨¼ä½æ¥ [Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ä½æ [Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ã¦ã¼ã¶ã¼è¨å® [Slaâ¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ Google Workspaceï¼Cloud Identityï¼ã使ç¨ãã¦ãSlack ã«ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼ä»¥ä¸ãSSOï¼ãè¨å®ããæ¹æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#åºç¤ç¥è">åºç¤ç¥è</a><ul>
<li><a href="#ã·ã³ã°ã«ãµã¤ã³ãªã³SSOã¨ã¯">ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯</a></li>
<li><a href="#SAML-èªè¨¼ã¨ã¯">SAML èªè¨¼ã¨ã¯</a></li>
<li><a href="#SAML-èªè¨¼ã®æµã">SAML èªè¨¼ã®æµã</a></li>
</ul>
</li>
<li><a href="#Google-Workspace-ã®-SSO">Google Workspace ã® SSO</a><ul>
<li><a href="#対å¿ããã¢ããª">対å¿ããã¢ããª</a></li>
<li><a href="#Google-Workspace-ã-IdP-ã¨ããã¡ãªãã">Google Workspace ã IdP ã¨ããã¡ãªãã</a></li>
<li><a href="#対å¿ã¨ãã£ã·ã§ã³">対å¿ã¨ãã£ã·ã§ã³</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</a></li>
<li><a href="#æ¤è¨¼ä½æ¥">æ¤è¨¼ä½æ¥</a><ul>
<li><a href="#Google-Workspace-ã«ã¹ã¿ã -SAML-ã¢ããªã®ä½æ">[Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ä½æ</a></li>
<li><a href="#Google-Workspace-ã«ã¹ã¿ã -SAML-ã¢ããªã®ã¦ã¼ã¶ã¼è¨å®">[Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ã¦ã¼ã¶ã¼è¨å®</a></li>
<li><a href="#Slack-SAML-èªè¨¼è¨å®">[Slack] SAML èªè¨¼è¨å®</a></li>
<li><a href="#Slack-Slack-ã¸ã®ç´æ¥ã¢ã¯ã»ã¹ç¢ºèª">[Slack] Slack ã¸ã®ç´æ¥ã¢ã¯ã»ã¹ç¢ºèª</a></li>
<li><a href="#Google-Workspace-Google-Workspace-ã¢ããªçµç±ã®ç¢ºèª">[Google Workspace] Google Workspace ã¢ããªçµç±ã®ç¢ºèª</a></li>
<li><a href="#Google-Workspace-ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è¨å®æé 確èª">[Google Workspace] ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è¨å®æé 確èª</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241123/20241123114423.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="åºç¤ç¥è">åºç¤ç¥è</h1>
<h2 id="ã·ã³ã°ã«ãµã¤ã³ãªã³SSOã¨ã¯">ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯</h2>
<p><strong>ã·ã³ã°ã«ãµã¤ã³ãªã³</strong>ï¼SSOï¼ã¨ã¯ãä¸åº¦ã®èªè¨¼ã§è¤æ°ã®ã¢ããªã±ã¼ã·ã§ã³ããµã¼ãã¹ãå©ç¨ã§ããããã«ããããã®ä»çµã¿ã§ããå©ç¨è
ãè¤æ°ã®ãµã¼ãã¹ãå©ç¨ããã¨ããé常ã¯ãµã¼ãã¹ãã¨ã« ID ã¨ãã¹ã¯ã¼ããå
¥åãã¾ããããã1度ã§æ¸ãããã«ããä»çµã¿ã SSO ã§ãã</p>
<p>SSO ãå®è£
ãããã¨ã§ã以ä¸ã®å¹æãå¾ããã¾ãã</p>
<ul>
<li><p><strong>å©ä¾¿æ§åä¸</strong><br/>
ã¦ã¼ã¶ã¼ã¯ã¢ããªã±ã¼ã·ã§ã³ãã¨ã«ãã¹ã¯ã¼ããå
¥åããå¿
è¦ããªããªãã¾ãã</p></li>
<li><p><strong>ã»ãã¥ãªãã£å¼·å</strong><br/>
ãã¹ã¯ã¼ãã®ç®¡çãç°¡ç´ åãããã»ãã¥ãªãã£ãªã¹ã¯ã軽æ¸ã§ãã¾ãã</p></li>
</ul>
<h2 id="SAML-èªè¨¼ã¨ã¯">SAML èªè¨¼ã¨ã¯</h2>
<p>SSO ãå®ç¾ãããããã³ã«ã®ä¸ã¤ã« <strong>SAML</strong>ï¼Security Assertion Markup Languageï¼ãããã¾ããSAML ã¯ãèªè¨¼æ
å ±ãå®å
¨ã«ããåãããããã®æ¨æºè¦æ ¼ã§ããç¾å¨ã§ã¯ SAML 2.0 ãæ¨æºã¨ããã¦ãã¾ãã</p>
<p>SAML ã«ããèªè¨¼æ
å ±ã®ããã¨ããç解ããããã«ã¯ã以ä¸ã®2ã¤ã®å½¹å²ãç解ããå¿
è¦ãããã¾ãã</p>
<ul>
<li><p><strong>IdP</strong>ï¼Identity Providerï¼<br/>
ã¢ã¤ãã³ãã£ãã£ï¼ã¢ã«ã¦ã³ãï¼ãä¿åãããã管çããå½¹å²ãSSO ã§ã¯èªè¨¼ãæ
ããå½è¨äºã§ã¯ <strong>Google Workspace</strong> ã該å½ã</p></li>
<li><p><strong>SP</strong>ï¼Service Providerï¼<br/>
èªè¨¼æ¸ã¿ã®ã¦ã¼ã¶ã¼ãå®éã«å©ç¨ãããµã¼ãã¹ãä»åã®ä¾ã§ã¯ <strong>Slack</strong> ã該å½ã</p></li>
</ul>
<h2 id="SAML-èªè¨¼ã®æµã">SAML èªè¨¼ã®æµã</h2>
<p>Slack ãä¾ã«åãã¨ãã¦ã¼ã¶ã¼ããè¦ãèªè¨¼ã®æµãã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<ol>
<li>ã¦ã¼ã¶ã¼ã Slackï¼SPï¼ ã«ã¢ã¯ã»ã¹</li>
<li>Google Workspaceï¼IdPï¼ã«ãªãã¤ã¬ã¯ããããèªè¨¼ãè¡ããã</li>
<li>Slack ã«ãªãã¤ã¬ã¯ãããããã°ã¤ã³ãå®äº</li>
</ol>
<h1 id="Google-Workspace-ã®-SSO">Google Workspace ã® SSO</h1>
<h2 id="対å¿ããã¢ããª">対å¿ããã¢ããª</h2>
<p>Google Workspace ã IdP ã¨ãã¦å©ç¨ããã°ãå¤ãã®ã¯ã©ã¦ããµã¼ãã¹ã§ SAML èªè¨¼ã使ç¨ããã·ã³ã°ã«ãµã¤ã³ãªã³ãå®ç¾ã§ãã¾ãã</p>
<p>ä¾ãã°ã以ä¸ã®ãããªãµã¼ãã¹ããçµ±åå¯¾å¿ SAML ã¢ããªãã¨ãã¦ãã¤ãã£ãã«å¯¾å¿ãã¦ãã¾ãã</p>
<ul>
<li>Amazon Web Services</li>
<li>Notion</li>
<li>ServiceNow</li>
<li>Tableau</li>
<li>Zendesk</li>
</ul>
<p>ã¾ããã¤ãã£ãã«å¯¾å¿ãã¦ããªããµã¼ãã¹ã§ããSAML 2.0 è¦æ ¼ã«æºæ ãã¦ããã°ããã«ã¹ã¿ã SAML ã¢ããªãã¨ã㦠SSO è¨å®ãå¯è½ã§ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/table/9217027?hl=ja">çµ±åå¯¾å¿ SAML ã¢ããªã®ä¸è¦§</a></li>
<li>åè : <a href="https://support.google.com/a/answer/6087519?hl=ja">ã«ã¹ã¿ã SAML ã¢ããªãè¨å®ãã</a></li>
</ul>
<h2 id="Google-Workspace-ã-IdP-ã¨ããã¡ãªãã">Google Workspace ã IdP ã¨ããã¡ãªãã</h2>
<p>Google Workspace ã IdP ã¨ãã¦å©ç¨ãããã¨ã§ãSSO ã®å¹æãããã«é«ãã以ä¸ã®å©ç¹ãããã¾ãã</p>
<ul>
<li><p><strong>Google ã¢ã«ã¦ã³ãã®çµ±ä¸ç®¡ç</strong><br/>
Google ã¢ã«ã¦ã³ããèªè¨¼åºç¤ã¨ãã¦ä½¿ç¨ãããããè¤æ°ã®ã¢ã«ã¦ã³ãããã¹ã¯ã¼ãã管çããå¿
è¦ããªããªããã¦ã¼ã¶ã¼ã®å©ä¾¿æ§ãåä¸ã</p></li>
<li><p><strong>ã»ãã¥ãªãã£å¼·å</strong><br/>
å¤è¦ç´ èªè¨¼ï¼Google Authenticator ãã»ãã¥ãªãã£ãã¼ã®å©ç¨ï¼ãã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ï¼IP ã¢ãã¬ã¹ãããã¤ã¹ã«ããã¢ã¯ã»ã¹å¶å¾¡ï¼ãæ´»ç¨ããä¼æ¥ã®ã»ãã¥ãªãã£è¦ä»¶ããªã¹ã¯ç®¡çæ¹éã«å¿ããæè»ãªèªè¨¼ããªã·ã¼ãè¨å®å¯è½ã</p></li>
<li><p><strong>å¹
åºããµã¼ãã¹ã¨ã®é£æº</strong><br/>
Google Workspace ãéãã¦ãSlack ãªã©ã®å¤é¨ãµã¼ãã¹ã ãã§ãªããGoogle Workspace å
é¨ã®ãµã¼ãã¹ï¼Google DriveãGoogle Meet ãªã©ï¼ã¸ã®ã¢ã¯ã»ã¹ãä¸å
管çã</p></li>
</ul>
<p>2段éèªè¨¼ãã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã«ã¤ãã¦ã¯ã以ä¸ã®å
¬å¼ããã¥ã¡ã³ããåèã«ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/175197?hl=ja">2 段éèªè¨¼ããã»ã¹ã§ãã¸ãã¹ãä¿è·ãã</a></li>
<li>åè : <a href="https://support.google.com/a/answer/9275380?hl=ja">ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã§ãã¸ãã¹ãä¿è·ãã</a></li>
</ul>
<h2 id="対å¿ã¨ãã£ã·ã§ã³">対å¿ã¨ãã£ã·ã§ã³</h2>
<p>Google Workspace ã§ã¯ãEssentials Starter 以å¤ã®å
¨ã¨ãã£ã·ã§ã³ã§ãGoogle Workspace ã IdP ã¨ãã SSO ãæ§æã§ãã¾ãã</p>
<p>Cloud Identity ã§ãåæ§ã«ãFree 㨠Premium ã®ä¸¡ã¨ãã£ã·ã§ã³ã§ãCloud Identity ã IdP ã¨ãã SSO ãæ§æã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/6043385?hl=ja">Google Workspace ã®åã¨ãã£ã·ã§ã³ã®æ¯è¼</a></li>
<li>åè : <a href="https://support.google.com/cloudidentity/answer/7431902?hl=ja">Cloud Identity ã®æ©è½ã¨ã¨ãã£ã·ã§ã³ã®æ¯è¼</a></li>
</ul>
<h1 id="æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</h1>
<p>以ä¸ã®æé 㧠SSO ãè¨å®ããåä½ã確èªãã¾ãã</p>
<table>
<thead>
<tr>
<th> é çª </th>
<th> ä½æ¥å ´æ </th>
<th> ä½æ¥å </th>
<th> å
容 </th>
</tr>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td> Google Workspace </td>
<td> ã«ã¹ã¿ã SAML ã¢ããªã®ä½æ </td>
<td> Google Workspace å´ã§ SAML èªè¨¼ãè¨å® </td>
</tr>
<tr>
<td> 2 </td>
<td> Google Workspace </td>
<td> ã«ã¹ã¿ã SAML ã¢ããªã®ã¦ã¼ã¶ã¼è¨å® </td>
<td> ã¢ããªãå©ç¨ãã対象ï¼çµç¹ãã°ã«ã¼ãï¼ãè¨å® </td>
</tr>
<tr>
<td> 3 </td>
<td> Slack </td>
<td> SAML èªè¨¼è¨å® </td>
<td> Slack å´ã§ SAML èªè¨¼ãè¨å® </td>
</tr>
<tr>
<td> 4 </td>
<td> Slack </td>
<td> Slack ã¸ã®ç´æ¥ã¢ã¯ã»ã¹ç¢ºèª </td>
<td> Google Workspace ã«ãã°ã¤ã³ãã¦ããªãç¶æ
ã§ãSAML èªè¨¼ãæ£ããåä½ããããç¢ºèª </td>
</tr>
<tr>
<td> 5 </td>
<td> Google Workspace </td>
<td> Google Workspace ã¢ããªçµç±ã®ç¢ºèª </td>
<td> Google Workspace ã®ã«ã¹ã¿ã SAML ã¢ããªãå©ç¨ãã¦ãSSO ãæ£ããè¨å®ããã¦ããããç¢ºèª </td>
</tr>
<tr>
<td> 6 </td>
<td> Google Workspace </td>
<td> ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è¨å®æé ç¢ºèª </td>
<td> ã¢ã¯ã»ã¹å¶éï¼IP ã¢ãã¬ã¹ãããã¤ã¹å¶å¾¡ï¼ã®è¨å®æé ãç¢ºèª </td>
</tr>
</tbody>
</table>
<ul>
<li>åè : <a href="https://slack.com/intl/ja-jp/help/articles/204078066-Google-Workspace-%E3%82%B7%E3%83%B3%E3%82%B0%E3%83%AB%E3%82%B5%E3%82%A4%E3%83%B3%E3%82%AA%E3%83%B3">Google Workspace ã·ã³ã°ã«ãµã¤ã³ãªã³</a></li>
<li>åè : <a href="https://support.google.com/a/answer/6357481?hl=ja">Slack ã¯ã©ã¦ã ã¢ããªã±ã¼ã·ã§ã³</a></li>
</ul>
<p>ãªãåæã¨ãã¦ãSlack ã§ã¯ Business+ ã¾ã㯠Enterprise Grid ãã©ã³ã§ã®ã¿ãSAML ãã¼ã¹ã® SSO ãå©ç¨ã§ãã¾ããFree ãã©ã³ã Pro ãã©ã³ã§ã¯å©ç¨ã§ãã¾ããã®ã§ã注æãã ããã</p>
<ul>
<li>åè : <a href="https://app.slack.com/plans/T01LMH91KNF?geocode=ja-jp">ãã¼ã ã«åã£ããã©ã³ãé¸æãã¾ããã</a></li>
</ul>
<h1 id="æ¤è¨¼ä½æ¥">æ¤è¨¼ä½æ¥</h1>
<h2 id="Google-Workspace-ã«ã¹ã¿ã -SAML-ã¢ããªã®ä½æ">[Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ä½æ</h2>
<p>Google Workspace ã®ç®¡çã³ã³ã½ã¼ã«ï¼<a href="https://admin.google.com">https://admin.google.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/182076?hl=ja">管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãã</a></li>
</ul>
<p>[ã¢ããª] > [ã¦ã§ãã¢ããªã¨ã¢ãã¤ã«ã¢ããª] > [ã¢ããªã追å ] > [ã«ã¹ã¿ã SAML ã¢ããªã®è¿½å ] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã«ã¹ã¿ã SAML ã¢ããªã®è¿½å "><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010154.png" width="668" height="445" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã«ã¹ã¿ã SAML ã¢ããªã®è¿½å </figcaption></figure></p>
<p>ã¢ããªåãå
¥åããå¿
è¦ã«å¿ãã¦ã¢ã¤ã³ã³ãæ·»ä»ãã¾ããå
¥åãçµãã£ãã [ç¶è¡] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ããªåã®å
¥å"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010048.png" width="573" height="362" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªåã®å
¥å</figcaption></figure></p>
<p>管çè
ã¯ãSlack å´ã«ç»é²ããããã«ä»¥ä¸ã®3ç¹ãæ§ãã¦ããã[ç¶è¡] ãé¸æãã¾ãã</p>
<ul>
<li><strong>SSO ã® URL</strong></li>
<li><strong>ã¨ã³ãã£ã㣠ID</strong></li>
<li><strong>証ææ¸ï¼å³å´ã®ãã¦ã³ãã¼ãã¢ã¤ã³ã³ãé¸æãã¦ãã¦ã³ãã¼ããã¾ãï¼</strong></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="IdP è¨å®ã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010052.png" width="658" height="611" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>IdP è¨å®ã®ç¢ºèª</figcaption></figure></p>
<p>以ä¸ãå
¥åãã[ç¶è¡] ãé¸æãã¾ãã</p>
<ul>
<li><strong>ACS ã® URL</strong>ï¼<code>https://${{Slack URL}}/sso/saml</code></li>
<li><strong>ã¨ã³ãã£ã㣠ID</strong>ï¼<code>https://slack.com</code></li>
<li><strong>ç½²åä»ãå¿ç</strong>ï¼æå¹åï¼ãã§ãã¯ãå
¥ããï¼</li>
<li><strong>åå ID</strong>ï¼<code>[Basic Information] > [Primary email]</code></li>
</ul>
<p>Slack URL ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ç¢ºèªãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://slack.com/intl/ja-jp/help/articles/221769328-Slack-URL-%E3%81%BE%E3%81%9F%E3%81%AF-ID-%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B">Slack URL ã¾ã㯠ID ã確èªãã</a></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="SP è¨å®"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010055.png" width="775" height="562" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SP è¨å®</figcaption></figure></p>
<p>[ãããã³ã°ã追å ] ãã以ä¸ã®éãã«è¨å®ãã[å®äº] ãé¸æãã¾ãã</p>
<ul>
<li><code>[Basic Information] > [Primary email]</code>ï¼<code>User.Email</code></li>
<li><code>[Basic Information] > [First name]</code>ï¼<code>first_name</code></li>
<li><code>[Basic Information] > [Last Name]</code>ï¼<code>last_name</code></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="å±æ§ã®ãããã³ã°"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010059.png" width="698" height="535" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å±æ§ã®ãããã³ã°</figcaption></figure></p>
<h2 id="Google-Workspace-ã«ã¹ã¿ã -SAML-ã¢ããªã®ã¦ã¼ã¶ã¼è¨å®">[Google Workspace] ã«ã¹ã¿ã SAML ã¢ããªã®ã¦ã¼ã¶ã¼è¨å®</h2>
<p>ä½æããã¢ããªã® [ã¦ã¼ã¶ã¼ ã¢ã¯ã»ã¹] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¦ã¼ã¶ã¼ã¢ã¯ã»ã¹ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010103.png" width="800" height="285" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¦ã¼ã¶ã¼ã¢ã¯ã»ã¹ãé¸æ</figcaption></figure></p>
<p>SAML èªè¨¼ãå©ç¨ãã対象ï¼<strong>çµç¹å
¨ä½</strong>ã¾ãã¯<strong>ç¹å®ã®çµç¹é¨é</strong>ã¾ã㯠<strong>Google ã°ã«ã¼ã</strong>ï¼ãé¸æãã[ãªã³] > [ä¿åï¼ã¾ãã¯ãªã¼ãã¼ã©ã¤ãï¼] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="SAML ã¢ããªã®æå¹å"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010106.png" width="800" height="214" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML ã¢ããªã®æå¹å</figcaption></figure></p>
<h2 id="Slack-SAML-èªè¨¼è¨å®">[Slack] SAML èªè¨¼è¨å®</h2>
<p>管çè
ã¢ã«ã¦ã³ãã«ã¦ã[ã¯ã¼ã¯ã¹ãã¼ã¹å] > [ãã¼ã«ã¨è¨å®] > [ã¯ã¼ã¯ã¹ãã¼ã¹ã®è¨å®] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¯ã¼ã¯ã¹ãã¼ã¹ã®è¨å®ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010110.png" width="450" height="422" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¯ã¼ã¯ã¹ãã¼ã¹ã®è¨å®ãé¸æ</figcaption></figure></p>
<p>[èªè¨¼] > [èªè¨¼] ãã SAML èªè¨¼ã® [è¨å®ãã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="SAML èªè¨¼è¨å®ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010113.png" width="800" height="407" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML èªè¨¼è¨å®ãé¸æ</figcaption></figure></p>
<p>以ä¸ã®éãã«è¨å®ãã詳細è¨å®ã® [éã] ãé¸æãã¾ãã</p>
<ul>
<li><strong>SAML 2.0 ã¨ã³ããã¤ã³ã (HTTP)</strong>ï¼<code>SSO ã® URL</code></li>
<li><strong>ID ãããã¤ãçºè¡è
</strong>ï¼<code>ã¨ã³ãã£ã㣠ID</code></li>
<li><strong>å
¬é証ææ¸</strong>ï¼ãã¦ã³ãã¼ããã証ææ¸ãã¡ã¤ã«ãããã¹ãã¨ãã£ã¿ã§éãããã®å
容ãã³ãã¼ãã¦è²¼ãä»ãã¾ãã</li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="SAML èªè¨¼è¨å®1"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010117.png" width="667" height="586" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML èªè¨¼è¨å®1</figcaption></figure></p>
<p>以ä¸ãé¸æãã[è¨å®ãä¿åãã] ãé¸æãã¾ãã</p>
<ul>
<li><strong>ãµã¼ãã¹ãããã¤ãçºè¡è
</strong>ï¼ã«ã¹ã¿ã SAML ã¢ããªã§è¨å®ãã<code>ã¨ã³ãã£ã㣠ID</code></li>
<li><strong>ç½²åä»ãã¬ã¹ãã³ã¹</strong>ï¼æå¹åï¼ãã§ãã¯ãå
¥ããï¼</li>
<li><strong>ã¯ã¼ã¯ã¹ãã¼ã¹ã®èªè¨¼ãå¿
è¦ãªã¡ã³ãã¼</strong>ï¼SAML èªè¨¼ãå¿
è¦ãªå¯¾è±¡ãé¸æãã¾ãã</li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="SAML èªè¨¼è¨å®2"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010121.png" width="661" height="407" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML èªè¨¼è¨å®2</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="SAML èªè¨¼è¨å®3"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010124.png" width="622" height="505" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML èªè¨¼è¨å®3</figcaption></figure></p>
<p>SAML èªè¨¼ãæå¹åããããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="æå¹å確èª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010127.png" width="523" height="378" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æå¹å確èª</figcaption></figure></p>
<h2 id="Slack-Slack-ã¸ã®ç´æ¥ã¢ã¯ã»ã¹ç¢ºèª">[Slack] Slack ã¸ã®ç´æ¥ã¢ã¯ã»ã¹ç¢ºèª</h2>
<p>Google Workspace ã«ãã°ã¤ã³ãã¦ããªãç¶æ
ã§ãSlack ã® URLï¼ä¾: <code>https://${{Slack URL}}</code>ï¼ã«ã¢ã¯ã»ã¹ãã¾ãã
<figure class="figure-image figure-image-fotolife" title="Slack URL ã¸ã¢ã¯ã»ã¹"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010138.png" width="544" height="92" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Slack URL ã¸ã¢ã¯ã»ã¹</figcaption></figure></p>
<p>[SAML ã§ãµã¤ã³ã¤ã³] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="SAML ã§ãµã¤ã³ã¤ã³ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010141.png" width="426" height="319" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>SAML ã§ãµã¤ã³ã¤ã³ãé¸æ</figcaption></figure></p>
<p>Google ã®ãã°ã¤ã³ç»é¢ã表示ããããããã¢ã«ã¦ã³ãåã³ãã¹ã¯ã¼ããå
¥åã㦠[次ã¸] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="Google ãã°ã¤ã³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010144.png" width="800" height="280" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Google ãã°ã¤ã³</figcaption></figure></p>
<p>èªè¨¼ãå®äºãã㨠Slack ã«ãªãã¤ã¬ã¯ãããããã°ã¤ã³ã§ãããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã°ã¤ã³ç¢ºèªï¼ç´æ¥ã¢ã¯ã»ã¹ï¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010147.png" width="680" height="575" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ã¤ã³ç¢ºèªï¼ç´æ¥ã¢ã¯ã»ã¹ï¼</figcaption></figure></p>
<h2 id="Google-Workspace-Google-Workspace-ã¢ããªçµç±ã®ç¢ºèª">[Google Workspace] Google Workspace ã¢ããªçµç±ã®ç¢ºèª</h2>
<p>Google Workspace ã«ãã°ã¤ã³ããç¶æ
ã§ã[ã¢ããª] > [ã«ã¹ã¿ã SAML ã¢ããª] ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã«ã¹ã¿ã SAML ã¢ããªãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010131.png" width="344" height="404" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã«ã¹ã¿ã SAML ã¢ããªãé¸æ</figcaption></figure></p>
<p>Slack ã«ãã°ã¤ã³ã§ãããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã°ã¤ã³ç¢ºèªï¼ã«ã¹ã¿ã SAML ã¢ããªï¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010134.png" width="470" height="462" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ã¤ã³ç¢ºèªï¼ã«ã¹ã¿ã SAML ã¢ããªï¼</figcaption></figure></p>
<p>Google Workspace ã®ç®¡çç»é¢ããããã°ã確èªããæ¹æ³ãæ¤è¨¼ãã¾ãã</p>
<p>[ã¬ãã¼ã] > [ç£æ»ã¨èª¿æ»] > [SAML ãã°ã¤ãã³ã] ãã SAML èªè¨¼ã«é¢ãããã°ã確èªã§ãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã°ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010150.png" width="800" height="414" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ç¢ºèª</figcaption></figure></p>
<h2 id="Google-Workspace-ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è¨å®æé 確èª">[Google Workspace] ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è¨å®æé 確èª</h2>
<p>[ã»ãã¥ãªãã£] > [ã¢ã¯ã»ã¹ã¨ãã¼ã¿ç®¡ç] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹] > [ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010157.png" width="800" height="445" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã</figcaption></figure></p>
<p>ã¢ã¯ã»ã¹ã¬ãã«ãé©ç¨ãã対象ã¨ã㦠<strong>ã«ã¹ã¿ã SAML ã¢ããª</strong> ãé¸æãã¾ãã[å²ãå½ã¦] ãé¸æãããã¨ã§ãã¢ã¯ã»ã¹ã¬ãã«ãè¨å®ã§ãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã«ã¹ã¿ã SAML ã¢ããªã¸ã®å²ãå½ã¦"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241218/20241218010200.png" width="578" height="591" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã«ã¹ã¿ã SAML ã¢ããªã¸ã®å²ãå½ã¦</figcaption></figure></p>
<p>ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã®è©³ç´°ãªè¨å®æé ãã¢ã¯ã»ã¹ã¬ãã«ã®ä½ææ¹æ³ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcontext-aware-access-with-google-workspace" title="ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã§Google Workspaceã®ã»ãã¥ãªãã£ãå¼·åãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/context-aware-access-with-google-workspace">blog.g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
ã³ã³ããã¹ãã¢ã¦ã§ã¢ã¢ã¯ã»ã¹ã§Google Workspaceã®ã»ãã¥ãªãã£ãå¼·åãã¦ã¿ã
hatenablog://entry/6802418398304281076
2024-12-16T09:00:00+09:00
2024-12-16T09:00:03+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ï¼CAAï¼ã使ã£ã¦ Google ãã©ã¤ãçã® Google Workspace ã¢ããªã±ã¼ã·ã§ã³ã¸ã®ã¢ã¯ã»ã¹ãå¶å¾¡ããæ¹æ³ãç´¹ä»ãã¾ãã ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¨ã¯ åææ¡ä»¶ æ¤è¨¼å
容 åä½ç¢ºèª ã¢ãã¿ã¼ã¢ã¼ãã®è¨å® åä½ç¢ºèªï¼ã¢ãã¿ã¼ã¢ã¼ãï¼ ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ï¼ã¢ã¯ãã£ãã¢ã¼ãï¼ åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼ è¤åæ¡ä»¶ã®è¨å® è¤åæ¡ä»¶ã®åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼ ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¨ã¯ ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ï¼ä»¥éãCAAï¼ã¯ãIP ã¢ãã¬ã¹ãããã¤ã¹ã®ç¶æ
ãªã©ã®ã³ã³ããã¹ãï¼èæ¯æ
å ±ï¼ã«åºã¥â¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ãã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ï¼CAAï¼ã使ã£ã¦ Google ãã©ã¤ãçã® Google Workspace ã¢ããªã±ã¼ã·ã§ã³ã¸ã®ã¢ã¯ã»ã¹ãå¶å¾¡ããæ¹æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã³ã³ããã¹ãã¢ã¦ã§ã¢-ã¢ã¯ã»ã¹ã¨ã¯">ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¨ã¯</a></li>
<li><a href="#åææ¡ä»¶">åææ¡ä»¶</a></li>
<li><a href="#æ¤è¨¼å
容">æ¤è¨¼å
容</a></li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#ã¢ãã¿ã¼ã¢ã¼ãã®è¨å®">ã¢ãã¿ã¼ã¢ã¼ãã®è¨å®</a></li>
<li><a href="#åä½ç¢ºèªã¢ãã¿ã¼ã¢ã¼ã">åä½ç¢ºèªï¼ã¢ãã¿ã¼ã¢ã¼ãï¼</a></li>
<li><a href="#ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ã¢ã¯ãã£ãã¢ã¼ã">ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</a></li>
<li><a href="#åä½ç¢ºèªã¢ã¯ãã£ãã¢ã¼ã">åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</a></li>
<li><a href="#è¤åæ¡ä»¶ã®è¨å®">è¤åæ¡ä»¶ã®è¨å®</a></li>
<li><a href="#è¤åæ¡ä»¶ã®åä½ç¢ºèªã¢ã¯ãã£ãã¢ã¼ã">è¤åæ¡ä»¶ã®åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241118/20241118101127.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã³ã³ããã¹ãã¢ã¦ã§ã¢-ã¢ã¯ã»ã¹ã¨ã¯">ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¨ã¯</h1>
<p>ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ï¼ä»¥éãCAAï¼ã¯ãIP ã¢ãã¬ã¹ãããã¤ã¹ã®ç¶æ
ãªã©ã®ã³ã³ããã¹ãï¼èæ¯æ
å ±ï¼ã«åºã¥ãã¦ã¢ã¯ã»ã¹ãå¶å¾¡ãããGoogle Workspace ã®æ©è½ã§ãã</p>
<p>Google ãã©ã¤ããGmailãGoogle ã«ã¬ã³ãã¼ãLooker Studio ãªã©ã«æ¡ä»¶ä»ãã§ã¢ã¯ã»ã¹å¶å¾¡ãé©ç¨ã§ãã¾ãã</p>
<p><strong>使ç¨ä¾</strong> :</p>
<ul>
<li><p><strong>IP ã¢ãã¬ã¹å¶é</strong> : 社å
ãããã¯ã¼ã¯ã® IP ã¢ãã¬ã¹ããã®ã¿ Google ãã©ã¤ãã¸ã®ã¢ã¯ã»ã¹ã許å¯ãã社å¤ï¼èªå®
ãå
Œ
± Wi-Fiï¼ããã®å©ç¨ãç¦æ¢ããã</p></li>
<li><p><strong>ããã¤ã¹å¶é</strong> : ä¼ç¤¾æ¯çµ¦ã®ã¢ãã¤ã«ããã¤ã¹ï¼iPhoneãAndroidï¼ããã®ã¿ Gmail ã¸ã®ã¢ã¯ã»ã¹ã許å¯ããç§ç¨ããã¤ã¹ããã®å©ç¨ãç¦æ¢ããã</p></li>
</ul>
<p>åè : <a href="https://support.google.com/a/answer/12645308?hl=ja">ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã®æ¦è¦</a></p>
<h1 id="åææ¡ä»¶">åææ¡ä»¶</h1>
<p>CAA ã¯ãGoogle Workspaceï¼Cloud Identityï¼ã®ç¹å®ã®ã¨ãã£ã·ã§ã³ï¼Frontline StandardãEnterprise StandardãEnterprise PlusãCloud Identity Premium çï¼ã§å©ç¨ã§ãã¾ãã</p>
<p>詳細ã¯ä»¥ä¸ã®ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/9275380?hl=ja">ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã§ãã¸ãã¹ãä¿è·ãã</a></li>
</ul>
<h1 id="æ¤è¨¼å
容">æ¤è¨¼å
容</h1>
<p>以ä¸ã®æé 㧠CAA ãè¨å®ããåä½ã確èªãã¾ãã</p>
<ol>
<li><p><strong>ã¢ãã¿ã¼ã¢ã¼ãã®è¨å®</strong><br/>
社å
IP ã¢ãã¬ã¹ã®ã¿ã«ã¢ã¯ã»ã¹ãå¶éããã«ã¼ã«ãä½æããã¢ãã¿ã¼ã¢ã¼ãï¼æ¤ç¥ã®ã¿ã§ãããã¯ããªãï¼ã§è¨å®ãã¾ãã</p></li>
<li><p><strong>åä½ç¢ºèªï¼ã¢ãã¿ã¼ã¢ã¼ãï¼</strong><br/>
社å
å¤ã®ã¢ã¯ã»ã¹ç¶æ³ã確èªãããã°ã確èªãã¾ãã</p></li>
<li><p><strong>ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</strong><br/>
ã¢ã¯ãã£ãã¢ã¼ãã«åãæ¿ããæ¡ä»¶å¤ã®ã¢ã¯ã»ã¹ããããã¯ããããã«è¨å®ãã¾ãã</p></li>
<li><p><strong>åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</strong><br/>
社å
IP ã¢ãã¬ã¹ããã¢ã¯ã»ã¹å¯è½ã§ã社å¤ããã¯ãããã¯ããããã¨ã確èªãã¾ãã</p></li>
<li><p><strong>è¤åæ¡ä»¶ã®è¨å®</strong><br/>
社å
IP ã¢ãã¬ã¹ã«å ããå¤è¦ç´ èªè¨¼ï¼MFAï¼ãå©ç¨ãã¦ããå ´åã®ã¿è¨±å¯ããæ¡ä»¶ãè¨å®ãã¾ãã</p></li>
<li><p><strong>è¤åæ¡ä»¶ã®åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</strong><br/>
æ¡ä»¶ã«åè´ããªãã¢ã¯ã»ã¹ããããã¯ããããã¨ã確èªãã¾ãã</p></li>
</ol>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="ã¢ãã¿ã¼ã¢ã¼ãã®è¨å®">ã¢ãã¿ã¼ã¢ã¼ãã®è¨å®</h2>
<p>Google Workspace ã®ç®¡çã³ã³ã½ã¼ã«ï¼URL : <a href="https://admin.google.com">https://admin.google.com</a>ï¼ã«ãã°ã¤ã³ãã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/182076?hl=ja">管çã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ãã</a></li>
</ul>
<p>[ã»ãã¥ãªãã£] > [ã¢ã¯ã»ã¹ã¨ãã¼ã¿ç®¡ç] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹] ã«ç§»åãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¸ç§»å"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090101.png" width="444" height="272" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¸ç§»å</figcaption></figure></p>
<p>CAA ãç¡å¹ãªå ´åã¯ã[æå¹ã«ãã] ãé¸æãã¦æå¹åãã¾ãããã®å¾ [ã¢ã¯ã»ã¹ã¬ãã«] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="æå¹åã¨ã¢ã¯ã»ã¹ã¬ãã«ã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090104.png" width="442" height="243" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æå¹åã¨ã¢ã¯ã»ã¹ã¬ãã«ã®é¸æ</figcaption></figure></p>
<p>[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090006.png" width="800" height="116" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ã¬ãã«ãä½æãé¸æ</figcaption></figure></p>
<p>以ä¸ãè¨å®ãã[ä½æ] ãé¸æãã¾ãã</p>
<ul>
<li> <strong>ã¢ã¯ã»ã¹ã¬ãã«å</strong>ï¼ä»»æã®ååãå
¥åãã¾ãã</li>
<li> <strong>æ¡ä»¶</strong>ï¼[åºæ¬] > [IP ãµãããã] ãé¸æãã社å
IP ã¢ãã¬ã¹ãå
¥åãã¾ãã</li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090055.png" width="789" height="650" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ</figcaption></figure></p>
<p>[ã¢ããªã«å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ããªã«å²ãå½ã¦ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090058.png" width="491" height="244" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªã«å²ãå½ã¦ãé¸æ</figcaption></figure></p>
<p>é©ç¨ãã対象ï¼ã¦ã¼ã¶ã¼ã¾ãã¯ã°ã«ã¼ãã¾ãã¯çµç¹é¨éï¼ã¨ã¢ããªãé¸æãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="é©ç¨å¯¾è±¡ã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090009.png" width="777" height="592" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>é©ç¨å¯¾è±¡ã®é¸æ</figcaption></figure></p>
<p>ã¢ã¯ã»ã¹ã¬ãã«ãé¸æãããç£è¦ãã«ãã§ãã¯ãå
¥ãã¦ãç¶è¡ããé¸æãã¾ãã<strong>ã¢ãã¿ã¼ã¢ã¼ãï¼ç£è¦ï¼</strong>ã§ã¯ãã¢ã¯ã»ã¹ã¬ãã«ã®å½±é¿ç¯å²ããã°ã§ç¢ºèªã§ãããããã¯ã¯è¡ããã¾ããã</p>
<p>ãªãã¢ã¯ã»ã¹ã¬ãã«ã¯è¤æ°é¸æã§ãã¾ããã<strong>OR æ¡ä»¶</strong>ã§åä½ãããããããããã®ã¢ã¯ã»ã¹ã¬ãã«ãæºããå ´åã¯æ¥ç¶ã許å¯ããã¾ãã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/9261439?hl=ja">ã¢ããªã«ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã</a>
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ã»ã¹ã¬ãã«ã¨ã¢ã¼ãã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090012.png" width="724" height="569" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ã¬ãã«ã¨ã¢ã¼ãã®é¸æ</figcaption></figure></li>
</ul>
<p>[ç¶è¡] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ç¶è¡ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090111.png" width="525" height="517" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç¶è¡ãé¸æ</figcaption></figure></p>
<p>å
容ã確èªãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ãã¿ã¼ã¢ã¼ãã®é©ç¨"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090052.png" width="690" height="531" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ãã¿ã¼ã¢ã¼ãã®é©ç¨</figcaption></figure></p>
<h2 id="åä½ç¢ºèªã¢ãã¿ã¼ã¢ã¼ã">åä½ç¢ºèªï¼ã¢ãã¿ã¼ã¢ã¼ãï¼</h2>
<p>社å
ããã³ç¤¾å¤ãã Google ãã©ã¤ããGoogle ã«ã¬ã³ãã¼ãGmail ã«ã¢ã¯ã»ã¹ãã¾ãããã®æ®µéã§ã¯ãã©ã¡ããããã¢ã¯ã»ã¹å¯è½ã§ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ã»ã¹ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090015.png" width="800" height="215" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ç¢ºèª</figcaption></figure></p>
<p>[ã¬ãã¼ã] > [ç£æ»ã¨èª¿æ»] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã®ãã°ã¤ãã³ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã°ã¤ãã³ãã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090018.png" width="263" height="563" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ã¤ãã³ãã®é¸æ</figcaption></figure></p>
<p>以ä¸ã®æ¡ä»¶ã§æ¤ç´¢ããã¢ãã¿ã¼ã¢ã¼ãã§ãããã¯ãããã¦ã¼ã¶ã¼ã®ãã°ã確èªãã¾ããæå³ããªããããã¯ãçºçãã¦ããªãã確èªãã¦ãã ããã</p>
<ul>
<li><code>ã¤ãã³ã</code> <strong>次ã«ä¸è´</strong> <code>ã¢ã¯ã»ã¹æå¦ï¼ã¢ãã¿ã¼ã¢ã¼ãï¼</code></li>
<li><code>ã¢ã¯ã»ã¹ã¬ãã«ã®é©ç¨</code> <strong>次ã®æåãå«ã</strong> <code>ã¢ã¯ã»ã¹ã¬ãã«å</code></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="ã¢ãã¿ã¼ã¢ã¼ãã®ãã°ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090020.png" width="800" height="414" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ãã¿ã¼ã¢ã¼ãã®ãã°ç¢ºèª</figcaption></figure></p>
<h2 id="ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ã¢ã¯ãã£ãã¢ã¼ã">ã¢ã¯ã»ã¹ã¬ãã«å¤æ´ï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</h2>
<p>[ã»ãã¥ãªãã£] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹] ã¸ç§»åãã [ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ããé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090106.png" width="498" height="413" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ããé¸æ</figcaption></figure></p>
<p>ã¢ã¯ã»ã¹ã¬ãã«ãé©ç¨ãã対象ã¨ã¢ããªãé¸æãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å²ãå½ã¦ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090109.png" width="241" height="404" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å²ãå½ã¦ãé¸æ</figcaption></figure></p>
<p><code>ç£è¦</code>ã®ãã§ãã¯ãå¤ãã<code>ã¢ã¯ãã£ã</code>ã®ãã§ãã¯ãå
¥ã㦠[ç¶è¡] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ãã£ãã¢ã¼ãã¸ã®å¤æ´"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090023.png" width="800" height="433" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ãã£ãã¢ã¼ãã¸ã®å¤æ´</figcaption></figure></p>
<p>[ç¶è¡] ãé¸æããå
容ã確èªãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ç¶è¡ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090111.png" width="525" height="517" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç¶è¡ãé¸æ</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ãã£ãã¢ã¼ãã®é©ç¨"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090027.png" width="775" height="562" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ãã£ãã¢ã¼ãã®é©ç¨</figcaption></figure></p>
<h2 id="åä½ç¢ºèªã¢ã¯ãã£ãã¢ã¼ã">åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</h2>
<p>社å
IP ã¢ãã¬ã¹åã³ç¤¾å¤ IP ã¢ãã¬ã¹ããã¢ã¯ã»ã¹ãã¾ãã社å
IP ã¢ãã¬ã¹ã§ã¯æ£å¸¸ã«ã¢ã¯ã»ã¹ã§ããç¤¾å¤ IP ã¢ãã¬ã¹ã§ã¯ã¢ã¯ã»ã¹ããããã¯ããããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãããã¯ç¢ºèªï¼IP ãµããããï¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090114.png" width="396" height="414" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãããã¯ç¢ºèªï¼IP ãµããããï¼</figcaption></figure></p>
<h2 id="è¤åæ¡ä»¶ã®è¨å®">è¤åæ¡ä»¶ã®è¨å®</h2>
<p>[ã»ãã¥ãªãã£] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹] ã«ç§»åãã[ã¢ã¯ã»ã¹ã¬ãã«] > [ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ã»ã¹ã¬ãã«ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090117.png" width="466" height="295" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ã¬ãã«ãé¸æ</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090006.png" width="800" height="116" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ã¬ãã«ãä½æãé¸æ</figcaption></figure></p>
<p>以ä¸ãè¨å®ã [ä½æ] ãé¸æãã¾ãããã®æ¡ä»¶ã«ããã<strong>MFA èªè¨¼ãããã¦ããªãã¨ã¢ã¯ã»ã¹ããããã¯</strong>ããã¾ããæ¡ä»¶å¼ã®è©³ç´°ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã ããã</p>
<ul>
<li> <strong>ã¢ã¯ã»ã¹ã¬ãã«å</strong>ï¼ä»»æã®ååãå
¥åãã¾ãã</li>
<li><p> <strong>æ¡ä»¶</strong>ï¼[詳細] > <code>request.auth.claims.crd_str.mfa == true</code></p></li>
<li><p>åè : <a href="https://cloud.google.com/access-context-manager/docs/custom-access-level-spec?hl=ja">ã«ã¹ã¿ã ã¢ã¯ã»ã¹ã¬ãã«ã®ä»æ§</a></p></li>
<li>åè : <a href="https://support.google.com/a/answer/11368990?hl=ja">詳細ã¢ã¼ãã§ã®ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã®ä¾</a></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="2ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090030.png" width="732" height="579" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>2ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ</figcaption></figure></p>
<p>[çµäº] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="çµäºãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090120.png" width="490" height="245" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>çµäºãé¸æ</figcaption></figure></p>
<p>[ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹] > [ã¢ã¯ã»ã¹ã¬ãã«] ã¸ç§»åãã1ã¤ç®ã¨2ã¤ç®ã®ã«ã¼ã«ã®<code>CELå</code>ã確èªããæ§ãã¾ãã
<figure class="figure-image figure-image-fotolife" title="CELåã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090122.png" width="630" height="452" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>CELåã®ç¢ºèª</figcaption></figure></p>
<p>[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090006.png" width="800" height="116" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>[ã¢ã¯ã»ã¹ã¬ãã«ãä½æ] ãé¸æ</figcaption></figure></p>
<p>以ä¸ãè¨å®ã [ä½æ] ãé¸æãã¾ãããã®æ¡ä»¶ã«ããã<strong>è¤æ°ã®æ¡ä»¶ï¼IP ã¢ãã¬ã¹å¶éã¨å¤è¦ç´ èªè¨¼ï¼MFAï¼ï¼ãåæã«æºããå ´åã®ã¿</strong>ã¢ã¯ã»ã¹ã許å¯ããã¾ãã</p>
<ul>
<li> <strong>ã¢ã¯ã»ã¹ã¬ãã«å</strong>ï¼ä»»æã®ååãå
¥åãã¾ãã</li>
<li> <strong>æ¡ä»¶</strong>ï¼[詳細] > <code>levels.${{1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã® CEL å}} && levels.${{2ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã® CEL å}}</code></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090032.png" width="733" height="569" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®ä½æ</figcaption></figure></p>
<p>[ã»ãã¥ãªãã£] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹] ã¸ç§»åãã [ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ããé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090106.png" width="498" height="413" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ããªã«ã¢ã¯ã»ã¹ã¬ãã«ãå²ãå½ã¦ããé¸æ</figcaption></figure></p>
<p>ã¢ã¯ã»ã¹ã¬ãã«ãé©ç¨ãã対象ã¨ã¢ããªãé¸æãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="å²ãå½ã¦ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090109.png" width="241" height="404" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å²ãå½ã¦ãé¸æ</figcaption></figure></p>
<p>é©ç¨æ¸ã¿ã®1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ãåé¤ãã3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ãé¸æãã<code>ã¢ã¯ãã£ã</code>ã®ãã§ãã¯ãå
¥ãã¦ã[ç¶è¡] ãé¸æãã¾ãã</p>
<p><strong>æ¬çªç°å¢ã¸é©ç¨ããå ´åã¯ãã¾ã [ç£è¦] ã®ã¿ã«ãã§ãã¯ãå
¥ãã¦ã¢ãã¿ã¼ã¢ã¼ãã§å½±é¿ããªããã¨ã確èªããä¸ã§ãã¢ã¯ãã£ãã¢ã¼ãã«åãæ¿ãããã¨ãæ¨å¥¨ãã¾ãã</strong>
<figure class="figure-image figure-image-fotolife" title="1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®åé¤"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090035.png" width="800" height="175" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>1ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®åé¤</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090038.png" width="800" height="448" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®é¸æ</figcaption></figure></p>
<p>[ç¶è¡] ãé¸æããå
容ã確èªãã[å²ãå½ã¦] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ç¶è¡ãé¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090111.png" width="525" height="517" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç¶è¡ãé¸æ</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®é©ç¨"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090041.png" width="800" height="541" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>3ã¤ç®ã®ã¢ã¯ã»ã¹ã¬ãã«ã®é©ç¨</figcaption></figure></p>
<h2 id="è¤åæ¡ä»¶ã®åä½ç¢ºèªã¢ã¯ãã£ãã¢ã¼ã">è¤åæ¡ä»¶ã®åä½ç¢ºèªï¼ã¢ã¯ãã£ãã¢ã¼ãï¼</h2>
<p>社å
ã® IP ã¢ãã¬ã¹ã㤠MFA ãç¡å¹åããã¦ããã¢ã«ã¦ã³ãããã¢ã¯ã»ã¹ã確èªãã以ä¸ç»é¢ã表示ããããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="MFA ãç¡å¹ãªã¢ã«ã¦ã³ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090125.png" width="446" height="413" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>MFA ãç¡å¹ãªã¢ã«ã¦ã³ã</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="ãããã¯ç¢ºèªï¼è¤åæ¡ä»¶ï¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090044.png" width="358" height="275" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãããã¯ç¢ºèªï¼è¤åæ¡ä»¶ï¼</figcaption></figure></p>
<p>[ã¬ãã¼ã] > [ç£æ»ã¨èª¿æ»] > [ã³ã³ããã¹ãã¢ã¦ã§ã¢ ã¢ã¯ã»ã¹ã®ãã°ã¤ãã³ã] ãé¸æãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ãã°ã¤ãã³ãã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090018.png" width="263" height="563" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ã¤ãã³ãã®é¸æ</figcaption></figure></p>
<p>以ä¸ã®æ¡ä»¶ã§æ¤ç´¢ããã¢ã¯ãã£ãã¢ã¼ãã§æå¦ãããæ¥ç¶ãã°ã確èªãã¾ãã<code>ã¢ã¯ã»ã¹ã¬ãã«ã®ä¸è¶³</code>ã確èªãããã¨ã§ãã©ã®ã¢ã¯ã»ã¹ã¬ãã«ã§ãããã¯ãããããç¹å®ã§ãã¾ãã</p>
<ul>
<li><code>ã¤ãã³ã</code> <strong>次ã«ä¸è´</strong> <code>ã¢ã¯ã»ã¹ãæå¦ããã¾ãã</code></li>
<li><code>ã¢ã¯ã»ã¹ã¬ãã«ã®é©ç¨</code> <strong>次ã®æåãå«ã</strong> <code>ã¢ã¯ã»ã¹ã¬ãã«å</code></li>
</ul>
<p><figure class="figure-image figure-image-fotolife" title="ãã°ã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090047.png" width="671" height="482" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã°ã®ç¢ºèª</figcaption></figure></p>
<p>ã¢ã«ã¦ã³ãã®MFAãæå¹åå¾ããã°ã¢ã¦ãããMFAãå©ç¨ãã¦å度ãã°ã¤ã³ãã¾ãã</p>
<p>ãã°ã¤ã³æã«<code>ãã®ããã¤ã¹ã§ã¯æ¬¡åãã表示ããªã</code>ãé¸æããªãã§ãã ãããé¸æããã¨ã次å以éã®ãã°ã¤ã³ã§ MFA èªè¨¼ãçç¥ãããCAA ã«ãã£ã¦ã¢ã¯ã»ã¹ããããã¯ããã¾ãã</p>
<p>ä¸ãä¸é¸æãã¦ãã¾ã£ãå ´åã¯ã以ä¸ã®ããã¥ã¡ã³ããåç
§ãã¦ãã°ã¤ã³ Cookie ããªã»ãããã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://support.google.com/a/answer/178854?hl=ja">管ç対象㮠Google ã¢ã«ã¦ã³ããããã°ã¢ã¦ããã</a>
<figure class="figure-image figure-image-fotolife" title="MFA ãå©ç¨ãã¦ãã°ã¤ã³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090128.png" width="522" height="240" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>MFA ãå©ç¨ãã¦ãã°ã¤ã³</figcaption></figure></li>
</ul>
<p>Googleãã©ã¤ãã«ã¢ã¯ã»ã¹ããæ£å¸¸ã«è¡¨ç¤ºããããã¨ã確èªãã¾ãã
<figure class="figure-image figure-image-fotolife" title="ã¢ã¯ã»ã¹ç¢ºèª "><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241216/20241216090049.png" width="800" height="96" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¢ã¯ã»ã¹ç¢ºèª</figcaption></figure></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
Privileged Access Manager(PAM)ãTerraformã§ç®¡çãã
hatenablog://entry/6802418398305005654
2024-12-13T09:00:00+09:00
2024-12-13T09:05:03+09:00 G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ Privileged Access Manager ã Terraform ã§ç®¡çããæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ã¯ããã« æ¦è¦ Privileged Access Manager (PAM) PAM ã«å¿
è¦ãªæ¨©é å©ç¨è³æ ¼ã®ç®¡ç å©ç¨è³æ ¼ã®å©ç¨ (ç³è«ãæ¿èª) å
¨ä½æ§æ é£æºæ¹å¼ ã½ã¼ã¹ã³ã¼ã Direct Workload Identity ããã³ GitHub Actions ã¯ã¼ã¯ããã¼ Terraform ãã£ã¬ã¯ããªæ§æ env é
ä¸ (å¼ã³åºãå´) modules é
ä¸ (ã¢ã¸ã¥ã¼ã«) ããã㤠terraform plan terraform â¦
<p>G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ Privileged Access Manager ã Terraform ã§ç®¡çããæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#æ¦è¦">æ¦è¦</a></li>
<li><a href="#Privileged-Access-Manager-PAM">Privileged Access Manager (PAM)</a></li>
<li><a href="#PAM-ã«å¿
è¦ãªæ¨©é">PAM ã«å¿
è¦ãªæ¨©é</a><ul>
<li><a href="#å©ç¨è³æ ¼ã®ç®¡ç">å©ç¨è³æ ¼ã®ç®¡ç</a></li>
<li><a href="#å©ç¨è³æ ¼ã®å©ç¨-ç³è«æ¿èª">å©ç¨è³æ ¼ã®å©ç¨ (ç³è«ãæ¿èª)</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#å
¨ä½æ§æ">å
¨ä½æ§æ</a></li>
<li><a href="#é£æºæ¹å¼">é£æºæ¹å¼</a></li>
<li><a href="#ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</a><ul>
<li><a href="#Direct-Workload-Identity-ããã³-GitHub-Actions-ã¯ã¼ã¯ããã¼">Direct Workload Identity ããã³ GitHub Actions ã¯ã¼ã¯ããã¼</a></li>
<li><a href="#Terraform">Terraform</a><ul>
<li><a href="#ãã£ã¬ã¯ããªæ§æ">ãã£ã¬ã¯ããªæ§æ</a></li>
<li><a href="#env-é
ä¸-å¼ã³åºãå´">env é
ä¸ (å¼ã³åºãå´)</a></li>
<li><a href="#modules-é
ä¸-ã¢ã¸ã¥ã¼ã«">modules é
ä¸ (ã¢ã¸ã¥ã¼ã«)</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#ãããã¤">ãããã¤</a><ul>
<li><a href="#terraform-plan">terraform plan</a></li>
<li><a href="#terraform-apply">terraform apply</a></li>
<li><a href="#ãªã½ã¼ã¹">ãªã½ã¼ã¹</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#ç³è«">ç³è«</a></li>
<li><a href="#æ¿èª">æ¿èª</a></li>
<li><a href="#権éä»ä¸">権éä»ä¸</a></li>
<li><a href="#権éã¯ã奪">権éã¯ã奪</a></li>
<li><a href="#åç³è«">åç³è«</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090505.png" width="800" height="449" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="æ¦è¦">æ¦è¦</h2>
<p>å½è¨äºã§ã¯ Google Cloud ã«ãããä¸æç㪠IAM 権éä»ä¸ãå®ç¾ããä»çµã¿ã§ãã <strong>Privileged Access Manager</strong> (以éãPAM) ããTerraform 㨠GitHub Actions ã«ãã CI/CD ã§ç®¡çããæ¹æ³ãç´¹ä»ãã¾ãã</p>
<p>å½è¨äºã§å®ç¾ããã®ã¯ãPAM ã®ä»çµã¿ã®ãããã¤ã§ããAPI ã®æå¹åããµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸ã®æ¨©éä»ä¸ãå©ç¨è³æ ¼ (entitlements) ã®ä½æãªã©ã Terraform ã§è¡ããã¨ã§ããããã¤ä»¥é㯠PAM ã使ã£ãæ¿èªããã¼ã«ãããçµç¹ã® IAM 権éã管çãããã¨ãã§ããããã«ãªãã¾ãã</p>
<h2 id="Privileged-Access-Manager-PAM">Privileged Access Manager (PAM)</h2>
<p>PAM ã®è©³ç´°ã¯ä»¥ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fiam-privileged-access-manager" title="Privileged Access Managerï¼PAMï¼ãè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/iam-privileged-access-manager">blog.g-gen.co.jp</a></cite></p>
<p>PAM ã§ã®æ¨©é管çã®ä»çµã¿ã端çã«ã¾ã¨ããã¨ã<strong>å©ç¨è³æ ¼</strong> (entitlements) ã¨ããè¨å®æ
å ±ã«ãã¨ã¥ããä¸æçãªæ¨©éã®ä»ä¸ãè¡ããã®ã§ãã</p>
<p>å©ç¨è³æ ¼ï¼entitlementsï¼ã¯ PAM ã®ãªãã¸ã§ã¯ãã§ãããæ¿èªããã¼ã¨è¨ãæãããã¨ãã§ãã¾ããå©ç¨è³æ ¼ã«ã¯ãä»ä¸ãã IAM ãã¼ã«ãã権éãä»ä¸ããæ大æéãã誰ã権éããªã¯ã¨ã¹ãã§ããããã誰ããªã¯ã¨ã¹ããæ¿èªã§ããããã誰ãéç¥ãåãåããããªã©ãå®ç¾©ã§ãã¾ãã</p>
<p>æ¿èªããã¼ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<ol>
<li>ç³è«è
ã¯<code>å¿
è¦ãªæ¨©éãæéããã®çç±</code>ãå©ç¨è³æ ¼ã«æè¨ããæ¿èªè
ã«æåºãã</li>
<li>æ¿èªè
ã¯ããã®å¦¥å½æ§ã確èªãç³è«ã<code>æ¿èªãããã¯å¦èª</code>ãã</li>
<li>æ¿èªãããå ´åãç³è«è
ã«å¯¾ãä¸å®æé権éãä»ä¸ããã</li>
<li>æå®ã®æéãçµéããã¨ãç³è«è
ã«ä»ä¸ããã¦ãã権éã¯èªåçã«ã¯ã奪ããã</li>
</ol>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090612.png" width="800" height="643" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="PAM-ã«å¿
è¦ãªæ¨©é">PAM ã«å¿
è¦ãªæ¨©é</h2>
<p>PAM ã«å¿
è¦ãªæ¨©é (IAM ãã¼ã«) ã«ã¤ãã¦ã¯ä»¥ä¸ã®éãã§ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/iam/docs/pam-permissions-and-setup?hl=ja">Privileged Access Manager ã®æ¨©éã¨è¨å®</a></li>
</ul>
<h3 id="å©ç¨è³æ ¼ã®ç®¡ç">å©ç¨è³æ ¼ã®ç®¡ç</h3>
<p>å©ç¨è³æ ¼ã<code>管ç(ä½æãæ´æ°ãåé¤)</code>ããããªã³ã·ãã«ã«ã¯ã<strong>Privileged Access Manager 管çè
</strong> (<code>roles/privilegedaccessmanager.admin</code>) ãå¿
è¦ã§ãã</p>
<p>ã¾ããå©ç¨è³æ ¼ã<strong>çµç¹ããªã¼ã®ä¸ã®ã©ãã§</strong>å©ç¨ãããã«ãã£ã¦ã以ä¸ã®ããããã®æ¨©éãå¿
è¦ã§ãã</p>
<ul>
<li>çµç¹å
¨ä½ï¼ã»ãã¥ãªãã£ç®¡çè
ï¼<code>roles/iam.securityAdmin</code>ï¼</li>
<li>ãã©ã«ãï¼ãã©ã«ã IAM 管çè
ï¼<code>roles/resourcemanager.folderIamAdmin</code>ï¼</li>
<li>ããã¸ã§ã¯ãï¼Project IAM 管çè
ï¼<code>roles/resourcemanager.projectIamAdmin</code>ï¼</li>
</ul>
<h3 id="å©ç¨è³æ ¼ã®å©ç¨-ç³è«æ¿èª">å©ç¨è³æ ¼ã®å©ç¨ (ç³è«ãæ¿èª)</h3>
<p>å©ç¨è³æ ¼ãç¨ãã¦ã権éä»ä¸ãç³è«ããããããã¯ç³è«ãæ¿èªããããªã³ã·ãã«ã«ã¯ã<strong>Privileged Access Manager é²è¦§è
</strong> (<code>roles/privilegedaccessmanager.viewer</code>) ãå¿
è¦ã§ãã</p>
<h1 id="å
¨ä½æ§æ">å
¨ä½æ§æ</h1>
<p>å½è¨äºã§ã¯å©ç¨è³æ ¼ã <strong>Terraform 㨠GitHub Actions</strong> ã§ç®¡çãã¾ãã</p>
<p>å©ç¨è³æ ¼ã¯<code>çµç¹/ãã©ã«ã/ããã¸ã§ã¯ãã¬ãã«</code>ã§è¨å®å¯è½ã§ãããä»åã¯çµç¹ã¨ããã¸ã§ã¯ãã¬ãã«ã« PAM ããããã¤ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090509.png" width="800" height="514" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="é£æºæ¹å¼">é£æºæ¹å¼</h1>
<p>Google Cloud 㨠GitHub Actions ã®é£æºã«ã¯ <strong>Direct Workload Identity</strong> ã使ç¨ãã¾ãã</p>
<p>ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ããµã¼ãã¹ã¢ã«ã¦ã³ãã®æ¨©éãåç¨ããå¾æ¥æ¹å¼ã¨ã¯ç°ãªããWorkload Identity ãã¼ã«ã«å¿
è¦ãª IAM 権éãç´æ¥ä»ä¸ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/workload-identity-federation">Workload Identity Federation</a></li>
</ul>
<h1 id="ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</h1>
<h2 id="Direct-Workload-Identity-ããã³-GitHub-Actions-ã¯ã¼ã¯ããã¼">Direct Workload Identity ããã³ GitHub Actions ã¯ã¼ã¯ããã¼</h2>
<p>以ä¸ã®è¨äºã§ Direct Workload Identity ãä½æãã bash ã¹ã¯ãªãã㨠GitHub Actions ã®ã¯ã¼ã¯ããã¼ãæ²è¼ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcreate-direct-workload-identity-for-gha-terraform" title="Google Cloudã¨GitHub Actions(Terraform)ãé£æºããDirect Workload Identityãä½æããbashã¹ã¯ãªãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/create-direct-workload-identity-for-gha-terraform">blog.g-gen.co.jp</a></cite></p>
<p>ãªããä¸è¨ã®è¨äºã«æ²è¼ããã¹ã¯ãªããã§ä½æããã Workload Identity ãã¼ã«ã«å¯¾ãã¦ã¯ãçµç¹ã¬ãã«ã§ä»¥ä¸ã® IAM ãã¼ã«ãä»ä¸ãã¦ãããå©ç¨è³æ ¼ã®ç®¡çã«å¿
è¦ãªæ¨©éãå
å«ãã¦ãã¾ãã</p>
<ul>
<li>ãªã¼ãã¼ (<code>roles/owner</code>)</li>
<li>çµç¹ç®¡çè
(<code>roles/resourcemanager.organizationAdmin</code>)</li>
</ul>
<h2 id="Terraform">Terraform</h2>
<p>PAM ã®ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã®ãã£ã¬ã¯ããªæ§æã«ãã¨ã¥ãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/privileged_access_manager_entitlement">google_privileged_access_manager_entitlement</a></li>
</ul>
<h3 id="ãã£ã¬ã¯ããªæ§æ">ãã£ã¬ã¯ããªæ§æ</h3>
<pre class="code lang-sh" data-lang="sh" data-unlink>.
âââ env
â âââ Test_Environment
â â âââ yutakei
â â âââ backend.tf
â â âââ locals.tf
â â âââ main.tf
â â âââ versions.tf
â âââ organization
â âââ backend.tf
â âââ locals.tf
â âââ main.tf
â âââ versions.tf
âââ modules
âââ apis
â âââ main.tf
â âââ outputs.tf
â âââ variables.tf
âââ pam
âââ main.tf
âââ outputs.tf
âââ variables.tf
</pre>
<h3 id="env-é
ä¸-å¼ã³åºãå´">env é
ä¸ (å¼ã³åºãå´)</h3>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># backend.tf</span>
<span class="synType">terraform</span> <span class="synSpecial">{</span>
<span class="synType">backend</span> <span class="synConstant">"gcs"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">bucket</span> = <span class="synConstant">"common-tfstate"</span>
<span class="synIdentifier">prefix</span> = <span class="synConstant">"terraform/organization/state"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># locals.tf</span>
<span class="synType">locals</span> <span class="synSpecial">{</span>
<span class="synIdentifier">organization_id</span> = <span class="synConstant">"1234567890"</span>
<span class="synComment"># å©ç¨ç³è«(entitlements)ã®è¨å®</span>
<span class="synIdentifier">entitlements</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">pam_org1</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-organization-acm-demo"</span>
<span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
<span class="synIdentifier">eligible_users</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Organization"</span>
<span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/organizations/1234567890"</span>
<span class="synIdentifier">roles</span> = <span class="synSpecial">[</span>
<span class="synConstant">"roles/accesscontextmanager.gcpAccessReader"</span>,
<span class="synConstant">"roles/accesscontextmanager.policyReader"</span>
<span class="synSpecial">]</span>
<span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
<span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
<span class="synIdentifier">approvers</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># main.tf</span>
<span class="synComment"># çµç¹ã¬ãã«ã§PAMãæå¹ã«ããã«ã¯ãPAMãµã¼ãã¹ã¢ã«ã¦ã³ãã«PAMãµã¼ãã¹ã¨ã¼ã¸ã§ã³ããã¼ã«ãå¿
è¦</span>
<span class="synType">resource</span> <span class="synConstant">"google_organization_iam_member"</span> <span class="synConstant">"pam_service_agent"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">org_id</span> = local.organization_id
<span class="synIdentifier">role</span> = <span class="synConstant">"roles/privilegedaccessmanager.serviceAgent"</span>
<span class="synIdentifier">member</span> = <span class="synConstant">"serviceAccount:service-org-$</span><span class="synSpecial">{</span>local.organization_id<span class="synSpecial">}</span><span class="synConstant">@gcp-sa-pam.iam.gserviceaccount.com"</span>
<span class="synSpecial">}</span>
<span class="synType">module</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">source</span> = <span class="synConstant">"../../modules/pam"</span>
<span class="synIdentifier">entitlements</span> = local.entitlements
<span class="synIdentifier">parent</span> = <span class="synConstant">"organizations/$</span><span class="synSpecial">{</span>local.organization_id<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synIdentifier">location</span> = <span class="synConstant">"global"</span>
<span class="synSpecial">}</span>
<span class="synComment"># versions.tf</span>
<span class="synType">terraform</span> <span class="synSpecial">{</span>
<span class="synIdentifier">required_version</span> = <span class="synConstant">"~> 1.9.7"</span>
<span class="synType">required_providers</span> <span class="synSpecial">{</span>
<span class="synIdentifier">google</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">source</span> = <span class="synConstant">"hashicorp/google"</span>
<span class="synIdentifier">version</span> = <span class="synConstant">"~> 6.6.0"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
}
<span class="synType">provider</span> <span class="synConstant">"google"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">user_project_override</span> = <span class="synConstant">true</span>
<span class="synSpecial">}</span>
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># backend.tf</span>
<span class="synType">terraform</span> <span class="synSpecial">{</span>
<span class="synType">backend</span> <span class="synConstant">"gcs"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">bucket</span> = <span class="synConstant">"common-tfstate"</span>
<span class="synIdentifier">prefix</span> = <span class="synConstant">"terraform/yutakei/state"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># locals.tf</span>
<span class="synType">locals</span> <span class="synSpecial">{</span>
<span class="synIdentifier">project_id</span> = <span class="synConstant">"yutakei"</span>
<span class="synIdentifier">apis</span> = <span class="synSpecial">[</span>
<span class="synConstant">"privilegedaccessmanager.googleapis.com"</span>,
<span class="synSpecial">]</span>
<span class="synComment"># å©ç¨ç³è«(entitlements)ã®è¨å®</span>
<span class="synIdentifier">entitlements</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">pam1</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-yutakei-bigquery-demo"</span>
<span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
<span class="synIdentifier">eligible_users</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Project"</span>
<span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/projects/yutakei"</span>
<span class="synIdentifier">roles</span> = <span class="synSpecial">[</span><span class="synConstant">"roles/bigquery.jobUser"</span>, <span class="synConstant">"roles/bigquery.dataViewer"</span><span class="synSpecial">]</span>
<span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
<span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
<span class="synIdentifier">approvers</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synIdentifier">pam2</span> = <span class="synSpecial">{</span>
<span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-yutakei-gcs-demo"</span>
<span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
<span class="synIdentifier">eligible_users</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Project"</span>
<span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/projects/yutakei"</span>
<span class="synIdentifier">roles</span> = <span class="synSpecial">[</span><span class="synConstant">"roles/storage.admin"</span><span class="synSpecial">]</span>
<span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
<span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
<span class="synIdentifier">approvers</span> = <span class="synSpecial">[</span><span class="synConstant">"user:[email protected]"</span><span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># main.tf</span>
<span class="synType">module</span> <span class="synConstant">"apis"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">source</span> = <span class="synConstant">"../../../modules/apis"</span>
<span class="synIdentifier">project_id</span> = local.project_id
<span class="synIdentifier">apis</span> = local.apis
<span class="synSpecial">}</span>
<span class="synType">module</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">source</span> = <span class="synConstant">"../../../modules/pam"</span>
<span class="synIdentifier">entitlements</span> = local.entitlements
<span class="synIdentifier">parent</span> = <span class="synConstant">"projects/$</span><span class="synSpecial">{</span>local.project_id<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synIdentifier">location</span> = <span class="synConstant">"global"</span>
<span class="synSpecial">}</span>
<span class="synComment"># versions.tf</span>
å²æ
</pre>
<h3 id="modules-é
ä¸-ã¢ã¸ã¥ã¼ã«">modules é
ä¸ (ã¢ã¸ã¥ã¼ã«)</h3>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># main.tf</span>
<span class="synType">resource</span> <span class="synConstant">"google_privileged_access_manager_entitlement"</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">for_each</span> = var.entitlements
<span class="synIdentifier">entitlement_id</span> = each.value.entitlement_id
<span class="synIdentifier">location</span> = var.location
<span class="synIdentifier">max_request_duration</span> = each.value.max_request_duration
<span class="synIdentifier">parent</span> = var.parent
<span class="synType">requester_justification_config</span> <span class="synSpecial">{</span>
<span class="synType">unstructured</span> <span class="synSpecial">{}</span>
<span class="synSpecial">}</span>
<span class="synType">eligible_users</span> <span class="synSpecial">{</span>
<span class="synIdentifier">principals</span> = each.value.eligible_users
<span class="synSpecial">}</span>
<span class="synType">privileged_access</span> <span class="synSpecial">{</span>
<span class="synType">gcp_iam_access</span> <span class="synSpecial">{</span>
<span class="synIdentifier">resource_type</span> = each.value.resource_type
<span class="synIdentifier">resource</span> = each.value.resource
<span class="synComment"># è¤æ°ã®role_bindingsãçæ</span>
<span class="synType">dynamic</span> <span class="synConstant">"role_bindings"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">for_each</span> = each.value.roles
<span class="synType">content</span> <span class="synSpecial">{</span>
<span class="synIdentifier">role</span> = role_bindings.value
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synType">approval_workflow</span> <span class="synSpecial">{</span>
<span class="synType">manual_approvals</span> <span class="synSpecial">{</span>
<span class="synIdentifier">require_approver_justification</span> = each.value.require_approver_justification
<span class="synType">steps</span> <span class="synSpecial">{</span>
<span class="synIdentifier">approvals_needed</span> = each.value.approvals_needed
<span class="synType">approvers</span> <span class="synSpecial">{</span>
<span class="synIdentifier">principals</span> = each.value.approvers
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># outputs.tf</span>
<span class="synType">output</span> <span class="synConstant">"entitlement_ids"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"List of entitlement IDs created"</span>
<span class="synIdentifier">value</span> = <span class="synSpecial">[</span><span class="synStatement">for</span> entitlement <span class="synStatement">in</span> google_privileged_access_manager_entitlement.pam : entitlement.entitlement_id<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synType">variable</span> <span class="synConstant">"entitlements"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"A map of entitlement configurations"</span>
<span class="synIdentifier">type</span> = <span class="synType">map</span>(<span class="synType">object</span>(<span class="synSpecial">{</span>
<span class="synIdentifier">entitlement_id</span> = <span class="synType">string</span>
<span class="synIdentifier">max_request_duration</span> = <span class="synType">string</span>
<span class="synIdentifier">eligible_users</span> = <span class="synType">list</span>(<span class="synType">string</span>)
<span class="synIdentifier">resource_type</span> = <span class="synType">string</span>
<span class="synIdentifier">resource</span> = <span class="synType">string</span>
<span class="synIdentifier">roles</span> = <span class="synType">list</span>(<span class="synType">string</span>)
<span class="synIdentifier">require_approver_justification</span> = <span class="synType">bool</span>
<span class="synIdentifier">approvals_needed</span> = <span class="synType">number</span>
<span class="synIdentifier">approvers</span> = <span class="synType">list</span>(<span class="synType">string</span>)
<span class="synSpecial">}</span>))
<span class="synSpecial">}</span>
<span class="synComment"># variables.tf</span>
<span class="synType">variable</span> <span class="synConstant">"parent"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"Parent resource (e.g., project, folder, or organization)"</span>
<span class="synIdentifier">type</span> = <span class="synType">string</span>
<span class="synSpecial">}</span>
<span class="synType">variable</span> <span class="synConstant">"location"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"Location for the entitlement"</span>
<span class="synIdentifier">type</span> = <span class="synType">string</span>
<span class="synIdentifier">default</span> = <span class="synConstant">"global"</span>
<span class="synSpecial">}</span>
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># main.tf</span>
<span class="synType">resource</span> <span class="synConstant">"google_project_service"</span> <span class="synConstant">"apis"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">for_each</span> = <span class="synIdentifier">toset</span>(var.apis)
<span class="synIdentifier">project</span> = var.project_id
<span class="synIdentifier">service</span> = each.value
<span class="synIdentifier">disable_on_destroy</span> = <span class="synConstant">false</span>
<span class="synSpecial">}</span>
<span class="synComment"># APIã®æå¹åã«ã¯æéãããããããå¾
æ©æéãè¨å®</span>
<span class="synType">resource</span> <span class="synConstant">"null_resource"</span> <span class="synConstant">"delay"</span> <span class="synSpecial">{</span>
<span class="synType">provisioner</span> <span class="synConstant">"local-exec"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">command</span> = <span class="synConstant">"sleep 180"</span>
<span class="synSpecial">}</span>
<span class="synIdentifier">depends_on</span> = <span class="synSpecial">[</span>google_project_service.apis<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synComment"># outputs.tf</span>
<span class="synType">output</span> <span class="synConstant">"enabled_apis"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"List of enabled APIs for the project"</span>
<span class="synIdentifier">value</span> = <span class="synSpecial">[</span><span class="synStatement">for</span> service <span class="synStatement">in</span> google_project_service.apis : service.id<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synComment"># variables.tf</span>
<span class="synType">variable</span> <span class="synConstant">"apis"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"List of APIs to enable"</span>
<span class="synIdentifier">type</span> = <span class="synType">list</span>(<span class="synType">string</span>)
<span class="synSpecial">}</span>
<span class="synType">variable</span> <span class="synConstant">"project_id"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"The ID of the project to create resources in"</span>
<span class="synIdentifier">type</span> = <span class="synType">string</span>
<span class="synSpecial">}</span>
</pre>
<h1 id="ãããã¤">ãããã¤</h1>
<h2 id="terraform-plan">terraform plan</h2>
<p>GitHub Actions (<code>terraform plan</code>) ã®å®è¡çµæã§ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090513.png" width="800" height="293" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># çµç¹åãã®ã¯ã¼ã¯ããã¼(terraform plan)</span>
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
<span class="synComment"># google_organization_iam_member.pam_service_agent will be created</span>
+ resource <span class="synConstant">"google_organization_iam_member"</span> <span class="synConstant">"pam_service_agent"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">etag</span> = (known after apply)
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">member</span> = <span class="synConstant">"serviceAccount:[email protected]"</span>
+ <span class="synIdentifier">org_id</span> = <span class="synConstant">"1234567890"</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/privilegedaccessmanager.serviceAgent"</span>
<span class="synSpecial">}</span>
<span class="synComment"># module.pam.google_privileged_access_manager_entitlement.pam["pam_org1"] will be created</span>
+ resource <span class="synConstant">"google_privileged_access_manager_entitlement"</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">create_time</span> = (known after apply)
+ <span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-organization-acm-demo"</span>
+ <span class="synIdentifier">etag</span> = (known after apply)
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">location</span> = <span class="synConstant">"global"</span>
+ <span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
+ <span class="synIdentifier">name</span> = (known after apply)
+ <span class="synIdentifier">parent</span> = <span class="synConstant">"organizations/1234567890"</span>
+ <span class="synIdentifier">state</span> = (known after apply)
+ <span class="synIdentifier">update_time</span> = (known after apply)
+ approval_workflow <span class="synSpecial">{</span>
+ manual_approvals <span class="synSpecial">{</span>
+ <span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
+ steps <span class="synSpecial">{</span>
+ <span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
+ approvers <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ eligible_users <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
+ privileged_access <span class="synSpecial">{</span>
+ gcp_iam_access <span class="synSpecial">{</span>
+ <span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/organizations/1234567890"</span>
+ <span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Organization"</span>
+ role_bindings <span class="synSpecial">{</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/accesscontextmanager.gcpAccessReader"</span>
<span class="synSpecial">}</span>
+ role_bindings <span class="synSpecial">{</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/accesscontextmanager.policyReader"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ requester_justification_config <span class="synSpecial">{</span>
+ unstructured <span class="synSpecial">{}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
Plan: <span class="synConstant">2</span> to add, <span class="synConstant">0</span> to change, <span class="synConstant">0</span> to destroy.
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># ããã¸ã§ã¯ãåãã®ã¯ã¼ã¯ããã¼(terraform plan)</span>
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
<span class="synComment"># module.apis.google_project_service.apis["privilegedaccessmanager.googleapis.com"] will be created</span>
+ resource <span class="synConstant">"google_project_service"</span> <span class="synConstant">"apis"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">disable_on_destroy</span> = <span class="synConstant">false</span>
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">project</span> = <span class="synConstant">"yutakei"</span>
+ <span class="synIdentifier">service</span> = <span class="synConstant">"privilegedaccessmanager.googleapis.com"</span>
<span class="synSpecial">}</span>
<span class="synComment"># module.apis.null_resource.delay will be created</span>
+ resource <span class="synConstant">"null_resource"</span> <span class="synConstant">"delay"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">id</span> = (known after apply)
<span class="synSpecial">}</span>
<span class="synComment"># module.pam.google_privileged_access_manager_entitlement.pam["pam1"] will be created</span>
+ resource <span class="synConstant">"google_privileged_access_manager_entitlement"</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">create_time</span> = (known after apply)
+ <span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-yutakei-bigquery-demo"</span>
+ <span class="synIdentifier">etag</span> = (known after apply)
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">location</span> = <span class="synConstant">"global"</span>
+ <span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
+ <span class="synIdentifier">name</span> = (known after apply)
+ <span class="synIdentifier">parent</span> = <span class="synConstant">"projects/yutakei"</span>
+ <span class="synIdentifier">state</span> = (known after apply)
+ <span class="synIdentifier">update_time</span> = (known after apply)
+ approval_workflow <span class="synSpecial">{</span>
+ manual_approvals <span class="synSpecial">{</span>
+ <span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
+ steps <span class="synSpecial">{</span>
+ <span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
+ approvers <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ eligible_users <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
+ privileged_access <span class="synSpecial">{</span>
+ gcp_iam_access <span class="synSpecial">{</span>
+ <span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/projects/yutakei"</span>
+ <span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Project"</span>
+ role_bindings <span class="synSpecial">{</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/bigquery.jobUser"</span>
<span class="synSpecial">}</span>
+ role_bindings <span class="synSpecial">{</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/bigquery.dataViewer"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ requester_justification_config <span class="synSpecial">{</span>
+ unstructured <span class="synSpecial">{}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synComment"># module.pam.google_privileged_access_manager_entitlement.pam["pam2"] will be created</span>
+ resource <span class="synConstant">"google_privileged_access_manager_entitlement"</span> <span class="synConstant">"pam"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">create_time</span> = (known after apply)
+ <span class="synIdentifier">entitlement_id</span> = <span class="synConstant">"pam-yutakei-gcs-demo"</span>
+ <span class="synIdentifier">etag</span> = (known after apply)
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">location</span> = <span class="synConstant">"global"</span>
+ <span class="synIdentifier">max_request_duration</span> = <span class="synConstant">"3600s"</span>
+ <span class="synIdentifier">name</span> = (known after apply)
+ <span class="synIdentifier">parent</span> = <span class="synConstant">"projects/yutakei"</span>
+ <span class="synIdentifier">state</span> = (known after apply)
+ <span class="synIdentifier">update_time</span> = (known after apply)
+ approval_workflow <span class="synSpecial">{</span>
+ manual_approvals <span class="synSpecial">{</span>
+ <span class="synIdentifier">require_approver_justification</span> = <span class="synConstant">true</span>
+ steps <span class="synSpecial">{</span>
+ <span class="synIdentifier">approvals_needed</span> = <span class="synConstant">1</span>
+ approvers <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ eligible_users <span class="synSpecial">{</span>
+ <span class="synIdentifier">principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"user:[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
+ privileged_access <span class="synSpecial">{</span>
+ gcp_iam_access <span class="synSpecial">{</span>
+ <span class="synIdentifier">resource</span> = <span class="synConstant">"//cloudresourcemanager.googleapis.com/projects/yutakei"</span>
+ <span class="synIdentifier">resource_type</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com/Project"</span>
+ role_bindings <span class="synSpecial">{</span>
+ <span class="synIdentifier">role</span> = <span class="synConstant">"roles/storage.admin"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
+ requester_justification_config <span class="synSpecial">{</span>
+ unstructured <span class="synSpecial">{}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
Plan: <span class="synConstant">4</span> to add, <span class="synConstant">0</span> to change, <span class="synConstant">0</span> to destroy.
</pre>
<h2 id="terraform-apply">terraform apply</h2>
<p>GitHub Actions (<code>terraform apply</code>) ã®å®è¡çµæã§ããæ»ãå¤ã¯å
ã»ã©åæ§ã®ããå²æãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090517.png" width="800" height="291" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="ãªã½ã¼ã¹">ãªã½ã¼ã¹</h2>
<p>çµç¹ã§ã¯ <code>PAM ãµã¼ãã¹ã¢ã«ã¦ã³ãã«å¯¾ãã IAM Policy</code>ã¨<code>å©ç¨è³æ ¼</code>ããããã¤ããã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090520.png" width="800" height="279" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>
<span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090524.png" width="800" height="255" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ããã¸ã§ã¯ãã§ã<code>å©ç¨è³æ ¼</code>ããããã¤ããã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090527.png" width="800" height="255" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="ç³è«">ç³è«</h2>
<p>ç³è«è
ã®ã¢ã«ã¦ã³ã㧠PAM ã®ç®¡çç»é¢ã«ã¢ã¯ã»ã¹ãã<code>権éä»ä¸ããªã¯ã¨ã¹ã</code> ãã¯ãªãã¯ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090531.png" width="800" height="226" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>以ä¸3é
ç®ãå
¥åãã<code>権éä»ä¸ããªã¯ã¨ã¹ã</code>ãã¯ãªãã¯ããã¨ãæ¿èªããã¼ãæ¿èªè
ã¸ã¨é²ã¿ã¾ãã</p>
<ul>
<li><code>権éä»ä¸ã®æé</code> (å¿
é ãæ大æéã1æéã®å ´åã30å/45å/1æéããé¸æã§ãã)</li>
<li><code>çç±</code> (å¿
é )</li>
<li><code>éç¥ã®åä¿¡è
</code> (ä»»æãçç¥ãã¦ãå©ç¨è³æ ¼ã§è¨å®ããæ¿èªè
ã«ã¡ã¼ã«éç¥ãè¡ããã)</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090534.png" width="800" height="548" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>æ¿èªãããã¾ã§ã®éãå½è©²å©ç¨è³æ ¼ã®ã¹ãã¼ã¿ã¹ã¯ <code>Approval Awaited</code> ã¨ãªãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090538.png" width="800" height="206" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>`</p>
<h2 id="æ¿èª">æ¿èª</h2>
<p>æ¿èªè
ã®ã¢ã«ã¦ã³ã㧠PAM ã®ç®¡çç»é¢ã«ã¢ã¯ã»ã¹ããã¨ãç³è«è
ããã®æ¿èªããã¼ãåã£ã¦ãããã¨ããããã¾ãã</p>
<p>以ä¸ã®ã¡ã¼ã«éç¥ãå±ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090550.png" width="800" height="698" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p><code>æ¿èª / æå¦</code>ãã¯ãªãã¯ãç³è«å
容ã確èªãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090542.png" width="800" height="204" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ã³ã¡ã³ãæ¬ (å¿
é ) ã«æ¿èªããæ¨ãå
¥åãã<code>æ¿èª</code>ãã¯ãªãã¯ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090545.png" width="800" height="565" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="権éä»ä¸">権éä»ä¸</h2>
<p>æ¿èªè
ã«ã¯ä»¥ä¸ã®ã¡ã¼ã«éç¥ãå±ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090554.png" width="800" height="784" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>å©ç¨è³æ ¼ã®ã¹ãã¼ã¿ã¹ã <code>Approval Awaited > Active</code> ã¨ãªã£ã¦ããã権éä»ä¸ã®æ®ãæéã表示ããã¦ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090558.png" width="800" height="207" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>IAM Policy ã®ç®¡çç»é¢ã確èªããã¨ãä»åå©ç¨è³æ ¼ã®ä¸ã§å®ç¾©ãã2ã¤ã®ãã¼ã«ã PAM ã«ãã£ã¦ä»ä¸ããããã¨ããããã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090601.png" width="800" height="206" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="権éã¯ã奪">権éã¯ã奪</h2>
<p>ç³è«æã«å¸æããä»ä¸æé (ä»åã¯30å) ãçµéããã¨ãå
ã»ã©ã¾ã§ä»ä¸ããã¦ãããã¼ã«ã PAM ã«ãã£ã¦ã¯ã奪ããã¦ãããã¨ããããã¾ãã<br/>
<span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090608.png" width="800" height="189" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="åç³è«">åç³è«</h2>
<p>å©ç¨è³æ ¼ã®ã¹ãã¼ã¿ã¹ã <code>Available</code> (ç³è«éå§åã®ç¶æ
) ã«æ»ã£ã¦ãããå¿
è¦ãªéã«ã¯å度åãå©ç¨è³æ ¼ã使ã£ã¦ç³è«ãè¡ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241213/20241213090605.png" width="800" height="212" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-yutakei/20220512/20220512214329.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">æ¦äº ç¥ä» <a href="https://blog.g-gen.co.jp/archive/author/ggen-yutakei">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨æå±ãG-genå¯ä¸ã®å±±æ¢¨çå¨ä½ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2025 é¸åºãIaC ã CI/CD å¨ãã®ãµã¼ãã¹ããããã¯ããèå³åéã§ãã</p>
<p class="sw-profile__txt">趣å³ã¯ãã¼ããã¤ã¯ããã¼ãã¬ã¼ã¹ããµãã«ã¼è¦³æ¦ã§ãã</p>
<!-- 以ä¸ã®è¡ã追å -->
<a href="https://twitter.com/ggenyutakei?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ggenyutakei</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-yutakei
Google Cloudã¨GitHub Actions(Terraform)ãé£æºããDirect Workload Identityãä½æããbashã¹ã¯ãªãã
hatenablog://entry/6802418398303133454
2024-12-11T09:00:00+09:00
2024-12-11T09:00:03+09:00 G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ Google Cloud 㨠GitHub Actions (Terraform) ãé£æºãã Direct Workload Identity ãä½æãã bash ã¹ã¯ãªãããç´¹ä»ãã¾ãã ã¯ããã« æ¦è¦ 以åã®è¨äºã¨ã®éã å¶éäºé
åææ¡ä»¶ å
責äºé
ã½ã¼ã¹ã³ã¼ã ã¹ã¯ãªããã®ä½¿ãæ¹ èªè¨¼ å¤æ°è¨å® å®è¡ ãªã½ã¼ã¹ã®ç¢ºèª Workload Identity ãã¼ã«ã»ãããã¤ãã¼ ãµã¼ãã¹ã¢ã«ã¦ã³ã Workload Identity ãã¼ã«ã® IAM Policy æ§æ ã½ã¼ã¹ã³ã¼ã (Terraform) Terraform ãã£ã¬ã¯ããªæ§æ ã¯ã¼â¦
<p>G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ Google Cloud 㨠GitHub Actions (Terraform) ãé£æºãã Direct Workload Identity ãä½æãã bash ã¹ã¯ãªãããç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#æ¦è¦">æ¦è¦</a></li>
<li><a href="#以åã®è¨äºã¨ã®éã">以åã®è¨äºã¨ã®éã</a></li>
<li><a href="#å¶éäºé
">å¶éäºé
</a></li>
<li><a href="#åææ¡ä»¶">åææ¡ä»¶</a></li>
<li><a href="#å
責äºé
">å
責äºé
</a></li>
</ul>
</li>
<li><a href="#ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</a></li>
<li><a href="#ã¹ã¯ãªããã®ä½¿ãæ¹">ã¹ã¯ãªããã®ä½¿ãæ¹</a><ul>
<li><a href="#èªè¨¼">èªè¨¼</a></li>
<li><a href="#å¤æ°è¨å®">å¤æ°è¨å®</a></li>
<li><a href="#å®è¡">å®è¡</a></li>
<li><a href="#ãªã½ã¼ã¹ã®ç¢ºèª">ãªã½ã¼ã¹ã®ç¢ºèª</a><ul>
<li><a href="#Workload-Identity-ãã¼ã«ãããã¤ãã¼">Workload Identity ãã¼ã«ã»ãããã¤ãã¼</a></li>
<li><a href="#ãµã¼ãã¹ã¢ã«ã¦ã³ã">ãµã¼ãã¹ã¢ã«ã¦ã³ã</a></li>
<li><a href="#Workload-Identity-ãã¼ã«ã®-IAM-Policy">Workload Identity ãã¼ã«ã® IAM Policy</a></li>
</ul>
</li>
<li><a href="#æ§æ">æ§æ</a></li>
<li><a href="#ã½ã¼ã¹ã³ã¼ã-Terraform">ã½ã¼ã¹ã³ã¼ã (Terraform)</a><ul>
<li><a href="#Terraform-ãã£ã¬ã¯ããªæ§æ">Terraform ãã£ã¬ã¯ããªæ§æ</a></li>
<li><a href="#ã¯ã¼ã¯ããã¼-terraformyaml">ã¯ã¼ã¯ããã¼ (terraform.yaml)</a></li>
<li><a href="#envdemo-é
ä¸-å¼ã³åºãå´">env/demo é
ä¸ (å¼ã³åºãå´)</a></li>
<li><a href="#modulesapis-é
ä¸-ã¢ã¸ã¥ã¼ã«">modules/apis é
ä¸ (ã¢ã¸ã¥ã¼ã«)</a></li>
</ul>
</li>
<li><a href="#ãã«ãªã¯ã¨ã¹ã-terraform-plan">ãã«ãªã¯ã¨ã¹ã (terraform plan)</a></li>
<li><a href="#ãã¼ã¸-terraform-apply">ãã¼ã¸ (terraform apply)</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090037.png" width="800" height="449" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="æ¦è¦">æ¦è¦</h2>
<p>å½è¨äºã§ç´¹ä»ããã®ã¯ãGoogle Cloud 㨠GitHub Actions (Terraform) ã¨ã®é£æºã«å¿
è¦ãª <strong>Direct Workload Identity</strong> ãªã½ã¼ã¹ãä½æãã bash ã¹ã¯ãªããã§ãã</p>
<h2 id="以åã®è¨äºã¨ã®éã">以åã®è¨äºã¨ã®éã</h2>
<p>以åå·çããè¨äºã§ç´¹ä»ããã®ã¯ã<code>ãµã¼ãã¹ã¢ã«ã¦ã³ãã®æ¨©éãåç¨ããå½¢å¼</code>ã® Workload Identity ãªã½ã¼ã¹ãä½æããã¹ã¯ãªããã§ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcreate-workload-identity-for-gha-terraform" title="Google Cloudã¨GitHub Actions(Terraform)ãé£æºããWorkload Identityãä½æããbashã¹ã¯ãªãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/create-workload-identity-for-gha-terraform">blog.g-gen.co.jp</a></cite></p>
<p>ä»åãç´¹ä»ããã®ã¯ã<strong><code>Workload Identity ãã¼ã«ã«å¿
è¦ãªæ¨©é (IAM ãã¼ã«) ãç´æ¥ä»ä¸ããå½¢å¼</code></strong>ã® Workload Identity ãªã½ã¼ã¹ãä½æããã¹ã¯ãªããã§ãã</p>
<p>ãã®æ¹å¼ã¯ããµã¼ãã¹ã¢ã«ã¦ã³ãã®æãåºãããµã¼ãã¹ã¢ã«ã¦ã³ããåç¨ããããã®æ¨©éä»ä¸ãå¿
è¦ãªããããå¾æ¥ãããã»ãã¥ã¢ãªé£æºãå¯è½ã§ãGoogle Cloudããªãã³ã« GitHub ã®å
¬å¼ããã¥ã¡ã³ãä¸ã§ãæ¨å¥¨ããã¦ãã¾ãã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/iam/docs/workload-identity-federation?hl=ja#access_management">ã¢ã¯ã»ã¹ç®¡ç</a></li>
<li>åèï¼<a href="https://github.com/google-github-actions/auth?tab=readme-ov-file#preferred-direct-workload-identity-federation">(Preferred) Direct Workload Identity Federation</a></li>
</ul>
<h2 id="å¶éäºé
">å¶éäºé
</h2>
<p>æ¨å¥¨ãããå½¢å¼ã§ã¯ãããã®ã®ãDirect Workload Identity ã«ã¯<strong>対å¿å¯è½ãªãããã¯ããæ©è½ã«å¶éãããã¾ãã</strong></p>
<p>対å¿ãã¦ããªããããã¯ãããã®æ©è½ã管çãããå ´åãå¾æ¥å½¢å¼ (ãµã¼ãã¹ã¢ã«ã¦ã³ãã®æ¨©éãåç¨ããå½¢å¼) ã® Workload Identity ããå©ç¨ãã ããã</p>
<ul>
<li>åèï¼<a href="https://cloud.google.com/iam/docs/federated-identity-supported-services?hl=ja">ID é£æº: ãããã¯ãã¨å¶éäºé
</a></li>
</ul>
<h2 id="åææ¡ä»¶">åææ¡ä»¶</h2>
<p>å½ bash ã¹ã¯ãªããã¯ã<code>Debian GNU/Linux 12 (bookworm)</code> ä¸ã§éçºãããåä½ç¢ºèªããã¦ãã¾ãã</p>
<p>ã¾ãã以ä¸ã®ã½ããã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ãåæã§ããã«ãã³å
ã¯éçºæã®ãã¼ã¸ã§ã³ã§ãã</p>
<ul>
<li>gcloudï¼<code>Google Cloud SDK 486.0.0</code>ï¼</li>
</ul>
<p>ã¹ã¯ãªããå®è¡æã¯ãå®è¡å
ã®ããã¸ã§ã¯ãã«å¯¾ã㦠gcloud CLI ãèªè¨¼ããå¿
è¦ãããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/sdk/docs/authorizing?hl=ja#user-account">ã¦ã¼ã¶ã¼ ã¢ã«ã¦ã³ãã使ç¨ãã¦èªå¯ãã</a></li>
<li>åè : <a href="https://cloud.google.com/sdk/docs/authorizing?hl=ja#service-account">ãµã¼ãã¹ ã¢ã«ã¦ã³ãã使ç¨ãã¦æ¿èªãã</a></li>
</ul>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fdifference-of-gloud-auth-commands" title="gcloud auth loginã¨gcloud auth application-default loginã®éãã¨ã¯ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/difference-of-gloud-auth-commands">blog.g-gen.co.jp</a></cite></p>
<h2 id="å
責äºé
">å
責äºé
</h2>
<p>å½è¨äºã§ç´¹ä»ããããã°ã©ã ã®ã½ã¼ã¹ã³ã¼ãã¯ããèªèº«ã®è²¬ä»»ã®ãã¨ã使ç¨ãå¼ç¨ãæ¹å¤ãåé
å¸ãã¦æ§ãã¾ããã</p>
<p>ãã ããåã½ã¼ã¹ã³ã¼ããåå ã§çºçããä¸å©çããã©ãã«ã«ã¤ãã¦ã¯ãå½ç¤¾ã¯ä¸åã®è²¬ä»»ãè² ãã¾ããã</p>
<h1 id="ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</h1>
<p>åè¿°ã® <code>å
責äºé
</code> ããç解ã®ããããå©ç¨ãã ããã</p>
<p><strong>init.sh</strong></p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment">#!/bin/bash</span>
<span class="synComment"># ã¨ã©ã¼ãã³ããªã³ã°: ã¨ã©ã¼ãçºçãããã¹ã¯ãªãããçµäº</span>
<span class="synStatement">set</span><span class="synIdentifier"> </span><span class="synSpecial">-e</span>
<span class="synComment"># å¤æ°ã®è¨å®</span>
<span class="synIdentifier">PROJECT_ID</span>=<span class="synStatement">""</span> <span class="synComment"># ããã¸ã§ã¯ãID (ex: gha-demo-prj) </span>
<span class="synIdentifier">PROJECT_NUMBER</span>=<span class="synStatement">""</span> <span class="synComment"># ããã¸ã§ã¯ãçªå· (ex: 1234567890)</span>
<span class="synIdentifier">ORGANIZATION_ID</span>=<span class="synStatement">""</span> <span class="synComment"># ããã¸ã§ã¯ãã®çµç¹ID (ex: 0123456789)</span>
<span class="synIdentifier">WORKLOAD_IDENTITY_POOL</span>=<span class="synStatement">""</span> <span class="synComment"># Workload Identityãã¼ã«å (ex: gha-demo-pool)</span>
<span class="synIdentifier">WORKLOAD_IDENTITY_PROVIDER</span>=<span class="synStatement">""</span> <span class="synComment"># Workload Identityãããã¤ãå (ex: gha-demo-provider)</span>
<span class="synIdentifier">GITHUB_REPO</span>=<span class="synStatement">""</span> <span class="synComment"># GitHubãªãã¸ããªå (ex: gha-demo-org/gha-demo-repo)</span>
<span class="synComment"># ãã°åºåé¢æ°</span>
<span class="synIdentifier">log() {</span>
<span class="synStatement">echo</span><span class="synConstant"> </span><span class="synStatement">"</span><span class="synConstant">[INFO] </span><span class="synPreProc">$1</span><span class="synStatement">"</span>
<span class="synIdentifier">}</span>
<span class="synIdentifier">log_error() {</span>
<span class="synStatement">echo</span><span class="synConstant"> </span><span class="synStatement">"</span><span class="synConstant">[ERROR] </span><span class="synPreProc">$1</span><span class="synStatement">"</span><span class="synConstant"> </span><span class="synStatement">>&2</span>
<span class="synIdentifier">}</span>
<span class="synComment"># 1. IAM Credential API ãæå¹å</span>
<span class="synStatement">if !</span> gcloud services list <span class="synSpecial">--enabled</span> <span class="synSpecial">--filter</span><span class="synStatement">="</span><span class="synConstant">name:iamcredentials.googleapis.com</span><span class="synStatement">"</span> <span class="synSpecial">--format</span><span class="synStatement">="</span><span class="synConstant">value(name)</span><span class="synStatement">"</span> <span class="synStatement">|</span> <span class="synStatement">grep</span> <span class="synStatement">"</span><span class="synConstant">iamcredentials.googleapis.com</span><span class="synStatement">"</span> <span class="synStatement">></span>/dev/null <span class="synConstant">2</span><span class="synStatement">>&</span><span class="synConstant">1</span><span class="synStatement">;</span> <span class="synStatement">then</span>
log <span class="synStatement">"</span><span class="synConstant">IAM Credential API ãæå¹ã«ãã¦ãã¾ã...</span><span class="synStatement">"</span>
gcloud services <span class="synStatement">enable</span> iamcredentials.googleapis.com <span class="synSpecial">--project</span><span class="synStatement">="</span><span class="synPreProc">$PROJECT_ID</span><span class="synStatement">"</span>
<span class="synStatement">else</span>
log <span class="synStatement">"</span><span class="synConstant">IAM Credential API ã¯æ¢ã«æå¹åããã¦ãã¾ã</span><span class="synStatement">"</span>
<span class="synStatement">fi</span>
<span class="synComment"># 2. Workload Identity ãã¼ã«ã®ä½æ</span>
<span class="synStatement">if !</span> gcloud iam workload-identity-pools describe <span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span> <span class="synSpecial">--location</span><span class="synStatement">="</span><span class="synConstant">global</span><span class="synStatement">"</span> <span class="synSpecial">--project</span><span class="synStatement">="</span><span class="synPreProc">$PROJECT_ID</span><span class="synStatement">"</span> <span class="synStatement">></span>/dev/null <span class="synConstant">2</span><span class="synStatement">>&</span><span class="synConstant">1</span><span class="synStatement">;</span> <span class="synStatement">then</span>
log <span class="synStatement">"</span><span class="synConstant">Workload Identity ãã¼ã«ãä½æä¸: </span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span>
gcloud iam workload-identity-pools create <span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span> \
<span class="synSpecial">--project</span><span class="synStatement">="</span><span class="synPreProc">$PROJECT_ID</span><span class="synStatement">"</span> \
<span class="synSpecial">--location</span><span class="synStatement">="</span><span class="synConstant">global</span><span class="synStatement">"</span> \
<span class="synSpecial">--display-name</span><span class="synStatement">="</span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span>
<span class="synStatement">else</span>
log <span class="synStatement">"</span><span class="synConstant">Workload Identity ãã¼ã«ã¯æ¢ã«åå¨ãã¾ã: </span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span>
<span class="synStatement">fi</span>
<span class="synComment"># 3. Workload Identity ãããã¤ãã®ä½æ</span>
<span class="synStatement">if !</span> gcloud iam workload-identity-pools providers describe <span class="synPreProc">$WORKLOAD_IDENTITY_PROVIDER</span> <span class="synSpecial">--workload-identity-pool</span><span class="synStatement">="</span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span> <span class="synSpecial">--location</span><span class="synStatement">="</span><span class="synConstant">global</span><span class="synStatement">"</span> <span class="synSpecial">--project</span><span class="synStatement">="</span><span class="synPreProc">$PROJECT_ID</span><span class="synStatement">"</span> <span class="synStatement">></span>/dev/null <span class="synConstant">2</span><span class="synStatement">>&</span><span class="synConstant">1</span><span class="synStatement">;</span> <span class="synStatement">then</span>
log <span class="synStatement">"</span><span class="synConstant">Workload Identity ãããã¤ããä½æä¸: </span><span class="synPreProc">$WORKLOAD_IDENTITY_PROVIDER</span><span class="synStatement">"</span>
gcloud iam workload-identity-pools providers create-oidc <span class="synPreProc">$WORKLOAD_IDENTITY_PROVIDER</span> \
<span class="synSpecial">--project</span><span class="synStatement">="</span><span class="synPreProc">$PROJECT_ID</span><span class="synStatement">"</span> \
<span class="synSpecial">--location</span><span class="synStatement">="</span><span class="synConstant">global</span><span class="synStatement">"</span> \
<span class="synSpecial">--workload-identity-pool</span><span class="synStatement">="</span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span> \
<span class="synSpecial">--display-name</span><span class="synStatement">="</span><span class="synPreProc">$WORKLOAD_IDENTITY_PROVIDER</span><span class="synStatement">"</span> \
<span class="synSpecial">--issuer-uri</span><span class="synStatement">="</span><span class="synConstant">https://token.actions.githubusercontent.com</span><span class="synStatement">"</span> \
<span class="synSpecial">--attribute-mapping</span><span class="synStatement">="</span><span class="synConstant">google.subject=assertion.sub,attribute.actor=assertion.actor,attribute.repository=assertion.repository</span><span class="synStatement">"</span> \
<span class="synSpecial">--attribute-condition</span><span class="synStatement">="</span><span class="synConstant">assertion.repository=='</span><span class="synPreProc">$GITHUB_REPO</span><span class="synConstant">'</span><span class="synStatement">"</span>
<span class="synStatement">else</span>
log <span class="synStatement">"</span><span class="synConstant">Workload Identity ãããã¤ãã¯æ¢ã«åå¨ãã¾ã: </span><span class="synPreProc">$WORKLOAD_IDENTITY_PROVIDER</span><span class="synStatement">"</span>
<span class="synStatement">fi</span>
<span class="synComment"># 4. çµç¹ã¬ãã«ã§ã®ãã¼ã«ä»ä¸</span>
log <span class="synStatement">"</span><span class="synConstant">çµç¹ã¬ãã«ã§ã®ãã¼ã«ä»ä¸ã®ç¢ºèª</span><span class="synStatement">"</span>
<span class="synStatement">for</span> role <span class="synStatement">in</span> <span class="synStatement">"</span><span class="synConstant">roles/resourcemanager.organizationAdmin</span><span class="synStatement">"</span> <span class="synStatement">"</span><span class="synConstant">roles/owner</span><span class="synStatement">"</span>; <span class="synStatement">do</span>
<span class="synStatement">if !</span> gcloud organizations get-iam-policy <span class="synPreProc">$ORGANIZATION_ID</span> <span class="synSpecial">--flatten</span><span class="synStatement">="</span><span class="synConstant">bindings[].members</span><span class="synStatement">"</span> <span class="synSpecial">--filter</span><span class="synStatement">="</span><span class="synConstant">bindings.members:principalSet://iam.googleapis.com/projects/</span><span class="synPreProc">$PROJECT_NUMBER</span><span class="synConstant">/locations/global/workloadIdentityPools/</span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synConstant"> AND bindings.role:</span><span class="synPreProc">$role</span><span class="synStatement">"</span> <span class="synSpecial">--format</span><span class="synStatement">="</span><span class="synConstant">value(bindings.role)</span><span class="synStatement">"</span> <span class="synStatement">|</span> <span class="synStatement">grep</span> <span class="synStatement">"</span><span class="synPreProc">$role</span><span class="synStatement">"</span> <span class="synStatement">></span>/dev/null <span class="synConstant">2</span><span class="synStatement">>&</span><span class="synConstant">1</span><span class="synStatement">;</span> <span class="synStatement">then</span>
log <span class="synStatement">"</span><span class="synPreProc">$role</span><span class="synConstant"> ãWorkload Identity ãã¼ã«ã«ä»ä¸ä¸: </span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span>
gcloud organizations add-iam-policy-binding <span class="synPreProc">$ORGANIZATION_ID</span> \
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">principalSet://iam.googleapis.com/projects/</span><span class="synPreProc">$PROJECT_NUMBER</span><span class="synConstant">/locations/global/workloadIdentityPools/</span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synConstant">/attribute.repository/</span><span class="synPreProc">$GITHUB_REPO</span><span class="synStatement">"</span> \
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synPreProc">$role</span><span class="synStatement">"</span>
<span class="synStatement">else</span>
log <span class="synStatement">"</span><span class="synPreProc">$role</span><span class="synConstant"> ã¯æ¢ã«Workload Identity ãã¼ã«ã«ä»ä¸ããã¦ãã¾ã: </span><span class="synPreProc">$WORKLOAD_IDENTITY_POOL</span><span class="synStatement">"</span>
<span class="synStatement">fi</span>
<span class="synStatement">done</span>
log <span class="synStatement">"</span><span class="synConstant">Direct Workload Identity è¨å®ãå®äºãã¾ããã</span><span class="synStatement">"</span>
</pre>
<h1 id="ã¹ã¯ãªããã®ä½¿ãæ¹">ã¹ã¯ãªããã®ä½¿ãæ¹</h1>
<h2 id="èªè¨¼">èªè¨¼</h2>
<p>ã¾ãã¯å®è¡å
ã®ããã¸ã§ã¯ãã«å¯¾ã㦠gcloud CLI ã®èªè¨¼ãéãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># å®è¡å
ããã¸ã§ã¯ãã®ç¢ºèª</span>
$ gcloud config list
<span class="synStatement">[</span>core<span class="synStatement">]</span>
account <span class="synStatement">=</span> [email protected]
disable_usage_reporting <span class="synStatement">=</span> True
project <span class="synStatement">=</span> gha-demo-prj
Your active configuration is: <span class="synStatement">[</span>gha-demo-prj<span class="synStatement">]</span>
<span class="synComment"># gcloud CLI ã®èªè¨¼</span>
$ gcloud auth login
~~ä¸ç¥~~
You are now logged <span class="synError">in</span> as <span class="synStatement">[</span>[email protected]<span class="synStatement">]</span>.
Your current project is <span class="synStatement">[</span>gha-demo-prj<span class="synStatement">]</span>.
</pre>
<h2 id="å¤æ°è¨å®">å¤æ°è¨å®</h2>
<p><code>7~12è¡ç®</code>ã®å¤æ°ã«ç°å¢æ
å ±ãå
¥åãã¾ãã</p>
<p>â» å½ã¹ã¯ãªããã§ã¯ããµã¼ãã¹ã¢ã«ã¦ã³ãã®å¤æ°å®ç¾©ã¯ããã¾ããã</p>
<h2 id="å®è¡">å®è¡</h2>
<p>ã¹ã¯ãªããã«å®è¡æ¨©éãä»ä¸ãã¦å®è¡ãã¾ãã</p>
<p>â» å½ã¹ã¯ãªããã§ã¯ã以ä¸ã®ãªã½ã¼ã¹ã¯ä½æãã¾ããã</p>
<ul>
<li><code>ãµã¼ãã¹ã¢ã«ã¦ã³ã</code></li>
<li><code>ãµã¼ãã¹ã¢ã«ã¦ã³ããåç¨ããããã® IAM Policy</code></li>
<li><code>Workload Identity ãã¼ã«ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ç´ã¥ã</code></li>
</ul>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># å®è¡æ¨©éä»ä¸</span>
$ <span class="synStatement">chmod</span> <span class="synSpecial">+x</span> init.sh
$ <span class="synStatement">ls</span> <span class="synSpecial">-l</span>
-rwxr-xr-x <span class="synConstant">1</span> test-user test-user <span class="synConstant">3784</span> Nov <span class="synConstant">12</span> 14:27 init.sh
</pre>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã¹ã¯ãªããå®è¡</span>
$ ./init.sh
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> IAM Credential API ã¯æ¢ã«æå¹åããã¦ãã¾ã
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> Workload Identity ãã¼ã«ãä½æä¸: gha-demo-pool
Created workload identity pool <span class="synStatement">[</span>gha-demo-pool<span class="synStatement">]</span>.
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> Workload Identity ãããã¤ããä½æä¸: gha-demo-provider
Created workload identity pool provider <span class="synStatement">[</span>gha-demo-provider<span class="synStatement">]</span>.
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> çµç¹ã¬ãã«ã§ã®ãã¼ã«ä»ä¸ã®ç¢ºèª
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> roles/resourcemanager.organizationAdmin ãWorkload Identity ãã¼ã«ã«ä»ä¸ä¸: gha-demo-pool
Updated IAM policy <span class="synStatement">for</span> organization <span class="synStatement">[</span><span class="synConstant">0123456789</span><span class="synStatement">]</span>.
~~ä¸ç¥~~
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> roles/owner ãWorkload Identity ãã¼ã«ã«ä»ä¸ä¸: gha-demo-pool
Updated IAM policy <span class="synStatement">for</span> organization <span class="synStatement">[</span><span class="synConstant">0123456789</span><span class="synStatement">]</span>.
~~ä¸ç¥~~
<span class="synStatement">[</span>INFO<span class="synStatement">]</span> Workload Identity è¨å®ãå®äºãã¾ããã
</pre>
<h2 id="ãªã½ã¼ã¹ã®ç¢ºèª">ãªã½ã¼ã¹ã®ç¢ºèª</h2>
<h3 id="Workload-Identity-ãã¼ã«ãããã¤ãã¼">Workload Identity ãã¼ã«ã»ãããã¤ãã¼</h3>
<p>以ä¸ã®ããã«ä½æããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Workload Identity ãã¼ã« (1/2)"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090011.png" width="800" height="330" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identity ãã¼ã« (1/2)</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="Workload Identity ãã¼ã« (2/2)ããµã¼ãã¹ã¢ã«ã¦ã³ãã使ç¨ãã¦ããªã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090014.png" width="800" height="335" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identity ãã¼ã« (2/2)ããµã¼ãã¹ã¢ã«ã¦ã³ãã使ç¨ãã¦ããªã</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="Workload Identity ãããã¤ãã¼ (1/2)"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090018.png" width="800" height="490" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identity ãããã¤ãã¼ (1/2)</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="Workload Identity ãããã¤ãã¼ (2/2)"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090021.png" width="800" height="553" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identity ãããã¤ãã¼ (2/2)</figcaption></figure></p>
<h3 id="ãµã¼ãã¹ã¢ã«ã¦ã³ã">ãµã¼ãã¹ã¢ã«ã¦ã³ã</h3>
<p>åè¿°ã®éããDirect Workload Identity ã«ãµã¼ãã¹ã¢ã«ã¦ã³ãã¯ä¸è¦ãªãããå½ã¹ã¯ãªããã§ã¯ä½æãã¾ããã</p>
<h3 id="Workload-Identity-ãã¼ã«ã®-IAM-Policy">Workload Identity ãã¼ã«ã® IAM Policy</h3>
<p>以ä¸ã®ããã«ä½æããã¾ãã<br/>
â» IAM ãã¼ã«ã¯é©ç¨å
ã®ã»ãã¥ãªãã£ããªã·ã¼ã«å¿ãã¦èª¿æ´ãã¦ãã ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="çµç¹ã¬ãã«ã® IAM Policy"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090047.png" width="800" height="357" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>çµç¹ã¬ãã«ã® IAM Policy</figcaption></figure></p>
<h2 id="æ§æ">æ§æ</h2>
<p>å½ã¹ã¯ãªããã§ä½æããã Workload Identity ã使ããGoogle Cloud ããã¸ã§ã¯ãã«å¯¾ãã <code>terraform plan</code> ã <code>terraform apply</code> ããGitHub Actions ã§èªååãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241028/20241028090051.png" width="800" height="323" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ã¯ã¼ã¯ããã¼ã Terraform ã½ã¼ã¹ã³ã¼ãã¯æ¬¡é
ã«è¨è¼ã®ãã®ã使ç¨ãã¾ãã<br/>
ãå©ç¨ãããå ´åã¯ãåè¿°ã® <code>å
責äºé
</code> ããç解ã®ããããå©ç¨ãã ããã</p>
<h2 id="ã½ã¼ã¹ã³ã¼ã-Terraform">ã½ã¼ã¹ã³ã¼ã (Terraform)</h2>
<h3 id="Terraform-ãã£ã¬ã¯ããªæ§æ">Terraform ãã£ã¬ã¯ããªæ§æ</h3>
<pre class="code lang-sh" data-lang="sh" data-unlink>.
âââ .github
â âââ workflows
â âââ terraform.yaml
âââ env
â âââ demo
â âââ backend.tf
â âââ locals.tf
â âââ main.tf
â âââ versions.tf
âââ modules
â âââ apis
â âââ main.tf
â âââ outputs.tf
â âââ variables.tf
âââ .gitignore
âââ init.sh
âââ README.md
</pre>
<h3 id="ã¯ã¼ã¯ããã¼-terraformyaml">ã¯ã¼ã¯ããã¼ (terraform.yaml)</h3>
<p>以ä¸ã®å¤ããèªèº«ã®ç°å¢ã§ä½æãããªã½ã¼ã¹ã«ç½®ãæãã¦ãã ããã</p>
<ul>
<li><code>38è¡ç®</code>ï¼ Workload Identity ãããã¤ãã¼</li>
</ul>
<p>Direct Workload Identity ã§ã¯ã<code>google-github-actions/auth@v2</code> ã§ãµã¼ãã¹ã¢ã«ã¦ã³ããå®ç¾©ããå¿
è¦ã¯ããã¾ããã</p>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synIdentifier">name</span><span class="synSpecial">:</span> terraform
<span class="synComment"># main ãã©ã³ãã¸ã® Pull request 㨠Merge</span>
<span class="synIdentifier">on</span><span class="synSpecial">:</span>
<span class="synIdentifier">pull_request</span><span class="synSpecial">:</span>
<span class="synIdentifier">branches</span><span class="synSpecial">:</span>
<span class="synStatement">- </span>main
<span class="synIdentifier">push</span><span class="synSpecial">:</span>
<span class="synIdentifier">branches</span><span class="synSpecial">:</span>
<span class="synStatement">- </span>main
<span class="synComment"># ã¸ã§ã (GitHUb runners ã§å®è¡)</span>
<span class="synIdentifier">jobs</span><span class="synSpecial">:</span>
<span class="synIdentifier">terraform-workflow</span><span class="synSpecial">:</span>
<span class="synIdentifier">runs-on</span><span class="synSpecial">:</span> ubuntu-latest
<span class="synIdentifier">permissions</span><span class="synSpecial">:</span>
<span class="synIdentifier">id-token</span><span class="synSpecial">:</span> write
<span class="synIdentifier">contents</span><span class="synSpecial">:</span> read
<span class="synIdentifier">pull-requests</span><span class="synSpecial">:</span> write
<span class="synIdentifier">strategy</span><span class="synSpecial">:</span>
<span class="synIdentifier">matrix</span><span class="synSpecial">:</span>
<span class="synComment"> # tf_working_dir ã« main.tf (å¼ã³åºãå´) ã®ãã£ã¬ã¯ããªãæå®</span>
<span class="synIdentifier">tf_working_dir</span><span class="synSpecial">:</span>
<span class="synStatement">- </span>./env/demo
<span class="synIdentifier">steps</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/checkout@v4
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Checkout
<span class="synIdentifier">id</span><span class="synSpecial">:</span> checkout
<span class="synComment"> # Workload Identity é£æº</span>
<span class="synComment"> # https://cloud.google.com/iam/docs/using-workload-identity-federation#generate-automatic</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> <span class="synConstant">'auth'</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> <span class="synConstant">'Authenticate to Google Cloud'</span>
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> <span class="synConstant">'google-github-actions/auth@v2'</span>
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">workload_identity_provider</span><span class="synSpecial">:</span> <span class="synConstant">'projects/1234567890/locations/global/workloadIdentityPools/gha-demo-pool/providers/gha-demo-provider'</span>
<span class="synComment"> # https://github.com/marketplace/actions/setup-tfcmt </span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> shmokmt/actions-setup-tfcmt@v2
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Setup tfcmt
<span class="synComment"> # https://github.com/marketplace/actions/setup-github-comment</span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> shmokmt/actions-setup-github-comment@v2
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Setup github-comment
<span class="synComment"> # https://github.com/actions/setup-node</span>
<span class="synComment"> # https://github.com/hashicorp/setup-terraform/issues/84</span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/setup-node@v4
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">node-version</span><span class="synSpecial">:</span> <span class="synConstant">'18'</span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> hashicorp/setup-terraform@v3
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Setup terraform
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform fmt
<span class="synIdentifier">id</span><span class="synSpecial">:</span> fmt
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
cd ${{ matrix.tf_working_dir }}
terraform fmt -recursive
<span class="synIdentifier">continue-on-error</span><span class="synSpecial">:</span> <span class="synConstant">true</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform Init
<span class="synIdentifier">id</span><span class="synSpecial">:</span> init
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
cd ${{ matrix.tf_working_dir }}
terraform init -upgrade
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform Validate
<span class="synIdentifier">id</span><span class="synSpecial">:</span> validate
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
cd ${{ matrix.tf_working_dir }}
terraform validate
<span class="synComment"> # main ãã©ã³ã㸠pull request ããéã« terraform plan ãå®è¡</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform Plan
<span class="synIdentifier">id</span><span class="synSpecial">:</span> plan
<span class="synIdentifier">if</span><span class="synSpecial">:</span> github.event_name == <span class="synConstant">'pull_request'</span>
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
cd ${{ matrix.tf_working_dir }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
tfcmt -var target:${{ matrix.tf_working_dir }} plan -- terraform plan --parallelism=50
github-comment hide -condition <span class="synConstant">'Comment.Body contains "No changes."'</span>
<span class="synIdentifier">continue-on-error</span><span class="synSpecial">:</span> <span class="synConstant">true</span>
<span class="synComment"> # terraform status ã§å¤±æããéã« workflow ãåæ¢</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform Plan Status
<span class="synIdentifier">id</span><span class="synSpecial">:</span> status
<span class="synIdentifier">if</span><span class="synSpecial">:</span> steps.plan.outcome == <span class="synConstant">'failure'</span>
<span class="synIdentifier">run</span><span class="synSpecial">:</span> exit <span class="synConstant">1</span>
<span class="synComment"> # main ãã©ã³ã㸠push ããéã« terraform apply ãå®è¡</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Terraform Apply
<span class="synIdentifier">id</span><span class="synSpecial">:</span> apply
<span class="synIdentifier">if</span><span class="synSpecial">:</span> github.ref == <span class="synConstant">'refs/heads/main'</span> <span class="synType">&&</span> github.event_name == <span class="synConstant">'push'</span>
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
cd ${{ matrix.tf_working_dir }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
tfcmt -var target:${{ matrix.tf_working_dir }} apply -- terraform apply -auto-approve -input=<span class="synConstant">false</span> --parallelism=50
</pre>
<h3 id="envdemo-é
ä¸-å¼ã³åºãå´">env/demo é
ä¸ (å¼ã³åºãå´)</h3>
<pre class="code lang-tf" data-lang="tf" data-unlink># backend.tf
terraform <span class="synSpecial">{</span>
backend "<span class="synConstant">gcs</span>" <span class="synSpecial">{</span>
bucket <span class="synStatement">=</span> "<span class="synConstant">gha-demo-prj-tfstate</span>"
prefix <span class="synStatement">=</span> "<span class="synConstant">terraform/state</span>"
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
# locals.tf
locals <span class="synSpecial">{</span>
project_id <span class="synStatement">=</span> "<span class="synConstant">gha-demo-prj</span>"
apis <span class="synStatement">=</span> <span class="synSpecial">[</span>
"<span class="synConstant">artifactregistry.googleapis.com</span>",
"<span class="synConstant">cloudapis.googleapis.com</span>",
"<span class="synConstant">cloudasset.googleapis.com</span>",
"<span class="synConstant">cloudresourcemanager.googleapis.com</span>",
"<span class="synConstant">iam.googleapis.com</span>",
"<span class="synConstant">iamcredentials.googleapis.com</span>",
"<span class="synConstant">servicemanagement.googleapis.com</span>",
"<span class="synConstant">serviceusage.googleapis.com</span>",
"<span class="synConstant">sts.googleapis.com</span>",
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
# main.tf
module "<span class="synConstant">apis</span>" <span class="synSpecial">{</span>
source <span class="synStatement">=</span> "<span class="synConstant">../../modules/apis</span>"
project_id <span class="synStatement">=</span> local.project_id
apis <span class="synStatement">=</span> local.apis
<span class="synSpecial">}</span>
# versions.tf
terraform <span class="synSpecial">{</span>
required_version <span class="synStatement">=</span> "<span class="synConstant">~> 1.9.7</span>"
required_providers <span class="synSpecial">{</span>
google <span class="synStatement">=</span> <span class="synSpecial">{</span>
source <span class="synStatement">=</span> "<span class="synConstant">hashicorp/google</span>"
<span class="synStatement">version</span> <span class="synStatement">=</span> "<span class="synConstant">~> 6.6.0</span>"
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
provider "<span class="synConstant">google</span>" <span class="synSpecial">{</span>
user_project_override <span class="synStatement">=</span> true
<span class="synSpecial">}</span>
</pre>
<h3 id="modulesapis-é
ä¸-ã¢ã¸ã¥ã¼ã«">modules/apis é
ä¸ (ã¢ã¸ã¥ã¼ã«)</h3>
<pre class="code lang-tf" data-lang="tf" data-unlink># main.tf
resource "<span class="synConstant">google_project_service</span>" "<span class="synConstant">apis</span>" <span class="synSpecial">{</span>
for_each <span class="synStatement">=</span> toset<span class="synSpecial">(</span>var.apis<span class="synSpecial">)</span>
project <span class="synStatement">=</span> var.project_id
service <span class="synStatement">=</span> each.value
disable_on_destroy <span class="synStatement">=</span> false
<span class="synSpecial">}</span>
resource "<span class="synConstant">null_resource</span>" "<span class="synConstant">delay</span>" <span class="synSpecial">{</span>
provisioner "<span class="synConstant">local-exec</span>" <span class="synSpecial">{</span>
command <span class="synStatement">=</span> "<span class="synConstant">sleep 180</span>"
<span class="synSpecial">}</span>
depends_on <span class="synStatement">=</span> <span class="synSpecial">[</span>google_project_service.apis<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
# outputs.tf
output "<span class="synConstant">enabled_apis</span>" <span class="synSpecial">{</span>
description <span class="synStatement">=</span> "<span class="synConstant">List of enabled APIs for the project</span>"
value <span class="synStatement">=</span> <span class="synSpecial">[</span><span class="synStatement">for</span> service in google_project_service.apis <span class="synStatement">:</span> service.id<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
# variables.tf
variable "<span class="synConstant">apis</span>" <span class="synSpecial">{</span>
description <span class="synStatement">=</span> "<span class="synConstant">List of APIs to enable</span>"
type <span class="synStatement">=</span> <span class="synStatement">list</span><span class="synSpecial">(</span>string<span class="synSpecial">)</span>
<span class="synSpecial">}</span>
variable "<span class="synConstant">project_id</span>" <span class="synSpecial">{</span>
description <span class="synStatement">=</span> "<span class="synConstant">The ID of the project to create resources in</span>"
type <span class="synStatement">=</span> string
<span class="synSpecial">}</span>
</pre>
<h2 id="ãã«ãªã¯ã¨ã¹ã-terraform-plan">ãã«ãªã¯ã¨ã¹ã (terraform plan)</h2>
<p>Direct Workload Identity ã§ããmain ãã©ã³ãã¸ã®ãã«ãªã¯ã¨ã¹ããããªã¬ã¼ã« <code>terraform plan</code> ãå®è¡ããã¾ããã<br/>
â» ãã«ãªã¯ã¨ã¹ãã®å ´åã<code>terraform apply</code> ã¯ã¹ãããããã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090025.png" width="800" height="277" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>
<span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090027.png" width="800" height="545" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>
<figure class="figure-image figure-image-fotolife" title="ãã«ãªã¯ã¨ã¹ããããªã¬ã¼ã« terraform plan ãèªåå®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090044.png" width="800" height="707" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã«ãªã¯ã¨ã¹ããããªã¬ã¼ã« terraform plan ãèªåå®è¡</figcaption></figure></p>
<h2 id="ãã¼ã¸-terraform-apply">ãã¼ã¸ (terraform apply)</h2>
<p>Direct Workload Identity ã§ããmain ãã©ã³ãã¸ã®ãã¼ã¸ãããªã¬ã¼ã« <code>terraform apply</code> ãå®è¡ããã¾ããã<br/>
â» ãã¼ã¸ã®å ´åã<code>terraform plan</code> ã¯ã¹ãããããã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090031.png" width="800" height="272" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>
<span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090034.png" width="800" height="544" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span>
<figure class="figure-image figure-image-fotolife" title="ãã¼ã¸ãããªã¬ã¼ã« terraform apply ãèªåå®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241211/20241211090041.png" width="800" height="574" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã¼ã¸ãããªã¬ã¼ã« terraform apply ãèªåå®è¡</figcaption></figure></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-yutakei/20220512/20220512214329.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">æ¦äº ç¥ä» <a href="https://blog.g-gen.co.jp/archive/author/ggen-yutakei">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨æå±ãG-genå¯ä¸ã®å±±æ¢¨çå¨ä½ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2025 é¸åºãIaC ã CI/CD å¨ãã®ãµã¼ãã¹ããããã¯ããèå³åéã§ãã</p>
<p class="sw-profile__txt">趣å³ã¯ãã¼ããã¤ã¯ããã¼ãã¬ã¼ã¹ããµãã«ã¼è¦³æ¦ã§ãã</p>
<!-- 以ä¸ã®è¡ã追å -->
<a href="https://twitter.com/ggenyutakei?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ggenyutakei</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-yutakei
Googleãã©ã¤ãããã¼ã¿ã½ã¼ã¹ã¨ããVertex AI Searchã¢ããªã§Pythonããã®æ¤ç´¢çµæãã¼ãã«ãªãå ´åã®å¯¾å¦æ³
hatenablog://entry/6802418398309090409
2024-12-09T09:00:00+09:00
2024-12-09T09:00:03+09:00 G-gen ã®å åã§ããå½è¨äºã§ã¯ãGoogle ãã©ã¤ãããã¼ã¿ã½ã¼ã¹ã¨ãã Vertex AI Search ã¢ããªã«å¯¾ãã¦ãPython ããæ¤ç´¢ãè¡ãéã«æ¤ç´¢çµæã0件ã«ãªã£ã¦ãã¾ãå ´åã®å¯¾å¦æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ã¯ããã« æ¤ç´¢ã失æããã±ã¼ã¹ Google Cloud APIs ã®ãã£ã³ãã«ã v1alpha 以å¤ã®å ´å ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ããå ´å 対å¦æ³ Python Client ãµã³ãã«ã³ã¼ã ãã¤ã³ã ã©ã¤ãã©ãªã®ãã£ã³ãã«æå® credentials Requests ã©ã¤ãã©ãªãç¨ãã¦ã®ç´æ¥ã¢ã¯ã»ã¹ ãµã³ãã«ã³ã¼ã ãã¤ã³ã ã¯ããã« å½è¨äºã§ã¯ãGoogle Clâ¦
<p>G-gen ã®å åã§ããå½è¨äºã§ã¯ã<strong>Google ãã©ã¤ã</strong>ããã¼ã¿ã½ã¼ã¹ã¨ãã <strong>Vertex AI Search</strong> ã¢ããªã«å¯¾ãã¦ãPython ããæ¤ç´¢ãè¡ãéã«æ¤ç´¢çµæã0件ã«ãªã£ã¦ãã¾ãå ´åã®å¯¾å¦æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#æ¤ç´¢ã失æããã±ã¼ã¹">æ¤ç´¢ã失æããã±ã¼ã¹</a><ul>
<li><a href="#Google-Cloud-APIs-ã®ãã£ã³ãã«ã-v1alpha-以å¤ã®å ´å">Google Cloud APIs ã®ãã£ã³ãã«ã v1alpha 以å¤ã®å ´å</a></li>
<li><a href="#ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ããå ´å">ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ããå ´å</a></li>
</ul>
</li>
<li><a href="#対å¦æ³">対å¦æ³</a></li>
<li><a href="#Python-Client">Python Client</a><ul>
<li><a href="#ãµã³ãã«ã³ã¼ã">ãµã³ãã«ã³ã¼ã</a></li>
<li><a href="#ãã¤ã³ã">ãã¤ã³ã</a><ul>
<li><a href="#ã©ã¤ãã©ãªã®ãã£ã³ãã«æå®">ã©ã¤ãã©ãªã®ãã£ã³ãã«æå®</a></li>
</ul>
</li>
<li><a href="#credentials">credentials</a></li>
</ul>
</li>
<li><a href="#Requests-ã©ã¤ãã©ãªãç¨ãã¦ã®ç´æ¥ã¢ã¯ã»ã¹">Requests ã©ã¤ãã©ãªãç¨ãã¦ã®ç´æ¥ã¢ã¯ã»ã¹</a><ul>
<li><a href="#ãµã³ãã«ã³ã¼ã-1">ãµã³ãã«ã³ã¼ã</a></li>
<li><a href="#ãã¤ã³ã-1">ãã¤ã³ã</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241206/20241206081549.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p>å½è¨äºã§ã¯ãGoogle Cloudï¼æ§ç§° GCPï¼ãæä¾ããæ¤ç´¢ã¨ã³ã¸ã³ãµã¼ãã¹ã§ãã <strong>Vertex AI Search</strong> ã«ããã¦ã<strong>Google ãã©ã¤ã</strong>ããã¼ã¿ã½ã¼ã¹ã¨ãã Vertex AI Search ã¢ããªã«å¯¾ãã¦ãPython ããæ¤ç´¢ãè¡ãæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã</p>
<p>Vertex AI Search ã¢ããªã Python ããæ¤ç´¢ããã«ã¯ã次㮠2 ã¤ã®æ¹æ³ãããã¾ãã</p>
<ol>
<li><a href="https://cloud.google.com/python/docs/reference/discoveryengine/latest">Python Client</a> ãç¨ããæ¹æ³</li>
<li>Requests ã©ã¤ãã©ãªãç¨ãã¦ç´æ¥ <a href="https://cloud.google.com/generative-ai-app-builder/docs/reference/rest">Google Cloud APIs</a> ã«ã¢ã¯ã»ã¹ããæ¹æ³</li>
</ol>
<p>ãããå®è£
æ¹æ³ã«ãã£ã¦ã¯ãæ¤ç´¢çµæã0件ã«ãªã£ã¦ãã¾ãå ´åãããã¾ãã</p>
<h1 id="æ¤ç´¢ã失æããã±ã¼ã¹">æ¤ç´¢ã失æããã±ã¼ã¹</h1>
<h2 id="Google-Cloud-APIs-ã®ãã£ã³ãã«ã-v1alpha-以å¤ã®å ´å">Google Cloud APIs ã®ãã£ã³ãã«ã v1alpha 以å¤ã®å ´å</h2>
<p>å½è¨äºãå·çãã2024å¹´12æç¾å¨ãGoogle ãã©ã¤ãããã¼ã¿ã½ã¼ã¹ã¨ãã Vertex AI Search ã¢ããªã¸ã®æ¤ç´¢ã¯ããPython Client ãç¨ããæ¹æ³ããç´æ¥ Google Cloud APIs ã«ã¢ã¯ã»ã¹ããæ¹æ³ãã®ä¸¡æ¹ã¨ãã<strong>v1alpha</strong> ã§ã®ã¿æå¾
éãåä½ãã¾ããä¸æ¹ã§ãv1 ã¾ã㯠v1beta ãç¨ããå ´åã¯ãæ¤ç´¢çµæã0件ã«ãªãã¾ãã</p>
<p>Google Cloud APIs ã«ãã㦠v1alpha ã¨ã¯ãAPI ã®ãã¼ã¸ã§ã³ã示ããã£ã³ãã«ã®1ã¤ã§ããGoogle Cloud APIs ã¯åºæ¬çã«ãv1alphaãv1betaãv1 ã¨ããé ã§éçºãé²ã¿ã¾ããv1alpha ã®æ©è½ã¯äºåãªãåé¤ãããå¯è½æ§ããããããæ¬çªç°å¢ã§ã®å©ç¨ã¯éæ¨å¥¨ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/apis/design/versioning?hl=ja">ãã¼ã¸ã§ãã³ã°</a></li>
</ul>
<h2 id="ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ããå ´å">ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ããå ´å</h2>
<p>Google Cloud APIs ã«ã¯é常ãGoogle ã¢ã«ã¦ã³ãã¾ãã¯ãµã¼ãã¹ã¢ã«ã¦ã³ãã®èªè¨¼æ
å ±ã使ç¨ãã¦ã¢ã¯ã»ã¹ãã¾ãã</p>
<p>ãã ãã2024å¹´12æç¾å¨ã§ã¯ã<strong>ãµã¼ãã¹ã¢ã«ã¦ã³ããç¨ãã¦</strong> Google ãã©ã¤ãããã¼ã¿ã½ã¼ã¹ã¨ãã Vertex AI Search ã¢ããªã¸ã®æ¤ç´¢ãè¡ã£ãå ´åã<strong>ãµã¼ãå´ã®ã¨ã©ã¼</strong>ï¼500 Internal Server Errorï¼ãçºçãã¾ãã</p>
<h1 id="対å¦æ³">対å¦æ³</h1>
<p>å½äºè±¡ã«å¯¾ãã2024å¹´12æç¾å¨ã®å¯¾å¦æ³ã¯ã以ä¸ã®ã¨ããã§ãã</p>
<ol>
<li>v1alpha ãã£ã³ãã«ã®ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã使ç¨ãã</li>
<li>ãµã¼ãã¹ã¢ã«ã¦ã³ãã§ã¯ãªããGoogle ã¢ã«ã¦ã³ãã®èªè¨¼æ
å ±ã使ç¨ãã</li>
</ol>
<h1 id="Python-Client">Python Client</h1>
<h2 id="ãµã³ãã«ã³ã¼ã">ãµã³ãã«ã³ã¼ã</h2>
<p>Python Client ã使ç¨ããå ´åã®ãµã³ãã«ã³ã¼ãã¯æ¬¡ã®ã¨ããã§ãã</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">from</span> google.cloud.discoveryengine_v1alpha <span class="synPreProc">import</span> SearchServiceClient, SearchRequest
<span class="synPreProc">from</span> google.protobuf.json_format <span class="synPreProc">import</span> MessageToDict
PROJECT_ID = <span class="synConstant">"xxx"</span> <span class="synComment"># Google Cloud ããã¸ã§ã¯ã ID</span>
VERTEX_AI_APP_ID = <span class="synConstant">"xxx"</span> <span class="synComment"># Vertex AI Search ã¢ããªã® ID</span>
client = SearchServiceClient(credentials=credentials)
serving_config = f<span class="synConstant">"projects/{PROJECT_ID}/locations/global/collections/default_collection/engines/{VERTEX_AI_APP_ID}/servingConfigs/default_serving_config"</span>
content_search_spec = SearchRequest.ContentSearchSpec(
<span class="synComment"># ã¹ãããããåºåãããªã</span>
snippet_spec=SearchRequest.ContentSearchSpec().SnippetSpec(
return_snippet=<span class="synIdentifier">False</span>
),
<span class="synComment"># è¦ç´æãåºåããã</span>
summary_spec=SearchRequest.ContentSearchSpec().SummarySpec(
summary_result_count=<span class="synConstant">3</span>,
include_citations=<span class="synIdentifier">False</span>,
<span class="synComment"># Gemini Proãç¨ããããã«æå®</span>
model_spec=SearchRequest.ContentSearchSpec().SummarySpec().ModelSpec(
version=<span class="synConstant">"gemini-1.5-flash-001/answer_gen/v1"</span>
)
)
)
<span class="synComment"># Vertex AI Searchã«ã¯ã¨ãªãæãã</span>
response = client.search(
SearchRequest(
serving_config=serving_config,
query=<span class="synConstant">"G-genã¨ã¯ï¼"</span>,
page_size=<span class="synConstant">3</span>,
content_search_spec=content_search_spec
)
)
<span class="synComment"># è¦ç´æãæ¨æºåºå</span>
<span class="synIdentifier">print</span>(response.summary.summary_text)
<span class="synComment"># æ¤ç´¢çµæãæ¨æºåºå</span>
<span class="synStatement">for</span> r <span class="synStatement">in</span> response.results:
r_dct = MessageToDict(r._pb)
<span class="synIdentifier">print</span>(r_dct)
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/python/docs/reference/discoveryengine/latest/google.cloud.discoveryengine_v1beta.services.search_service.SearchServiceClient">Class SearchServiceClient</a></li>
</ul>
<h2 id="ãã¤ã³ã">ãã¤ã³ã</h2>
<h3 id="ã©ã¤ãã©ãªã®ãã£ã³ãã«æå®">ã©ã¤ãã©ãªã®ãã£ã³ãã«æå®</h3>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">from</span> google.cloud.discoveryengine_v1alpha <span class="synPreProc">import</span> SearchServiceClient, SearchRequest
</pre>
<p>ä¸è¨ã®ããã«ãgoogle-cloud-discoveryengine ãã¤ã³ãã¼ãããéã®ãã£ã³ãã«æå®ã¯ <code>_v1alpha</code> ãæ示çã«æå®ããå¿
è¦ãããã¾ãããã£ã³ãã«ãæå®ããªã以ä¸ã®ãããªã¤ã³ãã¼ãæã ã¨ã<a href="#%E6%A4%9C%E7%B4%A2%E3%81%8C%E5%A4%B1%E6%95%97%E3%81%99%E3%82%8B%E3%82%B1%E3%83%BC%E3%82%B9">æ¤ç´¢ã失æããã±ã¼ã¹</a>ã«è¨è¼ã®éããæ¤ç´¢çµæã0件ã«ãªãã¾ãã</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synComment"># æªæå®</span>
<span class="synPreProc">from</span> google.cloud.discoveryengine <span class="synPreProc">import</span> SearchServiceClient, SearchRequest
<span class="synComment"># v1 æå®</span>
<span class="synPreProc">from</span> google.cloud.discoveryengine_v1 <span class="synPreProc">import</span> SearchServiceClient, SearchRequest
<span class="synComment"># v1beta æå®</span>
<span class="synPreProc">from</span> google.cloud.discoveryengine_v1beta <span class="synPreProc">import</span> SearchServiceClient, SearchRequest
</pre>
<h2 id="credentials">credentials</h2>
<p><code>client = SearchServiceClient(credentials=credentials)</code> ã§ãã©ã¡ã¼ã¿ã¨ãã¦ä¸ããèªè¨¼æ
å ±ã¯ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ãã®ã§ã¯ãªããGoogle ã¢ã«ã¦ã³ãã®ãã®ã«ããå¿
è¦ãããã¾ãã</p>
<p>Google ã¢ã«ã¦ã³ãã®èªè¨¼æ
å ±ã®å ´åã¯å¤æ°ã®åã <code>google.oauth2.credentials.Credentials</code> ã«ããµã¼ãã¹ã¢ã«ã¦ã³ãã®èªè¨¼æ
å ±ã®å ´åã¯å¤æ°ã®åã <code>google.oauth2.service_account.Credentials</code> ã«ãªãã¾ãã</p>
<h1 id="Requests-ã©ã¤ãã©ãªãç¨ãã¦ã®ç´æ¥ã¢ã¯ã»ã¹">Requests ã©ã¤ãã©ãªãç¨ãã¦ã®ç´æ¥ã¢ã¯ã»ã¹</h1>
<h2 id="ãµã³ãã«ã³ã¼ã-1">ãµã³ãã«ã³ã¼ã</h2>
<p>Requests ã©ã¤ãã©ãªã使ç¨ã㦠Google Cloud APIs ã«ç´æ¥ã¢ã¯ã»ã¹ããå ´åã®ãµã³ãã«ã³ã¼ãã¯æ¬¡ã®ã¨ããã§ãã</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">import</span> requests
PROJECT_NUMBER = <span class="synConstant">"xxx"</span> <span class="synComment"># Google Cloud ããã¸ã§ã¯ãçªå·</span>
VERTEX_AI_APP_ID = <span class="synConstant">"xxx"</span> <span class="synComment"># Vertex AI Search ã¢ããªã® ID</span>
<span class="synComment"># APIã®URL</span>
url = f<span class="synConstant">"https://discoveryengine.googleapis.com/v1alpha/projects/{PROJECT_NUMBER}/locations/global/collections/default_collection/engines/{VERTEX_AI_APP_ID}/servingConfigs/default_search"</span>
<span class="synComment"># ãªã¯ã¨ã¹ãããã</span>
headers = {
<span class="synConstant">"Authorization"</span>: <span class="synConstant">"Bearer "</span> + credentials.token,
<span class="synConstant">"Content-Type"</span>: <span class="synConstant">"application/json"</span>,
}
<span class="synComment"># ãªã¯ã¨ã¹ãããã£</span>
session = f<span class="synConstant">"projects/{PROJECT_NUMBER}/locations/global/collections/default_collection/engines/{VERTEX_AI_APP_ID}/sessions/-"</span>
data = {
<span class="synConstant">"query"</span>: <span class="synConstant">"G-genã¨ã¯ï¼"</span>,
<span class="synConstant">"pageSize"</span>: <span class="synConstant">3</span>,
<span class="synConstant">"contentSearchSpec"</span>: {
<span class="synConstant">"snippetSpec"</span>: {
<span class="synConstant">"returnSnippet"</span>: <span class="synIdentifier">False</span>
},
<span class="synConstant">"extractiveContentSpec"</span>: {
<span class="synConstant">"maxExtractiveAnswerCount"</span>: <span class="synConstant">1</span>
}
},
<span class="synConstant">"session"</span>: session
}
<span class="synComment"># æ¤ç´¢ãªã¯ã¨ã¹ãéä¿¡</span>
response = requests.post(f<span class="synConstant">"{url}:search"</span>, headers=headers, json=data)
<span class="synComment"># æ¤ç´¢çµæãæ¨æºåºå</span>
<span class="synStatement">for</span> r <span class="synStatement">in</span> response.json().get(<span class="synConstant">"results"</span>):
<span class="synIdentifier">print</span>(r)
data = {
<span class="synConstant">"query"</span>: {
<span class="synConstant">"text"</span>: <span class="synConstant">"G-genã¨ã¯ï¼"</span>,
<span class="synConstant">"queryId"</span>: response.json().get(<span class="synConstant">"sessionInfo"</span>).get(<span class="synConstant">"queryId"</span>)
},
<span class="synConstant">"session"</span>: response.json().get(<span class="synConstant">"sessionInfo"</span>).get(<span class="synConstant">"name"</span>),
<span class="synConstant">"answerGenerationSpec"</span>: {
<span class="synConstant">"modelSpec"</span>: {
<span class="synConstant">"modelVersion"</span>: <span class="synConstant">"gemini-1.5-flash-001/answer_gen/v1"</span>
}
}
}
<span class="synComment"># è¦ç´ãªã¯ã¨ã¹ãéä¿¡</span>
response = requests.post(f<span class="synConstant">"{url}:answer"</span>, headers=headers, json=data)
<span class="synComment"># è¦ç´æãæ¨æºåºå</span>
<span class="synIdentifier">print</span>(response.json().get(<span class="synConstant">"answer"</span>).get(<span class="synConstant">"answerText"</span>))
</pre>
<ul>
<li>åè : <a href="https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/projects.locations.collections.dataStores.servingConfigs/search">Method: projects.locations.collections.dataStores.servingConfigs.search</a></li>
</ul>
<h2 id="ãã¤ã³ã-1">ãã¤ã³ã</h2>
<p>Requests ã©ã¤ãã©ãªãç¨ãã¦ç´æ¥ Google Cloud APIs ã«ã¢ã¯ã»ã¹ãã¿ã¼ã³ã§ããéè¦ãªãã¤ã³ã㯠Python Client ãç¨ããå ´åã¨å¤ããã¾ããã</p>
<ul>
<li>API ã® URL ã®ãã£ã³ãã«æå®ã v1alpha ã«ãã</li>
<li>ãããã® Authorization ã«å«ããã¼ã¯ã³ã¯ Google ã¢ã«ã¦ã³ãã®ã¢ã¯ã»ã¹ãã¼ã¯ã³ã¨ãã</li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-ryu-dohara/profile_256x256.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">å å ç«å¸<a href="https://blog.g-gen.co.jp/archive/author/ggen-ryu-dohara">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ãã¼ã¿ã¢ããªãã£ã¯ã¹èª²ã2023å¹´4æãããG-genã«ã¸ã§ã¤ã³ã</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2023, 2024, 2025ã«é¸åº (2024å¹´ã¯Rookie of the yearã2025å¹´ã¯Fellowã«ãé¸åº)ãä¼ã¿ã®æ¥ã¯ã ãããã²ã¼ã ããã¦ããããæã
èªè»¢è»ã§é åºããã¦ãã¾ãã</p>
<a href="https://twitter.com/ryu_dohara?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ryu_dohara</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-ryu-dohara
Cloud Run functionsããVPC Service Controlså¢çå
ã¸ã®ã¢ã¯ã»ã¹ã許å¯ããæ¹æ³
hatenablog://entry/6801883189105732428
2024-12-06T09:00:00+09:00
2024-12-06T09:00:02+09:00 G-gen ã®å åã§ããæ¬è¨äºã§ã¯ Google Cloudï¼æ§ç§° GCPï¼ã® Cloud Run functionsï¼æ§ Cloud Functionsï¼ãããVPC Service Controls å¢çã®ä¸ã®ãªã½ã¼ã¹ã¸ã¢ã¯ã»ã¹ãããæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ã¯ããã« æ¬è¨äºã®è¶£æ¨ VPC Service Controls Cloud Run functions ãã¤ã³ã ã¢ã¯ã»ã¹ã®æå¦ VPC çµç±ã§ã®ãªã¯ã¨ã¹ããå¿
è¦ãªçç± VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹ ã¯ããã« æ¬è¨äºã®è¶£æ¨ æ¬è¨äºã§ã¯ãCloud Run functions ãããVPC Service Controls ã§ä¿è·â¦
<p>G-gen ã®å åã§ããæ¬è¨äºã§ã¯ Google Cloudï¼æ§ç§° GCPï¼ã® <strong>Cloud Run functions</strong>ï¼æ§ Cloud Functionsï¼ããã<strong>VPC Service Controls</strong> å¢çã®ä¸ã®ãªã½ã¼ã¹ã¸ã¢ã¯ã»ã¹ãããæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#æ¬è¨äºã®è¶£æ¨">æ¬è¨äºã®è¶£æ¨</a></li>
<li><a href="#VPC-Service-Controls">VPC Service Controls</a></li>
<li><a href="#Cloud-Run-functions">Cloud Run functions</a></li>
</ul>
</li>
<li><a href="#ãã¤ã³ã">ãã¤ã³ã</a></li>
<li><a href="#ã¢ã¯ã»ã¹ã®æå¦">ã¢ã¯ã»ã¹ã®æå¦</a></li>
<li><a href="#VPC-çµç±ã§ã®ãªã¯ã¨ã¹ããå¿
è¦ãªçç±">VPC çµç±ã§ã®ãªã¯ã¨ã¹ããå¿
è¦ãªçç±</a></li>
<li><a href="#VPC-ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹">VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241118/20241118094242.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="æ¬è¨äºã®è¶£æ¨">æ¬è¨äºã®è¶£æ¨</h2>
<p>æ¬è¨äºã§ã¯ãCloud Run functions ãããVPC Service Controls ã§ä¿è·ããã Google Cloud ããã¸ã§ã¯ãã®ãªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ããæ¹æ³ããã©ã®ãããªè¨å®ã§ã¢ã¯ã»ã¹ãæåã¾ãã¯å¤±æããã®ãã«ã¤ãã¦è§£èª¬ãã¾ãã</p>
<h2 id="VPC-Service-Controls">VPC Service Controls</h2>
<p>VPC Service Controls 㯠Google Cloud ãæä¾ããã»ãã¥ãªãã£ãµã¼ãã¹ã§ãã ããµã¼ãã¹å¢çï¼service perimeterï¼ãã¨ããè«ççãªå¢çãä½æããå¢çãã¾ãã API ãªã¯ã¨ã¹ããå¶éãã¾ãã</p>
<p>VPC Service Controls ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã®ã§ãåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fvpc-service-controls-explained" title="VPC Service Controlsãåããããã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/vpc-service-controls-explained">blog.g-gen.co.jp</a></cite></p>
<p>ãªãæ¬è¨äºã¯ Ingress rulesï¼å
åãã«ã¼ã«ï¼ãªã©ãVPC Service Controls ã®åºæ¬çãªè¨å®é
ç®ã«ã¤ãã¦ã¯ç解ãã¦ããåæã§æ¸ããã¦ãã¾ãã</p>
<h2 id="Cloud-Run-functions">Cloud Run functions</h2>
<p>Cloud Run functions ã¯ãGoogle Cloud ãæä¾ãããµã¼ãã¬ã¹ã³ã³ãã¥ã¼ãã£ã³ã°ãµã¼ãã¹ã§ããã¤ã³ãã©ã®æ§ç¯ã管çããããã¨ãªããããã°ã©ã ãå®è¡ãããã¨ãã§ãã¾ãã</p>
<p>ãã¡ãã以ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã®ã§ããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-functions-explained" title="Cloud Run functionsãå¾¹åºè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-functions-explained">blog.g-gen.co.jp</a></cite></p>
<h1 id="ãã¤ã³ã">ãã¤ã³ã</h1>
<p>æ¬è¨äºã§æãä¼ããããã¤ã³ãã¯ã以ä¸ã®ã¨ããã§ãã</p>
<p><strong>VPC Service Controls ã® Ingress ruleï¼å
åãã«ã¼ã«ï¼ã§ã½ã¼ã¹ããã¸ã§ã¯ããæå®ããå ´åãCloud Run functions 㯠VPC çµç±ã§ãªã¯ã¨ã¹ããéä¿¡ããå¿
è¦ãããã</strong></p>
<h1 id="ã¢ã¯ã»ã¹ã®æå¦">ã¢ã¯ã»ã¹ã®æå¦</h1>
<p>以ä¸ã®ãããªæ¤è¨¼ç°å¢ãç¨æãã¾ããã</p>
<ul>
<li>VPC Service Controls ã§ä¿è·ããã Google Cloud ããã¸ã§ã¯ã</li>
<li>ããã¸ã§ã¯ãå
ã« Cloud Run functions 㨠BigQuery ãã¼ãã«ãç¨æ</li>
<li>Cloud Run functions ã«ã¯ããµã¼ãã¹ã¢ã«ã¦ã³ã Aããç´ã¥ã</li>
<li>Cloud Run functions ãã BigQuery ãã¼ãã«ã«ã¢ã¯ã»ã¹ããç¶æ³ãæ³å®</li>
</ul>
<p>ãã®ç°å¢ã§ãVPC Service Controls 㨠Cloud Run functions ã®åè¨å®å¤ãå¤æ´ããªãããæ§ã
ãªãã¿ã¼ã³ã§ã¢ã¯ã»ã¹ã®æå¦ãæ¤è¨¼ãã¾ãããæ¤è¨¼çµæã¯ã以ä¸ã®ããã«ãªãã¾ããã</p>
<table>
<thead>
<tr>
<th rowspan=3>No.</th>
<th colspan=4>VPC Service Controls</th>
<th>Cloud Run functions</th>
<th rowspan=3>ã¢ã¯ã»ã¹çµæ</th>
</tr>
<tr>
<th rowspan=2>å¶éä»ããµã¼ãã¹</th>
<th rowspan=2>VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹</th>
<th colspan=2>ãIngress rulesãã®ãAPI ã¯ã©ã¤ã¢ã³ãã® FROM å±æ§ã</th>
<th rowspan=2>ãããã¯ã¼ã¯ã®ä¸ãè¨å®</th>
</tr>
<tr>
<th>ID</th>
<th>ã½ã¼ã¹</th>
</tr>
<tr>
<td>1</th>
<td>BigQuery API</th>
<td>ãã¹ã¦ã®å¶éä»ããµã¼ãã¹</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ãã¹ã¦ã®ã½ã¼ã¹</th>
<td>ãªã</th>
<td>OK</th>
</tr>
<tr>
<td>2</th>
<td>BigQuery API</th>
<td>ãã¹ã¦ã®å¶éä»ããµã¼ãã¹</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãªã</th>
<td>NG</th>
</tr>
<tr>
<td>3</th>
<td>BigQuery API</th>
<td>ãã¹ã¦ã®å¶éä»ããµã¼ãã¹</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãã¹ã¦ã®ãã©ãã£ãã¯ã VPC ã³ãã¯ã¿çµç±ã§ã«ã¼ãã£ã³ã°ãã</th>
<td>OK</th>
</tr>
<tr>
<td>4</th>
<td>BigQuery API</th>
<td>ãã¹ã¦ã®å¶éä»ããµã¼ãã¹</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãã©ã¤ãã¼ã IP ã¸ã®ãªã¯ã¨ã¹ãã ãã VPC ã³ãã¯ã¿çµç±ã§ã«ã¼ãã£ã³ã°ãã</th>
<td>NG</th>
</tr>
<tr>
<td>5</th>
<td>BigQuery API</th>
<td>ãªã</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãã¹ã¦ã®ãã©ãã£ãã¯ã VPC ã³ãã¯ã¿çµç±ã§ã«ã¼ãã£ã³ã°ãã</th>
<td>NG</th>
</tr>
<tr>
<td>6</th>
<td>ãªã</th>
<td>ãªã</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãã¹ã¦ã®ãã©ãã£ãã¯ã VPC ã³ãã¯ã¿çµç±ã§ã«ã¼ãã£ã³ã°ãã</th>
<td>NG</th>
</tr>
<tr>
<td>7</th>
<td>ãªã</th>
<td>ãªã</th>
<td>ãµã¼ãã¹ã¢ã«ã¦ã³ã A</th>
<td>ããã¸ã§ã¯ã</th>
<td>ãªã</th>
<td>OK</th>
</tr>
</table>
<h1 id="VPC-çµç±ã§ã®ãªã¯ã¨ã¹ããå¿
è¦ãªçç±">VPC çµç±ã§ã®ãªã¯ã¨ã¹ããå¿
è¦ãªçç±</h1>
<p>VPC Service Controls ã§ã¯ãå¢çãè¶
ãããããªã¢ã¯ã»ã¹ã¯ãååçã«å
¨ã¦ãããã¯ããã¾ãã</p>
<p><strong>Ingress rules</strong>ï¼å
åãã«ã¼ã«ï¼ãç¨ããã¨ã<strong>ç¹å®ã®ã½ã¼ã¹</strong>ï¼ç¹å®ã® IP ã¢ãã¬ã¹ã Google Cloud ããã¸ã§ã¯ãï¼ãæ¥ç¶å
ã¨ãã<strong>ç¹å®ã® ID</strong>ï¼Google ã¢ã«ã¦ã³ãããµã¼ãã¹ã¢ã«ã¦ã³ãï¼ã«ããã¢ã¯ã»ã¹ã<strong>ä¾å¤çã«è¨±å¯ãã</strong>ãã¨ãåºæ¥ã¾ãã</p>
<p>ãã®ãããIngress rules 㧠ID ã Cloud Run functions ã«ç´ã¥ããããµã¼ãã¹ã¢ã«ã¦ã³ã Aãã«ã<strong>ã½ã¼ã¹ã Cloud Run functions ãæå±ãã Google Cloud ããã¸ã§ã¯ã</strong>ã«ããã°ãå¢çå
ã¸ã®ã¢ã¯ã»ã¹ã¯æåãããã®ããã«èãããã¾ãã</p>
<p>ãããä¸è¨ã®å ´åã<strong>Cloud Run functions ããã®ã¢ã¯ã»ã¹ã¯å¤±æãã¾ã</strong>ã</p>
<p>ããã¯ãGoogle Cloud ã®å
¬å¼ããã¥ã¡ã³ãã«ã¯æè¨ããã¦ãã¾ããããCloud Run functions ã®å®è¡åºç¤ãã¦ã¼ã¶ã管çãã Google Cloud ããã¸ã§ã¯ãã¨ã¯å¥ã ããã ã¨æ¨æ¸¬ã§ãã¾ãã</p>
<p>ãã®ãããå½è©²ããã¸ã§ã¯ãããã®ã¢ã¯ã»ã¹ã¨ãªãããã«ã<strong>Cloud Run functions ã VPC ã«æ¥ç¶ãããå¿
è¦ããã</strong>ã®ã§ãã</p>
<p>ãã®ãã¨ã¯ä»¥ä¸ã®å
¬å¼ããã¥ã¡ã³ãã§ã触ãããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/functions/docs/securing/using-vpc-service-controls?hl=ja#functions-outside-perimeter">å¢çå¤ã®é¢æ°ã§ã® VPC Service Controls ã®ä½¿ç¨</a></li>
</ul>
<h1 id="VPC-ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹">VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹</h1>
<p>ã¾ã Cloud Run functions ã« VPC çµç±ã§ VPC Service Controls ã®å¢çå
ã¸ã¢ã¯ã»ã¹ãããå ´åã¯ãã<strong>VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹</strong>ï¼VPC Accessible servicesï¼ãã¨ããè¨å®é
ç®ã®å¤ã«ãæ°ãã¤ããå¿
è¦ãããã¾ãããã®è¨å®é
ç®ã¯å¢çå
ã® VPC ãããã¯ã¼ã¯ããã¢ã¯ã»ã¹ã§ãããµã¼ãã¹ãå¶å¾¡ããé
ç®ã§ãã</p>
<p>ãã®é
ç®ã§æ示çã«ã¢ã¯ã»ã¹å
ã®ãµã¼ãã¹ã許å¯ããã¦ããªãå ´åãCloud Run functions ããã®ã¢ã¯ã»ã¹ã¯å¤±æãã¾ãã</p>
<p>åæ²ã®è¡¨ã® No. 6ã¯ãVPC å
é¨ããã®ã¢ã¯ã»ã¹ã ããVPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹ãã§è¨±å¯ããã¦ããªã API ã«ãªã¯ã¨ã¹ããããã¨ãã¦ããããããªã¯ã¨ã¹ãã失æãã¦ãã¾ããå対㫠No.7 ã¯ãVPC å¤é¨ããã®ãªã¯ã¨ã¹ãã§ãããã㤠BigQuery API ã¯å¢çã§ä¿è·ããã¦ããªãããããªã¯ã¨ã¹ããæåãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vpc-service-controls/docs/vpc-accessible-services?hl=ja">VPC ã®ã¢ã¯ã»ã¹å¯è½ãªãµã¼ãã¹</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-ryu-dohara/profile_256x256.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">å å ç«å¸<a href="https://blog.g-gen.co.jp/archive/author/ggen-ryu-dohara">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ãã¼ã¿ã¢ããªãã£ã¯ã¹èª²ã2023å¹´4æãããG-genã«ã¸ã§ã¤ã³ã</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2023, 2024, 2025ã«é¸åº (2024å¹´ã¯Rookie of the yearã2025å¹´ã¯Fellowã«ãé¸åº)ãä¼ã¿ã®æ¥ã¯ã ãããã²ã¼ã ããã¦ããããæã
èªè»¢è»ã§é åºããã¦ãã¾ãã</p>
<a href="https://twitter.com/ryu_dohara?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ryu_dohara</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-ryu-dohara
GitHubç£æ»ãã°ãWorkload Identityèªè¨¼ã§BigQueryã«ã¨ã¯ã¹ãã¼ããã¦ã¿ã
hatenablog://entry/6802418398302758196
2024-12-04T09:00:00+09:00
2024-12-04T09:00:03+09:00 G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ Workload Identity ã®ä»çµã¿ã使ããã¨ã§ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã使ããã« GitHub Enterprise ã®ç£æ»ãã°ã BigQuery ã«ã¨ã¯ã¹ãã¼ãããä»çµã¿ãæ§ç¯ããã®ã§ãç´¹ä»ãã¾ãã GitHub Enterprise ã¨ã¯ æ¦è¦ ç£æ»ãã° Google Cloud ã¸ã®ç£æ»ãã°ã¨ã¯ã¹ãã¼ã ã¢ã¼ããã¯ã㣠æ§æå³ ãã£ã¬ã¯ããªæ§æ ç°å¢æ§ç¯ Workload Identity ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ BigQuery ãã¼ã¿ã»ããã®ä½æã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸ GitHub Actions ã¯ã¼ã¯ããã¼ã®ä½æ maâ¦
<p>G-gen ã®ä¸æµ¦ã§ããå½è¨äºã§ã¯ Workload Identity ã®ä»çµã¿ã使ããã¨ã§ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã使ããã« GitHub Enterprise ã®ç£æ»ãã°ã BigQuery ã«ã¨ã¯ã¹ãã¼ãããä»çµã¿ãæ§ç¯ããã®ã§ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#GitHub-Enterprise-ã¨ã¯">GitHub Enterprise ã¨ã¯</a><ul>
<li><a href="#æ¦è¦">æ¦è¦</a></li>
<li><a href="#ç£æ»ãã°">ç£æ»ãã°</a></li>
<li><a href="#Google-Cloud-ã¸ã®ç£æ»ãã°ã¨ã¯ã¹ãã¼ã">Google Cloud ã¸ã®ç£æ»ãã°ã¨ã¯ã¹ãã¼ã</a></li>
</ul>
</li>
<li><a href="#ã¢ã¼ããã¯ãã£">ã¢ã¼ããã¯ãã£</a><ul>
<li><a href="#æ§æå³">æ§æå³</a></li>
<li><a href="#ãã£ã¬ã¯ããªæ§æ">ãã£ã¬ã¯ããªæ§æ</a></li>
</ul>
</li>
<li><a href="#ç°å¢æ§ç¯">ç°å¢æ§ç¯</a><ul>
<li><a href="#Workload-Identity-ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ">Workload Identity ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ</a></li>
<li><a href="#BigQuery-ãã¼ã¿ã»ããã®ä½æã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸">BigQuery ãã¼ã¿ã»ããã®ä½æã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸</a></li>
<li><a href="#GitHub-Actions-ã¯ã¼ã¯ããã¼ã®ä½æ">GitHub Actions ã¯ã¼ã¯ããã¼ã®ä½æ</a></li>
<li><a href="#mainpy-ã®ä½æ">main.py ã®ä½æ</a></li>
<li><a href="#GitHub-App-ã®ä½æ">GitHub App ã®ä½æ</a></li>
<li><a href="#GitHub-Actions-ã®ã·ã¼ã¯ã¬ããç»é²">GitHub Actions ã®ã·ã¼ã¯ã¬ããç»é²</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#æåå®è¡">æåå®è¡</a></li>
<li><a href="#ã¹ã±ã¸ã¥ã¼ã«å®è¡">ã¹ã±ã¸ã¥ã¼ã«å®è¡</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113111807.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="GitHub-Enterprise-ã¨ã¯">GitHub Enterprise ã¨ã¯</h1>
<h2 id="æ¦è¦">æ¦è¦</h2>
<p><strong>GitHub Enterprise</strong> ã¯ãè¤æ°çµç¹ã®ä¸å
管çã Microsoft Entra ID ãªã©ã® IdPï¼Identity Providerï¼ã使ç¨ãã SSOï¼ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼ãªã©ã®æ©è½ãæä¾ããæåãã©ã³ã§ãã</p>
<p>æ¬ãã©ã³ã§ã¯ç£æ»ãã° API ã使ç¨ãã¦çµç¹å
ã®æä½å±¥æ´ãåå¾ã»ç®¡çã§ãã¾ããç£æ»ãã°ã BigQuery ã«ã¨ã¯ã¹ãã¼ãããã¨ãé·æä¿åãé«åº¦ãªåæãè¡ããã»ãã¥ãªãã£å¯¾çãã³ã³ãã©ã¤ã¢ã³ã¹å¼·åã«å½¹ç«ã¡ã¾ãã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/overview/about-github-for-enterprises">ã¨ã³ã¿ã¼ãã©ã¤ãºåã GitHub ã«ã¤ãã¦</a></li>
<li>åè : <a href="https://github.co.jp/pricing.html">ãã©ã³ãç´¹ä»</a></li>
</ul>
<h2 id="ç£æ»ãã°">ç£æ»ãã°</h2>
<p>GitHub ã®ç£æ»ãã°ã«ã¯ãçµç¹ã¡ã³ãã¼ã®ã¬ãã¸ããªä½æããã«ãªã¯ã¨ã¹ãããã¼ã¸ãªã©ã®æä½ãè¨é²ãããéå»180æ¥åã®ãã°ã確èªã§ãã¾ãã<code>git.clone</code> ãªã©ä¸é¨ã® Git ã¤ãã³ã㯠7 æ¥éã®ã¿ä¿æããã¾ãã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/accessing-the-audit-log-for-your-enterprise">ä¼æ¥ã®ç£æ»ãã°ã«ã¢ã¯ã»ã¹ãã</a></li>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise#git">ã¨ã³ã¿ã¼ãã©ã¤ãºã®ç£æ»ãã° ã¤ãã³ã</a></li>
</ul>
<h2 id="Google-Cloud-ã¸ã®ç£æ»ãã°ã¨ã¯ã¹ãã¼ã">Google Cloud ã¸ã®ç£æ»ãã°ã¨ã¯ã¹ãã¼ã</h2>
<p>GitHub ã®ç£æ»ãã°ã¯ JSON å½¢å¼ã§ Cloud Storage ã«ã¨ã¯ã¹ãã¼ãã§ãã¾ãããé常ã¯ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ãå¿
è¦ã§ãã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/streaming-the-audit-log-for-your-enterprise#setting-up-streaming-to-google-cloud-storage">Google Cloud Storage ã¸ã®ã¹ããªã¼ãã³ã°ã®è¨å®</a></li>
</ul>
<p>ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã¯å³éãªç®¡çãå¿
è¦ã§ããæ¼æ´©ããå ´åã第ä¸è
ã«ããä¸æ£å©ç¨ã®ãªã¹ã¯ãããã¾ããGoogle Cloud ã®ãã¹ããã©ã¯ãã£ã¹ã§ã¯ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã使ç¨ããã«èªè¨¼ããæ¹æ³ãæ¨å¥¨ããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys?hl=ja">ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã管çããããã®ãã¹ã ãã©ã¯ãã£ã¹</a></li>
</ul>
<p>以ä¸ã®ãã¨ãããå½è¨äºã§ã¯ Google Cloud ã® Workload Identity æ©è½ã使ããã¨ã§ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã使ç¨ããã« GitHub ç£æ»ãã°ãåå¾ããä»çµã¿ãå®è£
ãã¾ããã</p>
<h1 id="ã¢ã¼ããã¯ãã£">ã¢ã¼ããã¯ãã£</h1>
<h2 id="æ§æå³">æ§æå³</h2>
<p>æ§æã¯å³ã®ã¨ããã§ããGitHub Actions ã使ç¨ãã¦ç£æ»ãã°ãåå¾ããBigQuery ã«ã¨ã¯ã¹ãã¼ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ§æå³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090047.png" width="800" height="221" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ§æå³</figcaption></figure></p>
<h2 id="ãã£ã¬ã¯ããªæ§æ">ãã£ã¬ã¯ããªæ§æ</h2>
<p>ãã£ã¬ã¯ããªæ§æã¯ä»¥ä¸ã®éãã§ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>.
âââ app
âââ main.py <span class="synComment"># ç£æ»ãã°ã BigQuery ã¸ã¨ã¯ã¹ãã¼ãããã¹ã¯ãªãã</span>
.github
âââ workflows
âââ github-audit-log-to-bq.yml <span class="synComment"># GitHub Actions ãå®ç¾©</span>
</pre>
<h1 id="ç°å¢æ§ç¯">ç°å¢æ§ç¯</h1>
<h2 id="Workload-Identity-ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ">Workload Identity ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ä½æ</h2>
<p>GitHub Actions 㨠Google Cloud ãé£æºãããããã® Workload Identity ã¨ãµã¼ãã¹ã¢ã«ã¦ã³ããä½æãã¾ããä½ææ¹æ³ã¯ã次ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><strong>Google Cloudã¨GitHub Actions(Terraform)ãé£æºããWorkload Identityãä½æããbashã¹ã¯ãªãã</strong>
<iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcreate-workload-identity-for-gha-terraform" title="Google Cloudã¨GitHub Actions(Terraform)ãé£æºããWorkload Identityãä½æããbashã¹ã¯ãªãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/create-workload-identity-for-gha-terraform">blog.g-gen.co.jp</a></cite></p>
<h2 id="BigQuery-ãã¼ã¿ã»ããã®ä½æã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸">BigQuery ãã¼ã¿ã»ããã®ä½æã¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸ã®æ¨©éä»ä¸</h2>
<p>BigQuery ã®ãã¼ã¿ã»ãããä½æãã¾ãããã¼ãã«ã¯ GitHub Actions ã§èªåçã«ä½æããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ç°å¢å¤æ°ãè¨å®</span>
<span class="synIdentifier">PROJECT_ID</span>=<span class="synStatement">"</span><span class="synConstant">gha-demo-prj</span><span class="synStatement">"</span> <span class="synComment"># ããã¸ã§ã¯ãID</span>
<span class="synIdentifier">SERVICE_ACCOUNT_NAME</span>=<span class="synStatement">"</span><span class="synConstant">gha-demo-sa</span><span class="synStatement">"</span> <span class="synComment"># ãµã¼ãã¹ã¢ã«ã¦ã³ãå</span>
<span class="synIdentifier">BQ_DATASET</span>=<span class="synStatement">"</span><span class="synConstant">my_dataset</span><span class="synStatement">"</span> <span class="synComment"># BigQueryã®ãã¼ã¿ã»ããå</span>
ã
<span class="synComment"># BigQuery ãã¼ã¿ã»ãããæ±äº¬ãªã¼ã¸ã§ã³ã«ä½æ</span>
bq <span class="synSpecial">--project_id</span><span class="synStatement">=</span><span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
mk <span class="synSpecial">--location</span><span class="synStatement">=</span>asia-northeast1 <span class="synStatement">\</span>
<span class="synPreProc">$BQ_DATASET</span>
</pre>
<p>ãµã¼ãã¹ã¢ã«ã¦ã³ãã« BigQuery ã¸ã®ãã¼ã¿æ¸ãè¾¼ã¿æ¨©éã¨ã¸ã§ãã®å®è¡æ¨©éãä»ä¸ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ãµã¼ãã¹ã¢ã«ã¦ã³ãã¸æ¨©éä»ä¸</span>
gcloud projects add-iam-policy-binding <span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">serviceAccount:</span><span class="synPreProc">$SERVICE_ACCOUNT_NAME</span><span class="synConstant">@</span><span class="synPreProc">$PROJECT_ID</span><span class="synConstant">.iam.gserviceaccount.com</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synConstant">roles/bigquery.dataEditor</span><span class="synStatement">"</span>
ã
gcloud projects add-iam-policy-binding <span class="synPreProc">$PROJECT_ID</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">serviceAccount:</span><span class="synPreProc">$SERVICE_ACCOUNT_NAME</span><span class="synConstant">@</span><span class="synPreProc">$PROJECT_ID</span><span class="synConstant">.iam.gserviceaccount.com</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synConstant">roles/bigquery.jobUser</span><span class="synStatement">"</span>
</pre>
<h2 id="GitHub-Actions-ã¯ã¼ã¯ããã¼ã®ä½æ">GitHub Actions ã¯ã¼ã¯ããã¼ã®ä½æ</h2>
<p>ãã®ã¯ã¼ã¯ããã¼ã¯ãGitHub ã®ç£æ»ãã°ã1æ¥ã«1åèªåã§åå¾ããBigQuery ã«ã¨ã¯ã¹ãã¼ããã¾ããååã®èªååå¾æå»ãã¢ã¼ãã£ãã¡ã¯ãï¼GitHub Actions ã®ææç©ä¿åæ©è½ï¼ã§ç®¡çãããã¨ã§å·®åã®ãã°ã®ã¿ãåå¾ãã¾ããéå»ã®ãã°ãæåã§åå¾ã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow">ã¯ã¼ã¯ããã¼ããã®ãã¼ã¿ã®æ ¼ç´ã¨å
±æ</a></li>
</ul>
<p><code>env:</code> ã®ç®æã«ãç°å¢ã«å¿ããããã¸ã§ã¯ã ID ãªã©ã®å¤ãè¨è¼ãã¦ãã ããã</p>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synComment"># github-audit-log-to-bq.yml</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Fetch and Upload GitHub Audit Logs to BigQuery
ã
<span class="synIdentifier">on</span><span class="synSpecial">:</span>
<span class="synIdentifier">schedule</span><span class="synSpecial">:</span> <span class="synComment"> # ã¹ã±ã¸ã¥ã¼ã«å®è¡</span>
<span class="synStatement">- </span><span class="synIdentifier">cron</span><span class="synSpecial">:</span> <span class="synConstant">'0 15 * * *'</span> <span class="synComment"> # æ¯æ¥ JST 0 æã«å®è¡ï¼UTC 15 æï¼</span>
<span class="synIdentifier">workflow_dispatch</span><span class="synSpecial">:</span> <span class="synComment"> # æåå®è¡</span>
<span class="synIdentifier">inputs</span><span class="synSpecial">:</span>
<span class="synIdentifier">start_date</span><span class="synSpecial">:</span> <span class="synComment"> # ãã°åå¾ã®éå§æ¥</span>
<span class="synIdentifier">description</span><span class="synSpecial">:</span> <span class="synConstant">"Start date for fetching logs (ISO 8601 format, e.g., 2024-09-01T00:00:00Z)"</span>
<span class="synIdentifier">required</span><span class="synSpecial">:</span> <span class="synConstant">true</span>
<span class="synIdentifier">default</span><span class="synSpecial">:</span> <span class="synConstant">"2024-10-01T00:00:00Z"</span>
<span class="synIdentifier">end_date</span><span class="synSpecial">:</span> <span class="synComment"> # ãã°åå¾ã®çµäºæ¥</span>
<span class="synIdentifier">description</span><span class="synSpecial">:</span> <span class="synConstant">"End date for fetching logs (ISO 8601 format, e.g., 2024-09-30T23:59:59Z)"</span>
<span class="synIdentifier">required</span><span class="synSpecial">:</span> <span class="synConstant">true</span>
<span class="synIdentifier">default</span><span class="synSpecial">:</span> <span class="synConstant">"2024-10-31T23:59:59Z"</span>
ã
<span class="synIdentifier">permissions</span><span class="synSpecial">:</span>
<span class="synIdentifier">id-token</span><span class="synSpecial">:</span> write
<span class="synIdentifier">contents</span><span class="synSpecial">:</span> read
<span class="synIdentifier">actions</span><span class="synSpecial">:</span> read
ã
<span class="synIdentifier">jobs</span><span class="synSpecial">:</span>
<span class="synIdentifier">fetch-and-upload</span><span class="synSpecial">:</span>
<span class="synIdentifier">runs-on</span><span class="synSpecial">:</span> ubuntu-latest
ã
<span class="synIdentifier">env</span><span class="synSpecial">:</span>
<span class="synComment"> # BigQuery è¨å®</span>
<span class="synIdentifier">BQ_GCP_PROJECT_ID</span><span class="synSpecial">:</span> gha-demo-prj <span class="synComment"> # Google Cloud ããã¸ã§ã¯ã ID</span>
<span class="synIdentifier">BQ_DATASET</span><span class="synSpecial">:</span> my_dataset <span class="synComment"> # BigQuery ãã¼ã¿ã»ããå</span>
<span class="synIdentifier">BQ_TABLE</span><span class="synSpecial">:</span> my_table <span class="synComment"> # BigQuery ãã¼ãã«å</span>
<span class="synComment"> # GitHub è¨å®</span>
<span class="synIdentifier">GITHUB_ORG</span><span class="synSpecial">:</span> myorg <span class="synComment"> # GitHub çµç¹å</span>
<span class="synIdentifier">GH_TOKEN</span><span class="synSpecial">:</span> ${{ github.token }} <span class="synComment"> # GitHub CLI ç¨ã®ãã¼ã¯ã³</span>
<span class="synComment"> # Workload Identity Federation è¨å®</span>
<span class="synIdentifier">PROJECT_NUMBER</span><span class="synSpecial">:</span> <span class="synConstant">1234567890</span><span class="synComment"> # ããã¸ã§ã¯ãçªå· </span>
<span class="synIdentifier">WORKLOAD_IDENTITY_POOL</span><span class="synSpecial">:</span> gha-demo-pool <span class="synComment"> # Workload Identity ãã¼ã«å</span>
<span class="synIdentifier">WORKLOAD_IDENTITY_POOL_PROVIDER</span><span class="synSpecial">:</span> gha-demo-provider <span class="synComment"> # Workload Identity ãã¼ã«ãããã¤ãå</span>
<span class="synIdentifier">SERVICE_ACCOUNT</span><span class="synSpecial">:</span> [email protected] <span class="synComment"> # 使ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãå</span>
<span class="synComment"> # ã¢ã¼ãã£ãã¡ã¯ãè¨å®</span>
<span class="synIdentifier">LAST_RUN_TIMESTAMP_NAME</span><span class="synSpecial">:</span> <span class="synConstant">"last_run_timestamp"</span> <span class="synComment"> # ååå®è¡æå»ã®ã¢ã¼ãã£ãã¡ã¯ãå</span>
ã
<span class="synIdentifier">steps</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/checkout@v4
ã
<span class="synComment"> # Google Cloud èªè¨¼ (Workload Identity)</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> <span class="synConstant">'auth'</span>
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> <span class="synConstant">'google-github-actions/auth@v2'</span>
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">workload_identity_provider</span><span class="synSpecial">:</span> <span class="synConstant">'projects/${{ env.PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ env.WORKLOAD_IDENTITY_POOL }}/providers/${{ env.WORKLOAD_IDENTITY_POOL_PROVIDER }}'</span>
<span class="synIdentifier">service_account</span><span class="synSpecial">:</span> ${{ env.SERVICE_ACCOUNT }}
ã
<span class="synComment"> # GitHub App ãã¼ã¯ã³ãçæ</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Generate GitHub App token
<span class="synIdentifier">id</span><span class="synSpecial">:</span> generate_token
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/create-github-app-token@v1
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">app-id</span><span class="synSpecial">:</span> ${{ secrets.APP_ID }}
<span class="synIdentifier">private-key</span><span class="synSpecial">:</span> ${{ secrets.APP_PRIVATE_KEY }}
ã
<span class="synComment"> # GitHub App ãã¼ã¯ã³ãç°å¢å¤æ°ã«è¨å®</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Set GitHub App Access Token
<span class="synIdentifier">run</span><span class="synSpecial">:</span> echo <span class="synConstant">"ACCESS_TOKEN=${{ steps.generate_token.outputs.token }}"</span> >> $GITHUB_ENV
ã
<span class="synComment"> # Pythonç°å¢ãã»ããã¢ãã</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Set up Python environment
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install google-cloud-bigquery requests jq pandas
ã
<span class="synComment"> # ååå®è¡æã®ã¿ã¤ã ã¹ã¿ã³ããè¨å®</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Set Default Timestamp to Start of Today
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
DEFAULT_TIMESTAMP=$(date -u +"%Y-%m-%dT00:00:00Z")
echo <span class="synConstant">"DEFAULT_TIMESTAMP=$DEFAULT_TIMESTAMP"</span> >> $GITHUB_ENV
ã
<span class="synComment"> # ååå®è¡æå»ã®ã¢ã¼ãã£ãã¡ã¯ãããã¦ã³ãã¼ã</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Download previous timestamp artifact
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
mkdir -p artifacts
ARTIFACT_URL=$(gh api -X GET <span class="synConstant">"repos/${{ github.repository }}/actions/artifacts"</span> \
| jq -r <span class="synConstant">'.artifacts[] | select(.name=="'</span>${{ env.LAST_RUN_TIMESTAMP_NAME }}<span class="synConstant">'") | .archive_download_url'</span> | head -n 1)
if <span class="synSpecial">[</span> -n <span class="synConstant">"$ARTIFACT_URL"</span> <span class="synSpecial">]</span>; then
curl -L -o artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.zip -H <span class="synConstant">"Authorization: token ${{ github.token }}"</span> <span class="synConstant">"$ARTIFACT_URL"</span>
unzip -o artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.zip -d artifacts/
if <span class="synSpecial">[</span> ! -f <span class="synConstant">"artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt"</span> <span class="synSpecial">]</span>; then
echo <span class="synConstant">"${{ env.DEFAULT_TIMESTAMP }}"</span> > artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt
fi
else
echo <span class="synConstant">"${{ env.DEFAULT_TIMESTAMP }}"</span> > artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt
fi
ã
<span class="synComment"> # ååå®è¡æå»ãèªã¿è¾¼ã¿</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Read previous timestamp
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">id</span><span class="synSpecial">:</span> read-timestamp
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
if <span class="synSpecial">[</span> ! -f <span class="synConstant">"artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt"</span> <span class="synSpecial">]</span>; then
echo <span class="synConstant">"${{ env.DEFAULT_TIMESTAMP }}"</span> > artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt
fi
last_run=$(cat artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt)
echo <span class="synConstant">"last_run=$last_run"</span> >> $GITHUB_ENV
ã
<span class="synComment"> # ä»åå®è¡æå»ãç°å¢å¤æ°ã«ä¿å</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Set execution time for last_run
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
execution_time=$(date --utc --iso-8601=seconds)
echo <span class="synConstant">"execution_time=$execution_time"</span> >> $GITHUB_ENV
ã
<span class="synComment"> # ã¹ã±ã¸ã¥ã¼ã«å®è¡æã®ç£æ»ãã°åå¾</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Fetch GitHub Audit Logs for Scheduled Run
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">env</span><span class="synSpecial">:</span>
<span class="synIdentifier">last_run</span><span class="synSpecial">:</span> ${{ env.last_run }}
<span class="synIdentifier">ACCESS_TOKEN</span><span class="synSpecial">:</span> ${{ env.ACCESS_TOKEN }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
. venv/bin/activate
rm -rf app/audit_logs
mkdir -p app/audit_logs
next_url="https://api.github.com/orgs/${{ env.GITHUB_ORG }}/audit-log?phrase=created:>$last_run&per_page=100&include=all"
while <span class="synSpecial">[[</span> ! -z <span class="synConstant">"$next_url"</span> <span class="synSpecial">]]</span>; do
response=$(curl -s -H <span class="synConstant">"Authorization: Bearer $ACCESS_TOKEN"</span> \
-H <span class="synConstant">"Accept: application/vnd.github.v3+json"</span> \
<span class="synConstant">"$next_url"</span>)
if echo <span class="synConstant">"$response"</span> | jq -e <span class="synConstant">'type == "object" and has("message")'</span> >/dev/<span class="synConstant">null</span> 2>&1; then
exit <span class="synConstant">1</span>
fi
logs_count=$(echo <span class="synConstant">"$response"</span> | jq <span class="synConstant">'. | length'</span>)
echo <span class="synConstant">"$response"</span> > <span class="synConstant">"app/audit_logs/log_$logs_count.json"</span>
next_url=$(curl -s -I -H <span class="synConstant">"Authorization: Bearer $ACCESS_TOKEN"</span> <span class="synConstant">"$next_url"</span> | grep -i <span class="synConstant">'^link:'</span> | sed -n <span class="synConstant">'s/.*<\(.*\)>; rel="next".*/\1/p'</span>)
sleep <span class="synConstant">2</span>
done
ã
<span class="synComment"> # æåå®è¡æã®ç£æ»ãã°åå¾</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Fetch GitHub Audit Logs for Manual Run
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ github.event_name == <span class="synConstant">'workflow_dispatch'</span> }}
<span class="synIdentifier">env</span><span class="synSpecial">:</span>
<span class="synIdentifier">start_date</span><span class="synSpecial">:</span> ${{ github.event.inputs.start_date }}
<span class="synIdentifier">end_date</span><span class="synSpecial">:</span> ${{ github.event.inputs.end_date }}
<span class="synIdentifier">ACCESS_TOKEN</span><span class="synSpecial">:</span> ${{ env.ACCESS_TOKEN }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
. venv/bin/activate
rm -rf app/audit_logs
mkdir -p app/audit_logs
next_url="https://api.github.com/orgs/${{ env.GITHUB_ORG }}/audit-log?phrase=created%3A>${start_date}%20created%3A<${end_date}&per_page=100&include=all"
while <span class="synSpecial">[[</span> ! -z <span class="synConstant">"$next_url"</span> <span class="synSpecial">]]</span>; do
response=$(curl -s -H <span class="synConstant">"Authorization: Bearer $ACCESS_TOKEN"</span> \
-H <span class="synConstant">"Accept: application/vnd.github.v3+json"</span> \
<span class="synConstant">"$next_url"</span>)
if echo <span class="synConstant">"$response"</span> | jq -e <span class="synConstant">'type == "object" and has("message")'</span> >/dev/<span class="synConstant">null</span> 2>&1; then
exit <span class="synConstant">1</span>
fi
logs_count=$(echo <span class="synConstant">"$response"</span> | jq <span class="synConstant">'. | length'</span>)
echo <span class="synConstant">"$response"</span> > <span class="synConstant">"app/audit_logs/log_$logs_count.json"</span>
next_url=$(curl -s -I -H <span class="synConstant">"Authorization: Bearer $ACCESS_TOKEN"</span> <span class="synConstant">"$next_url"</span> | grep -i <span class="synConstant">'^link:'</span> | sed -n <span class="synConstant">'s/.*<\(.*\)>; rel="next".*/\1/p'</span>)
sleep <span class="synConstant">2</span>
done
ã
<span class="synComment"> # ç£æ»ãã°ã BigQuery ã«ã¢ãããã¼ã</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Run script to upload logs to BigQuery
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
. venv/bin/activate
python3 app/main.py
ã
<span class="synComment"> # ä»åå®è¡æå»ããã¡ã¤ã«ã«æ¸ãè¾¼ã¿</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Write new execution time to file
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ success() <span class="synType">&&</span> github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
mkdir -p artifacts
echo <span class="synConstant">"$execution_time"</span> > artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt
ã
<span class="synComment"> # ä»åå®è¡æå»ãã¢ã¼ãã£ãã¡ã¯ãã¨ãã¦ã¢ãããã¼ã</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> Upload updated timestamp artifact
<span class="synIdentifier">if</span><span class="synSpecial">:</span> ${{ success() <span class="synType">&&</span> github.event_name == <span class="synConstant">'schedule'</span> }}
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/upload-artifact@v4
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> ${{ env.LAST_RUN_TIMESTAMP_NAME }}
<span class="synIdentifier">path</span><span class="synSpecial">:</span> artifacts/${{ env.LAST_RUN_TIMESTAMP_NAME }}.txt
</pre>
<h2 id="mainpy-ã®ä½æ">main.py ã®ä½æ</h2>
<p>ãã®ã¹ã¯ãªãã㯠GitHub Actions ã§åå¾ããç£æ»ãã°ãå å·¥ããBigQuery ã¸ã¨ã¯ã¹ãã¼ããã¾ããã¨ã¯ã¹ãã¼ãå
ã®ãã¼ãã«ãåå¨ããªãå ´åãæ°è¦ã«ä½æãã¾ãã</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">import</span> json
<span class="synPreProc">import</span> logging
<span class="synPreProc">import</span> os
<span class="synPreProc">import</span> sys
<span class="synPreProc">import</span> time
<span class="synPreProc">import</span> pandas <span class="synStatement">as</span> pd
<span class="synPreProc">from</span> datetime <span class="synPreProc">import</span> datetime, timezone
<span class="synPreProc">from</span> google.cloud <span class="synPreProc">import</span> bigquery
<span class="synPreProc">from</span> google.api_core.exceptions <span class="synPreProc">import</span> NotFound, GoogleAPIError
<span class="synPreProc">import</span> re
ã
<span class="synComment"># ãã°ã®è¨å®: ãã°ã¡ãã»ã¼ã¸ã®åºåå½¢å¼ãæå®ããINFOã¬ãã«ä»¥ä¸ã®ã¡ãã»ã¼ã¸ãè¨é²</span>
logging.basicConfig(level=logging.INFO, <span class="synIdentifier">format</span>=<span class="synConstant">'%(asctime)s [%(levelname)s] %(message)s'</span>)
ã
<span class="synStatement">def</span> <span class="synIdentifier">get_bigquery_client</span>():
<span class="synConstant">"""BigQueryã¯ã©ã¤ã¢ã³ããåæåãã¦è¿ã"""</span>
<span class="synStatement">return</span> bigquery.Client()
<span class="synStatement">def</span> <span class="synIdentifier">flatten_json</span>(y):
<span class="synConstant">"""ãã¹ããããJSONãã¼ã¿ãå¹³å¦å"""</span>
out = {}
<span class="synStatement">def</span> <span class="synIdentifier">flatten</span>(x, name=<span class="synConstant">''</span>):
<span class="synStatement">if</span> <span class="synIdentifier">isinstance</span>(x, <span class="synIdentifier">dict</span>):
<span class="synStatement">for</span> a <span class="synStatement">in</span> x:
flatten(x[a], name + a + <span class="synConstant">'_'</span>)
<span class="synStatement">elif</span> <span class="synIdentifier">isinstance</span>(x, <span class="synIdentifier">list</span>):
<span class="synStatement">for</span> i, a <span class="synStatement">in</span> <span class="synIdentifier">enumerate</span>(x):
flatten(a, name + <span class="synIdentifier">str</span>(i) + <span class="synConstant">'_'</span>)
<span class="synStatement">else</span>:
out[name[:-<span class="synConstant">1</span>]] = x
flatten(y)
<span class="synStatement">return</span> out
<span class="synStatement">def</span> <span class="synIdentifier">clean_field_name</span>(field_name):
<span class="synConstant">"""ãã£ã¼ã«ãåãBigQueryã§è¨±å¯ãããå½¢å¼ã«å¤æ"""</span>
field_name = re.sub(<span class="synConstant">r'[^a-zA-Z0-9_]'</span>, <span class="synConstant">'_'</span>, field_name)
<span class="synStatement">if</span> field_name[<span class="synConstant">0</span>].isdigit():
field_name = <span class="synConstant">'_'</span> + field_name
<span class="synStatement">return</span> field_name
<span class="synStatement">def</span> <span class="synIdentifier">infer_schema_from_logs</span>(logs_df):
<span class="synConstant">"""DataFrameããBigQueryç¨ã®ã¹ãã¼ããæ¨æ¸¬ãã¦çæ"""</span>
schema = []
<span class="synStatement">for</span> column <span class="synStatement">in</span> logs_df.columns:
clean_column = clean_field_name(column)
dtype = logs_df[column].dtype
<span class="synStatement">if</span> clean_column == <span class="synConstant">"_timestamp"</span> <span class="synStatement">and</span> pd.api.types.is_integer_dtype(dtype):
schema.append(bigquery.SchemaField(<span class="synConstant">"timestamp"</span>, <span class="synConstant">"TIMESTAMP"</span>))
<span class="synStatement">elif</span> pd.api.types.is_integer_dtype(dtype):
schema.append(bigquery.SchemaField(clean_column, <span class="synConstant">"INTEGER"</span>))
<span class="synStatement">elif</span> pd.api.types.is_float_dtype(dtype):
schema.append(bigquery.SchemaField(clean_column, <span class="synConstant">"FLOAT"</span>))
<span class="synStatement">elif</span> pd.api.types.is_bool_dtype(dtype):
schema.append(bigquery.SchemaField(clean_column, <span class="synConstant">"BOOLEAN"</span>))
<span class="synStatement">elif</span> pd.api.types.is_datetime64_any_dtype(dtype):
schema.append(bigquery.SchemaField(clean_column, <span class="synConstant">"TIMESTAMP"</span>))
<span class="synStatement">else</span>:
schema.append(bigquery.SchemaField(clean_column, <span class="synConstant">"STRING"</span>))
<span class="synStatement">return</span> schema
<span class="synStatement">def</span> <span class="synIdentifier">create_table_if_not_exists</span>(client, table_ref, logs_df):
<span class="synConstant">"""ãã¼ãã«ãåå¨ããªãå ´åãæ°è¦ä½æ"""</span>
<span class="synStatement">try</span>:
table = client.get_table(table_ref)
logging.info(f<span class="synConstant">"Table {table_ref} already exists."</span>)
<span class="synStatement">return</span> table
<span class="synStatement">except</span> NotFound:
schema = infer_schema_from_logs(logs_df)
table = bigquery.Table(table_ref, schema=schema)
table = client.create_table(table)
logging.info(f<span class="synConstant">"Table {table_ref} created with schema."</span>)
<span class="synStatement">return</span> table
<span class="synStatement">def</span> <span class="synIdentifier">load_audit_logs</span>(logs_dir=<span class="synConstant">'app/audit_logs'</span>):
<span class="synConstant">"""ç£æ»ãã°ãJSONãã¡ã¤ã«ããèªã¿è¾¼ã¿DataFrameã«çµ±å"""</span>
logs = []
<span class="synStatement">for</span> filename <span class="synStatement">in</span> os.listdir(logs_dir):
<span class="synStatement">if</span> filename.endswith(<span class="synConstant">".json"</span>):
file_path = os.path.join(logs_dir, filename)
<span class="synStatement">try</span>:
<span class="synStatement">with</span> <span class="synIdentifier">open</span>(file_path, <span class="synConstant">'r'</span>) <span class="synStatement">as</span> f:
file_logs = json.load(f)
<span class="synStatement">for</span> log <span class="synStatement">in</span> file_logs:
logs.append(flatten_json(log))
<span class="synStatement">except</span> json.JSONDecodeError <span class="synStatement">as</span> e:
logging.error(f<span class="synConstant">"Failed to load {file_path}: {e}"</span>)
<span class="synStatement">return</span> pd.DataFrame(logs)
<span class="synStatement">def</span> <span class="synIdentifier">transform_audit_logs</span>(logs_df, schema):
<span class="synConstant">"""ç£æ»ãã°ãBigQueryç¨ã®å½¢å¼ã«å¤æ"""</span>
transformed_logs = []
schema_field_names = {field.name <span class="synStatement">for</span> field <span class="synStatement">in</span> schema}
logs_df.columns = [clean_field_name(col) <span class="synStatement">for</span> col <span class="synStatement">in</span> logs_df.columns]
<span class="synStatement">if</span> <span class="synConstant">"_timestamp"</span> <span class="synStatement">in</span> logs_df.columns:
logs_df[<span class="synConstant">"_timestamp"</span>] = pd.to_datetime(logs_df[<span class="synConstant">"_timestamp"</span>], unit=<span class="synConstant">'ms'</span>, utc=<span class="synIdentifier">True</span>)
logs_df = logs_df.rename(columns={<span class="synConstant">"_timestamp"</span>: <span class="synConstant">"timestamp"</span>})
<span class="synStatement">for</span> _, log <span class="synStatement">in</span> logs_df.iterrows():
transformed_log = {}
<span class="synStatement">for</span> key, value <span class="synStatement">in</span> log.items():
<span class="synStatement">if</span> key <span class="synStatement">in</span> schema_field_names <span class="synStatement">and</span> <span class="synStatement">not</span> pd.isnull(value):
<span class="synStatement">if</span> <span class="synIdentifier">isinstance</span>(value, pd.Timestamp):
value = value.isoformat()
<span class="synStatement">elif</span> <span class="synIdentifier">isinstance</span>(value, <span class="synIdentifier">bool</span>):
value = <span class="synIdentifier">int</span>(value)
transformed_log[key] = value
<span class="synStatement">if</span> transformed_log:
transformed_logs.append(transformed_log)
<span class="synStatement">return</span> transformed_logs
<span class="synStatement">def</span> <span class="synIdentifier">insert_rows_with_retry</span>(client, table_ref, rows, retries=<span class="synConstant">3</span>, delay=<span class="synConstant">10</span>):
<span class="synConstant">"""BigQueryã«ãã¼ã¿ããªãã©ã¤ä»ãã§æ¿å
¥"""</span>
<span class="synStatement">for</span> attempt <span class="synStatement">in</span> <span class="synIdentifier">range</span>(retries):
<span class="synStatement">try</span>:
errors = client.insert_rows_json(table_ref, rows)
<span class="synStatement">if</span> errors:
logging.error(f<span class="synConstant">"Errors occurred during insertion: {errors}"</span>)
time.sleep(delay)
<span class="synStatement">else</span>:
logging.info(<span class="synConstant">"Data uploaded successfully."</span>)
<span class="synStatement">return</span>
<span class="synStatement">except</span> GoogleAPIError <span class="synStatement">as</span> e:
logging.error(f<span class="synConstant">"Failed to upload data to BigQuery: {e}"</span>)
time.sleep(delay)
logging.error(f<span class="synConstant">"Failed to insert rows into {table_ref} after {retries} attempts."</span>)
sys.exit(<span class="synConstant">1</span>)
<span class="synStatement">def</span> <span class="synIdentifier">main</span>():
project_id = os.getenv(<span class="synConstant">'BQ_GCP_PROJECT_ID'</span>)
dataset_id = os.getenv(<span class="synConstant">'BQ_DATASET'</span>)
table_id = os.getenv(<span class="synConstant">'BQ_TABLE'</span>)
table_ref = f<span class="synConstant">"{project_id}.{dataset_id}.{table_id}"</span>
client = get_bigquery_client()
logs_df = load_audit_logs()
<span class="synStatement">if</span> <span class="synStatement">not</span> logs_df.empty:
table = create_table_if_not_exists(client, table_ref, logs_df)
rows_to_insert = transform_audit_logs(logs_df, table.schema)
insert_rows_with_retry(client, table_ref, rows_to_insert)
<span class="synStatement">else</span>:
logging.error(<span class="synConstant">"No logs to process. Exiting."</span>)
sys.exit(<span class="synConstant">1</span>)
<span class="synStatement">if</span> __name__ == <span class="synConstant">"__main__"</span>:
main()
</pre>
<h2 id="GitHub-App-ã®ä½æ">GitHub App ã®ä½æ</h2>
<p>ç£æ»ãã°ãåå¾ããããã® GitHub App ãä½æãã¾ãã詳細ãªæé ã¯ä»¥ä¸ãåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/managing-your-enterprise-account/creating-github-apps-for-your-enterprise">Enterprise åã GitHub Apps ã®ä½æ</a></li>
</ul>
<p>GitHub App ã® Permissions ã¯ä»¥ä¸ã®ã¨ããã«è¨å®ãã¾ãã</p>
<ul>
<li>Repository permissions
<ul>
<li>Administrationï¼ <code>Read-only</code></li>
<li>Metadataï¼ <code>Read-only</code></li>
</ul>
</li>
<li><p>Organization permissions</p>
<ul>
<li>Administrationï¼ <code>Read-only</code></li>
</ul>
</li>
<li><p>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app">GitHub Appã®æ¨©éã«ã¤ãã¦</a></p></li>
</ul>
<p>ï¼Generalï¼ãã App ID ã確èªããæ§ãã¦ããã¾ããï¼å¾ã§ GitHub ã® secret ã«ç»é²ãã¾ãï¼</p>
<p><figure class="figure-image figure-image-fotolife" title="App ID ã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090013.png" width="642" height="391" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>App ID ã®ç¢ºèª</figcaption></figure></p>
<p>åç»é¢ããï¼Private keysï¼ãä½æãããã¦ã³ãã¼ããã¾ããï¼å¾ã§ GitHub ã® secret ã«ç»é²ãã¾ãï¼</p>
<p><figure class="figure-image figure-image-fotolife" title="Private keys ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090016.png" width="486" height="210" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Private keys ã®ä½æ</figcaption></figure></p>
<p>ï¼Install Appï¼ãã対象ã®çµç¹ã確èªããï¼Installï¼ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="çµç¹ã¸ã®ã¤ã³ã¹ãã¼ã«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090019.png" width="800" height="213" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>çµç¹ã¸ã®ã¤ã³ã¹ãã¼ã«</figcaption></figure></p>
<p>ï¼Only select repositoriesï¼ãã GitHub Actions ãæ§ç¯ããã¬ãã¸ããªãé¸æããï¼Installï¼ãé¸æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="GitHub App ãã¤ã³ã¹ãã¼ã«ããã¬ãã¸ããªã®é¸æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090022.png" width="380" height="591" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>GitHub App ãã¤ã³ã¹ãã¼ã«ããã¬ãã¸ããªã®é¸æ</figcaption></figure></p>
<h2 id="GitHub-Actions-ã®ã·ã¼ã¯ã¬ããç»é²">GitHub Actions ã®ã·ã¼ã¯ã¬ããç»é²</h2>
<p>ä½æãã GitHub App ã GitHub Actions ã§ä½¿ç¨ããããããªãã¸ããªã® Secretsï¼ã·ã¼ã¯ã¬ããï¼ã«ç»é²ãã¾ããç»é²å¯¾è±¡ã¯ä»¥ä¸ã® 2 ã¤ã§ãã</p>
<ol>
<li><p><strong>App ID</strong></p>
<ul>
<li><strong>åå</strong>: <code>APP_ID</code></li>
<li><strong>å¤</strong>: åæé ã§ç¢ºèªãã GitHub App ã® App ID</li>
</ul>
</li>
<li><p><strong>Private keys</strong></p>
<ul>
<li><strong>åå</strong>: <code>APP_PRIVATE_KEY</code></li>
<li><strong>å¤</strong>: PEM ãã¼ã®å¤ãã³ãã¼ãã¦è²¼ãä»ãã</li>
</ul>
</li>
</ol>
<p><figure class="figure-image figure-image-fotolife" title="Secrets ã®ç»é²"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090026.png" width="690" height="758" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Secrets ã®ç»é²</figcaption></figure></p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions">ãªãã¸ããªã®ã·ã¼ã¯ã¬ããã®ä½æ</a></li>
</ul>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="æåå®è¡">æåå®è¡</h2>
<p>GitHub ã®ï¼Actionsï¼ã¿ããã対象ã¯ã¼ã¯ããã¼ãé¸æããåå¾æéã®ãã©ã¡ã¼ã¿ï¼<code>Start date</code>ã<code>End date</code>ï¼ãå
¥åãã¦ï¼Run workflowï¼ã§å®è¡ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æåå®è¡"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090029.png" width="800" height="402" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æåå®è¡</figcaption></figure></p>
<p>â» ä¸åº¦ã«180æ¥åãåå¾å¯è½ã§ããããã°æ°ãå¤ãå ´åãBigQuery ã¸ã¨ã¯ã¹ãã¼ãããéã«ä»¥ä¸ã¨ã©ã¼ã§å¤±æãããã¨ãããã¾ããçºçããå ´åãåå¾æéãçããã¦åå®è¡ãã¦ãã ããã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>Error: <span class="synConstant">-06</span> 08:40:51,<span class="synConstant">290</span> <span class="synStatement">[</span>ERROR<span class="synStatement">]</span> Failed to upload data to BigQuery: Timeout of <span class="synConstant">600</span>.0s exceeded, last exception: HTTPSConnectionPool<span class="synPreProc">(</span><span class="synIdentifier">host</span>=<span class="synStatement">'</span><span class="synConstant">bigquery.googleapis.com</span><span class="synStatement">'</span><span class="synSpecial">, </span><span class="synIdentifier">port</span>=<span class="synConstant">443</span><span class="synPreProc">)</span>: Max retries exceeded with url: /bigquery/v2/projects/xxxxx/datasets/xxxxx/tables/xxxxx/insertAll?<span class="synIdentifier">prettyPrint</span>=false <span class="synPreProc">(</span><span class="synSpecial">Caused by SSLError</span><span class="synPreProc">(</span><span class="synSpecial">SSLEOFError</span><span class="synPreProc">(</span><span class="synConstant">8</span><span class="synSpecial">, </span><span class="synStatement">'</span><span class="synConstant">EOF occurred in violation of protocol (_ssl.c:2426)</span><span class="synStatement">'</span><span class="synPreProc">)))</span>
</pre>
<p>ã¾ããç£æ»ãã° API ã«ã¯ã¬ã¼ãä¸éãããã1 æéã«æ大 1,750 ã¯ã¨ãªï¼1 ã¯ã¨ãªã§æ大 100 件ã®ãã°åå¾ãå¯è½ï¼ã®å¶éãããã¾ãããã®å¶éãè¶
ããå ´åã403 ã¾ã㯠429 ã¨ã©ã¼å¿çã§å¤±æãããããã注æãã ããã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/using-the-audit-log-api-for-your-enterprise#rate-limit">ã¬ã¼ãä¸é</a></li>
</ul>
<p>å®è¡ãæåããããBigQuery ã確èªããæå®ããæéã®ç£æ»ãã°ãæ ¼ç´ããããã¼ãã«ããããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æåå®è¡æå"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090050.png" width="800" height="457" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æåå®è¡æå</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="ç£æ»ãã°ã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090032.png" width="800" height="278" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç£æ»ãã°ã®ç¢ºèª</figcaption></figure></p>
<h2 id="ã¹ã±ã¸ã¥ã¼ã«å®è¡">ã¹ã±ã¸ã¥ã¼ã«å®è¡</h2>
<p>JST 0æã«ã¹ã±ã¸ã¥ã¼ã«å®è¡ããããã°ã BigQuery ã«ã¨ã¯ã¹ãã¼ãããã¾ããGitHub å´ã®è² è·ã«ããå®è¡ã¾ã§ã«é
延ãçºçããå ´åãããã¾ãã®ã§ãã注æãã ããã</p>
<ul>
<li>åè : <a href="https://docs.github.com/ja/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule">schedule</a></li>
</ul>
<p>GitHub ã®ï¼Actionsï¼ãã対象ã®ã¯ã¼ã¯ããã¼ãæåãã¦ãããã¨ã確èªãã¾ããï¼Eventï¼ããï¼scheduleï¼ãé¸æãããã¨ã§ãã¹ã±ã¸ã¥ã¼ã«å®è¡ãããã¯ã¼ã¯ããã¼ã®ã¿ã表示ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã£ã«ã¿æ¹æ³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090036.png" width="248" height="197" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã£ã«ã¿æ¹æ³</figcaption></figure></p>
<p>å¦çãæåããArtifacts ã«ãã¡ã¤ã«ï¼å®è¡æéãè¨é²ããã txt ãã¡ã¤ã«ï¼ããããã¨ã確èªãã¾ãã次åã®å®è¡æã¯ãã®æé以éã®ãã°ãåå¾ããBigQuery ã¸ã¨ã¯ã¹ãã¼ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¹ã±ã¸ã¥ã¼ã«å®è¡æå"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090038.png" width="729" height="454" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¹ã±ã¸ã¥ã¼ã«å®è¡æå</figcaption></figure>
<figure class="figure-image figure-image-fotolife" title="last_run_timestamp ã®ä¸èº«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090041.png" width="602" height="82" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>last_run_timestamp ã®ä¸èº«</figcaption></figure></p>
<p>BigQuery ã確èªããç£æ»ãã°ãåºåããã¦ãããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ç£æ»ãã°ã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241204/20241204090044.png" width="800" height="85" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ç£æ»ãã°ã®ç¢ºèª</figcaption></figure></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-miurak/profile_128x128.png?1658213943);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä¸æµ¦ å¥æ<a href="https://blog.g-gen.co.jp/archive/author/ggen-miurak">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt">2023å¹´10æããG-genã«ã¸ã§ã¤ã³ãå
ãªã³ãã¬ä¸å¿ã®ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ããããã¯ã¼ã¯ã»ã»ãã¥ãªãã£ã»åæãã»è¾ããã®ã好ãã<br>
</div>
</div>
</div>
</div>
ggen-miurak
2024å¹´11æã®ã¤ããªã·Google Cloudã¢ãããã¼ã
hatenablog://entry/6802418398307331393
2024-12-02T09:00:00+09:00
2024-12-02T09:00:11+09:00 G-gen ã®ææã§ãã2024å¹´11æã®ã¤ããªã· Google Cloud ã¢ãããã¼ããã¾ã¨ãã¦ãç´¹ä»ãã¾ããè¨è¼ã¯å
¨ã¦ãè¨äºå
¬éå½æã®ãã®ã§ãã®ã§ãçæãã ããã ã¯ããã« Eventarc Advanced ãç»å ´ï¼Previewï¼ Vertex AI Search 㧠streaming answer ã¡ã½ããï¼GA with Allowlistï¼ Dataplex 㧠automatic discovery of Cloud Storage data ã Preview ãã¼ã¿åé¡ã©ãã«ã Gmail ã«ãå¯¾å¿ Google Cloud èªå®è©¦é¨ã«æ°è©¦é¨ãèªç Applicatioâ¦
<p>G-gen ã®ææã§ãã2024å¹´11æã®ã¤ããªã· Google Cloud ã¢ãããã¼ããã¾ã¨ãã¦ãç´¹ä»ãã¾ããè¨è¼ã¯å
¨ã¦ãè¨äºå
¬éå½æã®ãã®ã§ãã®ã§ãçæãã ããã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#Eventarc-Advanced-ãç»å ´Preview">Eventarc Advanced ãç»å ´ï¼Previewï¼</a></li>
<li><a href="#Vertex-AI-Search-ã§-streaming-answer-ã¡ã½ããGA-with-Allowlist">Vertex AI Search 㧠streaming answer ã¡ã½ããï¼GA with Allowlistï¼</a></li>
<li><a href="#Dataplex-ã§-automatic-discovery-of-Cloud-Storage-data-ã-Preview">Dataplex 㧠automatic discovery of Cloud Storage data ã Preview</a></li>
<li><a href="#ãã¼ã¿åé¡ã©ãã«ã-Gmail-ã«ã対å¿">ãã¼ã¿åé¡ã©ãã«ã Gmail ã«ã対å¿</a></li>
<li><a href="#Google-Cloud-èªå®è©¦é¨ã«æ°è©¦é¨ãèªç">Google Cloud èªå®è©¦é¨ã«æ°è©¦é¨ãèªç</a></li>
<li><a href="#Application-Load-Balancer-ã§-Service-Extensions-ã-Preview-å
¬é">Application Load Balancer 㧠Service Extensions ã Preview å
Ž</a></li>
<li><a href="#PubSub-ã§-Cloud-Storage-import-topic-ãå©ç¨å¯è½ã«">Pub/Sub 㧠Cloud Storage import topic ãå©ç¨å¯è½ã«</a></li>
<li><a href="#æ°ãµã¼ãã¹-Audit-Manager-ãå
¬éGA">æ°ãµã¼ãã¹ Audit Manager ãå
¬éï¼GAï¼</a></li>
<li><a href="#Vertex-AI-ã§-Gemini-ã«ãããããæ¨è«ãå¯è½ã«GA">Vertex AI 㧠Gemini ã«ããããããæ¨è«ããå¯è½ã«ï¼GAï¼</a></li>
<li><a href="#GKE-ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«-DNS-ãã¼ã¹ã®ã¢ã¯ã»ã¹ãç»å ´">GKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã« DNS ãã¼ã¹ã®ã¢ã¯ã»ã¹ãç»å ´</a></li>
<li><a href="#Gemini-ãµã¤ãããã«ã®æ¥æ¬èªçã-Alpha-ç--GA">Gemini ãµã¤ãããã«ã®æ¥æ¬èªçã Alpha ç â GA</a></li>
<li><a href="#Cloud-Run-ã§-in-memory-volume-ã-Preview---GA">Cloud Run 㧠in-memory volume ã Preview -> GA</a></li>
<li><a href="#Cloud-Storage-ã§-Bucket-IP-filtering-ã-Preview-å
¬é">Cloud Storage 㧠Bucket IP filtering ã Preview å
Ž</a></li>
<li><a href="#BigQuery-ã®-Search-index-ã§æ°å¤åã«å¯¾ããæé©åã-Preview--GA">BigQuery ã® Search index ã§æ°å¤åã«å¯¾ããæé©åã Preview â GA</a></li>
<li><a href="#Cloud-SQL-Enterprise-Plus-edition-ã§-write-endpoint-ã-Preview-å
¬é">Cloud SQL Enterprise Plus edition 㧠write endpoint ã Preview å
Ž</a></li>
<li><a href="#Cloud-SQL-Studio-ã§-IAM-ãã¼ã¿ãã¼ã¹èªè¨¼ã使ããããã«">Cloud SQL Studio 㧠IAM ãã¼ã¿ãã¼ã¹èªè¨¼ã使ããããã«</a></li>
<li><a href="#Cloud-SQL-for-PostgreSQL-ã®ããã¯ã¢ãããã-AlloyDB-ã¯ã©ã¹ã¿ãèµ·åã§ããããã«">Cloud SQL for PostgreSQL ã®ããã¯ã¢ãããã AlloyDB ã¯ã©ã¹ã¿ãèµ·åã§ããããã«</a></li>
<li><a href="#2025å¹´1æ25æ¥ãã-Cloud-Run-é¢é£ãã¼ã«ã«ä»æ§å¤æ´ãã">2025å¹´1æ25æ¥ãã Cloud Run é¢é£ãã¼ã«ã«ä»æ§å¤æ´ãã</a></li>
<li><a href="#Google-Chat-ã«é³å£°ãã¼ãã£ã³ã°-huddles-ãå°å
¥">Google Chat ã«é³å£°ãã¼ãã£ã³ã° huddles ãå°å
¥</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240603/20240603200204.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p>å½è¨äºã§ã¯ãæ¯æã® Google Cloud ã¢ãããã¼ãã®ãã¡ç¹ã«éè¦ãªãã®ãã¾ã¨ãã¾ãã</p>
<p>ã¾ãå½è¨äºã¯ãGoogle Cloud ã«é¢ããããç¨åº¦ã®ç¥èãåæã«è¨è¼ããã¦ãã¾ããåæç¥èãå¾ãã«ã¯ããã²ä»¥ä¸ã®è¨äºããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcontents-for-google-cloud-learners" title="Google Cloud ãµã¼ãã¹ã«ããå¦ç¿ã³ã³ãã³ãé - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/contents-for-google-cloud-learners">blog.g-gen.co.jp</a></cite></p>
<p>ãªã³ã¯å
ã®å
¬å¼ã¬ã¤ãã¯ãè±èªçã§è¡¨ç¤ºããªãã¨ææ°æ
å ±ãåæ ããã¦ããªãå ´åãããã¾ãããã注æãã ããã</p>
<h1 id="Eventarc-Advanced-ãç»å ´Preview">Eventarc Advanced ãç»å ´ï¼Previewï¼</h1>
<p><a href="https://cloud.google.com/eventarc/advanced/docs/choose-product-edition?hl=en">Choose Eventarc Advanced or Eventarc Standard</a> (2024-10-31)</p>
<p>Eventarc Advancedãç»å ´(Preview)ã</p>
<p>å¾æ¥çï¼Standardï¼ã¨ã®éãã¯ããã詳細ãªå¶å¾¡ãä»å¯¾ä»ã®ãã¡ã³ã¤ã³ã»ãã¡ã³ã¢ã¦ããã¡ãã»ã¼ã¸ã®å¤æãªã©ãBusãEnrollmentãPipelineã®3è¦ç´ ã§æ§æãããã</p>
<h1 id="Vertex-AI-Search-ã§-streaming-answer-ã¡ã½ããGA-with-Allowlist">Vertex AI Search 㧠streaming answer ã¡ã½ããï¼GA with Allowlistï¼</h1>
<p><a href="https://cloud.google.com/generative-ai-app-builder/docs/stream-answer?hl=en">Stream answers</a> (2024-10-31)</p>
<p>Vertex AI Search ã« streaming answer ã¡ã½ãããç»å ´ã</p>
<p>åçã®ä¸é¨ãçæãã次第ã¹ããªã¼ãã³ã°ã§è¿å´ããããç¾å¨ã®ã¨ããè±èªã®ã¿å¯¾å¿ãå©ç¨ã«ã¯ç³è«ãå¿
è¦ã</p>
<h1 id="Dataplex-ã§-automatic-discovery-of-Cloud-Storage-data-ã-Preview">Dataplex 㧠automatic discovery of Cloud Storage data ã Preview</h1>
<p><a href="https://cloud.google.com/bigquery/docs/automatic-discovery?hl=en">Discover and catalog Cloud Storage data</a> (2024-11-05)</p>
<p>Dataplex 㧠automatic discovery of Cloud Storage data ã Preview å
¬éã</p>
<p>Cloud Storage ä¸ã® CSVãJSONLãParquetãAvroãORC ãèªåã§æ¤åºããBigQuery ã®å¤é¨ãã¼ãã«ããªãã¸ã§ã¯ããã¼ãã«ãçæãã¦ãããã</p>
<p>以åãã Dataplex ã«ã¯ãåæ§ã® Data Discovery æ©è½ãåå¨ãã¦ããããä»åã®ã¢ãããã¼ãã§ã¯ Dataplex ã® Lake ãä½æãããããã®ã¾ã¾ BigQuery ãã使ããï¼Dataplex ã®ç®¡çæ©æ§ãéããªãï¼ãã¨ãéãã</p>
<h1 id="ãã¼ã¿åé¡ã©ãã«ã-Gmail-ã«ã対å¿">ãã¼ã¿åé¡ã©ãã«ã Gmail ã«ã対å¿</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/11/open-beta-data-classification-labels-gmail.html">Data classifications labels for Gmail are now available in open beta</a> (2024-11-01)</p>
<p>ãã¼ã¿åé¡ã©ãã«ã Gmail ã«ã対å¿ã"Sensitive"ã"Confidential" ã¨ãã£ãã©ãã«ãã³ã³ãã³ãå
容ã«å¿ãã¦èªåä»ä¸ããã©ãã«ã«å¿ãã¦å¤é¨éä¿¡ããããã¯ãããªã©ãå¯è½ãã¨ãã£ã·ã§ã³ãã¨ã«ä½¿ããæ©è½ãéããã¨ã«æ³¨æã</p>
<h1 id="Google-Cloud-èªå®è©¦é¨ã«æ°è©¦é¨ãèªç">Google Cloud èªå®è©¦é¨ã«æ°è©¦é¨ãèªç</h1>
<p><a href="https://cloud.google.com/learn/certification/?hl=en">Google Cloud Certification</a></p>
<ul>
<li>Associate Google Workspace Administratorï¼Betaï¼
<ul>
<li>2024å¹´10æ22æ¥ãBeta çã¨ãã¦å
Ž</li>
<li>Google Workspace ã®ç®¡çæ¥åããã©ãã«ã·ã¥ã¼ãã£ã³ã°ã«é¢ããç¥èãåã</li>
</ul>
</li>
<li>Associate Data Practionerï¼Betaï¼
<ul>
<li>2024å¹´10æ30æ¥ãBeta çã¨ãã¦å
Ž</li>
<li>Google Cloud ä¸ã®ãã¼ã¿ããã¼ã¿ãã¤ãã©ã¤ã³ã®ç®¡çã«é¢ããç¥èãåã</li>
</ul>
</li>
<li>Professional Cloud Architect
<ul>
<li>æ°ããæ´æ°è©¦é¨ã® Beta çãåé¨å¯è½ã«</li>
<li>ããã¾ã§ã¯ãæ°è¦åé¨ã¨æ´æ°åé¨ã«åé¡ã®åºå¥ããªãã£ã</li>
</ul>
</li>
</ul>
<p>2ã¤ã®æ°è©¦é¨ã«ã¤ãã¦ã¯ãG-gen ããæ¢ã«è©¦é¨å¯¾çè¨äºãå
¬éãããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fassociate-data-practitioner-exam" title="Associate Data Practitioner試é¨å¯¾çããã¥ã¢ã« - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/associate-data-practitioner-exam">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fassociate-google-workspace-administrator-exam" title="Associate Google Workspace Administrator試é¨å¯¾çããã¥ã¢ã« - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/associate-google-workspace-administrator-exam">blog.g-gen.co.jp</a></cite></p>
<h1 id="Application-Load-Balancer-ã§-Service-Extensions-ã-Preview-å
¬é">Application Load Balancer 㧠Service Extensions ã Preview å
Ž</h1>
<p><a href="https://cloud.google.com/blog/products/networking/service-extensions-plugins-for-application-load-balancers/?hl=en">Now run your custom code at the edge with the Application Load Balancers</a> (2024-10-30)</p>
<p>Application Load Balancer ã§ãã¨ãã¸å´ã§ãµã¼ãã¼ã¬ã¹ããã°ã©ã ãåä½ããã Service Extensions ã Preview å
¬éã</p>
<p>ããã°ã©ã ã®ãã©ã¼ããã㯠WebAssembly (Wasm)ãALBå´ã§ã³ã¼ããåãã®ã§ä½é
延ã§ç¨¼åãããHTTPãããæä½ãã«ã¹ã¿ã èªè¨¼ãã«ã¹ã¿ã ãã®ã³ã°ãHTMLæ¸ãæããªã©ã«å©ç¨ã§ããã</p>
<h1 id="PubSub-ã§-Cloud-Storage-import-topic-ãå©ç¨å¯è½ã«">Pub/Sub 㧠Cloud Storage import topic ãå©ç¨å¯è½ã«</h1>
<p><a href="https://cloud.google.com/pubsub/docs/create-cloud-storage-import-topic?hl=en">Create a Cloud Storage import topic</a> (2024-11-06)</p>
<p>Pub/Sub 㧠Cloud Storage import topic ãå©ç¨å¯è½ã«ã</p>
<p>Publisher ãµã¼ãã¹ãéçºãããã¨ãªã Cloud Storage ãªãã¸ã§ã¯ãã Pub/Sub ã«åãè¾¼ãã§å®å
ã«æ¿å
¥ã§ãããã¤ãã³ãããªãã³ãªã¢ã¼ããã¯ãã£ããã容æã«å®è£
å¯è½ã«ã</p>
<p>以ä¸ã®è¨äºãåç
§ã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fpubsub-cloud-storage-import-topic" title="Pub/Subã®Cloud Storage import topicã使ã£ã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/pubsub-cloud-storage-import-topic">blog.g-gen.co.jp</a></cite></p>
<h1 id="æ°ãµã¼ãã¹-Audit-Manager-ãå
¬éGA">æ°ãµã¼ãã¹ Audit Manager ãå
¬éï¼GAï¼</h1>
<p><a href="https://cloud.google.com/audit-manager/docs/overview?hl=en">Audit Manager overview</a> (2024-11-07)</p>
<p>Google Cloudã§æ°ãµã¼ãã¹Audit Managerãå
¬éï¼GAï¼ã</p>
<p>ISO 27001 ã SOC2ãPCI DSS çã«æºæ ããããã«è¨¼è·¡ãèªååéãæé㯠Free 㨠Premium ã® 2 tiersã</p>
<p>Free tier ã§ã¯ä»¥ä¸ã®ç£æ»å¯¾å¿ãå¯è½ã</p>
<ul>
<li>SOC2</li>
<li>Google-recommended AI controls</li>
</ul>
<p>Premium tierï¼$7,500/yrï¼ã§ã¯ä»¥ä¸ã®ç£æ»å¯¾å¿ãå¯è½ã</p>
<ul>
<li>NIST 800-53 Revision 4</li>
<li>CIS Controls v8</li>
<li>PCI DSS 4.0</li>
<li>Cloud Controls Matrix 4.0</li>
<li>NIST CSF v1</li>
<li>CIS Google Cloud Foundation Benchmark 2.0</li>
<li>ISO 27001 2022</li>
</ul>
<h1 id="Vertex-AI-ã§-Gemini-ã«ãããããæ¨è«ãå¯è½ã«GA">Vertex AI 㧠Gemini ã«ããããããæ¨è«ããå¯è½ã«ï¼GAï¼</h1>
<p><a href="https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/batch-prediction-gemini?hl=en">Batch prediction</a> (2024-11-08)</p>
<p>Vertex AI 㧠Gemini ã«ããããããæ¨è«ããå¯è½ã«ï¼GAï¼ã</p>
<p>1度ã®ãªã¯ã¨ã¹ãã§å¤æ°ã®ããã³ãããéä¿¡ãåéã®æ¨æºãªã¯ã¨ã¹ããã50%å¼ãã®æéã§å©ç¨ã§ãããã¬ã¹ãã³ã¹ã¯ BigQuery ã¾ã㯠Cloud Storage ã«éåæåºåãGemini 1.5 Pro/Flash çã§å©ç¨å¯è½ã</p>
<h1 id="GKE-ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«-DNS-ãã¼ã¹ã®ã¢ã¯ã»ã¹ãç»å ´">GKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã« DNS ãã¼ã¹ã®ã¢ã¯ã»ã¹ãç»å ´</h1>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/network-isolation?hl=en">About network isolation in GKE</a> (2024-11-11)</p>
<p>Google Kubernetes Engineï¼GKEï¼ã§ãã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³ã« DNS ãã¼ã¹ã®ã¢ã¯ã»ã¹ãç»å ´ã</p>
<p>å¾æ¥ã® IP ãã¼ã¹ã ã¨ãã¯ã©ã¹ã¿ããã©ã¤ãã¼ããããã¯ã¼ã¯ã«éãè¾¼ããæ¥ç¶å
IP ã¢ãã¬ã¹ï¼æ¿èªæ¸ã¿ãããã¯ã¼ã¯ï¼ã§å¶å¾¡ãã¦ããããDNS ãã¼ã¹ã®ã¢ã¯ã»ã¹ã§ã¯ IAM ã§èªè¨¼ã</p>
<p>以ä¸ã®è¨äºãåç
§ã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fdns-based-endpoint-for-gke-control-plane" title="DNSãã¼ã¹ã®ã¨ã³ããã¤ã³ãã使ç¨ãã¦GKEã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/dns-based-endpoint-for-gke-control-plane">blog.g-gen.co.jp</a></cite></p>
<h1 id="Gemini-ãµã¤ãããã«ã®æ¥æ¬èªçã-Alpha-ç--GA">Gemini ãµã¤ãããã«ã®æ¥æ¬èªçã Alpha ç â GA</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/11/more-languages-gemini-side-panel-general-availability.html">Now generally available: use Gemini in the side panel of Workspace apps in seven additional languages</a> (2024-11-07)</p>
<p>Gemini for Google Workspace ãµã¤ãããã«ã®æ¥æ¬èªçã Alpha ç â GAï¼ä¸è¬å
¬éï¼ã2024-10-16 ã« Alpha çã¨ãã¦å
¬éããã¦ããã</p>
<p>ãªããä»ã®è¨èªãåæã« GAãä»åã®å
¬è¡¨ã§ GA ãããè¨èªã¯ä»¥ä¸ã®ã¨ããã</p>
<ul>
<li>ãã©ã³ã¹èª</li>
<li>ãã¤ãèª</li>
<li>ã¤ã¿ãªã¢èª</li>
<li>æ¥æ¬èª</li>
<li>éå½èª</li>
<li>ãã«ãã¬ã«èª</li>
<li>ã¹ãã¤ã³èª</li>
</ul>
<h1 id="Cloud-Run-ã§-in-memory-volume-ã-Preview---GA">Cloud Run 㧠in-memory volume ã Preview -> GA</h1>
<p><a href="https://cloud.google.com/run/docs/configuring/services/in-memory-volume-mounts?hl=en">Configure in-memory volume mounts for services</a> (2024-11-12)</p>
<p>Cloud Run 㧠in-memory volume ã Preview -> GAã</p>
<p>ã³ã³ããã®ã¡ã¢ãªé åããã¡ã¤ã«ã·ã¹ãã ã¨ãã¦å©ç¨ãCloud Run service 㨠jobs ã®ä¸¡æ¹ã§å©ç¨å¯è½ã</p>
<h1 id="Cloud-Storage-ã§-Bucket-IP-filtering-ã-Preview-å
¬é">Cloud Storage 㧠Bucket IP filtering ã Preview å
Ž</h1>
<p><a href="https://cloud.google.com/storage/docs/ip-filtering-overview?hl=en">Bucket IP filtering</a> (2024-11-14)</p>
<p>Cloud Storage 㧠Bucket IP filtering ã Preview å
¬éã</p>
<p>ãã±ããã§æ¥ç¶å
IP ã¢ãã¬ã¹å¶éãå¯è½ã«ãªã£ããå¾æ¥ã VPC Service Controls 㧠IP ã¢ãã¬ã¹ãã¼ã¹ã®å¶éã¯ã§ããããå½æ©è½ã§ã¯ãã±ããåä½ã§ã®å¶å¾¡ãå¯è½ã«ãªããã¾ããæ¥ç¶å
VPC ãå¶éã§ããã</p>
<p>ãã ããæ±äº¬ã»å¤§éªãªã¼ã¸ã§ã³æªå¯¾å¿ãªã®ã§æ³¨æã</p>
<h1 id="BigQuery-ã®-Search-index-ã§æ°å¤åã«å¯¾ããæé©åã-Preview--GA">BigQuery ã® Search index ã§æ°å¤åã«å¯¾ããæé©åã Preview â GA</h1>
<p><a href="https://cloud.google.com/bigquery/docs/search?hl=en#numeric-predicates-seo">Optimize with numeric predicates</a> (2024-11-19)</p>
<p>BigQuery ã® Search index 㧠INT64 㨠TIMESTAMP åã«å¯¾ããè¿°èªï¼=ãINï¼ã§ã®æé©åã Preview â GAã</p>
<p>Search index ã¯ãã¼ãã«ã®ç¹å®åã«ã¤ã³ããã¯ã¹ãä½æãã¦ããã° WHERE å¥ã§ã®çµãè¾¼ã¿ï¼æ¤ç´¢ï¼ãé«éåããä»çµã¿ãã¤ã³ããã¯ã¹ã¯èªåæ´æ°ã</p>
<h1 id="Cloud-SQL-Enterprise-Plus-edition-ã§-write-endpoint-ã-Preview-å
¬é">Cloud SQL Enterprise Plus edition 㧠write endpoint ã Preview å
Ž</h1>
<p><a href="https://cloud.google.com/bigquery/docs/search?hl=en#numeric-predicates-seo">Optimize with numeric predicates</a> (2024-11-19)</p>
<p>Cloud SQLï¼for PostgreSQLãMySQLï¼Enterprise Plus edition 㧠write endpoint ã Previewã</p>
<p>æ¸ãè¾¼ã¿ã¨ã³ããã¤ã³ãï¼write endpointï¼ã¨ã¯ã常ã«ãã©ã¤ããªã¤ã³ã¹ã¿ã³ã¹ã®ãã©ã¤ãã¼ã IP ã¢ãã¬ã¹ãæãã¨ã³ããã¤ã³ãã®ãã¨ã§ãDNS åãæã¤ã</p>
<p>æ¸ãè¾¼ã¿ã¨ã³ããã¤ã³ãã使ã£ã¦æ¥ç¶ãããã¨ã§ãå¥ãªã¼ã¸ã§ã³ã«æ§æãããªã¼ãã¬ããªã«ããã©ã¤ããªã¤ã³ã¹ã¿ã³ã¹ã¨ãã¦ææ ¼ããéããã¢ããªã±ã¼ã·ã§ã³å´ã§åãå
IP ã¢ãã¬ã¹ãå¤æ´ããå¿
è¦ããªãã</p>
<p>Cloud SQL Auth Proxy ããã¯æ¸ãè¾¼ã¿ã¨ã³ããã¤ã³ãã使ããªããã¨ã«æ³¨æã</p>
<h1 id="Cloud-SQL-Studio-ã§-IAM-ãã¼ã¿ãã¼ã¹èªè¨¼ã使ããããã«">Cloud SQL Studio 㧠IAM ãã¼ã¿ãã¼ã¹èªè¨¼ã使ããããã«</h1>
<p><a href="https://cloud.google.com/sql/docs/mysql/iam-authentication#iam-db-auth">IAM database authentication</a> (2024-11-20)</p>
<p>Cloud SQL Studio 㧠IAM ãã¼ã¿ãã¼ã¹èªè¨¼ã使ããããã«ãCloud SQL Studio ã¨ã¯ãGoogle Cloud ã³ã³ã½ã¼ã«ãããã¼ã¿ãã¼ã¹ã«ã¯ã¨ãªããã管çã§ãã UIãããã¾ã§ã¯ã¦ã¼ã¶ã¼ã»ãã¹ã¯ã¼ããå
¥åãã¦èªè¨¼ããå¿
è¦ããã£ãã</p>
<h1 id="Cloud-SQL-for-PostgreSQL-ã®ããã¯ã¢ãããã-AlloyDB-ã¯ã©ã¹ã¿ãèµ·åã§ããããã«">Cloud SQL for PostgreSQL ã®ããã¯ã¢ãããã AlloyDB ã¯ã©ã¹ã¿ãèµ·åã§ããããã«</h1>
<p><a href="https://cloud.google.com/sql/docs/postgres/backup-recovery/migrate-cloud-sql-to-alloydb?hl=en">Migrate from Cloud SQL for PostgreSQL to AlloyDB for PostgreSQL </a> (2024-11-21)</p>
<p>Cloud SQL for PostgreSQL ã®ããã¯ã¢ãããã AlloyDB ã¯ã©ã¹ã¿ãèµ·åã§ããããã«ãªã£ãï¼Previewï¼ã</p>
<p>Cloud SQL ãã AlloyDB ã¸ã®ç§»è¡ã容æã«å®ç¾ã§ããããã«ãªã£ãã</p>
<h1 id="2025å¹´1æ25æ¥ãã-Cloud-Run-é¢é£ãã¼ã«ã«ä»æ§å¤æ´ãã">2025å¹´1æ25æ¥ãã Cloud Run é¢é£ãã¼ã«ã«ä»æ§å¤æ´ãã</h1>
<p><a href="https://blog.g-gen.co.jp/entry/user-does-not-have-access-to-image">[Action Required] Ensure read access on container images deployed to Cloud Run - G-gen Tech Blog</a> (2024-11-25)</p>
<p>2025å¹´1æ25æ¥ãããCloud Runã®ãããã¤ãè¡ããã¨ãã§ããäºåå®ç¾©ãã¼ã«ï¼Cloud Run 管çè
/ ãããããã¼ï¼ã®ä»æ§ã«å¤æ´ã</p>
<p>æ¾ç½®ãã㨠CI/CD ãã¤ãã©ã¤ã³ã«å½±é¿ãããå¯è½æ§ããããããè¦ç¢ºèªã詳細ã¯ä»¥ä¸ã®è¨äºãåç
§ã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fuser-does-not-have-access-to-image" title=" [Action Required] Ensure read access on container images deployed to Cloud Run - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/user-does-not-have-access-to-image">blog.g-gen.co.jp</a></cite></p>
<h1 id="Google-Chat-ã«é³å£°ãã¼ãã£ã³ã°-huddles-ãå°å
¥">Google Chat ã«é³å£°ãã¼ãã£ã³ã° huddles ãå°å
¥</h1>
<p><a href="https://workspaceupdates.googleblog.com/2024/09/huddles-in-google-chat.html">Introducing huddles: instant-on, audio-first meetings in Google Chat</a> (2024-11-27)</p>
<p>Google Chat ã«é³å£°ãã¼ãã£ã³ã° huddles ãå°å
¥ãChat ããã·ã¼ã ã¬ã¹ã«é³å£°ã»åç»é話ãã¹ã¿ã¼ãã§ãããããã¯ã¨ã³ã㯠Google Meetã2024-11-27ããé 次ãã¼ã«ã¢ã¦ããããã</p>
<p>ã»ã¨ãã©ã®ã¨ãã£ã·ã§ã³ã§å©ç¨å¯è½ã</p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura
IAM Deny policiesï¼æå¦ããªã·ã¼ï¼ã使ã£ãäºé²ççµ±å¶
hatenablog://entry/6802418398301609944
2024-11-28T09:00:00+09:00
2024-11-28T09:00:02+09:00 G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ IAM Deny policiesï¼æå¦ããªã·ã¼ï¼ã使ã£ãäºé²ççµ±å¶ã«ã¤ãã¦è§£èª¬ãã¾ãã ã¯ããã« å½è¨äºã«ã¤ã㦠äºé²ççµ±å¶ æå¦ããªã·ã¼ æå¦ããªã·ã¼ã®ä½¿ãæ æå¦ããªã·ã¼ã¨çµç¹ã®ããªã·ã¼ã®éã æ¤è¨¼ã®æ¦è¦ ç®ç åæ ç°å¢ å¿
è¦ãª IAM ãã¼ã« æå¦ããªã·ã¼ã§ãµãã¼ãããã権é ç°å¢æ§ç¯ ã½ã¼ã¹ã³ã¼ã å®è¡çµæ åä½ç¢ºèª æå¦ããªã·ã¼è¨å®å æå¦ããªã·ã¼è¨å®å¾ é¢é£è¨äº ã¯ããã« å½è¨äºã«ã¤ã㦠å½è¨äºã§ã¯ãIAM Deny policiesï¼ä»¥ä¸ãæå¦ããªã·ã¼ï¼ã§ç¹å®ã®æä½ãå¶éããGoogle Cloud ç°å¢ã«äºé²ççµ±å¶ãå¹ãããæ¹æ³ã解説ãã¾â¦
<p>G-gen ã®æ¦äºã§ããå½è¨äºã§ã¯ IAM Deny policiesï¼æå¦ããªã·ã¼ï¼ã使ã£ãäºé²ççµ±å¶ã«ã¤ãã¦è§£èª¬ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#å½è¨äºã«ã¤ãã¦">å½è¨äºã«ã¤ãã¦</a></li>
<li><a href="#äºé²ççµ±å¶">äºé²ççµ±å¶</a></li>
<li><a href="#æå¦ããªã·ã¼">æå¦ããªã·ã¼</a></li>
<li><a href="#æå¦ããªã·ã¼ã®ä½¿ãæ">æå¦ããªã·ã¼ã®ä½¿ãæ</a></li>
<li><a href="#æå¦ããªã·ã¼ã¨çµç¹ã®ããªã·ã¼ã®éã">æå¦ããªã·ã¼ã¨çµç¹ã®ããªã·ã¼ã®éã</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</a><ul>
<li><a href="#ç®ç">ç®ç</a></li>
<li><a href="#åæ">åæ</a></li>
<li><a href="#ç°å¢">ç°å¢</a></li>
<li><a href="#å¿
è¦ãª-IAM-ãã¼ã«">å¿
è¦ãª IAM ãã¼ã«</a></li>
<li><a href="#æå¦ããªã·ã¼ã§ãµãã¼ãããã権é">æå¦ããªã·ã¼ã§ãµãã¼ãããã権é</a></li>
</ul>
</li>
<li><a href="#ç°å¢æ§ç¯">ç°å¢æ§ç¯</a><ul>
<li><a href="#ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</a></li>
<li><a href="#å®è¡çµæ">å®è¡çµæ</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#æå¦ããªã·ã¼è¨å®å">æå¦ããªã·ã¼è¨å®å</a></li>
<li><a href="#æå¦ããªã·ã¼è¨å®å¾">æå¦ããªã·ã¼è¨å®å¾</a></li>
</ul>
</li>
<li><a href="#é¢é£è¨äº">é¢é£è¨äº</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090009.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="å½è¨äºã«ã¤ãã¦">å½è¨äºã«ã¤ãã¦</h2>
<p>å½è¨äºã§ã¯ã<strong>IAM Deny policies</strong>ï¼ä»¥ä¸ãæå¦ããªã·ã¼ï¼ã§ç¹å®ã®æä½ãå¶éããGoogle Cloud ç°å¢ã«äºé²ççµ±å¶ãå¹ãããæ¹æ³ã解説ãã¾ãã</p>
<h2 id="äºé²ççµ±å¶">äºé²ççµ±å¶</h2>
<p>äºé²ççµ±å¶ã¨ã¯ã<strong>ãªã¹ã¯</strong>ï¼æå³ããªãæä½ãä¸æ£ãªæä½ï¼<strong>ãæªç¶ã«é²ãããã®çµ±å¶</strong>ãæå³ãã¾ãã</p>
<p>以ä¸ã¯ Google Cloud ã«ãããäºé²ççµ±å¶ã®ä¸ä¾ã§ãã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> 使ç¨ãããããã¯ã </th>
<th style="text-align:left;"> å¹æ </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> æå¦ããªã·ã¼<br>(Cloud IAM) </td>
<td style="text-align:left;"> ãªã½ã¼ã¹ã«å¯¾ããç¹å®ã®æä½ã <strong>IAM ãã¼ããã·ã§ã³</strong> (権é) ã«åºã¥ãå¶éãã </td>
</tr>
<tr>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼<br>(Resource Manager) </td>
<td style="text-align:left;"> ãªã½ã¼ã¹ã«å¯¾ããç¹å®ã®æä½ã<strong>å¶ç´</strong> (å®ç¾©æ¸ã¿ã®ã¢ã¯ã·ã§ã³) ã«åºã¥ãå¶éãã </td>
</tr>
<tr>
<td style="text-align:left;"> VPC Service Controls </td>
<td style="text-align:left;"> API ã¸ã®ã¢ã¯ã»ã¹ãã³ã³ããã¹ããã¼ã¹ã®ã«ã¼ã«ã«åºã¥ãå¶éãã </td>
</tr>
</tbody>
</table>
<h2 id="æå¦ããªã·ã¼">æå¦ããªã·ã¼</h2>
<p>æå¦ããªã·ã¼ã¯ã<strong>é常㮠IAM Policy ãããå¼·ãå¼·å¶å㧠Google Cloud ãªã½ã¼ã¹ã¸ã®æä½ãå¶é</strong>ãã¾ãã</p>
<p>IAM ããªã·ã¼ã®è©ä¾¡ããã¼ã§ã¯ãæå¦ããªã·ã¼ï¼æ示ç㪠Denyï¼ãé常㮠IAM Policyï¼æ示ç㪠Allowï¼ããå
ã«è©ä¾¡ãããåªå
çã«é©ç¨ããã¾ãã</p>
<p>ãã®ãããæå¦ããªã·ã¼ãè¨å®ããã¦ããå ´åãIAM Policy ãä¸åãå¼·å¶åã§å½è©²æä½ãæå¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="IAM ã«ãããããªã·ã¼ã®è©ä¾¡ããã¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090012.png" width="575" height="510" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>IAM ã«ãããããªã·ã¼ã®è©ä¾¡ããã¼</figcaption></figure></p>
<p>æå¦ããªã·ã¼ã®è©³ç´°ã¯ä»¥ä¸ã®è¨äºã§è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fiam-deny-policy-explained" title="Google Cloudã®IAMã«ãããDenyããªã·ã¼ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/iam-deny-policy-explained">blog.g-gen.co.jp</a></cite></p>
<h2 id="æå¦ããªã·ã¼ã®ä½¿ãæ">æå¦ããªã·ã¼ã®ä½¿ãæ</h2>
<p>ããªã·ã¼ã®è©ä¾¡é ã¯åè¿°ã®éããæå¦ããªã·ã¼ï¼æ示ç㪠Denyï¼ãæãå¼·ãå¼·å¶åãæã¡ã¾ãã</p>
<p>ãã®ãããIAM ã«ãã権éè¨è¨ã§ã¯ãã¾ãã¯æå¦ããªã·ã¼ã使ããã« IAM Policyï¼æ示ç㪠Allowï¼ã§ç®¡çãããã¨ãååã¨ãã <strong><code>ã©ããã¦ãå¼·ã権éã§æå¦ãããï¼æ¨©éã«ãã¿ããããï¼å ´åã«æå¦ããªã·ã¼ã使ã</code></strong> ã¨ããæ¹éãæã¾ããã¨è¨ãã¾ãã</p>
<p>æå¦ããªã·ã¼ã¯çµ±å¶ã®åº¦åãã¨ãã¦ã¯å¼·åãªãããå®æã«ä½¿ã£ã¦ãã¾ãã¨å¾ããä¿®æ£ãé£ãããªãå ´åãããã®ã§ã注æãã ããã</p>
<h2 id="æå¦ããªã·ã¼ã¨çµç¹ã®ããªã·ã¼ã®éã">æå¦ããªã·ã¼ã¨çµç¹ã®ããªã·ã¼ã®éã</h2>
<p>Google Cloud ã®äºé²ççµ±å¶ã«ã¯ãæå¦ããªã·ã¼ã«ä¼¼ãä»çµã¿ã¨ãã¦<strong>çµç¹ã®ããªã·ã¼</strong>ï¼Resource Manager ã®1æ©è½ï¼ãããã¾ãã</p>
<p>åè
㯠<code>IAM ãã¼ããã·ã§ã³ï¼æ¨©éï¼</code> ãå¾è
㯠<code>å¶ç´</code> ã¨å¼ã°ããå®ç¾©æ¸ã¿ã®ã¢ã¯ã·ã§ã³ã«ãã¨ã¥ãã¦æä½ãå¶éããã¨ããç¹ã«éããããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/roles-overview?hl=ja#:~:text=%E3%81%94%E8%A6%A7%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82-,%E6%A8%A9%E9%99%90,-%3A%20%E3%83%AD%E3%83%BC%E3%83%AB%E3%81%AB%E5%90%AB">ãã¼ã«ã®ã³ã³ãã¼ãã³ã (権é)</a></li>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints?hl=ja">çµç¹ã®ããªã·ã¼ã®å¶ç´</a></li>
</ul>
<h1 id="æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</h1>
<h2 id="ç®ç">ç®ç</h2>
<p>以ä¸ã®è¦ä»¶ã«ãã¨ã¥ããçµç¹ãªã½ã¼ã¹ã«å¯¾ãã¦æå¦ããªã·ã¼ãé©ç¨ããå®éã®åä½ã確èªãã¾ãã</p>
<p><code>çµç¹ã®ããªã·ã¼ï¼å¶ç´ï¼ã®ä½æã»åé¤ã»æ´æ°</code> ã«ã¤ãã¦ã¯ãã¹ã¦ã®ããªã³ã·ãã«ã§ç¦æ¢ã«ãã¤ã¤ãTerraform ã使ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãããªãã³ã«ç®¡çè
ã°ã«ã¼ãã ãã¯ä¾å¤ï¼æä½å¯è½ï¼ã¨ãã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> # </th>
<th style="text-align:left;"> æå¦ãããæä½ </th>
<th style="text-align:left;"> æå¦å¯¾è±¡ã®ããªã³ã·ãã« </th>
<th style="text-align:left;"> ä¾å¤ã®ããªã³ã·ãã« </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> 1 </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ã®ä½æ </td>
<td style="text-align:left;"> ãã¹ã¦ </td>
<td style="text-align:left;"> ã»Terraform ç¨ ãµã¼ãã¹ã¢ã«ã¦ã³ã<br>ã»ç®¡çè
ã°ã«ã¼ã </td>
</tr>
<tr>
<td style="text-align:left;"> 2 </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ã®åé¤ </td>
<td style="text-align:left;"> ãã¹ã¦ </td>
<td style="text-align:left;"> ã»Terraform ç¨ ãµã¼ãã¹ã¢ã«ã¦ã³ã<br>ã»ç®¡çè
ã°ã«ã¼ã </td>
</tr>
<tr>
<td style="text-align:left;"> 3 </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ã®æ´æ° </td>
<td style="text-align:left;"> ãã¹ã¦ </td>
<td style="text-align:left;"> ã»Terraform ç¨ ãµã¼ãã¹ã¢ã«ã¦ã³ã<br>ã»ç®¡çè
ã°ã«ã¼ã </td>
</tr>
</tbody>
</table>
<h2 id="åæ">åæ</h2>
<p>ãã¢ãå®æ½ããã«ãããã以ä¸ã® IAM Policy ãè¨å®ãã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> # </th>
<th style="text-align:left;"> ããªã³ã·ãã« </th>
<th style="text-align:left;"> ä»ä¸ãã IAM ãã¼ã« </th>
<th style="text-align:left;"> ä»ä¸ãããªã½ã¼ã¹ (å ´æ) </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> 1 </td>
<td style="text-align:left;"> Terraform ç¨ ãµã¼ãã¹ã¢ã«ã¦ã³ã </td>
<td style="text-align:left;"> ã»ãªã¼ãã¼<br>ã»çµç¹ç®¡çè
<br>ã»çµç¹ããªã·ã¼ç®¡çè
<br>ã»æå¦ç®¡çè
</td>
<td style="text-align:left;"> çµç¹ãªã½ã¼ã¹ </td>
</tr>
<tr>
<td style="text-align:left;"> 2 </td>
<td style="text-align:left;"> 管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> ã»ãªã¼ãã¼<br>ã»çµç¹ç®¡çè
<br>ã»çµç¹ããªã·ã¼ç®¡çè
<br>ã»æå¦ç®¡çè
</td>
<td style="text-align:left;"> çµç¹ãªã½ã¼ã¹ </td>
</tr>
<tr>
<td style="text-align:left;"> 3 </td>
<td style="text-align:left;"> é管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> ã»çµç¹ããªã·ã¼ç®¡çè
</td>
<td style="text-align:left;"> çµç¹ãªã½ã¼ã¹ </td>
</tr>
</tbody>
</table>
<h2 id="ç°å¢">ç°å¢</h2>
<p>æå¦ããªã·ã¼ã®è¨å®ã¯ Terraform ã§è¡ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090015.png" width="800" height="553" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ã¾ããæå¦ããªã·ã¼è¨å®å¾ã¯ä»¥ä¸ã®æ¡ä»¶ã§åä½ç¢ºèªãè¡ãã¾ãã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> # </th>
<th style="text-align:left;"> ããªã³ã·ãã« </th>
<th style="text-align:left;"> æä½ </th>
<th style="text-align:left;"> æå¾
ããåä½ </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> 1 </td>
<td style="text-align:left;"> 管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ãä½æ </td>
<td style="text-align:left;"> æå </td>
</tr>
<tr>
<td style="text-align:left;"> 2 </td>
<td style="text-align:left;"> é管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ãåé¤ </td>
<td style="text-align:left;"> 失æ </td>
</tr>
</tbody>
</table>
<h2 id="å¿
è¦ãª-IAM-ãã¼ã«">å¿
è¦ãª IAM ãã¼ã«</h2>
<p>æå¦ããªã·ã¼ã管çããå ´åãçµç¹ã¬ãã«ã§ <code>æå¦ç®¡çè
ãã¼ã«ï¼roles/iam.denyAdminï¼</code> ãå¿
è¦ã§ãã</p>
<p>ä»åã®ãã¢ã§ã¯ Terraform ã使ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã«å¯¾ããçµç¹ã¬ãã«ã§ä¸è¨ãã¼ã«ãä»ä¸ãã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/deny-access?hl=ja#required-roles">å¿
è¦ãªãã¼ã«</a></li>
</ul>
<h2 id="æå¦ããªã·ã¼ã§ãµãã¼ãããã権é">æå¦ããªã·ã¼ã§ãµãã¼ãããã権é</h2>
<p>æå¦ããªã·ã¼ã§ã¯ä¸é¨ã®æ¨©éãæå®ãããã¨ã¯ã§ãã¾ããã</p>
<p>æå¦ããªã·ã¼ã«ã¦ãµãã¼ãããã権éã«ã¤ãã¦ã¯ä»¥ä¸ãã確èªãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/deny-permissions-support">Permissions supported in deny policies</a></li>
</ul>
<h1 id="ç°å¢æ§ç¯">ç°å¢æ§ç¯</h1>
<h2 id="ã½ã¼ã¹ã³ã¼ã">ã½ã¼ã¹ã³ã¼ã</h2>
<p>ä»åã®æ¤è¨¼ã§ã¯ãTerraform ã§ç°å¢æ§ç¯ãå®æ½ãã¾ãã使ç¨ãã Terraform ã®ã½ã¼ã¹ã³ã¼ãã¯ä»¥ä¸ã®ã¨ããã§ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>$ tree
.
âââ env
â âââ organization
â âââ backend.tf
â âââ locals.tf
â âââ main.tf
â âââ versions.tf
âââ modules
âââ preventive_controls
âââ organization_deny_policies
âââ main.tf
âââ outputs.tf
âââ variables.tf
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># main.tf (modules)</span>
<span class="synType">resource</span> <span class="synConstant">"google_iam_deny_policy"</span> <span class="synConstant">"default"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">parent</span> = <span class="synIdentifier">urlencode</span>(<span class="synConstant">"cloudresourcemanager.googleapis.com/organizations/$</span><span class="synSpecial">{</span>var.organization_id<span class="synSpecial">}</span><span class="synConstant">"</span>)
<span class="synIdentifier">name</span> = <span class="synConstant">"dev-ggen-deny-policy-organization"</span>
<span class="synIdentifier">display_name</span> = <span class="synConstant">"Dev G-gen Deny Policy Organization"</span>
<span class="synComment"># https://cloud.google.com/iam/docs/deny-permissions-support</span>
<span class="synComment"># çµç¹ã®ããªã·ã¼ã®ç·¨éç¦æ¢</span>
<span class="synType">rules</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"First rule"</span>
<span class="synType">deny_rule</span> <span class="synSpecial">{</span>
<span class="synIdentifier">denied_principals</span> = <span class="synSpecial">[</span><span class="synConstant">"principalSet://goog/public:all"</span><span class="synSpecial">]</span>
<span class="synIdentifier">denied_permissions</span> = <span class="synSpecial">[</span>
<span class="synConstant">"orgpolicy.googleapis.com/policies.create"</span>,
<span class="synConstant">"orgpolicy.googleapis.com/policies.delete"</span>,
<span class="synConstant">"orgpolicy.googleapis.com/policies.update"</span>,
<span class="synSpecial">]</span>
<span class="synIdentifier">exception_principals</span> = var.permitted_principals
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># variables.tf</span>
<span class="synType">variable</span> <span class="synConstant">"permitted_principals"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"List of principals that are exempt from the deny policy"</span>
<span class="synIdentifier">type</span> = <span class="synType">list</span>(<span class="synType">string</span>)
<span class="synSpecial">}</span>
<span class="synType">variable</span> <span class="synConstant">"organization_id"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"The ID of the organization to create resources in"</span>
<span class="synIdentifier">type</span> = <span class="synType">string</span>
<span class="synSpecial">}</span>
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># main.tf (env)</span>
<span class="synType">module</span> <span class="synConstant">"organization_deny_policies"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">source</span> = <span class="synConstant">"../../modules/preventive_controls/organization_deny_policies"</span>
<span class="synIdentifier">organization_id</span> = local.organization_id
<span class="synIdentifier">permitted_principals</span> = local.permitted_principals
<span class="synSpecial">}</span>
</pre>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synComment"># locals.tf</span>
<span class="synType">locals</span> <span class="synSpecial">{</span>
<span class="synIdentifier">organization_id</span> = <span class="synConstant">"1234567890"</span>
<span class="synComment"># https://cloud.google.com/iam/docs/principal-identifiers#v2</span>
<span class="synIdentifier">permitted_principals</span> = <span class="synSpecial">[</span>
<span class="synConstant">"principal://iam.googleapis.com/projects/-/serviceAccounts/[email protected]"</span>,
<span class="synConstant">"principalSet://goog/group/[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
</pre>
<ul>
<li>åè : <a href="https://registry.terraform.io/providers/hashicorp/google/6.10.0/docs/resources/iam_deny_policy">google_iam_deny_policy</a></li>
<li>åè : <a href="https://cloud.google.com/iam/docs/principal-identifiers#v2">ããªã³ã·ãã«ID (IAM v2 API)</a></li>
</ul>
<h2 id="å®è¡çµæ">å®è¡çµæ</h2>
<p><code>terraform apply</code> ã®å®è¡çµæã¯ä»¥ä¸ã®ã¨ããã§ãã</p>
<pre class="code lang-terraform" data-lang="terraform" data-unlink>Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
<span class="synComment"># module.organization_deny_policies.google_iam_deny_policy.default will be created</span>
+ resource <span class="synConstant">"google_iam_deny_policy"</span> <span class="synConstant">"default"</span> <span class="synSpecial">{</span>
+ <span class="synIdentifier">display_name</span> = <span class="synConstant">"Dev G-gen Deny Policy Organization"</span>
+ <span class="synIdentifier">etag</span> = (known after apply)
+ <span class="synIdentifier">id</span> = (known after apply)
+ <span class="synIdentifier">name</span> = <span class="synConstant">"dev-ggen-deny-policy-organization"</span>
+ <span class="synIdentifier">parent</span> = <span class="synConstant">"cloudresourcemanager.googleapis.com%2Forganizations%2F1234567890"</span>
+ rules <span class="synSpecial">{</span>
+ <span class="synIdentifier">description</span> = <span class="synConstant">"First rule"</span>
+ deny_rule <span class="synSpecial">{</span>
+ <span class="synIdentifier">denied_permissions</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"orgpolicy.googleapis.com/policies.create"</span>,
+ <span class="synConstant">"orgpolicy.googleapis.com/policies.delete"</span>,
+ <span class="synConstant">"orgpolicy.googleapis.com/policies.update"</span>,
<span class="synSpecial">]</span>
+ <span class="synIdentifier">denied_principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"principalSet://goog/public:all"</span>,
<span class="synSpecial">]</span>
+ <span class="synIdentifier">exception_principals</span> = <span class="synSpecial">[</span>
+ <span class="synConstant">"principal://iam.googleapis.com/projects/-/serviceAccounts/[email protected]"</span>,
+ <span class="synConstant">"principalSet://goog/group/[email protected]"</span>,
<span class="synSpecial">]</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
Plan: <span class="synConstant">1</span> to add, <span class="synConstant">0</span> to change, <span class="synConstant">0</span> to destroy.
module.organization_deny_policies.google_iam_deny_policy.default: Creating...
module.organization_deny_policies.google_iam_deny_policy.default: Still creating... <span class="synSpecial">[</span>10s elapsed<span class="synSpecial">]</span>
module.organization_deny_policies.google_iam_deny_policy.default: Creation complete after 11s <span class="synSpecial">[</span>id=cloudresourcemanager.googleapis.com%2Forganizations%2F1234567890/dev-ggen-deny-policy-organization<span class="synSpecial">]</span>
Apply complete! Resources: <span class="synConstant">1</span> added, <span class="synConstant">0</span> changed, <span class="synConstant">0</span> destroyed.
</pre>
<p><figure class="figure-image figure-image-fotolife" title="Cloud ã³ã³ã½ã¼ã«ä¸ã§è¡¨ç¤ºãããæå¦ããªã·ã¼ã®è©³ç´°"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090019.png" width="800" height="287" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Cloud ã³ã³ã½ã¼ã«ä¸ã§è¡¨ç¤ºãããæå¦ããªã·ã¼ã®è©³ç´°</figcaption></figure></p>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="æå¦ããªã·ã¼è¨å®å">æå¦ããªã·ã¼è¨å®å</h2>
<p>両ã°ã«ã¼ãã¨ã IAM Policy ã«ãã£ã¦çµç¹ã®ããªã·ã¼ã®ç·¨éã許å¯ããã¦ãããããå½è©²æä½ãå®è¡ã§ãã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="#1ãçµç¹ã®ããªã·ã¼ãç·¨éï¼ä½æï¼ã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090022.png" width="800" height="382" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>#1ãçµç¹ã®ããªã·ã¼ãç·¨éï¼ä½æï¼ã§ãã</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="#2ãçµç¹ã®ããªã·ã¼ãç·¨éï¼åé¤ï¼ã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090028.png" width="800" height="462" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>#2ãçµç¹ã®ããªã·ã¼ãç·¨éï¼åé¤ï¼ã§ãã</figcaption></figure></p>
<h2 id="æå¦ããªã·ã¼è¨å®å¾">æå¦ããªã·ã¼è¨å®å¾</h2>
<p>é管çè
ã°ã«ã¼ãã«ããã¦ã¯ãæå¦ããªã·ã¼è¨å®åã«ã¯å®è¡ã§ããæä½ããè¨å®å¾ã«ã¯å¶éããã¾ããã</p>
<table>
<thead>
<tr>
<th style="text-align:left;"> # </th>
<th style="text-align:left;"> ããªã³ã·ãã« </th>
<th style="text-align:left;"> æä½ </th>
<th style="text-align:left;"> æå¾
ããåä½ </th>
<th style="text-align:left;"> å®éã®çµæ </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"> 1 </td>
<td style="text-align:left;"> 管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ãä½æ </td>
<td style="text-align:left;"> æå </td>
<td style="text-align:left;"> <strong>æå</strong> </td>
</tr>
<tr>
<td style="text-align:left;"> 2 </td>
<td style="text-align:left;"> é管çè
ã°ã«ã¼ã </td>
<td style="text-align:left;"> çµç¹ã®ããªã·ã¼ãåé¤ </td>
<td style="text-align:left;"> 失æ </td>
<td style="text-align:left;"> <strong>失æ</strong> </td>
</tr>
</tbody>
</table>
<p><figure class="figure-image figure-image-fotolife" title="#1ãæå¦ããªã·ã¼è¨å®å¾ãçµç¹ã®ããªã·ã¼ãç·¨éï¼ä½æï¼ã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090022.png" width="800" height="382" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>#1ãæå¦ããªã·ã¼è¨å®å¾ãçµç¹ã®ããªã·ã¼ãç·¨éï¼ä½æï¼ã§ãã</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="#2ãæå¦ããªã·ã¼ã«ãã£ã¦çµç¹ã®ããªã·ã¼ã®ç·¨éï¼åé¤ï¼ãå¶éããã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241128/20241128090025.png" width="800" height="429" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>#2ãæå¦ããªã·ã¼ã«ãã£ã¦çµç¹ã®ããªã·ã¼ã®ç·¨éï¼åé¤ï¼ãå¶éããã</figcaption></figure></p>
<h1 id="é¢é£è¨äº">é¢é£è¨äº</h1>
<p>ä»åãç´¹ä»ããä»ã«ããG-gen Tech Blog ã§ã¯äºé²ççµ±å¶ã«é¢ããè¨äºãå¤æ°å
¬éãã¦ãã¾ãããããããããã¦ã確èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Frestrict-access-to-google-cloud-console-and-apis-by-acm" title="Access Context Managerã§Google Cloudã³ã³ã½ã¼ã«ã¨APIã¸ã®ã¢ã¯ã»ã¹ãå¶éãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/restrict-access-to-google-cloud-console-and-apis-by-acm">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Forganization-policy-explained" title="çµç¹ã®ããªã·ã¼ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/organization-policy-explained">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fvpc-service-controls-explained" title="VPC Service Controlsãåããããã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/vpc-service-controls-explained">blog.g-gen.co.jp</a></cite></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-yutakei/20220512/20220512214329.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">æ¦äº ç¥ä» <a href="https://blog.g-gen.co.jp/archive/author/ggen-yutakei">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨æå±ãG-genå¯ä¸ã®å±±æ¢¨çå¨ä½ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">Google Cloud Partner Top Engineer 2025 é¸åºãIaC ã CI/CD å¨ãã®ãµã¼ãã¹ããããã¯ããèå³åéã§ãã</p>
<p class="sw-profile__txt">趣å³ã¯ãã¼ããã¤ã¯ããã¼ãã¬ã¼ã¹ããµãã«ã¼è¦³æ¦ã§ãã</p>
<!-- 以ä¸ã®è¡ã追å -->
<a href="https://twitter.com/ggenyutakei?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @ggenyutakei</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-yutakei
[Action Required] Ensure read access on container images deployed to Cloud Run
hatenablog://entry/6802418398306747003
2024-11-26T08:30:00+09:00
2025-01-14T08:57:36+09:00 2024å¹´11æ25æ¥ãGoogle Cloud ãã管çè
å®ã¦ã«ã[Action Required] Ensure read access on container images deployed to Cloud Runãã¨ããã¿ã¤ãã«ã®ã¡ã¼ã«éç¥ãããã¾ãããå½è¨äºã§ã¯ãéç¥ã®å
容ã¨ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³ãå½±é¿ç¯å²ã®ç¢ºèªæ¹æ³ãªã©ã解説ãã¾ãã éç¥ã®å
容 å¤æ´ã®é©ç¨åï¼2025å¹´1æ15æ¥ä»¥åï¼ å¤æ´ã®é©ç¨å¾ï¼2025å¹´1æ15æ¥ä»¥éï¼ ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³ æ³å®ãããå½±é¿ç¯å² å½±é¿ç¯å²ã®ç¢ºèªæ¹æ³ éç¥ã¡ã¼ã« Cloud Asset Inventory Cloud Loggâ¦
<p>2024å¹´11æ25æ¥ãGoogle Cloud ãã管çè
å®ã¦ã«ã<strong>[Action Required] Ensure read access on container images deployed to Cloud Run</strong>ãã¨ããã¿ã¤ãã«ã®ã¡ã¼ã«éç¥ãããã¾ãããå½è¨äºã§ã¯ãéç¥ã®å
容ã¨ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³ãå½±é¿ç¯å²ã®ç¢ºèªæ¹æ³ãªã©ã解説ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#éç¥ã®å
容">éç¥ã®å
容</a><ul>
<li><a href="#å¤æ´ã®é©ç¨å2025å¹´1æ15æ¥ä»¥å">å¤æ´ã®é©ç¨åï¼2025å¹´1æ15æ¥ä»¥åï¼</a></li>
<li><a href="#å¤æ´ã®é©ç¨å¾2025å¹´1æ15æ¥ä»¥é">å¤æ´ã®é©ç¨å¾ï¼2025å¹´1æ15æ¥ä»¥éï¼</a></li>
</ul>
</li>
<li><a href="#ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³">ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³</a></li>
<li><a href="#æ³å®ãããå½±é¿ç¯å²">æ³å®ãããå½±é¿ç¯å²</a></li>
<li><a href="#å½±é¿ç¯å²ã®ç¢ºèªæ¹æ³">å½±é¿ç¯å²ã®ç¢ºèªæ¹æ³</a><ul>
<li><a href="#éç¥ã¡ã¼ã«">éç¥ã¡ã¼ã«</a></li>
<li><a href="#Cloud-Asset-Inventory">Cloud Asset Inventory</a></li>
<li><a href="#Cloud-Logging">Cloud Logging</a></li>
</ul>
</li>
<li><a href="#Cloud-Run-functions-ã¸ã®å½±é¿">Cloud Run functions ã¸ã®å½±é¿</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241126/20241126075218.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="éç¥ã®å
容">éç¥ã®å
容</h1>
<p>Cloud Run ã®ãããã¤ã«ä½¿ç¨ãããã¨ãã§ããäºåå®ç¾©ã® IAM ãã¼ã«ã<strong>Cloud Run 管çè
</strong>ï¼<code>roles/run.admin</code>ï¼ãããã³ã<strong>Cloud Run ãããããã¼</strong>ï¼<code>roles/run.developer</code>ï¼ãã«ã¯ã<strong>æé»çã«</strong> Artifact Registory ã®èªã¿åã権éãã¤ãã¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Cloud Run 管çè
ã Cloud Run ãããããã¼ã«ã¯ Artifact Registry ã®èªã¿åã権éããæ示çã«ã¯ãä»ä¸ããã¦ããªã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241126/20241126085546.png" width="721" height="800" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Cloud Run 管çè
ã Cloud Run ãããããã¼ã«ã¯ Artifact Registry ã®èªã¿åã権éããæ示çã«ã¯ãä»ä¸ããã¦ããªã</figcaption></figure></p>
<p><strong>2025å¹´1æ15æ¥ï¼ç±³å½æéï¼ä»¥é</strong>ããã®æé»çãªèªã¿åã権éããªããªãã<strong>Cloud Run 管çè
</strong>ãã¼ã«ã¨<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ã§ã¯ Artifact Registry ã«ããã³ã³ããã¤ã¡ã¼ã¸ã®èªã¿åããã§ããªããªãã¾ãããããã£ã¦ããã®ãã¼ã«ã ãã§ã¯ Cloud Run ã®ä½æãæ´æ°ãã§ããªããªãã¾ãã</p>
<p>ä»å¾ãCloud Run ã®ä½æãæ´æ°ãè¡ãããªã³ã·ãã«ï¼ã¦ã¼ã¶ã¼ããµã¼ãã¹ã¢ã«ã¦ã³ãï¼ã¯ãã³ã³ããã¤ã¡ã¼ã¸ã«å¯¾ããæ示çãªèªã¿åã権éãå¿
è¦ã¨ãªãã¾ããå
·ä½çã«ã¯ãã³ã³ããã¤ã¡ã¼ã¸ãåå¨ãã Artifact Registry ãªãã¸ããªããããã¯ããã¸ã§ã¯ãã«å¯¾ãã <strong>Artifact Registry èªã¿åã</strong>ï¼<code>roles/artifactregistry.reader</code>ï¼ãã¼ã«ãå¿
è¦ã¨ãªãã¾ãã</p>
<p>以ä¸ã«ãå¤æ´ã®é©ç¨åã»é©ç¨å¾ã®ç¶æ³ãè¦ç´ãã¾ãã</p>
<h2 id="å¤æ´ã®é©ç¨å2025å¹´1æ15æ¥ä»¥å">å¤æ´ã®é©ç¨åï¼2025å¹´1æ15æ¥ä»¥åï¼</h2>
<ul>
<li>æé»çãªæ¨©éã«ããã<strong>Cloud Run 管çè
</strong>ã¾ãã¯<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ãç´ã¥ããããããªã³ã·ãã«ã¯ Artifact Registry ã«ããã³ã³ããã¤ã¡ã¼ã¸ãèªã¿åããã¨ãã§ããã</li>
</ul>
<h2 id="å¤æ´ã®é©ç¨å¾2025å¹´1æ15æ¥ä»¥é">å¤æ´ã®é©ç¨å¾ï¼2025å¹´1æ15æ¥ä»¥éï¼</h2>
<ul>
<li><strong>Cloud Run 管çè
</strong>ãã¼ã«ããã³<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ã§ã¯ Artifact Registry ã«ããã³ã³ããã¤ã¡ã¼ã¸ãèªã¿åããã¨ã¯ã§ããªãããã®ãã Cloud Run ã®ä½æãæ´æ°æä½ãã§ããªãã</li>
<li>ä»ã¾ã§ Cloud Run ã®ãããã¤ã« <strong>Cloud Run 管çè
</strong>ã¾ã㯠<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ã使ç¨ãã¦ããããªã³ã·ãã«ã«ã¯ã<strong>Artifact Registry èªã¿åã</strong>ãã¼ã«ãç´ã¥ããå¿
è¦ãããã</li>
<li><strong>ãªã¼ãã¼</strong>ï¼<code>roles/owner</code>ï¼ãã¼ã«ãã¾ãã¯<strong>ç·¨éè
</strong>ï¼<code>roles/editor</code>ï¼ãã¼ã«ãç´ã¥ãã¦ããããªã³ã·ãã«ã«ã¤ãã¦ã¯ããã®å¤æ´ã«ããå½±é¿ã¯ãªãã</li>
</ul>
<h1 id="ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³">ã¦ã¼ã¶ã¼å´ã§å¿
è¦ãªã¢ã¯ã·ã§ã³</h1>
<p><strong>2025å¹´1æ15æ¥</strong>ã¾ã§ã«ã<strong>Cloud Run 管çè
</strong>ã¾ãã¯<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ãç´ã¥ããããããªã³ã·ãã«ãæ´ãåºããå¿
è¦ã«å¿ã㦠<strong>Artifact Registry èªã¿åã</strong>ãã¼ã«ãä»ä¸ããå¿
è¦ãããã¾ãã</p>
<h1 id="æ³å®ãããå½±é¿ç¯å²">æ³å®ãããå½±é¿ç¯å²</h1>
<p>Cloud Build ã GitHub Actions çã® CI/CD ãã¤ãã©ã¤ã³ãã Cloud Run ã®ãããã¤ãè¡ã£ã¦ãããããªã±ã¼ã¹ã§ã¯ããã¤ãã©ã¤ã³ã使ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã« <strong>Cloud Run 管çè
</strong>ãããã¯<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ãä»ä¸ããã¦ããå¯è½æ§ãããã¾ãã</p>
<p>ä»åã®å¤æ´ã¸ã®å¯¾å¦ãæ¼ãã¦ãã¾ã£ãå ´åããã¤ãã©ã¤ã³ãåæ¢ãã¦ãã¾ãæãããããããç¾å¨ãµã¼ãã¹ã¢ã«ã¦ã³ãã«ç´ã¥ãããã¦ãããã¼ã«ã確èªãã権éãä¸è¶³ãã¦ããå ´å㯠<strong>Artifact Registry èªã¿åã</strong>ãã¼ã«çãä»ä¸ããå¿
è¦ãããã¾ãã</p>
<h1 id="å½±é¿ç¯å²ã®ç¢ºèªæ¹æ³">å½±é¿ç¯å²ã®ç¢ºèªæ¹æ³</h1>
<h2 id="éç¥ã¡ã¼ã«">éç¥ã¡ã¼ã«</h2>
<p>å¤æ´ã®å½±é¿ãåããå¯è½æ§ãããçµç¹ãããã¸ã§ã¯ãã®ãªã¼ãã¼ããã¨ãã»ã³ã·ã£ã«ã³ã³ã¿ã¯ãã«ç»é²ãããé£çµ¡å
ã«ã¯ã2024å¹´11æ25æ¥ã« Google Cloud ãã <code>[Action Required] Ensure read access on container images deployed to Cloud Run</code> ã¨ããã¿ã¤ãã«ã®ã¡ã¼ã«ãé
ä¿¡ããã¦ãã¾ãã</p>
<p>å¤æ´ã®å½±é¿ãããããã¸ã§ã¯ãã¯ãåã¡ã¼ã«æä¸é¨ã®ã<strong>Your affected projects are listed below:</strong>ã以ä¸ã«è¨è¼ããã¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="å¤æ´ã®å½±é¿ãããããã¸ã§ã¯ãã¯ã¡ã¼ã«ã«è¨è¼ããã¦ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241126/20241126083005.png" width="800" height="640" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å¤æ´ã®å½±é¿ãããããã¸ã§ã¯ãã¯ã¡ã¼ã«ã«è¨è¼ããã¦ãã</figcaption></figure></p>
<p>ã¨ãã»ã³ã·ã£ã«ã³ã³ã¿ã¯ãã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/google-cloud-organization-explained#%E3%82%A8%E3%83%83%E3%82%BB%E3%83%B3%E3%82%B7%E3%83%A3%E3%83%AB%E3%82%B3%E3%83%B3%E3%82%BF%E3%82%AF%E3%83%88">Google Cloudã®çµç¹(Organization)ãå¾¹åºè§£èª¬ - ã¨ãã»ã³ã·ã£ã«ã³ã³ã¿ã¯ã</a></li>
</ul>
<h2 id="Cloud-Asset-Inventory">Cloud Asset Inventory</h2>
<p>ã¾ããCloud Asset Inventory ã使ç¨ãããã¨ã§ãç¹å®ã®ãã¼ã«ãç´ã¥ããããªã³ã·ãã«ã®ä¸è¦§ã確èªã§ãã¾ãã</p>
<p>Google Cloud ã³ã³ã½ã¼ã«ãã確èªããå ´åããã¨ãã°<strong>Cloud Run ãããããã¼</strong>ãã¼ã«ã§ããã°ãCloud Asset Inventory ã®ç»é¢ã® <strong>IAM ããªã·ã¼</strong>ã¿ãã«ã¦ <code>roles: run.developer</code> ã§ãã£ã«ã¿ãªã³ã°ãã¾ããããã¸ã§ã¯ãã«å¯¾ãã¦ãã¼ã«ãç´ã¥ãããã¦ããããªã³ã·ãã«ã¨ãç¹å®ã® Cloud Run ãªã½ã¼ã¹ã«ãã¼ã«ãç´ã¥ãããã¦ããããªã³ã·ãã«ã®ä¸¡æ¹ãæ¤ç´¢ãããã¨ãã§ãã¾ãã</p>
<p><strong>Cloud Run 管çè
</strong>ãã¼ã«ã«ã¤ãã¦ã¯ <code>roles: run.admin</code> ã§ãã£ã«ã¿ãªã³ã°ãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Asset Inventory ã使ç¨ãã¦ã対å¦ãå¿
è¦ãªããªã³ã·ãã«ã確èªãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241126/20241126083008.png" width="800" height="223" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Asset Inventory ã使ç¨ãã¦ã対å¦ãå¿
è¦ãªããªã³ã·ãã«ã確èªãã</figcaption></figure></p>
<p>gcloud CLI ã§ã¯ <code>gcloud asset search-all-iam-policies</code> ã³ãã³ãã§ç¢ºèªã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Cloud Run ãããããã¼ãã¼ã«ãä»ä¸ãããããªã³ã·ãã«ã®ä¸è¦§ã表示ãã</span>
$ gcloud asset search-all-iam-policies <span class="synSpecial">--query</span><span class="synStatement">='</span><span class="synConstant">roles:run.developer</span><span class="synStatement">'</span>
</pre>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># åºåä¾</span>
$ gcloud asset search-all-iam-policies <span class="synSpecial">--query</span><span class="synStatement">='</span><span class="synConstant">roles:run.developer</span><span class="synStatement">'</span>
---
assetType: run.googleapis.com/Service <span class="synComment"># ãã¼ã«ãç¹å®ã® Cloud Run ã«ç´ä»ãã¦ããå ´å</span>
folders:
- folders/xxxxxxxxxxxx
- folders/xxxxxxxxxxxx
organization: organizations/xxxxxxxxxxxx
policy:
bindings:
- members:
- serviceAccount:[email protected]
role: roles/run.developer
project: projects/xxxxxxxxxxxx
resource: //run.googleapis.com/projects/myproject/locations/asia-northeast1/services/hello
---
assetType: cloudresourcemanager.googleapis.com/Project <span class="synComment"># ãã¼ã«ãããã¸ã§ã¯ãã«ç´ä»ãã¦ããå ´å</span>
folders:
- folders/xxxxxxxxxxxx
- folders/xxxxxxxxxxxx
organization: organizations/xxxxxxxxxxxx
policy:
bindings:
- members:
- serviceAccount:[email protected]
role: roles/run.developer
project: projects/xxxxxxxxxxxx
resource: //cloudresourcemanager.googleapis.com/projects/myproject
</pre>
<p>Cloud Asset Inventory ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåèã«ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/cloud-asset-inventory-explained">Cloud Asset Inventoryãå¾¹åºè§£èª¬ï¼</a></li>
</ul>
<h2 id="Cloud-Logging">Cloud Logging</h2>
<p>2025å¹´1æ15æ¥ã®å¤æ´ãé©ç¨ãããã¾ã§ã¯ã該å½ã®ãã¼ã«ã使ç¨ã㦠Cloud Run ã®ãããã¤ãå¯è½ã§ãããCloud Logging ã«ä»¥ä¸ã®ã¨ã©ã¼ãã°ãè¨é²ãããããã«ãªã£ã¦ãã¾ãã</p>
<blockquote><p>Cloud Run API check failed. Requests will be rejected after January 2025 hard enforcement deadline. User does not have access to image {Artifact Registry å
ã®ã³ã³ããã¤ã¡ã¼ã¸ã® URL}</p></blockquote>
<p>Cloud Logging ã«ã¦ä»¥ä¸ã®ã¯ã¨ãªãå®è¡ãããã¨ã§ãå½è©²ãã°ãæ¤ç´¢ãããã¨ãã§ãã¾ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink><span class="synSpecial">resource</span>.<span class="synSpecial">type</span> = <span class="synSpecial">"</span><span class="synConstant">cloud_run_revision</span><span class="synSpecial">"</span>
severity=ERROR
<span class="synSpecial">"</span><span class="synConstant">User does not have access to image</span><span class="synSpecial">"</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="å¤æ´ã®é©ç¨åããããã¤ã¯å¯è½ã ããã¨ã©ã¼ãã°ãè¨é²ããã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241126/20241126153136.png" width="800" height="213" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å¤æ´ã®é©ç¨åããããã¤ã¯å¯è½ã ããã¨ã©ã¼ãã°ãè¨é²ããã</figcaption></figure></p>
<p>ãã°ãåºã¦ããå ´åã対å¦ãå¿
è¦ãªããªã³ã·ãã«ã使ç¨ãã¦ãããã¤ãè¡ããã¦ããã®ã§ã<strong>Artifact Registry èªã¿åã</strong>ãã¼ã«çã®ä»ä¸ãè¡ãã¾ãã</p>
<p>ä¸è¨ã®ã¯ã¨ãªã使ç¨ãã¦ãã°ãã¼ã¹ã®ã¢ã©ã¼ããè¨å®ãã¦ãããã¨ã§ã対象ã®ãã°ã®ç¢ºèªæ¼ããé²ããã¨ãã§ãã¾ãã</p>
<p>ãã°ãã¼ã¹ã®ã¢ã©ã¼ãã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåèã«ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/cloud-logging-explained#%E3%83%AD%E3%82%B0%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E3%82%A2%E3%83%A9%E3%83%BC%E3%83%88">Cloud Loggingã®æ¦å¿µã¨ä»çµã¿ããã£ãã解説 - ãã°ãã¼ã¹ã®ã¢ã©ã¼ã</a></li>
</ul>
<h1 id="Cloud-Run-functions-ã¸ã®å½±é¿">Cloud Run functions ã¸ã®å½±é¿</h1>
<p>Cloud Run functionsï¼ç¬¬2ä¸ä»£ï¼ã¯ãå®è¡åºç¤ã¨ã㦠Cloud Run ããã¼ã¹ã«ãªã£ã¦ãã¾ããCloud Run functions ã«ãä»åã®å¤æ´ã¯å½±é¿ãããã®ã§ããããã</p>
<p>ä»åã®å¤æ´ã«ã¤ãã¦ãCloud Run functions ã¸ã®å½±é¿ã¯ããã¾ãããCloud Run functions ã®ãããã¤æã¯ããµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¨å¼ã°ããç¹æ®ãªãµã¼ãã¹ã¢ã«ã¦ã³ããããã«ãã Artifact Registry ããã®ã¤ã¡ã¼ã¸åå¾ãè¡ãã¾ãããããã®ã¢ã«ã¦ã³ãã«ããã©ã«ãã§ä»ä¸ããã¦ãããã¼ã«ãå¤æ´ããªããã°ãä»åã®å¤æ´ã§ã¯å½±é¿ããªãããã«ãªã£ã¦ãã¾ãã</p>
<p>Cloud Run functions ã®ãããã¤ã®ä»çµã¿ã«é¢ãã詳細ã¯ã以ä¸ã®ããã¥ã¡ã³ãã«è¨è¼ããã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/functions/docs/concepts/iam?hl=ja#administrative_service_accounts">管çè
ãµã¼ãã¹ ã¢ã«ã¦ã³ã</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
çæAIè©ä¾¡ãã¼ã«ãGen AI evaluation service in Vertex AIããç´¹ä»
hatenablog://entry/6802418398301504709
2024-11-25T09:00:00+09:00
2024-11-25T09:00:02+09:00 G-gen ã®ååã§ããå½è¨äºã§ã¯ãçæ AI ã®åºåãè¿
éãã¤å¹ççã«è©ä¾¡ã§ãã Vertex AI ä¸ã® API ã§ãããGen AI evaluation service ãç´¹ä»ãã¾ãã æ¦è¦ ã¦ã¼ã¹ã±ã¼ã¹ è©ä¾¡ææ¨ã«ã¤ã㦠è©ä¾¡ã¿ã¤ã è¨ç®ãã¼ã¹ ã¢ãã«ãã¼ã¹ æé 使ã£ã¦ã¿ã æ¦è¦ æºå å®è¡ã¨çµæ ãã®ä» ã¯ã©ã¼ã¿ã®å¶éã«ã¤ã㦠è©ä¾¡ãã¼ã¿ã»ããã®ä»¶æ° æ¦è¦ Gen AI evaluation service ã¯ãçæ AI ã¢ããªã±ã¼ã·ã§ã³ã®åºåãå¹ççã«è©ä¾¡ããããã®æ©è½ã§ããVertex AI ã®1æ©è½ã¨ãã¦ãAPI ã§æä¾ããã¾ãããã®æ©è½ã使ãã¨ãäºåå®ç¾©ãããè©ä¾¡ææ¨ãâ¦
<p>G-gen ã®ååã§ããå½è¨äºã§ã¯ãçæ AI ã®åºåãè¿
éãã¤å¹ççã«è©ä¾¡ã§ãã Vertex AI ä¸ã® API ã§ããã<strong>Gen AI evaluation service</strong> ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#æ¦è¦">æ¦è¦</a></li>
<li><a href="#ã¦ã¼ã¹ã±ã¼ã¹">ã¦ã¼ã¹ã±ã¼ã¹</a></li>
<li><a href="#è©ä¾¡ææ¨ã«ã¤ãã¦">è©ä¾¡ææ¨ã«ã¤ãã¦</a><ul>
<li><a href="#è©ä¾¡ã¿ã¤ã">è©ä¾¡ã¿ã¤ã</a></li>
<li><a href="#è¨ç®ãã¼ã¹">è¨ç®ãã¼ã¹</a></li>
<li><a href="#ã¢ãã«ãã¼ã¹">ã¢ãã«ãã¼ã¹</a></li>
</ul>
</li>
<li><a href="#æé">æé</a></li>
<li><a href="#使ã£ã¦ã¿ã">使ã£ã¦ã¿ã</a><ul>
<li><a href="#æ¦è¦-1">æ¦è¦</a></li>
<li><a href="#æºå">æºå</a></li>
<li><a href="#å®è¡ã¨çµæ">å®è¡ã¨çµæ</a></li>
</ul>
</li>
<li><a href="#ãã®ä»">ãã®ä»</a><ul>
<li><a href="#ã¯ã©ã¼ã¿ã®å¶éã«ã¤ãã¦">ã¯ã©ã¼ã¿ã®å¶éã«ã¤ãã¦</a></li>
<li><a href="#è©ä¾¡ãã¼ã¿ã»ããã®ä»¶æ°">è©ä¾¡ãã¼ã¿ã»ããã®ä»¶æ°</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241111/20241111095202.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="æ¦è¦">æ¦è¦</h1>
<p><strong>Gen AI evaluation service</strong> ã¯ãçæ AI ã¢ããªã±ã¼ã·ã§ã³ã®åºåãå¹ççã«è©ä¾¡ããããã®æ©è½ã§ããVertex AI ã®1æ©è½ã¨ãã¦ãAPI ã§æä¾ããã¾ãããã®æ©è½ã使ãã¨ãäºåå®ç¾©ãããè©ä¾¡ææ¨ããã¦ã¼ã¶ã¼ãç¬èªã«å®ç¾©ããã«ã¹ã¿ã è©ä¾¡ææ¨ãç¨ãã¦ãçæ AI ã¢ããªã±ã¼ã·ã§ã³ã®ããã©ã¼ãã³ã¹ã<strong>å®éçã«è©ä¾¡</strong>ã§ãã¾ãã</p>
<p>åæ§ã® LLM è©ä¾¡ãã¼ã«ã¨ãã¦ã¯ããªã¼ãã³ã½ã¼ã¹ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãã <a href="https://docs.ragas.io/en/stable/">Ragas</a> ãªã©ãããã¾ãããGen AI evaluation service 㯠<strong>Vertex AI ã¨ã·ã¼ã ã¬ã¹ã«çµ±åããã¦ãã</strong>ç¹ã¨ã<strong>ããã¼ã¸ããµã¼ãã¹ã§ããã¤ã³ãã©ã®ç®¡çãä¸è¦ãªç¹</strong>ãã¡ãªããã§ããä¸æ¹ã§ãRagas ã«æ¯ã¹è©ä¾¡ææ¨ãã³ãã¬ã¼ããå°ãªãç¹ããå°é¡ã§ã¯ããã¾ãã API å©ç¨æéãçºçããã¨ãã£ããã¡ãªãããããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/evaluation-overview">Gen AI evaluation service overview</a></li>
</ul>
<h1 id="ã¦ã¼ã¹ã±ã¼ã¹">ã¦ã¼ã¹ã±ã¼ã¹</h1>
<p>Gen AI Evaluation Service ã¯ã以ä¸ã®ãããªã¦ã¼ã¹ã±ã¼ã¹ã§å½¹ç«ã¡ã¾ãã</p>
<ul>
<li>çæ AI ã¢ãã«ã®é¸å®</li>
<li>æé©ãªã¢ãã«ãã©ã¡ã¼ã¿ãæ¢ç´¢</li>
<li>ããã³ããã¨ã³ã¸ãã¢ãªã³ã°ã®èª¿æ´</li>
<li>ãã¡ã¤ã³ãã¥ã¼ãã³ã°ã®è©ä¾¡</li>
<li>RAGï¼Retrieval Augmented Generationï¼ã®è©ä¾¡</li>
<li>Function calling ã®è©ä¾¡</li>
</ul>
<p>以ä¸ã®å
¬å¼ããã¥ã¡ã³ãã§ã¯ãã¦ã¼ã¹ã±ã¼ã¹å¥ã®ãµã³ãã« Notebook ãå
¬éããã¦ãããåèã«ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/evaluation-overview#notebooks_for_evaluation_use_cases">Notebooks for evaluation use cases</a></li>
</ul>
<h1 id="è©ä¾¡ææ¨ã«ã¤ãã¦">è©ä¾¡ææ¨ã«ã¤ãã¦</h1>
<h2 id="è©ä¾¡ã¿ã¤ã">è©ä¾¡ã¿ã¤ã</h2>
<p>Gen AI evaluation service ã«ã¯ã<strong>è¨ç®ãã¼ã¹</strong>ï¼Computation-basedï¼ã¨<strong>ã¢ãã«ãã¼ã¹</strong>ï¼Model-basedï¼ã® 2 種é¡ã®è©ä¾¡ã¿ã¤ããããã¾ãã</p>
<p>è¨ç®ãã¼ã¹ã®è©ä¾¡ã¯ãæ£è§£ãã¼ã¿ã¨ã®æ¯è¼ã«åºã¥ãã¦ã¹ã³ã¢ãç®åºãã¾ããå¦çé度ãéãããããªã¢ã«ã¿ã¤ã è©ä¾¡ã«ãé©ãã¦ãã¾ãã代表çãªææ¨ã¨ãã¦ãèªç¶è¨èªå¦çã§åºã使ããã BLEU ã ROUGE ãªã©ãããã¾ãã</p>
<p>ããããLLM ã®åºåè©ä¾¡ã§ã¯ããããããæ£è§£ãã¼ã¿ããæºåãããã¨ãé£ããå ´åãããã¾ããããã¯ãLLM ã®åºåã«å¯¾ãã¦åä¸ã®æ£è§£ãå®ãã«ããããã§ãããã®ãããå¤ãã®å ´åã人éã®å¤æã«ããè©ä¾¡ãè¡ããã¾ãããã¹ã±ã¼ã«ããã«ã¤ãã¦æéãå¢å ããã¨ãã課é¡ãããã¾ããããããèæ¯ãããç¾å¨ã§ã¯ã¢ãã«ãã¼ã¹ã®è©ä¾¡ã注ç®ããã¦ãã¾ãã</p>
<p>ã¢ãã«ãã¼ã¹ã®è©ä¾¡ã¯ãLLM èªä½ãå¤å®ã¢ãã«ã¨ãã¦ç¨ãã人éã«ããè©ä¾¡ã«è¿ãå½¢ã§è©ä¾¡ãã¾ããæ£è§£ãã¼ã¿ãå¿
é ã¨ããããæµæ¢ããããä¸è²«æ§ãã¨ãã£ãè¤éãªåºæºã§ã®è©ä¾¡ãå¯è½ã§ãããã³ããã®èª¿æ´ã«ããæè»ãªè©ä¾¡åºæºãè¨å®ã§ãã¾ãã</p>
<table>
<thead>
<tr>
<th> è©ä¾¡ã¿ã¤ã </th>
<th> è©ä¾¡ã¢ããã¼ã </th>
<th> æ£è§£ãã¼ã¿ï¼Ground truthï¼ </th>
<th> ã¬ã¤ãã³ã· </th>
</tr>
</thead>
<tbody>
<tr>
<td> è¨ç®ãã¼ã¹ </td>
<td> æ°å¼ãç¨ãã¦è©ä¾¡ãã </td>
<td> å¿
é </td>
<td> æ©ã </td>
</tr>
<tr>
<td> ã¢ãã«ãã¼ã¹ </td>
<td> å¤å®ã¢ãã« (LLM) ã«è©ä¾¡ããã </td>
<td> ä»»æ </td>
<td> é
ã </td>
</tr>
</tbody>
</table>
<h2 id="è¨ç®ãã¼ã¹">è¨ç®ãã¼ã¹</h2>
<p>è¨ç®ãã¼ã¹ã®è©ä¾¡ææ¨ã¯ãåè£ã¢ãã«ï¼è©ä¾¡å¯¾è±¡ã® LLMï¼ã®åºåãæ£è§£ãã¼ã¿ã«ã©ãã ãä¸è´ãã¦ããããæ°å¤åãã¾ãã以ä¸ã¯ããã¹ãçæåãã®è©ä¾¡ææ¨ã§ãã</p>
<table>
<thead>
<tr>
<th> è©ä¾¡ææ¨ </th>
<th> 説æ </th>
<th> é©ããã¦ã¼ã¹ã±ã¼ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Exact match </td>
<td> åè£ã¢ãã«ã®åºåãæ£è§£ãã¼ã¿ã¨å®å
¨ä¸è´ããå ´åã¯ã1ããããªãå ´åã¯ã0ããåºå </td>
<td> QA ãåé¡ã¿ã¹ã¯ </td>
</tr>
<tr>
<td> BLEU </td>
<td> åè£ã¢ãã«ã®åºåã¨æ£è§£ãã¼ã¿ã® n-gram ã®ä¸è´åº¦ãç®åºãåºå㯠[0 ~ 1] ã®ç¯å²ã§ãã¹ã³ã¢ãé«ãã»ã©çæããã¹ããæ£è§£ã«è¿ããã¨ã示ãã </td>
<td> 翻訳ã¿ã¹ã¯ </td>
</tr>
<tr>
<td> ROUGE </td>
<td> åè£ã¢ãã«ã®åºåã¨æ£è§£ãã¼ã¿ã® n-gram ã® F1-score ãç®åºãåºå㯠[0 ~ 1] ã®ç¯å²ã§ãã¹ã³ã¢ãé«ãã»ã©å
容ãé¡ä¼¼ãã¦ãããã¨ã示ãã </td>
<td> è¦ç´ã¿ã¹ã¯ </td>
</tr>
</tbody>
</table>
<p>ãã®ä»ãFunction Calling åãã®è©ä¾¡ææ¨ãªã©ãããã¾ãã詳細ã¯ä»¥ä¸ã®å
¬å¼ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/determine-eval#computation-based-metrics">Computation-based metrics</a></li>
</ul>
<h2 id="ã¢ãã«ãã¼ã¹">ã¢ãã«ãã¼ã¹</h2>
<p>ã¢ãã«ãã¼ã¹ã®è©ä¾¡ææ¨ã§ã¯ãLLM ãå¤å®ã¢ãã«ã¨ãã¦æ©è½ããåè£ã¢ãã«ã®åºåãè©ä¾¡ãã¾ãããã®ææ³ã¯ä¸è¬çã«ã<strong>LLM-as-a-Judge</strong> ã¨ãå¼ã°ãã¾ãã</p>
<p>è©ä¾¡æ¹å¼ã«ã¯ãåä¸ã®åºåã«å¯¾ãã <strong>Pointwise</strong> ã¨ãè¤æ°ã®åºåã®æ¯è¼ãè¡ã <strong>Pairwise</strong> ãããã¾ãã</p>
<table>
<thead>
<tr>
<th> æ¹å¼ </th>
<th> 説æ </th>
<th> ã¦ã¼ã¹ã±ã¼ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Pointwise </td>
<td> åä¸ã®åè£ã¢ãã«ã®åºåã«ã¹ã³ã¢ãä»ä¸ </td>
<td> éç¨æ®µéã§ã®ç¶ç¶çãªã¢ãã¿ãªã³ã°</td>
</tr>
<tr>
<td> Pairwise </td>
<td> 2 ã¤ã®åè£ã¢ãã«ã®åºåãæ¯è¼ããããé©åãªæ¹ãé¸æ </td>
<td> ã¢ãã«é¸å®ãããã³ããæ¯è¼</td>
</tr>
</tbody>
</table>
<p>ã¾ããGen AI evaluation service ã«ã¯ãæ§ã
ãªã¿ã¹ã¯ã«åãããäºåå®ç¾©æ¸ã¿ã®ããã³ãããã³ãã¬ã¼ããç¨æããã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th> </th>
<th> ããã¹ãçæ </th>
<th> ãã«ãã¿ã¼ã³ä¼è©±å½¢å¼ </th>
<th> è¦ç´ </th>
<th> QA å質 </th>
</tr>
</thead>
<tbody>
<tr>
<td> Pointwise </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_fluency">Fluency</a><br>ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_groundedness">Groundedness</a> ãªã©</td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_multiturn_chat_quality">Multi-turn Chat Quality</a><br>ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_multiturn_chat_safety">Multi-turn Safety</a> </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_summarization_quality">Summarization Quality</a> </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pointwise_question_answering_quality">Question Answering Quality</a> </td>
</tr>
<tr>
<td> Pairwise </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_fluency">Fluency</a><br>ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_groundedness">Groundedness</a> ãªã©</td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_multiturn_chat_quality">Multi-turn Chat Quality</a><br>ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_multiturn_chat_safety">Multi-turn Safety</a> </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_summarization_quality">Summarization Quality</a> </td>
<td> ã»<a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates#pairwise_question_answering_quality">Question Answering Quality</a> </td>
</tr>
</tbody>
</table>
<p>ãããã®ãã³ãã¬ã¼ãã¯æ´æ°ãããå¯è½æ§ããããããææ°æ
å ±ã¯ä»¥ä¸ã®å
¬å¼ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/metrics-templates">Metric prompt templates for model-based evaluation</a></li>
</ul>
<h1 id="æé">æé</h1>
<p>Gen AI Evaluation Serviceã®æéã¯ãå
¥åºåã®æåæ°ã¨è©ä¾¡ã¿ã¤ãã«åºã¥ãã¦è¨ç®ããã¾ãã</p>
<table>
<thead>
<tr>
<th> è©ä¾¡ã¿ã¤ã </th>
<th> ä¾¡æ ¼ </th>
</tr>
</thead>
<tbody>
<tr>
<td> ã¢ãã«ãã¼ã¹ (Pointwise, Pairwise) </td>
<td> å
¥å: $0.005 per 1k characters <br>åºå: $0.015 per 1k characters </td>
</tr>
<tr>
<td> è¨ç®ãã¼ã¹ </td>
<td> å
¥å: $0.00003 per 1k characters <br>åºå: $0.00009 per 1k characters </td>
</tr>
</tbody>
</table>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/pricing#gen_ai_evaluation_service">Vertex AI Pricing - Gen AI Evaluation Service</a></li>
</ul>
<h1 id="使ã£ã¦ã¿ã">使ã£ã¦ã¿ã</h1>
<h2 id="æ¦è¦-1">æ¦è¦</h2>
<p>ããã§ã¯ãRAG ã·ã¹ãã ã§çæãããåçã®ç²¾åº¦ãè©ä¾¡ããä¾ãç´¹ä»ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ§æå³"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241125/20241125090011.png" width="705" height="266" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ§æå³</figcaption></figure></p>
<p>ã¾ããçè
ã®å®è¡ç°å¢ã¨ãã¦ã¯ <a href="https://cloud.google.com/colab/docs">Colab Enterprise</a> ã使ç¨ãã¾ããColab Enterprise ã®å©ç¨æ¹æ³ã¯ä»¥ä¸ã®å
¬å¼ããã¥ã¡ã³ãã®ã¯ã¤ãã¯ã¹ã¿ã¼ãããåèä¸ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/colab/docs/create-console-quickstart">Create a notebook by using the Google Cloud console</a></li>
</ul>
<h2 id="æºå">æºå</h2>
<p>ï¼. ã©ã¤ãã©ãªã®ã¤ã³ã¹ãã¼ã«</p>
<pre class="code lang-python" data-lang="python" data-unlink>!pip install google-cloud-aiplatform[evaluation]==<span class="synConstant">1.71</span>.<span class="synConstant">0</span>
</pre>
<p>ï¼. Vertex AI ã¤ã³ã¹ã¿ã³ã¹ã®åæå</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synPreProc">import</span> vertexai
<span class="synPreProc">from</span> vertexai.evaluation <span class="synPreProc">import</span> EvalTask, MetricPromptTemplateExamples, PointwiseMetric
<span class="synPreProc">import</span> pandas <span class="synStatement">as</span> pd
PROJECT_ID = <span class="synConstant">""</span> <span class="synComment"># @param {type:"string"}</span>
LOCATION = <span class="synConstant">""</span> <span class="synComment"># @param {type:"string"}</span>
EXPERIMENT = <span class="synConstant">""</span> <span class="synComment"># @param {type:"string"}</span>
vertexai.init(
project=PROJECT_ID,
location=LOCATION
)
</pre>
<p>ï¼. äºåå®ç¾©æ¸ã¿è©ä¾¡ææ¨ãã³ãã¬ã¼ãã®ç¢ºèª</p>
<pre class="code lang-python" data-lang="python" data-unlink>MetricPromptTemplateExamples.list_example_metric_names()
</pre>
<p>åºåã¯ä»¥ä¸ã®éãã§ãã</p>
<pre class="code txt" data-lang="txt" data-unlink>['coherence',
'fluency',
'safety',
'groundedness',
'instruction_following',
'verbosity',
'text_quality',
'summarization_quality',
'question_answering_quality',
'multi_turn_chat_quality',
'multi_turn_safety',
'pairwise_coherence',
'pairwise_fluency',
'pairwise_safety',
'pairwise_groundedness',
'pairwise_instruction_following',
'pairwise_verbosity',
'pairwise_text_quality',
'pairwise_summarization_quality',
'pairwise_question_answering_quality',
'pairwise_multi_turn_chat_quality',
'pairwise_multi_turn_safety']</pre>
<p>ï¼. <code>question_answering_quality</code> ãã³ãã¬ã¼ãã®å
容ã確èª</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synComment"># ããã³ãããã³ãã¬ã¼ãã®ä¸èº«ã表示</span>
<span class="synIdentifier">print</span>(MetricPromptTemplateExamples.get_prompt_template(<span class="synConstant">"question_answering_quality"</span>))
</pre>
<p>åºåã¯ä»¥ä¸ã®éãã§ãã</p>
<p><code>question_answering_quality</code> ãã³ãã¬ã¼ãã®è©ä¾¡åºæºã¯ãRAG ã¢ã¼ããã¯ãã£ã使ã£ãã¢ããªã±ã¼ã·ã§ã³ã®è©ä¾¡ã«ã使ãããã§ãããããä»åã¯ãã®ãã³ãã¬ã¼ãããã®ã¾ã¾å©ç¨ãã¾ãã</p>
<pre class="code txt" data-lang="txt" data-unlink># Instruction
You are an expert evaluator. Your task is to evaluate the quality of the responses generated by AI models.
We will provide you with the user input and an AI-generated response.
You should first read the user input carefully for analyzing the task, and then evaluate the quality of the responses based on the Criteria provided in the Evaluation section below.
You will assign the response a rating following the Rating Rubric and Evaluation Steps. Give step-by-step explanations for your rating, and only choose ratings from the Rating Rubric.
# Evaluation
## Metric Definition
You will be assessing question answering quality, which measures the overall quality of the answer to the question in user input. The instruction for performing a question-answering task is provided in the user prompt.
## Criteria
Instruction following: The response demonstrates a clear understanding of the question answering task instructions, satisfying all of the instruction's requirements.
Groundedness: The response contains information included only in the context if the context is present in user prompt. The response does not reference any outside information.
Completeness: The response completely answers the question with sufficient detail.
Fluent: The response is well-organized and easy to read.
## Rating Rubric
5: (Very good). The answer follows instructions, is grounded, complete, and fluent.
4: (Good). The answer follows instructions, is grounded, complete, but is not very fluent.
3: (Ok). The answer mostly follows instructions, is grounded, answers the question partially and is not very fluent.
2: (Bad). The answer does not follow the instructions very well, is incomplete or not fully grounded.
1: (Very bad). The answer does not follow the instructions, is wrong and not grounded.
## Evaluation Steps
STEP 1: Assess the response in aspects of instruction following, groundedness, completeness and fluency according to the criteria.
STEP 2: Score based on the rubric.
# User Inputs and AI-generated Response
## User Inputs
### Prompt
{prompt}
## AI-generated Response
{response}</pre>
<p>ï¼. ã«ã¹ã¿ã è©ä¾¡ææ¨ <code>helpfulness</code> ã®å®ç¾©</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synComment"># ã«ã¹ã¿ã ãã³ãã¬ã¼ããä½æ</span>
helpfulness_prompt_template = <span class="synConstant">"""</span>
<span class="synConstant">You are a professional writing evaluator. Your job is to score writing responses according to pre-defined evaluation criteria.</span>
<span class="synConstant"> </span>
<span class="synConstant">You will be assessing helpfulness, which measures the ability to provide important details when answering a prompt.</span>
<span class="synConstant"> </span>
<span class="synConstant">You will assign the writing response a score from 5, 4, 3, 2, 1, following the rating rubric and evaluation steps.</span>
<span class="synConstant"> </span>
<span class="synConstant">## Criteria</span>
<span class="synConstant">Helpfulness: The response is comprehensive with well-defined key details. The user would feel very satisfied with the content in a good response.</span>
<span class="synConstant"> </span>
<span class="synConstant">## Rating Rubric</span>
<span class="synConstant">5 (completely helpful): Response is useful and very comprehensive with well-defined key details to address the needs in the instruction and usually beyond what explicitly asked. The user would feel very satisfied with the content in the response.</span>
<span class="synConstant">4 (mostly helpful): Response is very relevant to the instruction, providing clearly defined information that addresses the instruction's core needs. It may include additional insights that go slightly beyond the immediate instruction. The user would feel quite satisfied with the content in the response.</span>
<span class="synConstant">3 (somewhat helpful): Response is relevant to the instruction and provides some useful content, but could be more relevant, well-defined, comprehensive, and/or detailed. The user would feel somewhat satisfied with the content in the response.</span>
<span class="synConstant">2 (somewhat unhelpful): Response is minimally relevant to the instruction and may provide some vaguely useful information, but it lacks clarity and detail. It might contain minor inaccuracies. The user would feel only slightly satisfied with the content in the response.</span>
<span class="synConstant">1 (unhelpful): Response is useless/irrelevant, contains inaccurate/deceptive/misleading information, and/or contains harmful/offensive content. The user would feel not at all satisfied with the content in the response.</span>
<span class="synConstant"> </span>
<span class="synConstant">## Evaluation Steps</span>
<span class="synConstant">STEP 1: Assess comprehensiveness: does the response provide specific, comprehensive, and clearly defined information for the user needs expressed in the instruction?</span>
<span class="synConstant">STEP 2: Assess relevance: When appropriate for the instruction, does the response exceed the instruction by providing relevant details and related information to contextualize content and help the user better understand the response.</span>
<span class="synConstant">STEP 3: Assess accuracy: Is the response free of inaccurate, deceptive, or misleading information?</span>
<span class="synConstant">STEP 4: Assess safety: Is the response free of harmful or offensive content?</span>
<span class="synConstant"> </span>
<span class="synConstant">Give step by step explanations for your scoring, and only choose scores from 5, 4, 3, 2, 1.</span>
<span class="synConstant"> </span>
<span class="synConstant"> </span>
<span class="synConstant"># User Inputs and AI-generated Response</span>
<span class="synConstant">## User Inputs</span>
<span class="synConstant">### Prompt</span>
<span class="synConstant">{prompt}</span>
<span class="synConstant"> </span>
<span class="synConstant">## AI-generated Response</span>
<span class="synConstant">{response}</span>
<span class="synConstant">"""</span>
<span class="synComment"># ã«ã¹ã¿ã è©ä¾¡ææ¨ãå®ç¾© </span>
helpfulness = PointwiseMetric(
metric=<span class="synConstant">"helpfulness"</span>,
metric_prompt_template=helpfulness_prompt_template,
)
</pre>
<p>ï¼. ãµã³ãã«ãã¼ã¿ã®å®ç¾©</p>
<p>ä»åå©ç¨ãã以ä¸ã®ãµã³ãã«ãã¼ã¿ã¯ä»¥ä¸ã®ã¨ããã§ãã</p>
<ul>
<li><strong>questions</strong> ï¼ã¦ã¼ã¶ã¼ã®è³ªå</li>
<li><strong>retrieved_contexts</strong> ï¼ã³ã³ããã¹ãã¨ãªãæ¤ç´¢çµæ</li>
<li><strong>generated_answers</strong> ï¼LLM ã®åºå</li>
<li><strong>golden_answers</strong> ï¼æ£è§£ãã¼ã¿</li>
</ul>
<pre class="code lang-python" data-lang="python" data-unlink>questions = [
<span class="synConstant">"å¯å£«å±±ã¯ã©ãã®çã«ä½ç½®ãã¦ãã¾ããï¼"</span>,
<span class="synConstant">"æ±äº¬ã¿ã¯ã¼ã¯ã©ã®åºã«ä½ç½®ãã¦ãã¾ããï¼"</span>,
<span class="synConstant">"æ²ç¸ã®ä¸»è¦ãªä¼çµ±æçã¯ä½ã§ããï¼"</span>,
<span class="synConstant">"æ²ç¸ã®ä¼çµ±èè¸ã§æåãªãã®ã¯ä½ã§ããï¼"</span>
]
retrieved_contexts = [
<span class="synConstant">"å¯å£«å±±ã¯ãé岡çã¨å±±æ¢¨çã«ã¾ããã£ã¦ä½ç½®ãã¦ãã¾ããæ¨é«3,776ã¡ã¼ãã«ã®ãã®å±±ã¯ãæ¥æ¬ã®æé«å³°ã§ããã象徴çãªèªç¶ã®ã·ã³ãã«ã¨ãã¦è¦ªãã¾ãã¦ãã¾ãã"</span>,
<span class="synConstant">"æ±äº¬ã¿ã¯ã¼ã¯ãæ±äº¬é½æ¸¯åºã«ä½ç½®ãã¦ããã1958å¹´ã«å»ºã¦ãããé«ã333ã¡ã¼ãã«ã®é»æ³¢å¡ã§ããæ±äº¬ã®ã·ã³ãã«ã¨ãã¦ã観å
åæã¨ãªã£ã¦ãã¾ãã"</span>,
<span class="synConstant">"æ¥æ¬ã®ä¸»è¦ãªä¼çµ±æçã«ã¯ã寿å¸ã天ã·ããããã¾ããã¾ãã天ã·ãã¯æ²ç¸ã§ãã½ã¦ã«ãã¼ãã¨ãªã£ã¦ãã¾ã"</span>,
<span class="synConstant">"æ²ç¸ã®ä¼çµ±èè¸ã«ã¯ãã¨ã¤ãµã¼ãããã太é¼ã®ãªãºã ã«åããã¦è¸ããããã®ã§ãç¥ããªã©ã§åºãæ«é²ããã¦ãã¾ãã"</span>
]
generated_answers = [
<span class="synConstant">"é岡ç"</span>,
<span class="synConstant">"港åº"</span>,
<span class="synConstant">"天ã·ã"</span>,
<span class="synConstant">"ã¨ã¤ãµã¼"</span>
]
golden_answers = [
<span class="synConstant">"é岡çã¨å±±æ¢¨ç"</span>,
<span class="synConstant">"港åº"</span>,
<span class="synConstant">"ã´ã¼ã¤ã¼ãã£ã³ãã«ã¼ãã½ã¼ããã°"</span>,
<span class="synConstant">"ã¨ã¤ãµã¼"</span>,
]
</pre>
<p>ï¼. è©ä¾¡ãã¼ã¿ã»ããã®ä½æ</p>
<p>åè©ä¾¡ææ¨ã®å
¥åã«å¿
è¦ãªã«ã©ã åã¯ä»¥ä¸ã®éãã§ãã</p>
<table>
<thead>
<tr>
<th> è©ä¾¡ææ¨ </th>
<th> è©ä¾¡ã¿ã¤ã </th>
<th> å¿
è¦ãªã«ã©ã å </th>
</tr>
</thead>
<tbody>
<tr>
<td> question_answering_quality </td>
<td> ã¢ãã«ãã¼ã¹ï¼Pontwiseï¼ </td>
<td>ã»prompt<br>ã»response </td>
</tr>
<tr>
<td> helpfulness </td>
<td> ã¢ãã«ãã¼ã¹ï¼Pontwiseï¼ </td>
<td> ã»prompt<br>ã»response </td>
</tr>
<tr>
<td> exact_match </td>
<td> è¨ç®ãã¼ã¹ </td>
<td> ã»response<br>ã»reference </td>
</tr>
</tbody>
</table>
<p>å¿
è¦ãªã«ã©ã åã«æ²¿ã£ã¦è©ä¾¡ãã¼ã¿ã»ãããä½æãã¾ãã</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synComment"># è©ä¾¡ãã¼ã¿ã»ãããä½æ</span>
eval_dataset = pd.DataFrame(
{
<span class="synConstant">"prompt"</span>: [
<span class="synConstant">"Answer the question: "</span> + question + <span class="synConstant">" Context: "</span> + item
<span class="synStatement">for</span> question, item <span class="synStatement">in</span> <span class="synIdentifier">zip</span>(questions, retrieved_contexts)
],
<span class="synConstant">"response"</span>: generated_answers, <span class="synComment"># åè£ã¢ãã«ã®åºå</span>
<span class="synConstant">"reference"</span>: golden_answers, <span class="synComment"># æ£è§£ãã¼ã¿</span>
}
)
</pre>
<h2 id="å®è¡ã¨çµæ">å®è¡ã¨çµæ</h2>
<p>ï¼. è©ä¾¡ãå®è¡</p>
<pre class="code lang-python" data-lang="python" data-unlink><span class="synComment"># è©ä¾¡ã¿ã¹ã¯ãå®ç¾©</span>
eval_task = EvalTask(
dataset=eval_dataset,
metrics=[
<span class="synConstant">"question_answering_quality"</span>, <span class="synComment"># ã¢ãã«ãã¼ã¹ï¼äºåå®ç¾©ã®è©ä¾¡ææ¨ï¼</span>
helpfulness, <span class="synComment"># ã¢ãã«ãã¼ã¹ï¼ã¦ã¼ã¶ã¼ç¬èªã®è©ä¾¡ææ¨ï¼</span>
<span class="synConstant">"exact_match"</span> <span class="synComment"># è¨ç®ãã¼ã¹</span>
],
experiment=EXPERIMENT,
)
<span class="synComment"># è©ä¾¡ãªã¯ã¨ã¹ããå®è¡</span>
result = eval_task.evaluate()
</pre>
<p>evaluate ã¡ã½ããã®æ»ãå¤ã¯ <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/latest/vertexai.evaluation.EvalResult">EvalResult</a> ã¯ã©ã¹ã§ãã以ä¸ã®å±æ§ãæã£ã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th> å±æ§å </th>
<th> 説æ </th>
</tr>
</thead>
<tbody>
<tr>
<td> summary_metrics </td>
<td> åææ¨ã®å¹³åå¤ãæ¨æºåå·®ãªã©ã®ãµããªæ
å ± </td>
</tr>
<tr>
<td> metrics_table </td>
<td> è©ä¾¡çµæã®è©³ç´°æ
å ± </td>
</tr>
<tr>
<td> metadata </td>
<td> è©ä¾¡æã®å®é¨åãªã©ã®ã¡ã¿ãã¼ã¿æ
å ± </td>
</tr>
</tbody>
</table>
<p>ï¼. è©ä¾¡çµæã®ãµããªãåºå</p>
<pre class="code lang-python" data-lang="python" data-unlink>result.summary_metrics
</pre>
<p>åºåã¯ä»¥ä¸ã®éãã§ãã</p>
<pre class="code txt" data-lang="txt" data-unlink>{'row_count': 4,
'question_answering_quality/mean': 4.0,
'question_answering_quality/std': 1.1547005383792515,
'helpfulness/mean': 3.0,
'helpfulness/std': 0.816496580927726,
'exact_match/mean': 0.5,
'exact_match/std': 0.5773502691896257}</pre>
<p>ï¼ï¼. è©ä¾¡çµæã®è©³ç´°ãåºå</p>
<pre class="code lang-python" data-lang="python" data-unlink>result.metrics_table
</pre>
<p>åºåã¯ä»¥ä¸ã®éãã§ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241125/20241125090008.png" width="800" height="252" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>æåãè¦ãã¥ããããã <code>question_answering_quality</code> è©ä¾¡ææ¨ã®æåã®ã¬ã³ã¼ãã®ã¿ã以ä¸ã«è¨è¼ãã¾ãã</p>
<blockquote><p>[ <strong>prompt</strong> ]<br/>
Answer the question: å¯å£«å±±ã¯ã©ãã®çã«ä½ç½®ãã¦ãã¾ããï¼ <br/>
Context: å¯å£«å±±ã¯ãé岡çã¨å±±æ¢¨çã«ã¾ããã£ã¦ä½ç½®ãã¦ãã¾ããæ¨é«3,776ã¡ã¼ãã«ã®ãã®å±±ã¯ãæ¥æ¬ã®æé«å³°ã§ããã象徴çãªèªç¶ã®ã·ã³ãã«ã¨ãã¦è¦ªãã¾ãã¦ãã¾ãã</p>
<p>[ <strong>response</strong> ]<br/>
é岡ç</p>
<p>[ <strong>reference</strong> ]<br/>
é岡çã¨å±±æ¢¨ç</p>
<p>[ <strong>question_answering_quality/explanation</strong> ]<br/>
The response is incomplete. Although grounded in the given context and fluent, it only mentioned one of the two prefectures where Mt. Fuji is located. The prompt asked "In which prefecture is Mt. Fuji located?" The context clearly stated it's located in both Shizuoka and Yamanashi prefectures. Therefore, the instruction following is weak.</p>
<p>~æ¥æ¬èªã«ç¿»è¨³~<br/>
åçã¯ä¸å®å
¨ã§ããä¸ããããæèã«åºã¥ãã¦ããæµæ¢ã§ã¯ããã¾ãããå¯å£«å±±ããã 2 ã¤ã®çã®ãã¡ã® 1 ã¤ããè¨åããã¦ãã¾ãããããã³ããã¯ãå¯å£«å±±ã¯ã©ã®çã«ããã¾ãã?ãã¨å°ãã¦ãããæèããé岡çã¨å±±æ¢¨çã®ä¸¡æ¹ã«ãããã¨ã¯æããã§ãããããã£ã¦ãæ示ã«å¾ããã¨ãä¸ååã§ãã</p>
<p>[ <strong>question_answering_quality/score</strong> ]<br/>
3.0</p></blockquote>
<p>å®éçãªã¹ã³ã¢ãåå¾ã§ãã¦ãããã¨ã確èªã§ãã¾ããã
ãªããã¢ãã«ãã¼ã¹ã®è©ä¾¡ææ¨ã®åºåã«ã¯ <code>explanation</code> åãå«ã¾ãã¦ãããå¤å®ã¢ãã«ãã¹ã³ã¢ãç®åºããããã«è¡ã£ãæèã®éç¨ãè¨é²ããã¦ãã¾ããã¤ã¾ããexplanation åã®å
容ã <strong>å¤å®ã¢ãã«ãåºåããã¹ã³ã¢ã®æ ¹æ </strong> ã¨ãªãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/view-evaluation">View and interpret evaluation results</a></li>
</ul>
<h1 id="ãã®ä»">ãã®ä»</h1>
<h2 id="ã¯ã©ã¼ã¿ã®å¶éã«ã¤ãã¦">ã¯ã©ã¼ã¿ã®å¶éã«ã¤ãã¦</h2>
<p>ã¢ãã«ãã¼ã¹ã®è©ä¾¡ã¿ã¤ãã§ã¯ãå¤å®ã¢ãã«ã« Vertex AI Gemini API ã使ç¨ãããããã¯ã©ã¼ã¿ã«ã¯æ³¨æãå¿
è¦ã§ããç¹ã«ã1 度ã«å¤§éã®è©ä¾¡ãã¼ã¿ã»ãããå«ããå ´åããè©ä¾¡ãªã¯ã¨ã¹ãã®åæå®è¡æ°ãé«ããªãå ´åã¯ã <code>gemini-1.5-pro</code> ã®ã¯ã©ã¼ã¿ã®å¶éç·©åããæ¤è¨ãã ããã</p>
<p>å¶éç·©åã®ç³è«ã«ã¤ãã¦ã¯ãå
¬å¼ããã¥ã¡ã³ãããåç
§ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/run-evaluation#increase-quota">Run model-based evaluation with increased rate limits and quota</a></li>
</ul>
<h2 id="è©ä¾¡ãã¼ã¿ã»ããã®ä»¶æ°">è©ä¾¡ãã¼ã¿ã»ããã®ä»¶æ°</h2>
<p>é«å質ãªè©ä¾¡çµæãå¾ãããã«ã¯ãè©ä¾¡ãã¼ã¿ã»ããã 100ã400 件ã«ãããã¨ãæ¨å¥¨ããã¦ãã¾ãããã®ç¯å²ã§ããã°ãå¤ãå¤ã®å½±é¿ãæå°éã«æãã¤ã¤ããã¾ãã¾ãªã·ããªãªã§ã®ããã©ã¼ãã³ã¹ãæå¾
ã§ãã¾ããã¾ãã400 件ãè¶
ããã¨åè¿°ã®æ¹åå¹æãèããå¾åããããããä¸è¬çãªç®å®ã¨ã㦠400 件ãä¸éã¨ãããã¨ãæ¨å¥¨ããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/models/evaluation-dataset#best-practices">Best practices</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-matayuuu/profile_256x256.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">åå ä½æ¨¹<a href="https://blog.g-gen.co.jp/archive/author/ggen-matayuuu">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨</p>
<p class="sw-profile__txt">ã¯ããããæ²ç¸åºèº«ã®ã¯ã©ã¦ãã¨ã³ã¸ãã¢ï¼</p>
<p class="sw-profile__txt">ã»ã¼ã«ã¹ããã¨ã³ã¸ãã¢ã¸è»¢èº«ãGoogle Cloud å
¨ 11 è³æ ¼ä¿æãGoogle Cloud Champion Innovator (AI/ML)ãGoogle Cloud Partner Top Engineer 2024ãGoogle Cloud å
¬å¼ã¦ã¼ã¶ã¼ä¼ Jagu'e'r ã§ã¨ãã³ã¸ã§ãªã¹ãã好ããªåéã¯çæ AIã</p>
<a href="https://twitter.com/matayuuuu?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @matayuuuu</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-matayuuu
ããµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ããã¸ã®å¯¾å¦æ³
hatenablog://entry/6802418398300331936
2024-11-22T09:00:00+09:00
2024-11-22T09:00:01+09:00 G-gen ã®ææã§ããGoogle Cloudï¼æ§ç§° GCPï¼ã§ããµã¼ãã¹ã¢ã«ã¦ã³ãããèªè¨¼ãã¼ãä½æãããã¨ããéã« ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ã çµç¹ããªã·ã¼ã®å¶ç´ãiam.disableServiceAccountKeyCreationããçµç¹ã«é©ç¨ããã¦ãã¾ãã ã¨è¡¨ç¤ºããã¦ãã¼ãä½æã§ããªãå ´åã®ã対å¦æ³ãç´¹ä»ãã¾ãã äºè±¡ã¨ã¡ãã»ã¼ã¸ åå 対å¦ããå㫠対å¦æ¹æ³ 対å¦æé IAM 権éã®ç¢ºèª çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§» å¶ç´ã®ç·¨éç»é¢ã¸é·ç§» å¶ç´ãç·¨é çµæã®ç¢ºèª äºè±¡ã¨ã¡ãã»ã¼ã¸ Google Cloudï¼æ§ç§° Gâ¦
<p>G-gen ã®ææã§ããGoogle Cloudï¼æ§ç§° GCPï¼ã§ããµã¼ãã¹ã¢ã«ã¦ã³ãããèªè¨¼ãã¼ãä½æãããã¨ããéã« <code>ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ã</code> <code>çµç¹ããªã·ã¼ã®å¶ç´ãiam.disableServiceAccountKeyCreationããçµç¹ã«é©ç¨ããã¦ãã¾ãã</code> ã¨è¡¨ç¤ºããã¦ãã¼ãä½æã§ããªãå ´åã®ã対å¦æ³ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#äºè±¡ã¨ã¡ãã»ã¼ã¸">äºè±¡ã¨ã¡ãã»ã¼ã¸</a></li>
<li><a href="#åå ">åå </a></li>
<li><a href="#対å¦ããåã«">対å¦ããåã«</a></li>
<li><a href="#対å¦æ¹æ³">対å¦æ¹æ³</a></li>
<li><a href="#対å¦æé ">対å¦æé </a><ul>
<li><a href="#IAM-権éã®ç¢ºèª">IAM 権éã®ç¢ºèª</a></li>
<li><a href="#çµç¹ãã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ">çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ</a></li>
<li><a href="#çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»">çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»</a></li>
<li><a href="#å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»">å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»</a></li>
<li><a href="#å¶ç´ãç·¨é">å¶ç´ãç·¨é</a></li>
<li><a href="#çµæã®ç¢ºèª">çµæã®ç¢ºèª</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031132805.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="äºè±¡ã¨ã¡ãã»ã¼ã¸">äºè±¡ã¨ã¡ãã»ã¼ã¸</h1>
<p>Google Cloudï¼æ§ç§° GCPï¼ã§ããµã¼ãã¹ã¢ã«ã¦ã³ãããèªè¨¼ãã¼ãä½æãããã¨ããéã«ã以ä¸ã®ã¡ãã»ã¼ã¸ã表示ããããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ãä½æã§ãã¾ããã§ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031132839.png" width="627" height="470" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ã</figcaption></figure></p>
<blockquote><p>ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã®ä½æãç¡å¹ã«ãªã£ã¦ãã¾ã</p>
<p>çµç¹ããªã·ã¼ã®å¶ç´ãiam.disableServiceAccountKeyCreationããçµç¹ã«é©ç¨ããã¦ãã¾ãã</p>
<p>èããããåå : çµç¹ããªã·ã¼ç®¡çè
ãããµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã«é¢é£ããã»ãã¥ãªã㣠ã¤ã³ã·ãã³ããé²ãããã«ããã®çµç¹ããªã·ã¼ãé©ç¨ãã¾ãããã¾ãã ãããã©ã«ãã§ä¿è·ãã®é©ç¨ ã«ãããçµç¹ã«ããªã·ã¼ãèªåçã«é©ç¨ãããå¯è½æ§ãããã¾ãã</p>
<p>æ¨å¥¨ããã次ã®ã¹ããã: ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã¯ãé©åã«ç®¡çããªãã£ãå ´åãã»ãã¥ãªã㣠ãªã¹ã¯ã¨ãªãã¾ããå¯è½ã§ããã°ã ããå®å
¨ãªä»£æ¿æ段 ãé¸æãã¦ãã ããããµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ã§èªè¨¼ããå¿
è¦ãããå ´åã¯ã çµç¹ã®ãçµç¹ããªã·ã¼ç®¡çè
ãï¼roles/orgpolicy.policyAdminï¼ã®ãã¼ã«ãæã¤ç®¡çè
ã ãiam.disableServiceAccountKeyCreationãã®å¶ç´ã ç¡å¹ã«ãã å¿
è¦ãããã¾ãã</p>
<p>追跡çªå·: (è±æ°å)</p></blockquote>
<p>ã³ã³ã½ã¼ã«ãè±èªçã®å ´åã以ä¸ã®ãããªã¡ãã»ã¼ã¸ã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Service account key creation is disabled"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031132853.png" width="620" height="409" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Service account key creation is disabled</figcaption></figure></p>
<blockquote><p>Service account key creation is disabled</p>
<p>The organization policy constraint 'iam.disableServiceAccountKeyCreation' is enforced on your organization.
Possible Causes: Your Organization Policy Administrator enforced the Organization Policy to prevent security incidents related to Service Account keys. Alternatively, your organization may have been automatically enforced with the policy as part of Secure by Default enforcements.</p>
<p>Recommended Next Steps: Service account keys are a security risk if not managed correctly. You should choose a more secure alternative whenever possible. If you must authenticate with a service account key, an administrator with the "Organization Policy Administrator" (roles/orgpolicy.policyAdmin) role on the organization needs to disable the "iam.disableServiceAccountKeyCreation" constraint.</p>
<p>Tracking number: (alphanumeric characters)</p></blockquote>
<h1 id="åå ">åå </h1>
<p>ãã®äºè±¡ã¯ãçµç¹ããªã·ã¼ã®å¶ç´ <code>iam.disableServiceAccountKeyCreation</code> ãçµç¹ã¬ãã«ããã©ã«ãã¬ãã«ã¾ãã¯ããã¸ã§ã¯ãã¬ãã«ã§æå¹åããã¦ããã¨ãã«çºçãã¾ãã</p>
<p><strong>çµç¹ã®ããªã·ã¼</strong>ã¯ãã»ãã¥ãªãã£ãçµ±å¶ã®åä¸ã®ããã«ãæå®ã®ã«ã¼ã«ã Google Cloud ç°å¢å
¨ä½ã«é©ç¨ããä»çµã¿ã®ãã¨ã§ããçµç¹ã®ããªã·ã¼ã®è©³ç´°ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Forganization-policy-explained" title="çµç¹ã®ããªã·ã¼ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/organization-policy-explained">blog.g-gen.co.jp</a></cite></p>
<p><code>iam.disableServiceAccountKeyCreation</code> ã¯ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã®ä½æãç¦æ¢ããå¶ç´ã§ãããã®å¶ç´ã¯ã2024å¹´åé 以éã«ä½æããã Google Cloud çµç¹ã§ã¯<strong>ããã©ã«ãã§æå¹å</strong>ããã¦ãã¾ãããã以åã«ä½æãããçµç¹ã§ãã管çè
ãæ示çã«ãã®å¶ç´ãæå¹åãã¦ããå ´åã¯ããã®äºè±¡ãçºçãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts?hl=ja#disable_service_account_key_creation">ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ä½æã®ç¡å¹å</a></li>
</ul>
<h1 id="対å¦ããåã«">対å¦ããåã«</h1>
<p>ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã¯ JSON ãã©ã¼ãããã®ããã¹ããã¡ã¤ã«ï¼ããã㯠P12 å½¢å¼ã®ãã¡ã¤ã«ï¼ã§ãããæµåºã®å±éºãããã¾ãããã®ããä¸è¬çã«ã¯<strong>ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã®ä½¿ç¨ã¯éæ¨å¥¨</strong>ã§ããã代ããã«ããã°ã©ã åä½åºç¤ï¼Compute Engine VM ã Cloud Run Serviceï¼ã«ãµã¼ãã¹ã¢ã«ã¦ã³ããã¢ã¿ããããããåä½åºç¤ã Google Cloud 以å¤ãªã®ã§ããã° Workload Identity ã Workforce Identity ã®ä½¿ç¨ãæ¨å¥¨ããã¾ãã</p>
<p>2024å¹´åé 以éã«ä½æããã Google Cloud çµç¹ã§ <code>iam.disableServiceAccountKeyCreation</code> ãããã©ã«ãã§æå¹åããã¦ããã®ã¯ããªã¹ã¯ã®é«ãææ³ã§ãããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ã®ä½¿ç¨ãææ¢ããããã§ãã</p>
<p>ãã®ã¨ã©ã¼ã解æ¶ããæãç°¡åãªæ¹æ³ã¯ã<code>iam.disableServiceAccountKeyCreation</code> å¶ç´ãç¡å¹åãããã¨ã§ãããç¡å¹åãè¡ãåã«ã<strong>æ¬å½ã«ãµã¼ãã¹ã¢ã«ã¦ã³ããã¼ãçæããå¿
è¦ãããã®ã</strong>ã代ããã«ãµã¼ãã¹ã¢ã«ã¦ã³ãã®ã¢ã¿ããã Workload Identity ã§<strong>代ç¨ã§ããªãã</strong>ããååãæ¤è¨ãã ããã</p>
<p>ãªã Workload Identity ã¨ã¯ãOIDC ã SAML 2.0 ãå©ç¨ãã¦ãAmazon Web Servicesï¼AWSï¼ã Microsoft AzureãActive Directory Federation Service çã® ID ã使ã£ã¦ Google Cloud ã«èªè¨¼ããä»çµã¿ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/migrate-from-service-account-keys?hl=ja">ãµã¼ãã¹ ã¢ã«ã¦ã³ã ãã¼ãã移è¡ãã</a></li>
<li>åè : <a href="https://cloud.google.com/iam/docs/workload-identity-federation?hl=ja">Workload Identity é£æº</a></li>
<li>åè : <a href="https://cloud.google.com/iam/docs/workforce-identity-federation?hl=ja">Workforce Identity ã®é£æº</a></li>
</ul>
<h1 id="対å¦æ¹æ³">対å¦æ¹æ³</h1>
<p>çµç¹ããªã·ã¼ã®å¶ç´ <code>iam.disableServiceAccountKeyCreation</code> ãç¡å¹åãããã¨ã§ããµã¼ãã¹ã¢ã«ã¦ã³ããã¼ãä½æã§ããããã«ãªãã¾ãã</p>
<p>çµç¹ããªã·ã¼ã®å¶ç´ã¯ãçµç¹ã¬ãã«ããã©ã«ãã¬ãã«ãããã¸ã§ã¯ãã¬ãã«ã§é©ç¨ãããã¨ãã§ãã親ãªã½ã¼ã¹ã®ããªã·ã¼ã¯åãªã½ã¼ã¹ã«<strong>ç¶æ¿</strong>ããã¾ãããã ããæ示çã«è¨å®ãããã¨ã§ãåãªã½ã¼ã¹å´ã§è¦ªãªã½ã¼ã¹ã®å¶ç´ããªã¼ãã¼ã©ã¤ãï¼ä¸æ¸ãï¼ãããã¨ãå¯è½ã§ãã</p>
<p>ãã£ã¦ãåãå¾ãé¸æè¢ã¨ãã¦ã¯ã以ä¸ã®ããããã«ãªãã¾ãã</p>
<ol>
<li><code>iam.disableServiceAccountKeyCreation</code> ãçµç¹ã¬ãã«ã§ç¡å¹åãã</li>
<li><code>iam.disableServiceAccountKeyCreation</code> ããã©ã«ãã¬ãã«ã§ãªã¼ãã¼ã©ã¤ããã¦ç¡å¹åãã</li>
<li><code>iam.disableServiceAccountKeyCreation</code> ãããã¸ã§ã¯ãã¬ãã«ã§ãªã¼ãã¼ã©ã¤ããã¦ç¡å¹åãã</li>
</ol>
<p>ä¸è¨ã®ãã¡ <code>1.</code>ã<code>2.</code> ã®å ´åãçµç¹å
¨ä½ãããã¯ãã©ã«ãå
¨ä½ã§å¶ç´ãç¡å¹ã«ãªããå½±é¿ã¯ä»ã®ããã¸ã§ã¯ãã«ãåã³ã¾ãã<code>3.</code> ã®å½±é¿ç¯å²ã¯å½è©²ããã¸ã§ã¯ãã®ã¿ã§ãã</p>
<p>ãã以éãå½è¨äºã§ã¯å½è©²å¶ç´ãç¡å¹åããæé ã解説ãã¾ãããåæ²ã®ã対å¦ããåã«ãããèªã¿ããã ãã<strong>ãªã¹ã¯ãç解ããããã§å®æ½</strong>ãã¦ãã ããã</p>
<h1 id="対å¦æé ">対å¦æé </h1>
<h2 id="IAM-権éã®ç¢ºèª">IAM 権éã®ç¢ºèª</h2>
<p>å½æé ãå®æ½ããã«ã¯ãæä½ãã Google ã¢ã«ã¦ã³ãããããã¯ã¢ã«ã¦ã³ããæå±ããã°ã«ã¼ããã<strong>çµç¹ã¬ãã«</strong>ã§<strong>çµç¹ããªã·ã¼ç®¡çè
</strong>ï¼<code>roles/orgpolicy.policyAdmin</code>ï¼ãã¼ã«ãæã£ã¦ããå¿
è¦ãããã¾ãã</p>
<p>çµç¹ããªã·ã¼ç®¡çè
ãä»ä¸ã§ããæãä¸ä½ã¬ãã«ã®ãªã½ã¼ã¹ã¯ãçµç¹ãã§ãããã£ã¦ããã©ã«ããããã¸ã§ã¯ãã¬ãã«ã§å¶ç´ããªã¼ãã¼ã©ã¤ãããå ´åã§ããçµç¹ã¬ãã«ã§çµç¹ããªã·ã¼ç®¡çè
ãã¼ã«ãæã£ã¦ããå¿
è¦ãããã¾ãã</p>
<p>ä½æ¥è
ã® Google ã¢ã«ã¦ã³ããå¿
è¦ãªæ¨©éãæã£ã¦ããªãå ´åã¯ãçµç¹ã¬ãã«ã§ IAM ãã¼ã«ãçµç¹ããªã·ã¼ç®¡çè
ããä»ä¸ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/access-control-org?hl=ja">IAM ã使ç¨ããçµç¹ãªã½ã¼ã¹ã®ã¢ã¯ã»ã¹å¶å¾¡</a></li>
</ul>
<h2 id="çµç¹ãã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ">çµç¹ããã©ã«ãã¾ãã¯ããã¸ã§ã¯ããé¸æ</h2>
<p>Google Cloud ã³ã³ã½ã¼ã«ã«ãã°ã¤ã³ããããã¸ã§ã¯ãã»ã¬ã¯ã¿ã¼ãã¯ãªãã¯ãã¦ãå¶ç´ãç¡å¹åãé©ç¨ããçµç¹ããã©ã«ããã¾ãã¯ããã¸ã§ã¯ããé¸æãã¾ãã</p>
<p>å½è¨äºã®ã対å¦ããåã«ãã対å¦æ¹æ³ãããããèªã¿ã«ãªããå¶ç´ã®ç·¨éä½ç½®ã決ããããã§é¸æãã¦ãã ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133005.png" width="1014" height="465" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»">çµç¹ã®ããªã·ã¼ç»é¢ã¸é·ç§»</h2>
<p>ã³ã³ã½ã¼ã«ä¸é¨ã®æ¤ç´¢ããã¯ã¹ã«ãçµç¹ã®ããªã·ã¼ããå
¥åãããµã¸ã§ã¹ãããããçµç¹ã®ããªã·ã¼ããé¸æãã¾ãã</p>
<p>ã¾ãã¯ããIAM ã¨ç®¡çãç»é¢ããç´æ¥é·ç§»ãã¦ãæ§ãã¾ããã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133035.png" width="1200" height="518" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»">å¶ç´ã®ç·¨éç»é¢ã¸é·ç§»</h2>
<p>å¶ç´ä¸è¦§ã®ä¸é¨ã®ãã£ã«ã¿ã« <code>constraints/iam.disableServiceAccountKeyCreation</code> ãå
¥åãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133046.png" width="1200" height="518" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ãã£ã«ã¿çµæã®ä¸ãããDisable service account key creation ãã¯ãªãã¯ãã¦ãç·¨éç»é¢ã¸é·ç§»ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133054.png" width="1200" height="518" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="å¶ç´ãç·¨é">å¶ç´ãç·¨é</h2>
<p>ãã¿ã³ãããªã·ã¼ã管çããæ¼ä¸ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133108.png" width="1056" height="614" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<p>ãããªã·ã¼ã®ã½ã¼ã¹ããããã¯ã§ãã親ã®ããªã·ã¼ããªã¼ãã¼ã©ã¤ãããããé¸æãã¾ãããã«ã¼ã«ããããã¯ã表示ãããã®ã§ããã«ã¼ã«ã®è¿½å ããæ¼ä¸ãããé©ç¨ããããªããã«ãã¾ããæå¾ã«ããã¿ã³ãããªã·ã¼ãè¨å®ããæ¼ä¸ãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133117.png" width="391" height="724" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h2 id="çµæã®ç¢ºèª">çµæã®ç¢ºèª</h2>
<p>è¨å®ãå®äºããã¨ã以ä¸ã®ãããªè¡¨ç¤ºã«ãªãã¾ãã</p>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241031/20241031133125.png" width="705" height="681" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura
çµç¹ã®ããªã·ã¼ãã¿ã°ã§å¶å¾¡ãã¦ã¿ã
hatenablog://entry/6802418398299705868
2024-11-20T09:00:00+09:00
2025-01-10T09:36:38+09:00 Google Cloud ã®çµç¹ããªã·ã¼æ©è½ã§ãããã¸ã§ã¯ãã«ã¿ã°ãé©ç¨ãããã¨ã§ä¾å¤è¨å®ãè¡ãæ¹æ³ãæ¤è¨¼ãã¾ããã ã¯ããã« å½è¨äºã«ã¤ã㦠åæç¥è æ¤è¨¼ ã¿ã°ãã¼ã¨å¤ã®ä½æ ãã©ã«ãã¨ããã¸ã§ã¯ãã®ä½æ ããªã·ã¼ã®é©ç¨ è£è¶³æ
å ± æ¡ä»¶ã®æå®ã«ã¤ã㦠Terraform ã¯ããã« å½è¨äºã«ã¤ã㦠Google Cloudï¼æ§ç§° GCPï¼ã§ã¯çµç¹ã®ããªã·ã¼ã使ã£ã¦ãçµç¹å
ã®ããã¸ã§ã¯ãã«ä¸å¾ã§ã»ãã¥ãªãã£ãçµ±å¶å¼·åã®ããã®è¨å®ãé©ç¨ã§ãã¾ãããã®ã¨ããç¹å®ã®ããã¸ã§ã¯ãã«ã®ã¿ä¾å¤ãè¨ãããå ´åãããã¾ãã ä¾ãã°ãçµç¹å
¨ä½ã«ãå
¬éã¢ã¯ã»ã¹ã®é²æ¢ãé©ç¨ããï¼constraints/storagâ¦
<p>Google Cloud ã®çµç¹ããªã·ã¼æ©è½ã§ãããã¸ã§ã¯ãã«ã¿ã°ãé©ç¨ãããã¨ã§ä¾å¤è¨å®ãè¡ãæ¹æ³ãæ¤è¨¼ãã¾ããã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a><ul>
<li><a href="#å½è¨äºã«ã¤ãã¦">å½è¨äºã«ã¤ãã¦</a></li>
<li><a href="#åæç¥è">åæç¥è</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼">æ¤è¨¼</a><ul>
<li><a href="#ã¿ã°ãã¼ã¨å¤ã®ä½æ">ã¿ã°ãã¼ã¨å¤ã®ä½æ</a></li>
<li><a href="#ãã©ã«ãã¨ããã¸ã§ã¯ãã®ä½æ">ãã©ã«ãã¨ããã¸ã§ã¯ãã®ä½æ</a></li>
<li><a href="#ããªã·ã¼ã®é©ç¨">ããªã·ã¼ã®é©ç¨</a></li>
</ul>
</li>
<li><a href="#è£è¶³æ
å ±">è£è¶³æ
å ±</a><ul>
<li><a href="#æ¡ä»¶ã®æå®ã«ã¤ãã¦">æ¡ä»¶ã®æå®ã«ã¤ãã¦</a></li>
<li><a href="#Terraform">Terraform</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241107/20241107104104.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<h2 id="å½è¨äºã«ã¤ãã¦">å½è¨äºã«ã¤ãã¦</h2>
<p>Google Cloudï¼æ§ç§° GCPï¼ã§ã¯<strong>çµç¹ã®ããªã·ã¼</strong>ã使ã£ã¦ãçµç¹å
ã®ããã¸ã§ã¯ãã«ä¸å¾ã§ã»ãã¥ãªãã£ãçµ±å¶å¼·åã®ããã®è¨å®ãé©ç¨ã§ãã¾ãããã®ã¨ããç¹å®ã®ããã¸ã§ã¯ãã«ã®ã¿<strong>ä¾å¤</strong>ãè¨ãããå ´åãããã¾ãã</p>
<p>ä¾ãã°ãçµç¹å
¨ä½ã«ãå
¬éã¢ã¯ã»ã¹ã®é²æ¢ãé©ç¨ããï¼<code>constraints/storage.publicAccessPrevention</code>ï¼ãã¨ããçµç¹ã®ããªã·ã¼ã®å¶ç´ãé©ç¨ãã¦ããã¨ãã¾ããããããããããã¸ã§ã¯ãã§ã¯ Cloud Storage ã®å
¬éãã±ããã«éçã³ã³ãã³ãããã¹ãã£ã³ã°ãã¦ããã¨ãã¾ãããã®ã¨ãã¯ãå½è©²ããã¸ã§ã¯ãã®ã¿ãå¶ç´ã®é©ç¨å¤ã«ããå¿
è¦ãããã¾ãã</p>
<p>å½è¨äºã§ã¯ãã®ãããªå ´åãæ³å®ãã¦ãã¿ã°ã使ã£ã¦ç¹å®ã®ããã¸ã§ã¯ãã¯å¶ç´ã®å¯¾è±¡å¤ã¨ãã¤ã¤ããã®ä»å
¨ã¦ã®çµç¹å
ããã¸ã§ã¯ãã«å¶ç´ãé©ç¨ããæ¤è¨¼ãè¡ãã¾ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/resource-manager/docs/organization-policy/tags-organization-policy?hl=ja">ã¿ã°ã使ç¨ããçµç¹ã®ããªã·ã¼ã®è¨å®</a></li>
</ul>
<h2 id="åæç¥è">åæç¥è</h2>
<p>å½è¨äºã§ã¯ Resource Manager ã®<strong>ã¿ã°</strong>æ©è½ãå©ç¨ãã¾ããã¿ã°ã®è©³ç´°ããé¡ä¼¼æ©è½ã§ããã©ãã«ã¨ã®å·®ç°ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fdifference-between-tags-and-labels" title="ã¿ã°ã¨ã©ãã«ã®éãã«ã¤ã㦠(Tags / Labels) - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/difference-between-tags-and-labels">blog.g-gen.co.jp</a></cite></p>
<p>çµç¹ã®ããªã·ã¼æ©è½ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ãããç¹ã«ãç¶æ¿ã¨å¼ã°ããæ§è³ªã«ã¤ãã¦ã¯ç解ãå¿
è¦ã§ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Forganization-policy-explained" title="çµç¹ã®ããªã·ã¼ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/organization-policy-explained">blog.g-gen.co.jp</a></cite></p>
<h1 id="æ¤è¨¼">æ¤è¨¼</h1>
<h2 id="ã¿ã°ãã¼ã¨å¤ã®ä½æ">ã¿ã°ãã¼ã¨å¤ã®ä½æ</h2>
<p>ã¾ããçµç¹ã®ãªã½ã¼ã¹ã¨ãã¦ããIAM ã¨ç®¡çãç»é¢ãã<strong>ã¿ã°ãã¼</strong>ãä½æãã¾ããä»å㯠<code>apply-policy</code> ã¨ããå称ã§ä½æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¿ã°ãã¼ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090017.png" width="800" height="575" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¿ã°ãã¼ä½æ</figcaption></figure></p>
<p>次ã«ãã¿ã°ãã¼ã®å¤ã¨ãã¦ã<code>true</code> 㨠<code>false</code> ãä½æãã¾ããä»åã®æ¤è¨¼ã§ã¯ãã®å¤ã使ã£ã¦ãã¾ãããå¿
ããããã¼ã«å¤ã§ããå¿
è¦ã¯ãªããéç¨ä¸é½åã®è¯ãæååãæå®ãã¦æ§ãã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã¿ã°ã®å¤ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090013.png" width="800" height="557" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã¿ã°ã®å¤ä½æ</figcaption></figure></p>
<h2 id="ãã©ã«ãã¨ããã¸ã§ã¯ãã®ä½æ">ãã©ã«ãã¨ããã¸ã§ã¯ãã®ä½æ</h2>
<p>以ä¸ã®ããã«ãã©ã«ãã¨ããã¸ã§ã¯ããä½æãã¾ãã</p>
<ul>
<li>ãã©ã«ãã«å±ããªãããã¸ã§ã¯ã
<ul>
<li><code>test-20241028-true</code></li>
<li><code>test-20241028-false</code></li>
<li><code>test-20241028-none</code></li>
</ul>
</li>
<li>ãã©ã«ã <code>my_folder</code></li>
<li>åãã©ã«ãé
ä¸ã®ã以ä¸ã®ããã¸ã§ã¯ã
<ul>
<li><code>test-20241028-true-in-folder</code></li>
<li><code>test-20241028-false-in-folder</code></li>
<li><code>test-20241028-none-in-folder</code></li>
</ul>
</li>
</ul>
<p>ã¿ã° <code>apply-policy: true</code> ããããã¸ã§ã¯ã <code>test-20241028-true</code> 㨠<code>test-20241028-true-in-folder</code> ã«ä»ä¸ãã¾ãã</p>
<p>ã¿ã° <code>apply-policy: false</code> ããããã¸ã§ã¯ã <code>test-20241028-false</code> 㨠<code>test-20241028-false-in-folder</code> ã«ä»ä¸ãã¾ãã</p>
<p>ããã«ãã¿ã° <code>apply-policy: false</code> ãããã©ã«ã <code>my_folder</code> ã«ä»ä¸ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ããã¸ã§ã¯ãã®ä½æã»ã¿ã°ã®ä»ä¸"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090021.png" width="800" height="251" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ããã¸ã§ã¯ãã®ä½æã»ã¿ã°ã®ä»ä¸</figcaption></figure></p>
<p>ãã©ã«ãã«ã¿ã°ãä»ä¸ããå ´åããã®ãã©ã«ãã«å±ããããã¸ã§ã¯ãã«ã¯<strong>ã¿ã°ãç¶æ¿</strong>ããã¾ãããã ããããã¸ã§ã¯ãã«ã¿ã°ãç´æ¥ä»ä¸ããã¦ããå ´åããã¡ãã<strong>åªå
</strong>ããã¾ããä¸è¨ã®ã¹ã¯ãªã¼ã³ã·ã§ããã§ã¯ãããã¸ã§ã¯ã <code>test-20241028-none-in-folder</code> ã® Tags åã«ç¶æ¿ã表ãã¢ã¤ã³ã³ã表示ããã¦ããããã©ã«ãããç¶æ¿ãããã¿ã°ãé©ç¨ããã¦ãããã¨ããããã¾ãã</p>
<h2 id="ããªã·ã¼ã®é©ç¨">ããªã·ã¼ã®é©ç¨</h2>
<p>ãã®çµç¹ã«å¯¾ãã¦ãçµç¹ã¬ãã«ã§å¶ç´ãé©ç¨ãã¾ããä»åé©ç¨ããå¶ç´ã¯ãå
¬éã¢ã¯ã»ã¹ã®é²æ¢ãé©ç¨ããï¼<code>constraints/storage.publicAccessPrevention</code>ï¼ãã§ããçµç¹ã¬ãã«ã«ãã®å¶ç´ãé©ç¨ãã¤ã¤ãã¿ã° <code>apply-policy: false</code> ãä»ä¸ãããããã¸ã§ã¯ãã§ã¯ãã®å¶ç´ã®å¹æãçºæ®ãããªãç¶æ
ãç®æãã¾ãã</p>
<p>çµç¹ã®ããªã·ã¼ã® Google Cloud ã³ã³ã½ã¼ã«ç»é¢ã§ä¸è¨ã®å¶ç´ãæ¤ç´¢ããç·¨éãã¾ãããã®æãè¨å®å¤ã¨ãã¦ãã親ã®ããªã·ã¼ããªã¼ãã¼ã©ã¤ãããããé¸æãã¾ããç·¨éç»é¢ã§ã¯ã2ã¤ã®ã«ã¼ã«ã追å ãã¾ãã</p>
<p>1ã¤ç®ã¯ãç¹å®ã®ã¿ã°ãã¼ã¨å¤ãæã£ã¦ãããã¨ãæ¡ä»¶ã«ããé©ç¨ããããªããã¨ãããã®ã§ããè¨å®å¤ãå¤ã®ãã¹ãã¯ã<code>[organization_name]/apply-policy/false</code> ã¨ãã¾ããã¿ã°ãä½ææ¸ã¿ã®å ´åããã«ãã¦ã³ã¡ãã¥ã¼ããé¸æã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ããªã·ã¼ã®ç·¨é"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090045.png" width="800" height="433" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ããªã·ã¼ã®ç·¨é</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="å¤ã®ãã¹"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090049.png" width="800" height="211" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>å¤ã®ãã¹</figcaption></figure></p>
<p>2ã¤ç®ã¯ã1ã¤ç®ã®ã«ã¼ã«ã®æ¡ä»¶ã«åè´ããªãå ´åã«é©ç¨ããããããã©ã«ãã®ã«ã¼ã«ã§ãããã«ã¼ã«ã®è¿½å ããæ¼ä¸ãããé©ç¨ãã®ã©ã¸ãªãã¿ã³ã§ããªã³ããé¸æãã¾ãããããè¨å®ããªãå ´åã<code>A
boolean policy must always include one unconditional rule.</code> ã¨ããã¡ãã»ã¼ã¸ã表示ãããããªã·ã¼ã®è¨å®ãå®äºãã¾ããã</p>
<p>çµç¹ã¬ãã«ã§ããªã·ã¼ãé©ç¨ãããå ´åãã³ã³ã½ã¼ã«ç»é¢ã®è¡¨è¨ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="é©ç¨ãããçµç¹ããªã·ã¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090025.png" width="800" height="769" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>é©ç¨ãããçµç¹ããªã·ã¼</figcaption></figure></p>
<p>ããªã·ã¼ã®é©ç¨å¾ãåããã¸ã§ã¯ãã®ããªã·ã¼é©ç¨ç¶æ
ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã</p>
<table>
<thead>
<tr>
<th> ããã¸ã§ã¯ã </th>
<th> â:é©ç¨æ¸ã¿ãÃ:æªé©ç¨ </th>
</tr>
</thead>
<tbody>
<tr>
<td> test-20241028-true </td>
<td> â </td>
</tr>
<tr>
<td> test-20241028-false </td>
<td> Ã </td>
</tr>
<tr>
<td> test-20241028-none </td>
<td> â </td>
</tr>
<tr>
<td> test-20241028-true-in-folder </td>
<td> â </td>
</tr>
<tr>
<td> test-20241028-false-in-folder </td>
<td> Ã </td>
</tr>
<tr>
<td> test-20241028-none-in-folder </td>
<td> Ã </td>
</tr>
</tbody>
</table>
<p>以ä¸ã¯ãåããã¸ã§ã¯ãã¬ãã«ã§ããªã·ã¼ã®é©ç¨ç¶æ
ã確èªããéã®ãã£ããã£ã§ããæ³å®ããã¨ããã«ãããªã·ã¼ãé©ç¨ããã¦ãããã¨ããããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-true"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090009.png" width="800" height="669" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-true</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-false"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090041.png" width="800" height="692" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-false</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-none"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090033.png" width="800" height="641" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-none</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-true-in-folder"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090006.png" width="800" height="651" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-true-in-folder</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-false-in-folder"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090037.png" width="800" height="678" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-false-in-folder</figcaption></figure></p>
<p><figure class="figure-image figure-image-fotolife" title="test-20241028-none-in-folder"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241120/20241120090029.png" width="800" height="665" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>test-20241028-none-in-folder</figcaption></figure></p>
<p>以ä¸ã®æ¤è¨¼çµæããã以ä¸ã®ãã¨ã確ããããã¾ããã</p>
<ul>
<li>æ示çã«ã¿ã°ãä»ä¸ããããã¸ã§ã¯ãã«ã¯ãããªã·ã¼ãé©ç¨ãããªã</li>
<li>親ãã©ã«ãã®ã¿ã°ãç¶æ¿ãã¦ããããã¸ã§ã¯ãã«ã¯ãããªã·ã¼ãé©ç¨ãããªã</li>
<li>ã¿ã°ãä»ä¸ããã¦ããªãããã¸ã§ã¯ãã«ã¯ãããã©ã«ãã«ã¼ã«ã«åºã¥ãããªã·ã¼ãé©ç¨ããã</li>
</ul>
<h1 id="è£è¶³æ
å ±">è£è¶³æ
å ±</h1>
<h2 id="æ¡ä»¶ã®æå®ã«ã¤ãã¦">æ¡ä»¶ã®æå®ã«ã¤ãã¦</h2>
<p>ä»åã®æ¤è¨¼ã§ã¯ãããªã·ã¼ã®é¤å¤å¯¾è±¡ã¨ããããã¸ã§ã¯ããã¿ã°ã§æå®ãã¾ãããå対ã«ãé©ç¨å¯¾è±¡ãã¿ã°ã§æå®ãããã¨ãå¯è½ã§ãã</p>
<p>ã¾ããä»åã®æ¤è¨¼ã§ã¯ã¿ã°åã使ã£ã¦æå®ããæ¹æ³ãç´¹ä»ãã¾ããããä»ã«ã¿ã°ã®æ°¸ç¶ IDï¼permanent IDãã¿ã°ãã¼ãå¤ãæã¤ãªã½ã¼ã¹ IDï¼ã§æå®ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/iam/docs/tags-access-control?hl=ja#condition-id">æ°¸ç¶ ID ã使ç¨ããæ¡ä»¶</a></li>
</ul>
<h2 id="Terraform">Terraform</h2>
<p>å½æ¤è¨¼ã§ä½¿ç¨ããçµç¹ã¬ãã«ã®ãªã½ã¼ã¹ã¯ã以ä¸ã®ããã« Terraform ã§è¨è¿°ãããã¨ãã§ãã¾ãããªã以ä¸ã®ãµã³ãã«ã³ã¼ãå
ã®å¤æ° <code>organization_number_id</code> ã¯10~13æ¡ã®æ°åã§è¡¨ãããçµç¹ ID ã§ãã</p>
<pre class="code lang-terraform" data-lang="terraform" data-unlink><span class="synType">resource</span> <span class="synConstant">"google_tags_tag_key"</span> <span class="synConstant">"apply_policy"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">short_name</span> = <span class="synConstant">"apply-policy"</span>
<span class="synIdentifier">parent</span> = <span class="synConstant">"organizations/$</span><span class="synSpecial">{</span>var.organization_number_id<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"The flag indicating whether to apply the policy or not."</span>
<span class="synSpecial">}</span>
<span class="synType">resource</span> <span class="synConstant">"google_tags_tag_value"</span> <span class="synConstant">"apply_policy_true"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">parent</span> = <span class="synConstant">"tagKeys/$</span><span class="synSpecial">{</span>google_tags_tag_key.apply_policy.name<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synIdentifier">short_name</span> = <span class="synConstant">"true"</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"Apply organization policy to the project."</span>
<span class="synSpecial">}</span>
<span class="synType">resource</span> <span class="synConstant">"google_tags_tag_value"</span> <span class="synConstant">"apply_policy_false"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">parent</span> = <span class="synConstant">"tagKeys/$</span><span class="synSpecial">{</span>google_tags_tag_key.apply_policy.name<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synIdentifier">short_name</span> = <span class="synConstant">"false"</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"Do NOT apply organization policy to the project."</span>
<span class="synSpecial">}</span>
<span class="synType">resource</span> <span class="synConstant">"google_org_policy_policy"</span> <span class="synConstant">"storage_public_access_prevention"</span> <span class="synSpecial">{</span>
<span class="synIdentifier">name</span> = <span class="synConstant">"organizations/$</span><span class="synSpecial">{</span>var.organization_number_id<span class="synSpecial">}</span><span class="synConstant">/storage.publicAccessPrevention"</span>
<span class="synIdentifier">parent</span> = <span class="synConstant">"organizations/$</span><span class="synSpecial">{</span>var.organization_number_id<span class="synSpecial">}</span><span class="synConstant">"</span>
<span class="synType">spec</span> <span class="synSpecial">{</span>
<span class="synType">rules</span> <span class="synSpecial">{</span>
<span class="synIdentifier">enforce</span> = <span class="synConstant">"FALSE"</span>
<span class="synType">condition</span> <span class="synSpecial">{</span>
<span class="synIdentifier">title</span> = <span class="synConstant">"Do NOT apply with the tag"</span>
<span class="synIdentifier">description</span> = <span class="synConstant">"Do NOT apply storage.publicAccessPrevention on the projects tagged with apply-policy: false"</span>
<span class="synIdentifier">expression</span> = <span class="synConstant">"resource.matchTag('$</span><span class="synSpecial">{</span>var.organization_number_id<span class="synSpecial">}</span><span class="synConstant">/apply-policy', 'false')"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synType">rules</span> <span class="synSpecial">{</span>
<span class="synIdentifier">enforce</span> = <span class="synConstant">"TRUE"</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
</pre>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn.profile-image.st-hatena.com/users/ggen-shunsuketsumori/profile_128x128.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">G-genã¡ã³ãã¼<a href="https://blog.g-gen.co.jp/archive/author/ggen-tsumori">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨
<p class="sw-profile__txt"><br>
</div>
</div>
</div>
</div>
ggen-shunsuketsumori
Pub/Subã®Cloud Storage import topicã使ã£ã¦ã¿ã
hatenablog://entry/6802418398303434810
2024-11-18T09:00:00+09:00
2024-11-18T09:00:00+09:00 G-gen ã®ææã§ããPub/Sub ã® Cloud Storage ã¤ã³ãã¼ããããã¯ï¼Cloud Storage import topicï¼ã使ãã¨ãäºåã«æå®ãã Cloud Storage ãã±ããã« Put ãããããã¹ããªãã¸ã§ã¯ããããã¼ã³ã¼ã㧠Pub/Sub ãããã¯ã«ãããªãã·ã¥ããç°¡åã« Pub/Sub ãµãã¹ã¯ãªãã·ã§ã³ã«é
ä¿¡ã§ãã¾ãã åæç¥è Cloud Storage ã¤ã³ãã¼ããããã¯ã¨ã¯ è¨å®å¤ æ¤è¨¼ã®æ¦è¦ ç°å¢æ§ç¯ ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãããªãã·ã¥ï¼ ãã±ããã®ä½æ ãããã¯ã®ä½æ ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãã±ãâ¦
<p>G-gen ã®ææã§ããPub/Sub ã® <strong>Cloud Storage ã¤ã³ãã¼ããããã¯</strong>ï¼Cloud Storage import topicï¼ã使ãã¨ãäºåã«æå®ãã Cloud Storage ãã±ããã« Put ãããããã¹ããªãã¸ã§ã¯ããããã¼ã³ã¼ã㧠Pub/Sub ãããã¯ã«ãããªãã·ã¥ããç°¡åã« Pub/Sub ãµãã¹ã¯ãªãã·ã§ã³ã«é
ä¿¡ã§ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#åæç¥è">åæç¥è</a><ul>
<li><a href="#Cloud-Storage-ã¤ã³ãã¼ããããã¯ã¨ã¯">Cloud Storage ã¤ã³ãã¼ããããã¯ã¨ã¯</a></li>
<li><a href="#è¨å®å¤">è¨å®å¤</a></li>
</ul>
</li>
<li><a href="#æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</a></li>
<li><a href="#ç°å¢æ§ç¯">ç°å¢æ§ç¯</a><ul>
<li><a href="#ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸-IAM-権éã®ä»ä¸ãããªãã·ã¥">ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãããªãã·ã¥ï¼</a></li>
<li><a href="#ãã±ããã®ä½æ">ãã±ããã®ä½æ</a></li>
<li><a href="#ãããã¯ã®ä½æ">ãããã¯ã®ä½æ</a></li>
<li><a href="#ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸-IAM-権éã®ä»ä¸ãã±ããèªã¿åã">ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãã±ããèªã¿åãï¼</a></li>
<li><a href="#BigQuery-ãã¼ãã«ã¨-BigQuery-ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ">BigQuery ãã¼ãã«ã¨ BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ</a></li>
<li><a href="#ãããã¯ã®ç¶æ
ã確èª">ãããã¯ã®ç¶æ
ã確èª</a></li>
</ul>
</li>
<li><a href="#åä½ç¢ºèª">åä½ç¢ºèª</a><ul>
<li><a href="#ãªãã¸ã§ã¯ãã®-Put">ãªãã¸ã§ã¯ãã® Put</a></li>
<li><a href="#ãã¼ãã«ã®ç¢ºèª">ãã¼ãã«ã®ç¢ºèª</a></li>
<li><a href="#追å æ¤è¨¼åºåãæåã®è¿½å ">追å æ¤è¨¼ï¼åºåãæåã®è¿½å ï¼</a></li>
<li><a href="#追å æ¤è¨¼ã¡ãã»ã¼ã¸æ¬æã®ç¢ºèª">追å æ¤è¨¼ï¼ã¡ãã»ã¼ã¸æ¬æã®ç¢ºèªï¼</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113095706.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="åæç¥è">åæç¥è</h1>
<h2 id="Cloud-Storage-ã¤ã³ãã¼ããããã¯ã¨ã¯">Cloud Storage ã¤ã³ãã¼ããããã¯ã¨ã¯</h2>
<p><strong>Pub/Sub</strong> ã¯ãGoogle Cloudï¼æ§ç§° GCPï¼ã®ãã«ããã¼ã¸ããªã¡ãã»ã¼ã¸ã³ã°ãµã¼ãã¹ã§ããPub/Sub ã®æ義ããå®ç¾ã§ããã¢ã¼ããã¯ãã£ã¯ä»¥ä¸ã®è¨äºããåç
§ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Funderstanding-loosely-coupled-architecture" title="Google Cloudã§ç解ããççµåã¢ã¼ããã¯ãã£ã¨ã¡ãã»ã¼ã¸ã³ã°ãµã¼ãã¹ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/understanding-loosely-coupled-architecture">blog.g-gen.co.jp</a></cite></p>
<p>Pub/Sub ã® <strong>Cloud Storage ã¤ã³ãã¼ããããã¯</strong>ï¼Cloud Storage import topicï¼ã使ãã¨ãäºåã«æå®ãã Cloud Storage ãã±ããã« Put ãããããã¹ããªãã¸ã§ã¯ããããã¼ã³ã¼ã㧠Pub/Sub ãããã¯ã«ãããªãã·ã¥ããç°¡åã« Pub/Sub ãµãã¹ã¯ãªãã·ã§ã³ã«é
ä¿¡ã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/pubsub/docs/create-cloud-storage-import-topic?hl=en">Create a Cloud Storage import topic</a></li>
</ul>
<p>ãã® Cloud Storage ã¤ã³ãã¼ããããã¯ã<strong>使ããªãå ´å</strong>ã¯ãCloud Storage ã«ãªãã¸ã§ã¯ãã Put ããããã¨ã Eventarc ã§æ¤ç¥ããCloud Run functions çãèµ·åãè¨è¿°ããããã°ã©ã ã§é
ä¿¡å
ã«æ¸ãè¾¼ãã¨ããå¦çã®éçºãå¿
è¦ã«ãªãã¾ãã</p>
<p>ä¸æ¹ã§ãå½è¨äºã§ç´¹ä»ãã Cloud Storage ã¤ã³ãã¼ããããã¯ã使ãã°ãCloud Storage ãã±ããã«æ¸ãè¾¼ã¾ãããªãã¸ã§ã¯ããèªã¿åã<strong>ããã°ã©ã ãéçºãããã¨ãªã</strong>ãèªåçã« Pub/Sub ãããã¯ã«ãããªãã·ã¥ãããã¨ãã§ãã¾ãã</p>
<p>ãã®ããã«ã㦠Pub/Sub ãããã¯ã«ãããªãã·ã¥ãããã¡ãã»ã¼ã¸ã¯ããµãã¹ã¯ãªãã·ã§ã³ãçµç±ãã¦ãBigQuery ã«æ¸ãè¾¼ãã ããä»ã® API ã¨ã³ããã¤ã³ãã« Push ãããã¨ãªã©ãå¯è½ã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="é常ã®ãããã¯ã¨ Cloud Storage ã¤ã³ãã¼ããããã¯ã®éã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113093323.png" width="1187" height="523" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>é常ã®ãããã¯ã¨ Cloud Storage ã¤ã³ãã¼ããããã¯ã®éã</figcaption></figure></p>
<h2 id="è¨å®å¤">è¨å®å¤</h2>
<p>Cloud Storage ã¤ã³ãã¼ããããã¯ã«ã¯ã以ä¸ã®ãããªè¨å®å¤ãããã¾ãã</p>
<table>
<thead>
<tr>
<th> è¨å®å </th>
<th> 説æ </th>
</tr>
</thead>
<tbody>
<tr>
<td> åãè¾¼ã¿å
ãã±ãã </td>
<td> ãã¼ã¿ãåãè¾¼ã Cloud Storage ãã±ãããæå® </td>
</tr>
<tr>
<td> ãªãã¸ã§ã¯ãã®å½¢å¼ </td>
<td> TextãAvroãPub/Sub Avro ããé¸æ </td>
</tr>
<tr>
<td> åºåãæå </td>
<td> Text ã®å ´åã®ã¿æå®ããã®åºåãæåã«åºã¥ãã¦ã¡ãã»ã¼ã¸ãåå²ãããã1æåã¾ã§ãçç¥ãã㨠<code>\n</code> ï¼æ¹è¡ï¼ </td>
</tr>
<tr>
<td> æçã®ãªãã¸ã§ã¯ãä½ææé </td>
<td> åãè¾¼ã¿éå§æå»ããã®æå»ããåã«ä½æããããªãã¸ã§ã¯ãã¯åãè¾¼ã¾ããªã </td>
</tr>
<tr>
<td> glob ãã¿ã¼ã³ </td>
<td> ããã§æå®ãããã¹ãã¿ã¼ã³ã«ä¸è´ãããªãã¸ã§ã¯ãã®ã¿ãåãè¾¼ã¾ããã<code>**</code> ã§å
¨ãªãã¸ã§ã¯ãã<code>**.txt</code> ã§æ¡å¼µåæå®ç </td>
</tr>
</tbody>
</table>
<p>以ä¸ã¯ãGoogle Cloud ã³ã³ã½ã¼ã«ã«ãããè¨å®ç»é¢ã®ã¹ã¯ãªã¼ã³ã·ã§ããã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãããã¯ä½æç»é¢"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112191229.png" width="592" height="738" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãããã¯ä½æç»é¢</figcaption></figure></p>
<h1 id="æ¤è¨¼ã®æ¦è¦">æ¤è¨¼ã®æ¦è¦</h1>
<p>å½è¨äºã§ã¯ã以ä¸ã®æ§æã§æ¤è¨¼ãè¡ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¤è¨¼ 1"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113094432.png" width="1156" height="188" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¤è¨¼ 1</figcaption></figure></p>
<p>ä¸è¨ã®æ§æã§ã¯ãCloud Storage ã¤ã³ãã¼ããããã¯ã«ããèªåçãªã¡ãã»ã¼ã¸åãè¾¼ã¿ãè¡ãã¾ããåãè¾¼ãã ã¡ãã»ã¼ã¸ã¯ãBigQuery ãµãã¹ã¯ãªãã·ã§ã³çµç±ã§ BigQuery ãã¼ãã«ã«æ¸ãè¾¼ã¿ã¾ããããã«ããã½ã¼ã¹ã³ã¼ããä¸åæ¸ããã¨ãªããCloud Storage ã«å°çããããã¹ããã¼ã¿ãé 次ãBigQuery ã«æ¸ãè¾¼ããã¨ãå¯è½ã§ãã</p>
<p>Pub/Sub ã® BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã®è©³ç´°ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fpubsub-bigquery-subscription" title="Pub/Subã®BigQueryãµãã¹ã¯ãªãã·ã§ã³ã使ã£ã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/pubsub-bigquery-subscription">blog.g-gen.co.jp</a></cite></p>
<p>ããã«ã追å æ¤è¨¼ã¨ãã¦ãã¡ãã»ã¼ã¸æ¬æã®æ§æã確ããããããPull ãµãã¹ã¯ãªãã·ã§ã³ãä½æãã¦ç´æ¥ã¡ãã»ã¼ã¸ã®å
容ã確èªããæ¤è¨¼ãè¡ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¤è¨¼ 2"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113094500.png" width="1156" height="188" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¤è¨¼ 2</figcaption></figure></p>
<h1 id="ç°å¢æ§ç¯">ç°å¢æ§ç¯</h1>
<h2 id="ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸-IAM-権éã®ä»ä¸ãããªãã·ã¥">ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãããªãã·ã¥ï¼</h2>
<p>Pub/Sub ãå©ç¨ãããµã¼ãã¹ã¨ã¼ã¸ã§ã³ãï¼Google Cloud ãµã¼ãã¹ãå©ç¨ãããµã¼ãã¹ã¢ã«ã¦ã³ãã®ãã¨ï¼ã«ãå¿
è¦ãª IAM 権éãä»ä¸ãã¾ãã</p>
<p>ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãå㯠<code>service-{PROJECT_NUMBER}@gcp-sa-pubsub.iam.gserviceaccount.com</code> ã§ãã<code>{PROJECT_NUMBER}</code> ã«ã¯ããã¸ã§ã¯ãçªå·ãå
¥ãã¾ãããã®ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã«ãããã¸ã§ã¯ãã¬ãã«ã§ Pub/Sub ãããªãã·ã£ã¼ï¼<code>roles/pubsub.publisher</code>ï¼ãã¼ã«ãä»ä¸ãã¾ãããã®ãã¼ã«ã¯ããµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã Cloud Storage ã¤ã³ãã¼ããããã¯ã«ãã¼ã¿ããããªãã·ã¥ããã®ã«å¿
è¦ã«ãªãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/pubsub/docs/create-cloud-storage-import-topic#add-publisher-role">Add the Pub/Sub publisher role to the Pub/Sub service account</a></li>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/service-agent-explained">ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¨ã¯ä½ã â G-gen Tech Blog</a></li>
</ul>
<p>ããã¸ã§ã¯ãã¬ãã«ã® IAM ãã¤ã³ãã£ã³ã°ä¸è¦§ç»é¢ã§ã¯ããµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã«ä»ä¸ããã IAM ãã¼ã«ã¯é表示ã«ãªã£ã¦ãã¾ãã以ä¸ã®ã¹ã¯ãªã¼ã³ã·ã§ããã®ããã«ãGoogle æä¾ã®ãã¼ã«ä»ä¸ãå«ããããã§ãã¯ããã¯ã¹ããªã³ã«ããã¨ãIAM ãã¼ã«ã表示ããã¾ãã</p>
<p>ãªã以ä¸ã®ã¹ã¯ãªã¼ã³ã·ã§ããã§ã¯ãããã©ã«ãã§ä»ä¸ããã¦ãããCloud Pub/Sub ãµã¼ãã¹ ã¨ã¼ã¸ã§ã³ãããä»åä»ä¸ãããPub/Sub ãããªãã·ã£ã¼ãã«å ãã¦ãBigQuery ãã¼ã¿ç·¨éè
ããä»ä¸ããã¦ãã¾ãããããã¯ä»åã®æ¤è¨¼ã§ BigQuery ãµãã¹ã¯ãªãã·ã§ã³ãå©ç¨ããããã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ããã¸ã§ã¯ãã® IAM ç»é¢"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112192844.png" width="1181" height="372" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ããã¸ã§ã¯ãã® IAM ç»é¢</figcaption></figure></p>
<h2 id="ãã±ããã®ä½æ">ãã±ããã®ä½æ</h2>
<p>Cloud Storage ãã±ãããä½æãã¾ããä»åã¯ã以ä¸ã®ãããªãã±ãããä½æãã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="Cloud Storage ãã±ããã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112193642.png" width="1102" height="562" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Cloud Storage ãã±ããã®ä½æ</figcaption></figure></p>
<h2 id="ãããã¯ã®ä½æ">ãããã¯ã®ä½æ</h2>
<p>Cloud Storage ã¤ã³ãã¼ããããã¯ãä½æãã¾ãã</p>
<p>ãªãã¸ã§ã¯ãã®å½¢å¼ã¯ Text ã¨ããåºåãæåã¯ç©ºç½ã¨ãã¾ããåºåãæåãæ示ããªãå ´åã<code>\n</code> ï¼æ¹è¡ï¼ãåºåãæåã¨ãã¦èªèããã¾ããã¤ã¾ããããããã¹ããã¡ã¤ã«ããã±ããã« Put ããå ´åã<strong>1è¡ã1ã¡ãã»ã¼ã¸</strong>ã¨ã㦠Pub/Sub ãããã¯ã«åãè¾¼ã¾ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Cloud Storage ã¤ã³ãã¼ããããã¯ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112193751.png" width="724" height="652" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Cloud Storage ã¤ã³ãã¼ããããã¯ã®ä½æ</figcaption></figure></p>
<h2 id="ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãã¸-IAM-権éã®ä»ä¸ãã±ããèªã¿åã">ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãã±ããèªã¿åãï¼</h2>
<p>ãã®ã¨ããPub/Sub ã®ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãï¼<code>service-{PROJECT_NUMBER}@gcp-sa-pubsub.iam.gserviceaccount.com</code>ï¼ã対象ãã±ããã¸ã®èªã¿åã権éãæã£ã¦ããªãå ´åã以ä¸ã®ãããªã¡ãã»ã¼ã¸ã表示ããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="権éã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112193929.png" width="724" height="652" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>権éã®ç¢ºèªã¨ä»ä¸</figcaption></figure></p>
<p>ã権éã®è¨å®ããæ¼ä¸ããã¨ã以ä¸ã®ãããªç»é¢ã表示ãããããã¼ã«ã®ä»ä¸ããã¯ãªãã¯ãããã¨ã§å¿
è¦ãª IAM 権éãä»ä¸ã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="IAM 権éã®ä»ä¸"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112194128.png" width="1167" height="368" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>IAM 権éã®ä»ä¸</figcaption></figure></p>
<p>ãããè¡ãã¨ã対象ãã±ããã®ã¬ãã«ã§ãStorage ãªãã¸ã§ã¯ãé²è¦§è
ããStorage ã¬ã¬ã·ã¼ ãã±ããèªã¿åãããã¼ã«ãä»ä¸ããã¾ãã以ä¸ã®ããã«ããã±ããã®ã権éãã¿ãã§ä»ä¸ããã IAM ãã¼ã«ã確èªã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã±ããã¬ãã«ã®æ¨©éã®ç¢ºèª"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241112/20241112194307.png" width="1167" height="606" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã±ããã¬ãã«ã®æ¨©éã®ç¢ºèª</figcaption></figure></p>
<h2 id="BigQuery-ãã¼ãã«ã¨-BigQuery-ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ">BigQuery ãã¼ãã«ã¨ BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ</h2>
<p>ãã¼ã¿æ ¼ç´å
ã® BigQuery ãã¼ãã«ãä½æãã¾ããid å㨠data åãæã¤ã·ã³ãã«ãªãã¼ãã«ãä½æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="BigQuery ãã¼ãã«"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113090105.png" width="1143" height="398" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>BigQuery ãã¼ãã«</figcaption></figure></p>
<p>ãã®å¾ãCloud Storage ã¤ã³ãã¼ããããã¯ã«ç´ã¥ããµãã¹ã¯ãªãã·ã§ã³ããBigQuery ãµãã¹ã¯ãªãã·ã§ã³ãã¿ã¤ãã§ä½æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113095032.png" width="669" height="652" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã®ä½æ</figcaption></figure></p>
<p>BigQuery ãµãã¹ã¯ãªãã·ã§ã³ã¯ããããã¯ãåãåã£ãã¡ãã»ã¼ã¸ãèªåçã« BigQuery ã«æ¸ãè¾¼ãã§ããã¾ããä»åã¯ãã¹ãã¼ãã使ç¨ããªããã«è¨å®ããã®ã§ãã¡ãã»ã¼ã¸ã¯ <code>data</code> ã¨ããå称ãæã¤åã«æååã¨ãã¦æ¸ãè¾¼ã¾ãã¾ãã</p>
<h2 id="ãããã¯ã®ç¶æ
ã確èª">ãããã¯ã®ç¶æ
ã確èª</h2>
<p>ããã§ããããã¯ã®ç¶æ
ã確èªãã¾ããä½æãã Cloud Storage ã¤ã³ãã¼ããããã¯ã®è©³ç´°ç»é¢ã§ããããã¯ã®ã¹ãã¼ã¿ã¹ã以ä¸ã®ããã«ç·è²ã§è¡¨ç¤ºããã¦ããã°ãæ£ããè¨å®ãå®äºãã¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãããã¯ãæ£ããè¨å®ããã¦ããç¶æ
"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113090605.png" width="1115" height="223" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãããã¯ãæ£ããè¨å®ããã¦ããç¶æ
</figcaption></figure></p>
<p>ãã以ä¸ã®ããã«è¡¨ç¤ºããã¦ããå ´åãPub/Sub ã®ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ãããããã¯ã¸ã®ãããªãã·ã¥æ¨©éãæã£ã¦ããªããã¨ãèãããã¾ããå½è¨äºã® <code>ãµã¼ãã¹ã¨ã¼ã¸ã§ã³ã㸠IAM 権éã®ä»ä¸ï¼ãããªãã·ã¥ï¼</code> ã«æ»ããããã¸ã§ã¯ãã¬ãã«ã§ Pub/Sub ãããªãã·ã£ã¼ï¼<code>roles/pubsub.publisher</code>ï¼ãã¼ã«ãä»ä¸ãã¦ãã ããããããã¯ããããã¯ã¬ãã«ã§ãã¼ã«ãä»ä¸ãããã¨ãå¯è½ã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="åãè¾¼ã¿ã®ãªã½ã¼ã¹ã¨ã©ã¼: 権éã®å
¬éãæå¦ããã¾ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113090837.png" width="1115" height="223" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>åãè¾¼ã¿ã®ãªã½ã¼ã¹ã¨ã©ã¼: 権éã®å
¬éãæå¦ããã¾ãã</figcaption></figure></p>
<pre class="code" data-lang="" data-unlink>åãè¾¼ã¿ã®ãªã½ã¼ã¹ã¨ã©ã¼: 権éã®å
¬éãæå¦ããã¾ãã</pre>
<h1 id="åä½ç¢ºèª">åä½ç¢ºèª</h1>
<h2 id="ãªãã¸ã§ã¯ãã®-Put">ãªãã¸ã§ã¯ãã® Put</h2>
<p>åä½ç¢ºèªã®ãããCloud Storage ãã±ããã«ãªãã¸ã§ã¯ãã Put ãã¾ãã</p>
<p>ä»åã¯ã以ä¸ã®ãããªãã¡ã¤ã«ã Put ãã¾ãããæ¹è¡ã§åºåãããã2è¡ã®ããã¹ãæ
å ±ã§ãã</p>
<p><strong>test-file-01.txt</strong></p>
<pre class="code" data-lang="" data-unlink>This is the first message.
This is the second message.</pre>
<p><figure class="figure-image figure-image-fotolife" title="ãªãã¸ã§ã¯ãã® Put"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113091016.png" width="1152" height="401" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãªãã¸ã§ã¯ãã® Put</figcaption></figure></p>
<h2 id="ãã¼ãã«ã®ç¢ºèª">ãã¼ãã«ã®ç¢ºèª</h2>
<p>Put ãããããã¹ããã¡ã¤ã«å
ã®ããã¹ãæ
å ±ã¯ãCloud Storage ã¤ã³ãã¼ããããã¯ã«èªåçã«åãè¾¼ã¾ããBigQuery ãµãã¹ã¯ãªãã·ã§ã³ã«ãã£ã¦ã対象ãã¼ãã«ã® data åã«æ¸ãè¾¼ã¾ããã¯ãã§ãã</p>
<p>対象ãã¼ãã«ã« <code>SELECT</code> æãå®è¡ããã¨ãæ³å®ã©ããã2è¡ã®ããã¹ãæ
å ±ãæ¸ãè¾¼ã¾ãã¦ãã¾ããããªãã¸ã§ã¯ãã® Put ãããã¼ãã«ã«æ
å ±ãæ¸ãè¾¼ã¾ããã¾ã§ãããã1åç¨åº¦ã®ã©ã°ãããã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="BigQuery ã«ããã¹ããã¼ã¿ãæ ¼ç´ããã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113091138.png" width="1077" height="456" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>BigQuery ã«ããã¹ããã¼ã¿ãæ ¼ç´ããã</figcaption></figure></p>
<h2 id="追å æ¤è¨¼åºåãæåã®è¿½å ">追å æ¤è¨¼ï¼åºåãæåã®è¿½å ï¼</h2>
<p>追å æ¤è¨¼ã¨ãã¦ãå
ç¨ã¯çç¥ãããããã¯ã®ãåºåãæåãã®è¨å®ã追å ãã¦ã¿ã¾ãã</p>
<p>以ä¸ã®ããã«ãåºåãæåã <code>,</code>ï¼ã«ã³ãï¼ã¨ãã¦è¨å®ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="åºåãæåãã«ã³ãã«è¨å®"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113091412.png" width="837" height="602" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>åºåãæåãã«ã³ãã«è¨å®</figcaption></figure></p>
<p>ãã®å¾ãCloud Storage ãã±ããã«æ¬¡ã®ãã¡ã¤ã«ã Put ãã¾ããåè§ã¹ãã¼ã¹ã®æ±ãã確ãããããã3åç®ã®æåå <code>3rd field</code> ã®æåã«ã¯ãããã¦åè§ã¹ãã¼ã¹ãå
¥ãã¦ãã¾ãã</p>
<p><strong>test-csv-02.csv</strong></p>
<pre class="code csv" data-lang="csv" data-unlink>1st field,2nd field, 3rd field</pre>
<p>çµæã¯ã以ä¸ã®ããã«æ³å®ã©ããæ ¼ç´ããã¾ãããã«ã³ãã®ãã¨ã®åè§ã¹ãã¼ã¹ãåæ ããã¦ããã<code>3rd field</code> ã®æåã«ã¯åè§ã¹ãã¼ã¹ãå
¥ã£ã¦ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ã«ã³ãåºåãã®ãã¼ã¿ãæ ¼ç´ããã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113091701.png" width="1073" height="572" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ã«ã³ãåºåãã®ãã¼ã¿ãæ ¼ç´ããã</figcaption></figure></p>
<h2 id="追å æ¤è¨¼ã¡ãã»ã¼ã¸æ¬æã®ç¢ºèª">追å æ¤è¨¼ï¼ã¡ãã»ã¼ã¸æ¬æã®ç¢ºèªï¼</h2>
<p>ããã«è¿½å æ¤è¨¼ã¨ãã¦ãPull ãµãã¹ã¯ãªãã·ã§ã³ãä½æãã¦ãCloud Storage ã¤ã³ãã¼ããããã¯ããçºè¡ãããã¡ãã»ã¼ã¸ã®æ¬æã確èªãã¾ãã</p>
<p>以ä¸ã®ããã«ãPull ãµãã¹ã¯ãªãã·ã§ã³ãä½æãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Pull ãµãã¹ã¯ãªãã·ã§ã³ãä½æ"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113091848.png" width="1097" height="581" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Pull ãµãã¹ã¯ãªãã·ã§ã³ãä½æ</figcaption></figure></p>
<p>以ä¸ã®ãã¡ã¤ã«ã Put ãã¾ãã</p>
<pre class="code csv" data-lang="csv" data-unlink>another 1st field,another 2nd field, another 3rd field</pre>
<p>ãã®å¾ã<code>gcloud pubsub subscriptions pull</code> ã³ãã³ãã§ãµãã¹ã¯ãªãã·ã§ã³ããã¡ãã»ã¼ã¸ã Pull ãã¾ãã<code>--limit</code> ãªãã·ã§ã³ãã¤ããã«å®è¡ããã¨ã1åã®ã¡ãã»ã¼ã¸ã®ã¿ã Pull ããã¾ããä»å㯠<code>--limit=10</code> ãæå®ãã3ã¤ã®ã¡ãã»ã¼ã¸ãåå¾ã§ãããã¨ã確èªãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="3ã¤ã®ã¡ãã»ã¼ã¸ã Pull ã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113092100.png" width="1149" height="479" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>3ã¤ã®ã¡ãã»ã¼ã¸ã Pull ã§ãã</figcaption></figure></p>
<p>æ³å®ã©ããã3ã¤ã®ã¡ãã»ã¼ã¸ã Pull ã§ãã¾ããããã¼ã¿æ¬æï¼<code>data</code>ï¼ã¯ Base64 ã§ã¨ã³ã³ã¼ãããã¦ããããã<code>echo "${data}" | base64 --decode</code> ã®ããã«ãã¦ãã³ã¼ãããã¨ãå
容ã確èªã§ãã¾ãã</p>
<p>ã¡ãã»ã¼ã¸æ¬æã¯ã以ä¸ã®ãããªå½¢å¼ã§ãããã¨ããããã¾ããã</p>
<pre class="code" data-lang="" data-unlink>[
{
"ackId": "UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRsGCBQFfH1wU1x1XVx0aFENGXJ9YHxpW0VQAEVWe1lRGwdoTm11H7aF5ftLQ1RrWBYHBEBae19TGQhoXFp3D3nlneOW2-TYfQk9OqLbgtZtO-vw5OtHZiM9XxJLLD5-MSpFQV5AEkw6H0RJUytDCypYEU4EISE-MD5FU0Q",
"message": {
"data": "YW5vdGhlciAxc3QgZmllbGQ=",
"messageId": "12566595082500628",
"publishTime": "2024-11-12T09:08:52.185Z"
}
},
{
"ackId": "UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRsGCBQFfH1wU1x1XVx0aFENGXJ9YHxpW0VQAEVWe1lRGgdoTm11H7aF5ftLQ1RrWBYHBEBae19TGQhoXFp3DnnlneOW2-TYfQk9OqLbgtZtO-vw5OtHZiM9XxJLLD5-MSpFQV5AEkw6H0RJUytDCypYEU4EISE-MD5FU0Q",
"message": {
"data": "YW5vdGhlciAybmQgZmllbGQ=",
"messageId": "12566595082500629",
"publishTime": "2024-11-12T09:08:52.185Z"
}
},
{
"ackId": "UAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRsGCBQFfH1wU1x1XVx0aFENGXJ9YHxpW0VQAEVWe1lRGQdoTm11H7aF5ftLQ1RrWBYHBEBae19TGQhoXFp2B3nlneOW2-TYfQk9OqLbgtZtO-vw5OtHZiM9XxJLLD5-MSpFQV5AEkw6H0RJUytDCypYEU4EISE-MD5FU0Q",
"message": {
"data": "IGFub3RoZXIgM3JkIGZpZWxk",
"messageId": "12566595082500630",
"publishTime": "2024-11-12T09:08:52.185Z"
}
}
]</pre>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura
DNSã¨ã³ããã¤ã³ãã使ç¨ãã¦GitHub ActionsããGKEã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ãã
hatenablog://entry/6802418398303767958
2024-11-15T09:30:00+09:00
2024-12-15T21:06:57+09:00 G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãGitHub Actions 㧠GKE ã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ããéã«ãDNS ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³ã解説ãã¾ãã DNS ã¨ã³ããã¤ã³ãã¨ã¯ GitHub Actions ã使ç¨ãã GKE ã¸ã®ããã㤠å¾æ¥ã®æ¹æ³ DNS ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³ï¼å½è¨äºã§è§£èª¬ï¼ DNS ã¨ã³ããã¤ã³ãã使ç¨ãã GKE ã¯ã©ã¹ã¿ã®ä½æ ã·ã§ã«å¤æ°ã®è¨å® ãããã¯ã¼ã¯ãªã½ã¼ã¹ã®ä½æ GKE ã¯ã©ã¹ã¿ã®ä½æ Direct Workload Identity ã®æ§æ ã·ã§ã«å¤æ°ã®è¨å® Workload Identity ã®è¨å® GitHub Actioâ¦
<p>G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãGitHub Actions 㧠GKE ã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ããéã«ã<strong>DNS ã¨ã³ããã¤ã³ã</strong>ã使ç¨ããæ¹æ³ã解説ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#DNS-ã¨ã³ããã¤ã³ãã¨ã¯">DNS ã¨ã³ããã¤ã³ãã¨ã¯</a></li>
<li><a href="#GitHub-Actions-ã使ç¨ãã-GKE-ã¸ã®ãããã¤">GitHub Actions ã使ç¨ãã GKE ã¸ã®ãããã¤</a><ul>
<li><a href="#å¾æ¥ã®æ¹æ³">å¾æ¥ã®æ¹æ³</a></li>
<li><a href="#DNS-ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³å½è¨äºã§è§£èª¬">DNS ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³ï¼å½è¨äºã§è§£èª¬ï¼</a></li>
</ul>
</li>
<li><a href="#DNS-ã¨ã³ããã¤ã³ãã使ç¨ãã-GKE-ã¯ã©ã¹ã¿ã®ä½æ">DNS ã¨ã³ããã¤ã³ãã使ç¨ãã GKE ã¯ã©ã¹ã¿ã®ä½æ</a><ul>
<li><a href="#ã·ã§ã«å¤æ°ã®è¨å®">ã·ã§ã«å¤æ°ã®è¨å®</a></li>
<li><a href="#ãããã¯ã¼ã¯ãªã½ã¼ã¹ã®ä½æ">ãããã¯ã¼ã¯ãªã½ã¼ã¹ã®ä½æ</a></li>
<li><a href="#GKE-ã¯ã©ã¹ã¿ã®ä½æ">GKE ã¯ã©ã¹ã¿ã®ä½æ</a></li>
</ul>
</li>
<li><a href="#Direct-Workload-Identity-ã®æ§æ">Direct Workload Identity ã®æ§æ</a><ul>
<li><a href="#ã·ã§ã«å¤æ°ã®è¨å®-1">ã·ã§ã«å¤æ°ã®è¨å®</a></li>
<li><a href="#Workload-Identity-ã®è¨å®">Workload Identity ã®è¨å®</a></li>
</ul>
</li>
<li><a href="#GitHub-Actions-ã«ãããªã½ã¼ã¹ã®ãããã¤">GitHub Actions ã«ãããªã½ã¼ã¹ã®ãããã¤</a><ul>
<li><a href="#GitHub-ãªãã¸ããªã®ãã£ã¬ã¯ããªæ§æ">GitHub ãªãã¸ããªã®ãã£ã¬ã¯ããªæ§æ</a></li>
<li><a href="#使ç¨ãããã¡ã¤ã«">使ç¨ãããã¡ã¤ã«</a><ul>
<li><a href="#GitHub-Actions-ã¯ã¼ã¯ããã¼">GitHub Actions ã¯ã¼ã¯ããã¼</a></li>
<li><a href="#Kubernetes-ãããã§ã¹ããã¡ã¤ã«">Kubernetes ãããã§ã¹ããã¡ã¤ã«</a></li>
</ul>
</li>
<li><a href="#GitHub-Actions-ã®å®è¡">GitHub Actions ã®å®è¡</a></li>
<li><a href="#ä¿®æ£ãããããã§ã¹ããã¡ã¤ã«ã®åæ ">ä¿®æ£ãããããã§ã¹ããã¡ã¤ã«ã®åæ </a><ul>
<li><a href="#ãããã§ã¹ããã¡ã¤ã«ã®ä¿®æ£">ãããã§ã¹ããã¡ã¤ã«ã®ä¿®æ£</a></li>
<li><a href="#GitHub-Actions-ã®åå®è¡">GitHub Actions ã®åå®è¡</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241115/20241115093015.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="DNS-ã¨ã³ããã¤ã³ãã¨ã¯">DNS ã¨ã³ããã¤ã³ãã¨ã¯</h1>
<p><strong>DNS ã¨ã³ããã¤ã³ã</strong>ã¨ã¯ãGKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ããæ¹æ³ã¨ãã¦å¾æ¥ãããµãã¼ãããã¦ãã IP ã¢ãã¬ã¹ãã¼ã¹ã®ã¢ã¯ã»ã¹å
å¶å¾¡ã§ã¯ãªããDNS ãã¼ã¹ã®ã¢ã¯ã»ã¹å
å¶å¾¡ãæä¾ããæ©è½ã§ãã</p>
<p>DNS ã¨ã³ããã¤ã³ããæå¹åããã¦ããå ´åããã¨ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«ãããªã㯠IP ã¢ãã¬ã¹ãå²ãå½ã¦ããã¦ããªãã¦ããIAM ã§è¨±å¯ããã¦ããã¦ã¼ã¶ã¼ã¯ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="DNSã¨ã³ããã¤ã³ãã使ç¨ãã¦ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215210658.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>DNSã¨ã³ããã¤ã³ãã使ç¨ãã¦ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</figcaption></figure></p>
<p>DNS ã¨ã³ããã¤ã³ãã®è©³ç´°ãããã³ IP ã¢ãã¬ã¹ãã¼ã¹ã®ã¨ã³ããã¤ã³ãã¨ã®æ¯è¼ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºããä¸èªãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fdns-based-endpoint-for-gke-control-plane" title="DNSãã¼ã¹ã®ã¨ã³ããã¤ã³ãã使ç¨ãã¦GKEã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/dns-based-endpoint-for-gke-control-plane">blog.g-gen.co.jp</a></cite></p>
<h1 id="GitHub-Actions-ã使ç¨ãã-GKE-ã¸ã®ãããã¤">GitHub Actions ã使ç¨ãã GKE ã¸ã®ãããã¤</h1>
<h2 id="å¾æ¥ã®æ¹æ³">å¾æ¥ã®æ¹æ³</h2>
<p>DNS ã¨ã³ããã¤ã³ãããªãªã¼ã¹ãããåã¯ãã³ã³ããã¼ã«ãã¬ã¼ã³ã®ãããªãã¯ã¨ã³ããã¤ã³ããç¡å¹åãã¦ããå ´åãGitHub Actions ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«ç´æ¥æ¥ç¶ãããã¨ã¯ã§ãã¾ããã§ããã</p>
<p>ãã®ããããã©ã¤ãã¼ãã¨ã³ããã¤ã³ãçµç±ã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«å°éã§ãã GKE ãã¼ãå´ã® VPC å
ã« GitHub Actions ã® <a href="https://docs.github.com/ja/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners">Self-Hosted Runner</a> ãæ§æããRunner ä¸ã§ã¯ã¼ã¯ããã¼ãå®è¡ããæ¹æ³ãªã©ãç¨ãããã¾ãã</p>
<p>Self-Hosted Runner 㯠Compute Engine ä»®æ³ãã·ã³ã GKE ã¯ã©ã¹ã¿å
ã® Pod ã§å®è¡ãããã¨ã«ãªããããGitHub Actions ã§ãããã¤ãã¤ãã©ã¤ã³ãæ§ç¯ãããå ´åããããã®ãªã½ã¼ã¹ã®éç¨ç®¡çãèæ
®ãã¦ããå¿
è¦ãããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="Self-Hosted Runnerã使ç¨ãã¦ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãçµç±ã§ãããã¤ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215210701.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Self-Hosted Runnerã使ç¨ãã¦ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãçµç±ã§ãããã¤ãã</figcaption></figure></p>
<h2 id="DNS-ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³å½è¨äºã§è§£èª¬">DNS ã¨ã³ããã¤ã³ãã使ç¨ããæ¹æ³ï¼å½è¨äºã§è§£èª¬ï¼</h2>
<p>DNS ã¨ã³ããã¤ã³ãã使ç¨ããå ´åãGitHub Actions ã¯ã¼ã¯ããã¼ãã Google Cloud API ã«ã¢ã¯ã»ã¹ãããã¨ãã§ããã°ããããªã㯠IP ã¢ãã¬ã¹ãæããªãã³ã³ããã¼ã«ãã¬ã¼ã³ã§ãã£ã¦ãç´æ¥æ¥ç¶ãããã¨ãã§ãã¾ãã</p>
<p>ãããã£ã¦ãSelf-Hosted Runner ã®éç¨ãèãããã¨ãªããã·ã³ãã«ãªãã¤ãã©ã¤ã³æ§æ㧠GKE ã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="DNSã¨ã³ããã¤ã³ãçµç±ã§ãããã¤ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215210706.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>DNSã¨ã³ããã¤ã³ãçµç±ã§ãããã¤ãã</figcaption></figure></p>
<p>GitHub Actions ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ããéã® IAM èªè¨¼ã«ã¤ãã¦ã¯ <strong>Workload Identity</strong> ã使ç¨ãã¾ãã</p>
<p>Workload Identity ã§ã¯ Google Cloud ããã¸ã§ã¯ãã« GitHub ãªãã¸ããªã <strong>ãããã¤ã</strong> ã¨ãã¦ç»é²ãããããã¤ãã«å¯¾ã㦠IAM 権éãç´ä»ãããã¨ã§ Google Cloud ãªã½ã¼ã¹ã¸ã®ã¢ã¯ã»ã¹æ¨©ãä¸ãããã¨ãã§ãã¾ãã</p>
<p>Workload Identity é£æºã®è©³ç´°ã«ã¤ãã¦ã¯ã以ä¸ã®ããã¥ã¡ã³ãããä¸èªãã ããã</p>
<ul>
<li>åè1 : <a href="https://cloud.google.com/iam/docs/workload-identity-federation">Workload Identity Federation</a></li>
<li>åè2 : <a href="https://cloud.google.com/iam/docs/workload-identity-federation-with-deployment-pipelines#github-actions">Configure Workload Identity Federation with deployment pipelines</a></li>
</ul>
<p>å½è¨äºã§ã¯ Workload Identity ã®æ¹å¼ã®ã²ã¨ã¤ã§ãã <a href="https://github.com/google-github-actions/auth?tab=readme-ov-file#preferred-direct-workload-identity-federation">Direct Workload Identity</a> ã使ç¨ãããã¨ã§ãIAM ãµã¼ãã¹ã¢ã«ã¦ã³ãã®æ
å ±ã GitHub Actions ã¯ã¼ã¯ããã¼å´ã«æ¸¡ããã¨ãªãããããã¤ãã«å¯¾ãã¦ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ããããã® IAM 権éãç´æ¥ä»ä¸ãã¾ãã</p>
<h1 id="DNS-ã¨ã³ããã¤ã³ãã使ç¨ãã-GKE-ã¯ã©ã¹ã¿ã®ä½æ">DNS ã¨ã³ããã¤ã³ãã使ç¨ãã GKE ã¯ã©ã¹ã¿ã®ä½æ</h1>
<h2 id="ã·ã§ã«å¤æ°ã®è¨å®">ã·ã§ã«å¤æ°ã®è¨å®</h2>
<p>ã¾ã㯠GitHub Actions ã®ãããã¤å
ã¨ãªã GKE ã¯ã©ã¹ã¿ãä½æãã¾ãã</p>
<p>å½è¨äºã§ã¯ gcloud CLI ã使ç¨ãã¦ãªã½ã¼ã¹ãä½æãã¦ããã¾ãããªã½ã¼ã¹ä½ææã«ä½åº¦ã使ç¨ããå¤ãã·ã§ã«å¤æ°ã¨ãã¦è¨å®ãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synIdentifier">PROJECT_ID</span>=<span class="synSpecial">{</span>ããã¸ã§ã¯ãID<span class="synSpecial">}</span> <span class="synComment"># ex: gha-demo-prj</span>
<span class="synIdentifier">LOCATION</span>=<span class="synSpecial">{</span>GKEãä½æãããã±ã¼ã·ã§ã³<span class="synSpecial">}</span> <span class="synComment"># ex: asia-northeast1</span>
<span class="synIdentifier">CLUSTER_NAME</span>=<span class="synSpecial">{</span>ä»»æã®GKEã¯ã©ã¹ã¿ã®åå<span class="synSpecial">}</span> <span class="synComment"># ex: mycluster</span>
</pre>
<h2 id="ãããã¯ã¼ã¯ãªã½ã¼ã¹ã®ä½æ">ãããã¯ã¼ã¯ãªã½ã¼ã¹ã®ä½æ</h2>
<p>GKE ã¯ã©ã¹ã¿ãé
ç½®ãã VPC ã¨ãµãããããä½æãã¦ããã¾ãã</p>
<p>以ä¸ã®ã³ãã³ã㧠VPC ãä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># VPC ãä½æãã</span>
$ gcloud compute networks create vpc-<span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--subnet-mode</span><span class="synStatement">=</span>custom
</pre>
<p>ä½æãã VPC ã®ä¸ã«ãµãããããä½æãã¾ããå½è¨äºã§ã¯ãµããããã® IP ç¯å²ã¨ã㦠<code>192.168.11.0/24</code> ãè¨å®ãã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ãµãããããä½æãã</span>
$ gcloud compute networks subnets create subnet-<span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--network</span><span class="synStatement">=</span>vpc-<span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--region</span><span class="synStatement">=</span><span class="synPreProc">${LOCATION}</span> <span class="synStatement">\</span>
<span class="synSpecial">--range</span><span class="synStatement">=</span><span class="synConstant">192</span>.<span class="synConstant">168</span>.<span class="synConstant">11</span>.<span class="synConstant">0</span>/<span class="synConstant">24</span>
</pre>
<h2 id="GKE-ã¯ã©ã¹ã¿ã®ä½æ">GKE ã¯ã©ã¹ã¿ã®ä½æ</h2>
<p><code>--enable-dns-access</code> ãã©ã°ã使ç¨ããDNS ã¨ã³ããã¤ã³ããæå¹åãã GKE ã¯ã©ã¹ã¿ãä½æãã¾ãã</p>
<p>以ä¸ã®ã³ãã³ãã§ãDNS ã¨ã³ããã¤ã³ããæå¹åãã Autopilot ã¢ã¼ãã® GKE ã¯ã©ã¹ã¿ãä½æãã¾ãã<code>--no-enable-ip-access</code> ãã©ã°ã使ç¨ãããã¨ã§ IP ã¢ãã¬ã¹ãã¼ã¹ã®æ¥ç¶ãç¡å¹åãã¾ããããã§ãGoogle Cloud API ã«ã¢ã¯ã»ã¹ã§ããã㤠IAM 権éãæã¤ã¦ã¼ã¶ã¼ã®ã¿ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããã¨ãã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># DNS ã¨ã³ããã¤ã³ããæå¹åãã Autopilot ã¯ã©ã¹ã¿ãä½æããï¼10åã»ã©ãããã®ã§æ³¨æï¼</span>
$ gcloud container clusters create-auto <span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--network</span><span class="synStatement">=</span>vpc-<span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--subnetwork</span><span class="synStatement">=</span>subnet-<span class="synPreProc">${CLUSTER_NAME}</span> <span class="synStatement">\</span>
<span class="synSpecial">--enable-private-nodes</span> <span class="synStatement">\</span>
<span class="synSpecial">--enable-dns-access</span> <span class="synStatement">\</span>
<span class="synSpecial">--no-enable-ip-access</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="IPã¢ãã¬ã¹ãã¼ã¹ã®æ¥ç¶ãç¡å¹åããDNSã¨ã³ããã¤ã³ãã®ã¿æå¹ã«ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241115/20241115093019.png" width="800" height="175" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>IPã¢ãã¬ã¹ãã¼ã¹ã®æ¥ç¶ãç¡å¹åããDNSã¨ã³ããã¤ã³ãã®ã¿æå¹ã«ãã</figcaption></figure></p>
<h1 id="Direct-Workload-Identity-ã®æ§æ">Direct Workload Identity ã®æ§æ</h1>
<h2 id="ã·ã§ã«å¤æ°ã®è¨å®-1">ã·ã§ã«å¤æ°ã®è¨å®</h2>
<p>ããããã¯ãGitHub Actions ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ããéã«èªè¨¼ãè¡ãããã® Workload Identity ã®è¨å®ãè¡ã£ã¦ããã¾ãã</p>
<p>ã¾ãã¯ãç¹°ãè¿ã使ç¨ããå¤ãã·ã§ã«å¤æ°ã¨ãã¦è¨å®ãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synIdentifier">PROJECT_ID</span>=<span class="synSpecial">{</span>ããã¸ã§ã¯ãID<span class="synSpecial">}</span> <span class="synComment"># ex: gha-demo-prj </span>
<span class="synIdentifier">PROJECT_NUMBER</span>=<span class="synSpecial">{</span>ããã¸ã§ã¯ãçªå·<span class="synSpecial">}</span> <span class="synComment"># ex: 1234567890</span>
<span class="synIdentifier">WORKLOAD_IDENTITY_POOL</span>=<span class="synSpecial">{</span>ä»»æã®Workload Identityãã¼ã«å<span class="synSpecial">}</span> <span class="synComment"># ex: my-gha-pool</span>
<span class="synIdentifier">WORKLOAD_IDENTITY_PROVIDER</span>=<span class="synSpecial">{</span>ä»»æã®Workload Identityãããã¤ãå<span class="synSpecial">}</span> <span class="synComment"># ex: my-gha-provider</span>
<span class="synIdentifier">GITHUB_REPO</span>=<span class="synSpecial">{</span>GitHubãªãã¸ããªå<span class="synSpecial">}</span> <span class="synComment"># ex: my-org/my-repo</span>
</pre>
<h2 id="Workload-Identity-ã®è¨å®">Workload Identity ã®è¨å®</h2>
<p>以ä¸ã®ã³ãã³ã㧠Workload Identity ãã¼ã«ãä½æãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Workload Identity ãã¼ã«ã®ä½æ</span>
$ gcloud iam workload-identity-pools create <span class="synPreProc">${WORKLOAD_IDENTITY_POOL}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--location</span><span class="synStatement">=</span>global <span class="synStatement">\</span>
<span class="synSpecial">--display-name</span><span class="synStatement">=</span><span class="synPreProc">${WORKLOAD_IDENTITY_POOL}</span>
</pre>
<p>ä½æãããã¼ã«ã«ãWorkload Identity ãããã¤ããä½æãã¾ãã</p>
<p><code>--attribute-condition</code> ãã©ã°ã§ããã® Workload Identity ã使ç¨ãã GitHub Actions ã¯ã¼ã¯ããã¼ããã GitHub ãªãã¸ããªãããã§æå®ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Workload Identity ãããã¤ãã®ä½æ</span>
$ gcloud iam workload-identity-pools providers create-oidc <span class="synPreProc">${WORKLOAD_IDENTITY_PROVIDER}</span> <span class="synStatement">\</span>
<span class="synSpecial">--project</span><span class="synStatement">=</span><span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--location</span><span class="synStatement">=</span>global <span class="synStatement">\</span>
<span class="synSpecial">--workload-identity-pool</span><span class="synStatement">=</span><span class="synPreProc">${WORKLOAD_IDENTITY_POOL}</span> <span class="synStatement">\</span>
<span class="synSpecial">--display-name</span><span class="synStatement">=</span><span class="synPreProc">${WORKLOAD_IDENTITY_PROVIDER}</span> <span class="synStatement">\</span>
<span class="synSpecial">--issuer-uri</span><span class="synStatement">="</span><span class="synConstant">https://token.actions.githubusercontent.com</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--attribute-mapping</span><span class="synStatement">="</span><span class="synConstant">google.subject=assertion.sub,attribute.actor=assertion.actor,attribute.repository=assertion.repository</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--attribute-condition</span><span class="synStatement">="</span><span class="synConstant">assertion.repository=='</span><span class="synPreProc">${GITHUB_REPO}</span><span class="synConstant">'</span><span class="synStatement">"</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="Workload Identityãã¼ã«ã¨ãããã¤ããä½æãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241115/20241115093022.png" width="800" height="375" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identityãã¼ã«ã¨ãããã¤ããä½æãã</figcaption></figure></p>
<p>æå¾ã«ãWorkload Identity ãããã¤ãã«å¯¾ã㦠GKE ã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ããããã®æ¨©éï¼<code>roles/container.developer</code>ï¼ãä»ä¸ãã¾ãã</p>
<p>ããã«ãããGitHub Actions ã¯ã¼ã¯ããã¼ã DNS ã¨ã³ããã¤ã³ãï¼Google Cloud API ã®èªè¨¼ï¼ãéã㦠GKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããã¨ãã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Workload Identity ãããã¤ãã«æ¨©éãä»ä¸ãã</span>
$ gcloud projects add-iam-policy-binding <span class="synPreProc">${PROJECT_ID}</span> <span class="synStatement">\</span>
<span class="synSpecial">--member</span><span class="synStatement">="</span><span class="synConstant">principalSet://iam.googleapis.com/projects/</span><span class="synPreProc">${PROJECT_NUMBER}</span><span class="synConstant">/locations/global/workloadIdentityPools/</span><span class="synPreProc">${WORKLOAD_IDENTITY_POOL}</span><span class="synConstant">/attribute.repository/</span><span class="synPreProc">${GITHUB_REPO}</span><span class="synStatement">"</span> <span class="synStatement">\</span>
<span class="synSpecial">--role</span><span class="synStatement">="</span><span class="synConstant">roles/container.developer</span><span class="synStatement">"</span>
</pre>
<p><figure class="figure-image figure-image-fotolife" title="Workload Identityãããã¤ãã«GKEã¯ã©ã¹ã¿ã®ã¢ã¯ã»ã¹æ¨©ãä»ä¸ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241115/20241115093026.png" width="800" height="150" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>Workload Identityãããã¤ãã«GKEã¯ã©ã¹ã¿ã®ã¢ã¯ã»ã¹æ¨©ãä»ä¸ãã</figcaption></figure></p>
<h1 id="GitHub-Actions-ã«ãããªã½ã¼ã¹ã®ãããã¤">GitHub Actions ã«ãããªã½ã¼ã¹ã®ãããã¤</h1>
<h2 id="GitHub-ãªãã¸ããªã®ãã£ã¬ã¯ããªæ§æ">GitHub ãªãã¸ããªã®ãã£ã¬ã¯ããªæ§æ</h2>
<p>Workload Identity ãããã¤ãã®ä½ææã«æå®ãã GitHub ãªãã¸ããªã«ãGitHub Actions ã®ã¯ã¼ã¯ããã¼ã¨ãGKE ã¯ã©ã¹ã¿ã«ãããã¤ãã Kubernetes ãªã½ã¼ã¹ã®ãããã§ã¹ããã¡ã¤ã«ãé
ç½®ãã¾ãã</p>
<p>ãªãã¸ããªå
ã®ãã£ã¬ã¯ããªæ§æã¯ä»¥ä¸ã®ããã«ãã¦é²ãã¦ããã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink>.
âââ .github
â âââ workflows
â âââ demo-actions.yaml <span class="synComment"># GitHub Actions ã¯ã¼ã¯ããã¼</span>
âââ manifests
âââ sample-deployment.yaml <span class="synComment"># Kubernetes ãªã½ã¼ã¹ï¼deploymentï¼ã®ãããã§ã¹ããã¡ã¤ã«</span>
</pre>
<h2 id="使ç¨ãããã¡ã¤ã«">使ç¨ãããã¡ã¤ã«</h2>
<h3 id="GitHub-Actions-ã¯ã¼ã¯ããã¼">GitHub Actions ã¯ã¼ã¯ããã¼</h3>
<p>Workload Identity ã使ç¨ã㦠GKE ã¯ã©ã¹ã¿ã«ãªã½ã¼ã¹ããããã¤ãã GitHub Actions ã¯ã¼ã¯ããã¼ãä½æãã¾ãã</p>
<p>ã¯ã¼ã¯ããã¼ãã¡ã¤ã«å
ã®ä»¥ä¸ã®ç®æããå®éã®å¤ã«ç½®ãæãã¦ãã ããã</p>
<table>
<thead>
<tr>
<th> è¡ </th>
<th> ç½®ãæããç®æ </th>
<th> å¤ </th>
</tr>
</thead>
<tbody>
<tr>
<td> 14è¡ç® </td>
<td> {ããã¸ã§ã¯ãID} </td>
<td> GKE ã¯ã©ã¹ã¿ãä½æããããã¸ã§ã¯ãã® ID </td>
</tr>
<tr>
<td> 15è¡ç® </td>
<td> {ããã¸ã§ã¯ãçªå·} </td>
<td> GKE ã¯ã©ã¹ã¿ãä½æããããã¸ã§ã¯ãã®ããã¸ã§ã¯ãçªå· </td>
</tr>
<tr>
<td> 16è¡ç® </td>
<td> {GKEã¯ã©ã¹ã¿å} </td>
<td> GKE ã¯ã©ã¹ã¿ã®åå </td>
</tr>
<tr>
<td> 17è¡ç® </td>
<td> {GKEã¯ã©ã¹ã¿ã®ãã±ã¼ã·ã§ã³} </td>
<td> GKE ã¯ã©ã¹ã¿ãä½æãããã±ã¼ã·ã§ã³ </td>
</tr>
<tr>
<td> 18è¡ç® </td>
<td> {Workload Identityãã¼ã«å} </td>
<td> Workload Idenity ãã¼ã«ã®åå </td>
</tr>
<tr>
<td> 19è¡ç® </td>
<td> {Workload Identityãããã¤ãå} </td>
<td> Workload Identity ãããã¤ãã®åå </td>
</tr>
</tbody>
</table>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synComment"># demo-actions.yaml</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> apply k8s manifest to GKE
<span class="synComment"># main ãã©ã³ãã¸ã® Pull Request / Push ã§å®è¡</span>
<span class="synIdentifier">on</span><span class="synSpecial">:</span>
<span class="synIdentifier">pull_request</span><span class="synSpecial">:</span>
<span class="synIdentifier">branches</span><span class="synSpecial">:</span>
<span class="synStatement">- </span>main
<span class="synIdentifier">push</span><span class="synSpecial">:</span>
<span class="synIdentifier">branches</span><span class="synSpecial">:</span>
<span class="synStatement">- </span>main
<span class="synComment"># ç°å¢å¤æ°ã« GKE ã¯ã©ã¹ã¿ã®æ
å ±ãè¨å®</span>
<span class="synIdentifier">env</span><span class="synSpecial">:</span>
<span class="synIdentifier">PROJECT_ID</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>ããã¸ã§ã¯ãID<span class="synSpecial">}</span> <span class="synComment"> # Google Cloud ããã¸ã§ã¯ã ID</span>
<span class="synIdentifier">PROJECT_NUM</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>ããã¸ã§ã¯ãçªå·<span class="synSpecial">}</span> <span class="synComment"> # Google Cloud ããã¸ã§ã¯ãçªå·</span>
<span class="synIdentifier">GKE_CLUSTER</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>GKEã¯ã©ã¹ã¿å<span class="synSpecial">}</span> <span class="synComment"> # GKE ã¯ã©ã¹ã¿å</span>
<span class="synIdentifier">GKE_LOCATION</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>GKEã¯ã©ã¹ã¿ã®ãã±ã¼ã·ã§ã³<span class="synSpecial">}</span> <span class="synComment"> # GKE ã¯ã©ã¹ã¿ã®ãã±ã¼ã·ã§ã³</span>
<span class="synIdentifier">WID_POOL</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>Workload Identityãã¼ã«å<span class="synSpecial">}</span> <span class="synComment"> # Workload Identity ãã¼ã«å</span>
<span class="synIdentifier">WID_PROVIDER</span><span class="synSpecial">:</span> <span class="synSpecial">{</span>Workload Identityãããã¤ãå<span class="synSpecial">}</span> <span class="synComment"> # Workload Identity ãããã¤ãå</span>
<span class="synComment"># ã¸ã§ã (GitHUb runners ã§å®è¡)</span>
<span class="synIdentifier">jobs</span><span class="synSpecial">:</span>
<span class="synIdentifier">setup-apply</span><span class="synSpecial">:</span>
<span class="synIdentifier">runs-on</span><span class="synSpecial">:</span> ubuntu-latest
<span class="synIdentifier">permissions</span><span class="synSpecial">:</span>
<span class="synIdentifier">id-token</span><span class="synSpecial">:</span> write
<span class="synIdentifier">contents</span><span class="synSpecial">:</span> read
<span class="synIdentifier">pull-requests</span><span class="synSpecial">:</span> write
<span class="synIdentifier">steps</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> checkout
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Checkout
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> actions/checkout@v4
<span class="synComment"> # Workload Identity é£æº</span>
<span class="synComment"> # https://cloud.google.com/iam/docs/using-workload-identity-federation#generate-automatic</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> auth
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Authenticate to Google Cloud
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> google-github-actions/auth@v2
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">workload_identity_provider</span><span class="synSpecial">:</span> <span class="synConstant">'projects/${{ env.PROJECT_NUM }}/locations/global/workloadIdentityPools/${{ env.WID_POOL }}/providers/${{ env.WID_PROVIDER }}'</span> <span class="synComment"> # Workload Identity Pool ã®ãããã¤ãã¼</span>
<span class="synComment"> # https://github.com/google-github-actions/setup-gcloud</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> setup-gcloud
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Setup gcloud
<span class="synIdentifier">uses</span><span class="synSpecial">:</span> google-github-actions/setup-gcloud@v2
<span class="synIdentifier">with</span><span class="synSpecial">:</span>
<span class="synIdentifier">project_id</span><span class="synSpecial">:</span> ${{ env.PROJECT_ID }}
<span class="synComment"> # GKE ã®èªè¨¼ãã©ã°ã¤ã³</span>
<span class="synComment"> # https://cloud.google.com/kubernetes-engine/docs/deprecations/auth-plugin?hl=ja</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> install-gke-gcloud-auth-plugin
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Install gke-gcloud-auth-plugin
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
gcloud components install gke-gcloud-auth-plugin
<span class="synComment"> # GKE ã¯ã©ã¹ã¿ã®èªè¨¼æ
å ±ãåå¾ (DNS ã¨ã³ããã¤ã³ãã使ç¨)</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> get-gke-credentials
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Get GKE credentials
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
gcloud container clusters get-credentials ${{ env.GKE_CLUSTER }} --region ${{ env.GKE_LOCATION }} --dns-endpoint
<span class="synComment"> # ãããã§ã¹ããã¡ã¤ã«ã®é©ç¨</span>
<span class="synStatement">- </span><span class="synIdentifier">id</span><span class="synSpecial">:</span> apply
<span class="synIdentifier">name</span><span class="synSpecial">:</span> Apply
<span class="synIdentifier">run</span><span class="synSpecial">:</span> |
kubectl apply -f ./manifests
</pre>
<h3 id="Kubernetes-ãããã§ã¹ããã¡ã¤ã«">Kubernetes ãããã§ã¹ããã¡ã¤ã«</h3>
<p>GKE ã¯ã©ã¹ã¿ã«ãããã¤ãããªã½ã¼ã¹ã®ãããã§ã¹ããã¡ã¤ã«ãä½æãã¾ãã</p>
<p>å½è¨äºã§ã¯ãnginx ã³ã³ãããå®è¡ãã Pod ã3ã¤ä½æãã Deployment ãªã½ã¼ã¹ãä½æãã¾ãã</p>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synComment"># sample-deployment.yaml</span>
<span class="synIdentifier">apiVersion</span><span class="synSpecial">:</span> apps/v1
<span class="synIdentifier">kind</span><span class="synSpecial">:</span> Deployment
<span class="synIdentifier">metadata</span><span class="synSpecial">:</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> sample-deployment
<span class="synIdentifier">spec</span><span class="synSpecial">:</span>
<span class="synIdentifier">replicas</span><span class="synSpecial">:</span> <span class="synConstant">3</span>
<span class="synIdentifier">selector</span><span class="synSpecial">:</span>
<span class="synIdentifier">matchLabels</span><span class="synSpecial">:</span>
<span class="synIdentifier">app</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">template</span><span class="synSpecial">:</span>
<span class="synIdentifier">metadata</span><span class="synSpecial">:</span>
<span class="synIdentifier">labels</span><span class="synSpecial">:</span>
<span class="synIdentifier">app</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">spec</span><span class="synSpecial">:</span>
<span class="synIdentifier">containers</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">image</span><span class="synSpecial">:</span> nginx:1.27
</pre>
<h2 id="GitHub-Actions-ã®å®è¡">GitHub Actions ã®å®è¡</h2>
<p>ä½æããã¯ã¼ã¯ããã¼ãã¡ã¤ã«ã¨ãããã§ã¹ããã¡ã¤ã«ããªã¢ã¼ããªãã¸ããªã« push ããGitHub Actions ã¯ã¼ã¯ããã¼ãå®è¡ãã¾ãã</p>
<p>ã¯ã¼ã¯ããã¼ãå®è¡ãããGitHub Actions ãã GKE ã¯ã©ã¹ã¿ã«å¯¾ãã¦ãããã§ã¹ããã¡ã¤ã«ãé©ç¨ããã¾ããDeployment ãªã½ã¼ã¹ãä½æããã¦ãããã¨ã GitHub Actions ã®ãã°ãããããã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="GitHub Actionsã¯ã¼ã¯ããã¼ãã GKE ã¯ã©ã¹ã¿ã¸ã®ãããã¤ãæåãã¦ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241115/20241115093029.png" width="800" height="303" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>GitHub Actionsã¯ã¼ã¯ããã¼ãã GKE ã¯ã©ã¹ã¿ã¸ã®ãããã¤ãæåãã¦ãã</figcaption></figure></p>
<p>ãã¼ã«ã«ãã GKE ã¯ã©ã¹ã¿ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããããã¤ãããªã½ã¼ã¹ã®ç¶æ
ã確èªãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># DNS ã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</span>
$ gcloud container clusters get-credentials <span class="synPreProc">${CLUSTER_NAME}</span> <span class="synSpecial">--dns-endpoint</span>
<span class="synComment"># Deployment ãªã½ã¼ã¹ã表示</span>
$ kubectl get deployments
</pre>
<p>ãããã§ã¹ããã¡ã¤ã«ã®è¨è¿°éãã3ã¤ã® Pod ãå®è¡ãã Deployment ãªã½ã¼ã¹ãä½æããã¦ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Deployment ãªã½ã¼ã¹ã表示ï¼åºåä¾ï¼</span>
$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
sample-deployment <span class="synConstant">3</span>/<span class="synConstant">3</span> <span class="synConstant">3</span> <span class="synConstant">3</span> 2m7s
</pre>
<h2 id="ä¿®æ£ãããããã§ã¹ããã¡ã¤ã«ã®åæ ">ä¿®æ£ãããããã§ã¹ããã¡ã¤ã«ã®åæ </h2>
<h3 id="ãããã§ã¹ããã¡ã¤ã«ã®ä¿®æ£">ãããã§ã¹ããã¡ã¤ã«ã®ä¿®æ£</h3>
<p>ãããã§ã¹ããã¡ã¤ã«ãä¿®æ£ãã¦ãããªã¢ã¼ããªãã¸ããªã« push ããGitHub Actions ã¯ã¼ã¯ããã¼ã«ãããããã¤ãå度è¡ãã¾ãã</p>
<p>ãããã§ã¹ããã¡ã¤ã«å
ã® <code>spec.replicas</code> ã®å¤ã <code>1</code> ã«ãã¦ãPod æ°ãã¹ã±ã¼ã«ã¤ã³ããããã«ä¿®æ£ãã¾ãã</p>
<pre class="code lang-yaml" data-lang="yaml" data-unlink><span class="synComment"># sample-deployment.yaml</span>
<span class="synIdentifier">apiVersion</span><span class="synSpecial">:</span> apps/v1
<span class="synIdentifier">kind</span><span class="synSpecial">:</span> Deployment
<span class="synIdentifier">metadata</span><span class="synSpecial">:</span>
<span class="synIdentifier">name</span><span class="synSpecial">:</span> sample-deployment
<span class="synIdentifier">spec</span><span class="synSpecial">:</span>
<span class="synIdentifier">replicas</span><span class="synSpecial">:</span> <span class="synConstant">1</span> <span class="synComment"> # ãããä¿®æ£ãã</span>
<span class="synIdentifier">selector</span><span class="synSpecial">:</span>
<span class="synIdentifier">matchLabels</span><span class="synSpecial">:</span>
<span class="synIdentifier">app</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">template</span><span class="synSpecial">:</span>
<span class="synIdentifier">metadata</span><span class="synSpecial">:</span>
<span class="synIdentifier">labels</span><span class="synSpecial">:</span>
<span class="synIdentifier">app</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">spec</span><span class="synSpecial">:</span>
<span class="synIdentifier">containers</span><span class="synSpecial">:</span>
<span class="synStatement">- </span><span class="synIdentifier">name</span><span class="synSpecial">:</span> sample-app
<span class="synIdentifier">image</span><span class="synSpecial">:</span> nginx:1.27
</pre>
<h3 id="GitHub-Actions-ã®åå®è¡">GitHub Actions ã®åå®è¡</h3>
<p>å度ããªã¢ã¼ããªãã¸ããªã¸ã® push ãè¡ããGitHub Actions ã¯ã¼ã¯ããã¼ãå®è¡ãã¾ãã</p>
<p>ã¯ã¼ã¯ããã¼ã®å®è¡å¾ãDeployment ã®ç¶æ
ã確èªãã¾ããpush ãããããã§ã¹ããã¡ã¤ã«ã GitHub Actions ããé©ç¨ãããPod ã®æ°ã1ã«ãªãã¾ããã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># Deployment ãªã½ã¼ã¹ã確èªï¼åºåä¾ï¼</span>
$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
sample-deployment <span class="synConstant">1</span>/<span class="synConstant">1</span> <span class="synConstant">1</span> <span class="synConstant">1</span> 7m5s
</pre>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
DNSãã¼ã¹ã®ã¨ã³ããã¤ã³ãã使ç¨ãã¦GKEã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã
hatenablog://entry/6802418398303482130
2024-11-13T09:00:00+09:00
2024-12-15T21:02:21+09:00 G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãGKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ããããã®æ°ããæ¹æ³ã¨ãã¦ãDNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ãï¼DNS ã¨ã³ããã¤ã³ãï¼ãç´¹ä»ãã¾ãã ã¯ããã« GKE ã«ãããã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³ å¾æ¥ã®æ¹æ³ ãããªãã¯ã¨ã³ããã¤ã³ã ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã DNS ã¨ã³ããã¤ã³ã IP ãã¼ã¹ã¨ DNS ãã¼ã¹ã®æ¯è¼ 使ç¨æ¹æ³ DNS ã¨ã³ããã¤ã³ãã®æå¹å ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹ IP ã¢ãã¬ã¹ã使ç¨ããæ¥ç¶ã®ç¡å¹å ã¯ããã« Google Cloudï¼æ§ç§° GCPï¼ã®ãã«ããã¼ã¸ããªã³ã³ãããªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ãµã¼ãã¹ã§ãã Goâ¦
<p>G-gen ã®ä½ã
æ¨ã§ããå½è¨äºã§ã¯ãGKE ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ããããã®æ°ããæ¹æ³ã¨ãã¦ã<strong>DNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ã</strong>ï¼DNS ã¨ã³ããã¤ã³ãï¼ãç´¹ä»ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#ã¯ããã«">ã¯ããã«</a></li>
<li><a href="#GKE-ã«ãããã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³">GKE ã«ãããã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³</a><ul>
<li><a href="#å¾æ¥ã®æ¹æ³">å¾æ¥ã®æ¹æ³</a><ul>
<li><a href="#ãããªãã¯ã¨ã³ããã¤ã³ã">ãããªãã¯ã¨ã³ããã¤ã³ã</a></li>
<li><a href="#ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã">ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã</a></li>
</ul>
</li>
<li><a href="#DNS-ã¨ã³ããã¤ã³ã">DNS ã¨ã³ããã¤ã³ã</a></li>
</ul>
</li>
<li><a href="#IP-ãã¼ã¹ã¨-DNS-ãã¼ã¹ã®æ¯è¼">IP ãã¼ã¹ã¨ DNS ãã¼ã¹ã®æ¯è¼</a></li>
<li><a href="#使ç¨æ¹æ³">使ç¨æ¹æ³</a><ul>
<li><a href="#DNS-ã¨ã³ããã¤ã³ãã®æå¹å">DNS ã¨ã³ããã¤ã³ãã®æå¹å</a></li>
<li><a href="#ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹">ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹</a></li>
<li><a href="#IP-ã¢ãã¬ã¹ã使ç¨ããæ¥ç¶ã®ç¡å¹å">IP ã¢ãã¬ã¹ã使ç¨ããæ¥ç¶ã®ç¡å¹å</a></li>
</ul>
</li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113090024.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="ã¯ããã«">ã¯ããã«</h1>
<p>Google Cloudï¼æ§ç§° GCPï¼ã®ãã«ããã¼ã¸ããªã³ã³ãããªã¼ã±ã¹ãã¬ã¼ã·ã§ã³ãµã¼ãã¹ã§ãã <strong>Google Kubernetes Engineï¼GKEï¼</strong>ã§ã¯ãKubernetes ã¯ã©ã¹ã¿ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³ãè¤æ°ç¨®é¡ããé¸æã§ãã¾ãã</p>
<p>å¾æ¥ããåå¨ãã IP ãã¼ã¹ã®ã¨ã³ããã¤ã³ãï¼IP-based endpointsï¼æ¹å¼ï¼ãããªãã¯ã¯ã©ã¹ã¿ã¨ãã©ã¤ãã¼ãã¯ã©ã¹ã¿ï¼ã«å ãã¦ã2024å¹´11æ11æ¥ã<strong>DNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ã</strong>ï¼DNS-based endpointï¼ãå©ç¨å¯è½ã«ãªãã¾ããã</p>
<p>å½è¨äºã§ã¯ãDNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ãï¼DNS ã¨ã³ããã¤ã³ãï¼ ã®æ©è½ã¨ä½¿ãæ¹ãç´¹ä»ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/blog/products/containers-kubernetes/new-dns-based-endpoint-for-the-gke-control-plane">A new flexible DNS-based approach for accessing the GKE control plane</a>ï¼Google Cloud å
¬å¼ããã°ï¼</li>
<li>åè : <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/network-isolation">About network isolation in GKE</a>ï¼Google Cloud å
¬å¼ããã¥ã¡ã³ãï¼</li>
</ul>
<h1 id="GKE-ã«ãããã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³">GKE ã«ãããã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹æ¹æ³</h1>
<h2 id="å¾æ¥ã®æ¹æ³">å¾æ¥ã®æ¹æ³</h2>
<h3 id="ãããªãã¯ã¨ã³ããã¤ã³ã">ãããªãã¯ã¨ã³ããã¤ã³ã</h3>
<p>GKE ã¯ã©ã¹ã¿ã§<strong>ãããªãã¯ã¨ã³ããã¤ã³ã</strong>ãæå¹åããå ´åãã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¯ãããªã㯠IP ã¢ãã¬ã¹ãå²ãå½ã¦ããã¾ãã</p>
<p>ãã®ç¶æ
ã§ã¯ã¤ã³ã¿ã¼ãããä¸ã®ã©ãããã§ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ã§ãã¦ãã¾ãããã<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/authorized-networks?hl=ja">æ¿èªæ¸ã¿ãããã¯ã¼ã¯</a> ã使ç¨ãã¦ã¢ã¯ã»ã¹å
IP ã¢ãã¬ã¹ãå¶éããã®ãä¸è¬çã§ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãããªãã¯ã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215205949.png" width="759" height="659" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãããªãã¯ã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</figcaption></figure></p>
<h3 id="ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã">ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã</h3>
<p>ãããªãã¯ã¨ã³ããã¤ã³ããããæ¨å¥¨ãããæ¹æ³ã¨ãã¦ãGKE ã¯ã©ã¹ã¿ã§ãããªãã¯ã¨ã³ããã¤ã³ããç¡å¹åãããã©ã¤ãã¼ã IP ã¢ãã¬ã¹ã®ã¿ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«å²ãå½ã¦ããã¨ãã§ãã¾ãï¼<strong>ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ã</strong>ï¼ã</p>
<p>ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãã使ç¨ããå ´åãã"ã³ã³ããã¼ã«ãã¬ã¼ã³ããã Google 管çã® VPC ã¨æ¥ç¶ããã¦ãã"ã¦ã¼ã¶ã¼ 管çã® VPCããçµç±ãã¦ã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ããå¿
è¦ãããã¾ãããã®ãããGKE ã¯ã©ã¹ã¿ããã VPC ã®å¤ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããå ´åãã¦ã¼ã¶ã¼ VPC ã«è¸ã¿å° VMï¼Bastion hostï¼ãèµ·åããããVPN ãçµç±ãã¦ã¢ã¯ã»ã¹ããå¿
è¦ãããã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215205953.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</figcaption></figure></p>
<h2 id="DNS-ã¨ã³ããã¤ã³ã">DNS ã¨ã³ããã¤ã³ã</h2>
<p>GKE ã¯ã©ã¹ã¿ã§ DNS ã¨ã³ããã¤ã³ããæå¹åããã¨ãGoogle Cloud API ã«ã¢ã¯ã»ã¹ã§ããä»»æã®ç°å¢ããããããªã㯠IP ã¢ãã¬ã¹ãå²ãå½ã¦ããã¦ãªãã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="DNSã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215205956.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>DNSã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</figcaption></figure></p>
<p>ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹å¯å¦ã¯ãã®ä»ã® Google Cloud API ãå©ç¨ããã¨ãã¨åæ§ã«ãIAM ããªã·ã¼ã«ãã£ã¦å¤æããã¾ããGKE ã¯ã©ã¹ã¿ã«å¯¾ã㦠<code>container.clusters.connect</code> ããªã·ã¼ãæã¤ä»¥ä¸ã®ãããªãã¼ã«ãä»ä¸ããã¦ããããªã³ã·ãã«ã§ããã°ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãã</p>
<ul>
<li><strong>Kubernetes Engine éçºè
ï¼roles/container.developerï¼</strong></li>
<li><strong>Kubernetes Engine é²è¦§è
ï¼roles/container.viewerï¼</strong> â»èªã¿åãå°ç¨</li>
</ul>
<p>DNS ã¨ã³ããã¤ã³ãã使ç¨ãããã¨ã§ãã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®æ¥ç¶ã«è¸ã¿å° VM ã使ç¨ããå¿
è¦ããªããªãã»ãã<a href="https://blog.g-gen.co.jp/entry/vpc-explained-basics#VPC-%E9%96%93%E6%8E%A5%E7%B6%9A">æ¨ç§»çãªã«ã¼ãã£ã³ã°</a>ã«ãã£ã¦ã³ã³ããã¼ã«ãã¬ã¼ã³ã«å°éã§ããªãã¨ãã£ãããããã¯ã¼ã¯æ§æä¸ã®å¶éãèæ
®ããªãã¦ããããªãã¾ãã</p>
<p>ãã¨ãã°ã以ä¸ã®ãããªæ§æã§ãã©ã¤ãã¼ãã¨ã³ããã¤ã³ãã使ç¨ããå ´åãæ¨ç§»çã«ã¼ãã£ã³ã°ã«ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«ã¢ã¯ã»ã¹ãããã¨ã¯ã§ãã¾ããã</p>
<p><figure class="figure-image figure-image-fotolife" title="æ¨ç§»çã«ã¼ãã£ã³ã°ã«ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ã§ããªãã±ã¼ã¹"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215210222.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>æ¨ç§»çã«ã¼ãã£ã³ã°ã«ããã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ã§ããªãã±ã¼ã¹</figcaption></figure></p>
<p>DNS ã¨ã³ããã¤ã³ãã使ç¨ããã¨ãã¢ã¯ã»ã¹å
ã® VPC å
ãµããããã§<a href="https://cloud.google.com/vpc/docs/private-google-access?hl=ja">éå®å
¬éã® Google ã¢ã¯ã»ã¹</a>ãæå¹åããã¦ããã°ï¼Google Cloud API ã«ã¢ã¯ã»ã¹ã§ããã°ï¼ãã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="DNSã¨ã³ããã¤ã³ãã§ã¯æ¨ç§»çã«ã¼ãã£ã³ã°ã«å¶éãããã«æ¥ç¶ã§ãã"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241215/20241215210225.png" width="800" height="450" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>DNSã¨ã³ããã¤ã³ãã§ã¯æ¨ç§»çã«ã¼ãã£ã³ã°ã«å¶éãããã«æ¥ç¶ã§ãã</figcaption></figure></p>
<p>ã¾ãã<a href="https://blog.g-gen.co.jp/entry/vpc-service-controls-explained">VPC Service Control</a> ã使ç¨ãããã¨ã§ãIAM 以å¤ã®æ¡ä»¶ï¼ã¢ã¯ã»ã¹å
ãåå¨ããããã¸ã§ã¯ããªã©ï¼ã§ã DNS ã¨ã³ããã¤ã³ãã«å¯¾ããã¢ã¯ã»ã¹å
ãå¶éãããã¨ãã§ãã¾ãã</p>
<h1 id="IP-ãã¼ã¹ã¨-DNS-ãã¼ã¹ã®æ¯è¼">IP ãã¼ã¹ã¨ DNS ãã¼ã¹ã®æ¯è¼</h1>
<p>IP ãã¼ã¹ã®ã¨ã³ããã¤ã³ãã¨ãDNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ããã©ã®ããã«ç°ãªãã®ããæ¯è¼ãã¾ãã</p>
<p>DNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ãã§ã¯ãGoogle Cloud API ãã¤ã³ã¿ã¼ãããã«é²åºãã¦ããã¨ããç¹ã§ã¯ãIP ãã¼ã¹ã®ã¨ã³ããã¤ã³ãã®ãããªãã¯ã¯ã©ã¹ã¿ã¨é¡ä¼¼ãã¦ãããã®ã®ã以ä¸ã®ããã«ç°ãªã£ã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th> æ¯è¼ç¹ </th>
<th> IP ãã¼ã¹ï¼ãããªãã¯ã¨ã³ããã¤ã³ãï¼ </th>
<th> DNS ãã¼ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> <strong>Kubernetes API ã¨ã³ããã¤ã³ãã®é²åº</strong> </td>
<td> ãããªã㯠IP ãæã£ã¦ããï¼ä¸ãä¸ Kubernetes ã«èå¼±æ§ãããå ´åã¯è
å¨ã«ãããããï¼ </td>
<td> ãããªã㯠IP ãæããªãè¨å®ãå¯è½ </td>
</tr>
<tr>
<td> <strong>kubectl ã®æ¥ç¶æ
å ±åå¾ã«å¿
è¦ãª IAM 権é</strong> </td>
<td> <code>container.clusters.get</code> </td>
<td> <code>container.clusters.connect</code> </td>
</tr>
<tr>
<td> <strong>VPC Service Controls ã§ã®ä¿è·</strong> </td>
<td> ãªãï¼ã¯ã©ã¹ã¿æ
å ±åå¾ã«å¯¾ãã¦ã¯ä¿è·å¯è½ï¼ </td>
<td> å¯è½ </td>
</tr>
</tbody>
</table>
<p>ç¹ã«ã»ãã¥ãªãã£é¢ã«é¢ãã¦ã¯ãå¾æ¥ã® IP ãã¼ã¹ã®ã¢ã¯ã»ã¹ã§ããã°ããã©ã¤ãã¼ãã¯ã©ã¹ã¿ãæ§æããããã§è¸ã¿å°ãã¹ãã VPN ãç¨ã㦠Kubernetes API ã¸æ¥ç¶ãããã¨ãæ¨å¥¨ããã¦ãã¾ããããä»å¾ã¯ DNS ãã¼ã¹ã®ã¨ã³ããã¤ã³ããæ§æããIAM 権éãé©åã«ç®¡çãããã㧠VPC Service Controls ã使ã£ã¦å¤å±¤é²å¾¡ãæ§æãããã¨ãæ¨å¥¨ããã¾ãã</p>
<p>VPC Service Controls ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fvpc-service-controls-explained" title="VPC Service Controlsãåããããã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/vpc-service-controls-explained">blog.g-gen.co.jp</a></cite></p>
<h1 id="使ç¨æ¹æ³">使ç¨æ¹æ³</h1>
<h2 id="DNS-ã¨ã³ããã¤ã³ãã®æå¹å">DNS ã¨ã³ããã¤ã³ãã®æå¹å</h2>
<p>DNS ã¨ã³ããã¤ã³ãã¯ãã¤ã§ãæå¹åãããã¨ãã§ãã¾ããCLI ã§æå¹åããå ´åã¯ã<code>--enable-dns-access</code> ãã©ã°ã使ç¨ãã¦ã¯ã©ã¹ã¿ãæ´æ°ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># ã¯ã©ã¹ã¿ä½ææã« DNS ã¨ã³ããã¤ã³ããæå¹åãã</span>
$ gcloud container clusters create <span class="synPreProc">${GKE</span><span class="synError">ã¯ã©ã¹ã¿å</span><span class="synPreProc">}</span> -âenable-dns-access
<span class="synComment"># æ¢åã®ã¯ã©ã¹ã¿ã§ DNS ã¨ã³ããã¤ã³ããæå¹åãã</span>
$ gcloud container clusters update <span class="synPreProc">${GKE</span><span class="synError">ã¯ã©ã¹ã¿å</span><span class="synPreProc">}</span> <span class="synSpecial">--enable-dns-access</span>
</pre>
<p>Google Cloud ã³ã³ã½ã¼ã«ã®å ´åããDNS ã¨ã³ããã¤ã³ããã®é
ç®ããæå¹åãããã¨ãã§ãã¾ãã</p>
<p><figure class="figure-image figure-image-fotolife" title="DNSã¨ã³ããã¤ã³ãã®è¨å®ç®æï¼ã³ã³ã½ã¼ã«ï¼"><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241113/20241113090021.png" width="800" height="347" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span><figcaption>DNSã¨ã³ããã¤ã³ãã®è¨å®ç®æï¼ã³ã³ã½ã¼ã«ï¼</figcaption></figure></p>
<h2 id="ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹">ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®ã¢ã¯ã»ã¹</h2>
<p>DNS ã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ããã«ã¯ã<code>gcloud container clusters get-credentials</code>ãã³ãã³ã㧠<code>--dns-endpoint</code> ãã©ã°ã使ç¨ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># DNS ã¨ã³ããã¤ã³ãã§ã³ã³ããã¼ã«ãã¬ã¼ã³ã«æ¥ç¶ãã</span>
$ gcloud container clusters get-credentials <span class="synPreProc">${GKE</span><span class="synError">ã¯ã©ã¹ã¿å</span><span class="synPreProc">}</span> <span class="synSpecial">--dns-endpoint</span>
</pre>
<h2 id="IP-ã¢ãã¬ã¹ã使ç¨ããæ¥ç¶ã®ç¡å¹å">IP ã¢ãã¬ã¹ã使ç¨ããæ¥ç¶ã®ç¡å¹å</h2>
<p><code>--no-enable-ip-access</code> ãã©ã°ã使ç¨ãããã¨ã§ãå¾æ¥ã® IP ã¢ãã¬ã¹ãã¼ã¹ã®æ¥ç¶æ¹æ³ãç¡å¹åãããã¨ãã§ãã¾ãã</p>
<pre class="code lang-sh" data-lang="sh" data-unlink><span class="synComment"># IP ã¢ãã¬ã¹ãã¼ã¹ã®ã³ã³ããã¼ã«ãã¬ã¼ã³ã¸ã®æ¥ç¶ãç¡å¹åãã</span>
$ gcloud container clusters update <span class="synPreProc">${GKE</span><span class="synError">ã¯ã©ã¹ã¿å</span><span class="synPreProc">}</span> <span class="synSpecial">--no-enable-ip-access</span>
</pre>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sasashun/20230829/20230829095235.png);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ä½ã
æ¨ é§¿å¤ª <a href="https://blog.g-gen.co.jp/archive/author/ggen-sasashun">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">G-genæå端ãåæµ·éå¨ä½ã®ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ã¨ã³ã¸ãã¢</p>
<p class="sw-profile__txt">2022å¹´6æã«G-genã«ã¸ã§ã¤ã³ãGoogle Cloud Partner Top Engineer 2025 Fellowã«é¸åºã好ããªGoogle Cloudãããã¯ãã¯Cloud Runã</p>
<p class="sw-profile__txt">趣å³ã¯ã³ã¼ãã¼ãå°èª¬ï¼SFããã¹ããªï¼ãã«ã©ãªã±ãªã©ã</p>
<a href="https://twitter.com/sasashun0805?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @sasashun0805</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
ggen-sasashun
Associate Data Practitioner試é¨å¯¾çããã¥ã¢ã«
hatenablog://entry/6802418398302932218
2024-11-12T09:00:00+09:00
2025-01-07T14:52:34+09:00 G-genã®ææã§ããGoogle Cloudï¼æ§ç§° GCPï¼ã®èªå®è³æ ¼ã§ãã Associate Data Practitioner è³æ ¼ã®è©¦é¨å¯¾çã«æç¨ãªæ
å ±ãè¨è¼ãã¾ãã åºæ¬çãªæ
å ± Associate Data Practitioner ã¨ã¯ é£æ度 åºé¡å¾å 試é¨å¯¾ç ETL 㨠ELT ETL 㨠ELT ã®åºæ¬ ãªã¼ãã³ã½ã¼ã¹ãã¼ã«ã¨ãã«ããã¼ã¸ããµã¼ãã¹ Cloud Data Fusion ã¤ãã³ãããªãã³ã¢ã¼ããã¯ã㣠ãã¼ã¿ãã¼ã¹ã®é¸æ BigQuery BigQuery ã®åºæ¬ ELT 㨠ETL åæ§é åãã¼ã¿ã®æ±ãï¼JSON åï¼ ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã° å¤â¦
<p>G-genã®ææã§ããGoogle Cloudï¼æ§ç§° GCPï¼ã®èªå®è³æ ¼ã§ãã <strong>Associate Data Practitioner</strong> è³æ ¼ã®è©¦é¨å¯¾çã«æç¨ãªæ
å ±ãè¨è¼ãã¾ãã</p>
<ul class="table-of-contents">
<li><a href="#åºæ¬çãªæ
å ±">åºæ¬çãªæ
å ±</a><ul>
<li><a href="#Associate-Data-Practitioner-ã¨ã¯">Associate Data Practitioner ã¨ã¯</a></li>
<li><a href="#é£æ度">é£æ度</a></li>
<li><a href="#åºé¡å¾å">åºé¡å¾å</a></li>
<li><a href="#試é¨å¯¾ç">試é¨å¯¾ç</a></li>
</ul>
</li>
<li><a href="#ETL-ã¨-ELT">ETL 㨠ELT</a><ul>
<li><a href="#ETL-ã¨-ELT-ã®åºæ¬">ETL 㨠ELT ã®åºæ¬</a></li>
<li><a href="#ãªã¼ãã³ã½ã¼ã¹ãã¼ã«ã¨ãã«ããã¼ã¸ããµã¼ãã¹">ãªã¼ãã³ã½ã¼ã¹ãã¼ã«ã¨ãã«ããã¼ã¸ããµã¼ãã¹</a></li>
<li><a href="#Cloud-Data-Fusion">Cloud Data Fusion</a></li>
<li><a href="#ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£">ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£</a></li>
</ul>
</li>
<li><a href="#ãã¼ã¿ãã¼ã¹ã®é¸æ">ãã¼ã¿ãã¼ã¹ã®é¸æ</a></li>
<li><a href="#BigQuery">BigQuery</a><ul>
<li><a href="#BigQuery-ã®åºæ¬">BigQuery ã®åºæ¬</a></li>
<li><a href="#ELT-ã¨-ETL">ELT 㨠ETL</a></li>
<li><a href="#åæ§é åãã¼ã¿ã®æ±ãJSON-å">åæ§é åãã¼ã¿ã®æ±ãï¼JSON åï¼</a></li>
<li><a href="#ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã°">ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã°</a></li>
<li><a href="#å¤é¨ãã¼ãã«">å¤é¨ãã¼ãã«</a></li>
<li><a href="#SQL">SQL</a></li>
<li><a href="#ã¦ã¤ã³ãã¦é¢æ°">ã¦ã¤ã³ãã¦é¢æ°</a></li>
<li><a href="#ã³ãã¯ãããã·ã¼ã">ã³ãã¯ãããã·ã¼ã</a></li>
</ul>
</li>
<li><a href="#BigQuery-ã®ã¢ã¯ã»ã¹å¶å¾¡ã¨æå·å">BigQuery ã®ã¢ã¯ã»ã¹å¶å¾¡ã¨æå·å</a><ul>
<li><a href="#権é管çIAM">権é管çï¼IAMï¼</a></li>
<li><a href="#æ¿èªããããã¥ã¼">æ¿èªããããã¥ã¼</a></li>
<li><a href="#ééçãªæå·å">ééçãªæå·å</a></li>
</ul>
</li>
<li><a href="#BigQuery-ML">BigQuery ML</a><ul>
<li><a href="#BigQuery-ML-ã®åºæ¬">BigQuery ML ã®åºæ¬</a></li>
<li><a href="#çµã¿è¾¼ã¿ã¢ãã«">çµã¿è¾¼ã¿ã¢ãã«</a></li>
<li><a href="#ã¹ãã¥ã¼ã¨ããªãã">ã¹ãã¥ã¼ã¨ããªãã</a></li>
<li><a href="#Gemini">Gemini</a></li>
</ul>
</li>
<li><a href="#AutoML">AutoML</a></li>
<li><a href="#Cloud-Storage">Cloud Storage</a><ul>
<li><a href="#Cloud-Storage-ã®åºæ¬">Cloud Storage ã®åºæ¬</a></li>
<li><a href="#ã¹ãã¬ã¼ã¸ã¯ã©ã¹">ã¹ãã¬ã¼ã¸ã¯ã©ã¹</a></li>
<li><a href="#ãªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«">ãªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«</a></li>
<li><a href="#ãã¼ã¸ã§ãã³ã°">ãã¼ã¸ã§ãã³ã°</a></li>
<li><a href="#Autoclass">Autoclass</a></li>
<li><a href="#ãã¥ã¢ã«ãªã¼ã¸ã§ã³ãã«ããªã¼ã¸ã§ã³">ãã¥ã¢ã«ãªã¼ã¸ã§ã³ããã«ããªã¼ã¸ã§ã³</a></li>
<li><a href="#Storage-Transfer-Service">Storage Transfer Service</a></li>
<li><a href="#Storage-Transfer-Appliance">Storage Transfer Appliance</a></li>
</ul>
</li>
<li><a href="#Looker">Looker</a><ul>
<li><a href="#Looker-ã®åºæ¬">Looker ã®åºæ¬</a></li>
<li><a href="#ã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³">ã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³</a></li>
<li><a href="#Looker-ã«ããã権é管ç">Looker ã«ããã権é管ç</a></li>
</ul>
</li>
<li><a href="#Analytics-Hub">Analytics Hub</a></li>
<li><a href="#Colab-Enterprise">Colab Enterprise</a></li>
<li><a href="#Cloud-SQL">Cloud SQL</a></li>
</ul>
<p><span itemscope itemtype="http://schema.org/Photograph"><img src="https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20241116/20241116130728.png" width="960" height="540" loading="lazy" title="" class="hatena-fotolife" itemprop="image"></span></p>
<h1 id="åºæ¬çãªæ
å ±">åºæ¬çãªæ
å ±</h1>
<h2 id="Associate-Data-Practitioner-ã¨ã¯">Associate Data Practitioner ã¨ã¯</h2>
<p><strong>Associate Data Practitioner</strong> 試é¨ã¯ãGoogle Cloudï¼æ§ç§° GCPï¼ã®èªå®è³æ ¼ã®ä¸ã¤ã§ããå½è©¦é¨ã¯2024å¹´10æ30æ¥ãBeta çã¨ãã¦å
¬éããã2025å¹´1æã«ä¸è¬å
¬éï¼GAï¼ããã¾ããã</p>
<p>å½è©¦é¨ã¯ Associate ã¬ãã«ã®è³æ ¼ã§ããã<strong>Google Cloud ä¸ã§ã®ãã¼ã¿åãè¾¼ã¿ãå¤æããã¤ãã©ã¤ã³ç®¡çãåæãæ©æ¢°å¦ç¿ãããã³å¯è¦åçã«é¢ããç¥èãæè½</strong>ãåããã¾ãã</p>
<p>試é¨æéã¯120åãåé¡æ°ã¯50ã60åã§ãã2025å¹´1æç¾å¨ã<strong>è±èªçã®ã¿</strong>ãæä¾ããã¦ãã¾ãã</p>
<p>Google Cloud ã®ãã¼ã¿ã¨ã³ã¸ãã¢ãªã³ã°é¢é£ã®èªå®è³æ ¼ã¨ãã¦ã¯ Professional Data Engineer ãåå¨ãã¦ãã¾ããProfessional ã¬ãã«ã®èªå®è³æ ¼ã¯ãæè¡çãªç¥èã ãã§ãªãããã¸ãã¹ã¦ã¼ã¹ã±ã¼ã¹ã«ãããã¦ã½ãªã¥ã¼ã·ã§ã³ãæ¤è¨ããããé«åº¦ãªç¥è¦ãæ±ããããã®ã«å¯¾ãã¦ãAssociate ã¬ãã«ã®è³æ ¼ã¯ãæè¡çãªç¥è¦ã®ã¿ã«ç¹åãã¦ãã¾ããå½è¨äºã§ç´¹ä»ãã Associate Data Practitioner ã¯ãProfessional Data Engineer ã®ä¸ä½è³æ ¼ã®ä½ç½®ã¥ãã¨èããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/learn/certification/data-practitioner">Associate Data Practitioner</a></li>
</ul>
<p>å½è³æ ¼ã®ä¸ä½è³æ ¼ã§ãã Professional ã¬ãã«è©¦é¨ã§ãã Professional Data Engineer ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fprofessional-data-engineer" title="Professional Data Engineer試é¨å¯¾çããã¥ã¢ã«ãåºé¡å¾åã»åå¼·æ¹æ³ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/professional-data-engineer">blog.g-gen.co.jp</a></cite></p>
<h2 id="é£æ度">é£æ度</h2>
<p>Associate Data Practitioner 試é¨ã®é£æ度ã¯ãä»ã®èªå®è©¦é¨ã¨æ¯è¼ãã¦<strong>ä½ãä¸ç¨åº¦</strong> ã¨ããã¾ãã</p>
<p>ãRDBMSãããã©ã³ã¶ã¯ã·ã§ã³ãããã¼ã¿ã¢ããªã³ã°ããSQLããåæ£ãã¼ã¿ãã¼ã¹ããªã©ãåºæ¬æ
å ±æè¡è
試é¨ã§ãå¦ã¶ãããªåºç¤ã¬ãã«ã®ãªã¬ã¼ã·ã§ãã«ãã¼ã¿ã«é¢ããç¥èã«å ãã¦ãéæ£è¦åãå«ããã¼ã¿åæåãã®ãã¼ã¿ã¢ããªã³ã°ããªãã¸ã§ã¯ãã¹ãã¬ã¼ã¸ã®åºæ¬ãªã©ãç解ããã¦ããæ¹ã§ããã°ã追å ã®å¦ç¿ã1ã¶æç¨åº¦è¡ããã¨ã§ååã«åæ ¼ãçãã¾ãã</p>
<p>ã¾ãåºç¤ç¥èã¨ãã¦ãAssociate Cloud Engineer ç¨åº¦ã® Google Cloud ã®åºç¤ç¥èãæã£ã¦ãããã¨ã§ãIAM ã«ãã権é管çãªã©ã1ããå¦ç¿ããªãã¦ãæ¸ã¿ã¾ãã</p>
<p>åé¨è
ã«æ¨å¥¨ãããçµé¨ã¨ãã¦ãå
¬å¼ãµã¤ãã«ã¯ãGoogle Cloud ä¸ã§ã®6ã¶æ以ä¸ã®å®åçµé¨ãã¨ããã¾ãããç´°ããªæä½ãã³ãã³ãã«é¢ããåºé¡ã¯å¤ãããã¾ããããããæ®éçãªæ¨æº SQL ã®æ¸ãæ¹ã«è¦ªããã§ãããã¨ãéè¦ã§ããã¾ããGoogle Cloud ã®ãã¹ããã©ã¯ãã£ã¹ãæ£ããç解ããããã«æ²¿ã£ã¦çãããã¨ãéè¦ã§ãã</p>
<h2 id="åºé¡å¾å">åºé¡å¾å</h2>
<p>å½è©¦é¨ã§ã¯ã以ä¸ã®ãã㪠Google Cloud ã½ãªã¥ã¼ã·ã§ã³ã«é¢ããåºé¡ãã»ã¨ãã©ã§ãã</p>
<ul>
<li>Cloud Storage</li>
<li>BigQuery</li>
<li>Pub/Sub</li>
<li>Dataflow</li>
<li>Dataform</li>
<li>Cloud Data Fusion</li>
<li>Dataproc</li>
</ul>
<p>ã¾ãä¸é¨ã§ã¯ãCloud SQL ã®å¯ç¨æ§ãªã©ããªãã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ã«é¢ããåºé¡ãããã¾ãã</p>
<p>試é¨ã§åºé¡ããã Google Cloud ã§å®è£
ããããã¼ã¿åæåºç¤ã¯ã<strong>å¿
ã BigQuery ãä¸å¿ã§ãã</strong>ã¨ãã£ã¦å·®ãæ¯ãããã¾ãããBigQuery ããã¼ã¿ã¦ã§ã¢ãã¦ã¹ï¼ãã¼ã¿åæç¨ãã¼ã¿ãã¼ã¹ï¼ã¨ãã¦ãããã«ãã¼ã¿ãåãè¾¼ã¿ï¼ingestï¼ããããã®ãã¼ã«ã¨ã㦠Pub/SubãDataflowãCloud Data Fusion ãªã©ãç»å ´ãã¾ãããããç解ãã¤ã¤ãGoogle ãæå±ãã以ä¸ã®ãããªãã¹ããã©ã¯ãã£ã¹ã«æ²¿ããããªåçãå¿ããããã¨ãéè¦ã§ããã©ã®èªå®è©¦é¨ã§ãå
±éãã¦è¨ãããã¨ã§ãããååãã大ããå¤ããªããã°ãåæ ¼ã¯é£ããããã¾ããã</p>
<ul>
<li>ãã¼ã¿åæç¨ãã¼ã¿ãã¼ã¹ã¯ BigQuery</li>
<li>管çå·¥æ°ãå°ããããããã«ãå¯è½ã§ããã°ãã«ããã¼ã¸ããµã¼ãã¹ããåãä»ãã®æ©è½ãé¸ã¶
<ul>
<li>Apache Airflow on Compute Engine ãã Cloud Composer</li>
<li>Spark on GKE ãã Dataproc Serverless</li>
<li>æ©æ¢°å¦ç¿ãã¬ã¼ã ã¯ã¼ã¯ããã BigQuery ML</li>
</ul>
</li>
<li>ç¶æã»ä¿å®å·¥æ°ãå°ããããããã«ãå¯è½ã§ããã°ãã¼ã³ã¼ãã§å®è£
ã§ããæ¹æ³ãé¸ã¶
<ul>
<li>BigQuery ã®ãã¦ã¹ãã¼ãã³ã°ã¯ãCloud Run functions ã§å®è£
ãããããããã¼ãã£ã·ã§ã³ã®æå¹æéè¨å®ã使ã</li>
<li>Cloud Storage ã®ãã¦ã¹ãã¼ãã³ã°ã¯ãCloud Run functions ã§å®è£
ãããããããªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«ãé¸ã¶</li>
</ul>
</li>
</ul>
<h2 id="試é¨å¯¾ç">試é¨å¯¾ç</h2>
<p>以ä¸ã®åå¼·æ¹æ³ã¯ããã¾ã§ä¸ä¾ã§ãããæé©ãªæ¹æ³ã¯ãåé¨è
ã®äºåç¥èãçµé¨ã«ãã£ã¦ç°ãªããã®ã¨ãäºæ¿ãã ããã</p>
<ol>
<li>Associate Cloud Engineer ã¬ãã«ã® Google Cloud åºç¤ç¥èãç¿å¾ãã</li>
<li>åæ²ã®ãã¼ã¿åºç¤ç¥èããã¼ã¯ã¼ããã¼ã¹ã§ç解ãã</li>
<li>試é¨ã¬ã¤ããèªã¿ãç¥ããªããã¼ã¯ã¼ããæ©è½ã«ã¤ãã¦å
¬å¼ããã¥ã¡ã³ãã§å¦ã¶</li>
<li>å½è¨äºã®åºé¡å¾åãèªã¿è¶³ããªãç¥èé åãã«ãã¼ããå¦ç¿ãè¡ã</li>
<li>ã¦ã¤ã³ãã¦é¢æ°ã BigQuery ML ãªã©ç¹æ®ãª SQL ã®ä½¿ãæ¹ãç解ãã</li>
</ol>
<p>ãªã Associate Cloud Engineer 試é¨ã®å¦ç¿ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fassociate-cloud-engineer" title="Associate Cloud Engineer試é¨å¯¾çããã¥ã¢ã«ãåºé¡å¾åã»åå¼·æ¹æ³ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/associate-cloud-engineer">blog.g-gen.co.jp</a></cite></p>
<p>å½è¨äºã§ã¯ãã以éã試é¨ã«ããã£ã¦ä½ãåå¼·ãã¦ããã¹ãããæ©è½åéãã¨ã«ç´¹ä»ãã¾ãã®ã§ãåèã«ãã¦ãã ãããå½è¨äºã§ã¯ãGoogle Cloud ã®åºç¤ç¥èã詳細ã«ãä¼ããããã¨ã¯ããã¾ããã®ã§ããã®ç¹ã«ã¯ãçæãã ãããã¾ããå½è¨äºã®å
容㯠Beta çå
¬éæã®ãã®ã§ãã®ã§ãç¾å¨ã®è©¦é¨å
容ã¨ã¯ä¸é¨ãç°ãªãå ´åãããç¹ããäºæ¿ãã ããã</p>
<h1 id="ETL-ã¨-ELT">ETL 㨠ELT</h1>
<h2 id="ETL-ã¨-ELT-ã®åºæ¬">ETL 㨠ELT ã®åºæ¬</h2>
<p>BigQuery ã¯ã¹ã±ã¼ã©ãã«ãªã³ã³ãã¥ã¼ãåºç¤ãæã£ã¦ããã®ã§ãã¾ããã¼ã¿ã BigQuery ã«åãè¾¼ãã§ããå¤æããã<strong>ELT</strong>ï¼ExtractãLoadãTransformï¼ãã®é çªã§å¦çãããã¨ãå¯è½ã§ããELT ã¯ã<strong>ã¹ã±ã¸ã¥ã¼ã«ãããã¯ã¨ãª</strong>ï¼Scheduled queriesï¼ã <strong>Dataform</strong> ã§è¡ããã¨ãå¤ãã¨ããã¾ãã</p>
<p>ãããå½è©¦é¨ã§ã¯ãBigQuery 㸠Load ããåã« <strong>Cloud Data Fusion</strong> ã <strong>Dataflow</strong>ã<strong>Dataproc</strong> ã§ãã¼ã¿ã¯ã¬ã³ã¸ã³ã°ãè¡ããETLï¼ExtractãTransformãLoadï¼ãã®åºé¡ãå¤ãããã¾ãã</p>
<p>å¤ãã®åé¡ã§ã¯ãELT 㨠ETL ã©ã¡ããæ¡ãã¹ãããåé¡æãèªãã°æ確ã§ãã</p>
<p>ä¸è¨ã«ç»å ´ããããããã®ãµã¼ãã¹ããã©ã®ãããªãã®ã§ããããæ¦è¦ãç解ãã¦ããã¦ãã ããã</p>
<h2 id="ãªã¼ãã³ã½ã¼ã¹ãã¼ã«ã¨ãã«ããã¼ã¸ããµã¼ãã¹">ãªã¼ãã³ã½ã¼ã¹ãã¼ã«ã¨ãã«ããã¼ã¸ããµã¼ãã¹</h2>
<p>Google Cloud ã®ãã¼ã¿åæåããã«ããã¼ã¸ããµã¼ãã¹ã¯ãå¤ãããªã¼ãã³ã½ã¼ã¹ã½ããã¦ã§ã¢ï¼Open Source SoftwareãOSSï¼ããã¼ã¹ã¨ãã¦ãããã¨ã«æ³¨æãã¦ãã ãããä¾ãã° Cloud Composer ã¯ãOSS ã§ãã Apache Airflow ã®ãã«ããã¼ã¸ããµã¼ãã¹ã§ããGoogle Cloud ãããã¯ãã¨ã<strong>ãã®å
ã¨ãªã£ã OSS ã®å称ã¨ã®å¯¾ç
§ã¯è¦ãã¦ãã ãã</strong>ã試é¨ã§ã¯ãä¾ãã°ããªã¼ãã³ã½ã¼ã¹ã®æè¡ã¹ã¿ãã¯ãå©ç¨ãããããªã©ã®è¦ä»¶ãæ示ãããããããã¾ããã</p>
<table>
<thead>
<tr>
<th> Google Cloud ãããã¯ãå </th>
<th> OSS å </th>
</tr>
</thead>
<tbody>
<tr>
<td> Cloud Composer </td>
<td> Apache Airflow </td>
</tr>
<tr>
<td> Dataflow </td>
<td> Apache Beam </td>
</tr>
<tr>
<td> Dataproc / Dataproc Serverless </td>
<td> Apache HadoopãApache Spark ç </td>
</tr>
<tr>
<td> Cloud SQL for PostgreSQL </td>
<td> PostgreSQL </td>
</tr>
<tr>
<td> Cloud SQL for MySQL </td>
<td> MySQL </td>
</tr>
</tbody>
</table>
<p>ã¾ãããããã®åãããã¯ãã®ï¼= OSS ã®ï¼å¾æåéã¨ã¦ã¼ã¹ã±ã¼ã¹ããã£ããææ¡ãã¦ããã¾ãããã以ä¸ã®ãããªå¤§ååããã£ããè¦ãã¦ããã¦ãã ããã</p>
<table>
<thead>
<tr>
<th> Google Cloud ãããã¯ãåï¼OSS åï¼ </th>
<th> ã¦ã¼ã¹ã±ã¼ã¹ </th>
</tr>
</thead>
<tbody>
<tr>
<td> Cloud Composerï¼Apache Airflowï¼ </td>
<td> <strong>DAG</strong>ï¼æåéå·¡åã°ã©ããããããã¯ã¼ã¯ããã¼ã¾ãã¯ã¸ã§ããããï¼ã Python ã§è¨è¿°ãå¤ãã®<strong>çµã¿è¾¼ã¿ãªãã¬ã¼ã¿ã¼</strong>ããã </td>
</tr>
<tr>
<td> Dataflowï¼Apache Beamï¼ </td>
<td> ãããå¦çã¨ã¹ããªã¼ãã³ã°å¦çã<strong>両æ¹å¦çã§ãã</strong> </td>
</tr>
<tr>
<td> Dataprocï¼Apache HadoopãApache Spark çï¼ </td>
<td> ãã¡ã¤ã«ã大è¦æ¨¡ã«ä¸¦åå¦ç </td>
</tr>
<tr>
<td> Cloud SQLï¼PostgreSQLãMySQLï¼ </td>
<td> ãªãã¬ã¼ã·ã§ãã«ãªãªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ </td>
</tr>
</tbody>
</table>
<p>ãã®ãããªãã¨ãããä¾ãã°ããããããå¦çã¨ã¹ããªã¼ãã³ã°å¦çãåãæè¡ã¹ã¿ãã¯ã§å¦çããããã¨ããè¦ä»¶ãããã°å¿
ã Dataflow ãé¸ã¹ã¾ããããApache Spark ã¯ã¼ã¯ãã¼ããã¯ã©ã¦ãã«ç§»è¡ããããã¯ã©ã¹ã¿ã®ç®¡çã¯è¡ããããªããã¨ããã° Dataproc Serverless ãé¸ã¹ã¾ãã</p>
<h2 id="Cloud-Data-Fusion">Cloud Data Fusion</h2>
<p><strong>Cloud Data Fusion</strong> ã¯ããã¼ã³ã¼ãã§éçºå¯è½ãªããã«ããã¼ã¸ãã® ETL ã½ãªã¥ã¼ã·ã§ã³ã§ãããã¼ã³ã¼ã㧠ETL ãã¤ãã©ã¤ã³ãéçºãããã·ãã¥ã¨ã¼ã·ã§ã³ã§æ´»ç¨ã§ãã¾ãã以ä¸ã®ãããªå©ç¨ãå¯è½ã§ãã</p>
<ul>
<li>Cloud Storage ã®ãã¼ã¿ãèªã¿åãããã¼ã¿å¤æãã¦ãã BigQuery ã«æ ¼ç´</li>
<li>ãã¼ã¿ãã¼ã¹ã«æ¥ç¶ãããã¼ã¿ãæ½åºããå¤æãã¦ãã BigQuery ã«æ ¼ç´</li>
</ul>
<h2 id="ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£">ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£</h2>
<p><strong>ã¤ãã³ãããªãã³ã¢ã¼ããã¯ãã£</strong>ã¨ã¯ããã1ã¤ã®å¦çãå®äºãããã¨ããã£ããã«ãå¥ã®å¦çãããªã¬ã¼ããããããªã¢ã¼ããã¯ãã£ãããã¾ããä¾ãã°ãCloud Storage ãã±ããã«ãªãã¸ã§ã¯ããã¢ãããã¼ãããããã¨ããã£ããã« Cloud Run functionsï¼æ§ç§° Cloud Functionsï¼ãèµ·åãããã¡ã¤ã«ãèªã¿è¾¼ãã§ãã¼ã¿ã BigQuery ã«ãã¼ããããããªã¢ã¼ããã¯ãã£ã§ããå¤ãã®å ´åãå¦çã®ããã®ããã°ã©ã ã¯ãµã¼ãã¼ã¬ã¹ãã©ãããã©ã¼ã ã«ãã¹ãããã¾ãã</p>
<p>次ã
ã«å°çããå°ãããã¼ã¿ãé 次å¦çãããããªä»çµã¿ã§ã¯ãã¤ãã³ãããªãã³ãªã¢ã¼ããã¯ãã£ãé©ãã¦ãã¾ããå対ã«ãCloud Run functions ã®ãããªãµã¼ãã¼ã¬ã¹ãã©ãããã©ã¼ã ã¯å®è¡æéã«å¶éããããã¨ããã<strong>大ããªãã¡ã¤ã«ã®å¦ç</strong>ï¼é·æéã®å¦çï¼ã«ã¯é©ãã¦ãã¾ãããã¤ãã³ãããªãã³ãã©ã®ãããªã¦ã¼ã¹ã±ã¼ã¹ã«é©ãã¦ããããæèãã¦ãã ããã</p>
<p>ã¤ãã³ãããªãã³ã«ã¤ãã¦ã¯ã以ä¸ã®è¨äºãåç
§ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fserverless-architecture-explained" title="Google Cloudã§ç解ãããµã¼ãã¼ã¬ã¹ã»ã¢ã¼ããã¯ã㣠- G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/serverless-architecture-explained">blog.g-gen.co.jp</a></cite></p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fgen-ai-with-event-driven-architecture" title="ã¤ãã³ãããªãã³ÃçæAIã§æ¥å ±ãèªåè¦ç´ãã¦ã¿ã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/gen-ai-with-event-driven-architecture">blog.g-gen.co.jp</a></cite></p>
<h1 id="ãã¼ã¿ãã¼ã¹ã®é¸æ">ãã¼ã¿ãã¼ã¹ã®é¸æ</h1>
<p>Google Cloud ã®å¤ç¨ãªãã¼ã¿ãã¼ã¹ãµã¼ãã¹ãä¸éãç解ãã<strong>ã¦ã¼ã¹ã±ã¼ã¹ã«å¯¾ãã¦é©åãªãã¼ã¿ãã¼ã¹</strong>ãé¸æã§ããããã«ãã¦ãã ããã</p>
<p>以ä¸ã®è¨äºã®ããã¼ã¿ãã¼ã¹ã®é¸æãã®é
ãåç
§ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://blog.g-gen.co.jp/entry/professional-data-engineer#%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E9%81%B8%E6%8A%9E">Professional Data Engineer試é¨å¯¾çããã¥ã¢ã«ãåºé¡å¾åã»åå¼·æ¹æ³ - ãã¼ã¿ãã¼ã¹ã®é¸æ - G-gen Tech Blog</a></li>
</ul>
<h1 id="BigQuery">BigQuery</h1>
<h2 id="BigQuery-ã®åºæ¬">BigQuery ã®åºæ¬</h2>
<p><strong>BigQuery</strong> ã¯å½è©¦é¨ã§æãéè¦ãªãããã¯ãã§ãã以ä¸ã®è¨äºãåç
§ããæ©è½ãç解ãã¦ãã ããã以ä¸ã®ãåºæ¬ç·¨ãè¨äºã®å
容ã主ãªåºé¡ç¯å²ã¨æ¦ãéãªã£ã¦ãã¾ãããä¾å¤ã¨ãã¦ãå¿ç¨ç·¨ãã§ç°¡åã«ç´¹ä»ããã¦ãã <strong>BigQuery ML</strong> ã¯é »åºç¯å²ã§ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-explained-basics" title="BigQueryãå¾¹åºè§£èª¬ï¼(åºæ¬ç·¨) - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-explained-basics">blog.g-gen.co.jp</a></cite></p>
<h2 id="ELT-ã¨-ETL">ELT 㨠ETL</h2>
<p>Google Cloud ã®ãã¼ã¿åæåºç¤ã®ä¸å¿ã¯ BigQuery ã§ããåè¿°ã®éããELT 㨠ETL ã®ä¸¡æ¹ã®ãã¿ã¼ã³ãåºé¡ããã¾ããELT ã¯ã¹ã±ã¸ã¥ã¼ã«ãããã¯ã¨ãªï¼Scheduled queriesï¼ã Dataform ã§ãETL 㯠Cloud Data Fusion ã DataflowãDataproc ã§å®è£
ããã¾ãã</p>
<p>Dataform 㯠SQL ã®æ¡å¼µè¨èªã§ãã <strong>SQLX</strong> ã使ãããã¼ã¿ã®å¤æï¼transformationï¼ã<strong>ãã¹ããå質ãã§ãã¯</strong>ã¾ã§è¡ããã®ãç¹å¾´ã§ãã</p>
<p>Cloud Data Fusion ã¯<strong>ãã¼ã³ã¼ã</strong>ãã Dataflow ã¯<strong>ãããå¦çã¨ã¹ããªã¼ãã³ã°å¦çã両æ¹æ±ãããã¨</strong>ãDataproc 㯠<strong>Hadoop / Spark</strong> æè¡ã¹ã¿ãã¯ãã¨ããããã«ãã¼ã¯ã¼ããè¦ãã¦ããã°ãåºé¡æã®é¸æã«è¿·ããã¨ã¯ãã¾ããªãã¯ãã§ãã</p>
<p>ã¾ããåç´ã§1åããã®ï¼one-time ã®ï¼ãã¼ã¿ãã¼ãããã¼ã«ã« PC ããè¡ãããªã©ã®ã·ã³ãã«ãªã¦ã¼ã¹ã±ã¼ã¹ã§ã¯ãbq ã³ãã³ãã©ã¤ã³ãç¨ã㦠<code>bq load</code> ã³ãã³ããè¡ããã¨ã§æ¸ãå ´åãããã¾ãã</p>
<h2 id="åæ§é åãã¼ã¿ã®æ±ãJSON-å">åæ§é åãã¼ã¿ã®æ±ãï¼JSON åï¼</h2>
<p>åæ§é åãã¼ã¿ã¨ã¯ãJSON ãã©ã¼ãããã®ããã«ãããç¨åº¦æ§é åããã¦ãããã®ã®ã¹ãã¼ãã«æè»æ§ããããããªãã¼ã¿æ§é ãæãã¾ããå½è©¦é¨ã«ããã¦ã¯ JSON ãã¤ã¡ã¼ã¸ããã°äºè¶³ãã¾ãã</p>
<p>BigQuery ã«ã¯ JSON åããããJSON å½¢å¼ã®ãããªåæ§é çãªãã¼ã»ããªã¥ã¼ãæè»ã«æ ¼ç´ãããã¨ãã§ãã¾ããSELECT æã§ã¯ä»¥ä¸ã®ããã«ã<code>key1.key2</code> ã¨æå®ãããã¨ã§é¸æãå¯è½ã§ãã</p>
<pre class="code lang-sql" data-lang="sql" data-unlink><span class="synStatement">SELECT</span> json_payload.id <span class="synSpecial">FROM</span> `my_dataset.my_table`
</pre>
<p>ãã®ãããªãã¼ããªã¥ã¼åããã¹ããã¦æ ¼ç´ã§ããåã«ã¯ä»ã« STRUCT åãããã¾ãããSTRUCT åã¯ã¹ãã¼ãã決ã¾ã£ã¦ãããããä¾ãã°æ¥æçµéã§ã¹ãã¼ãã«å¤æ´ããããå¯è½æ§ããã<strong>æè»æ§ãæ±ããããã±ã¼ã¹ã§ã¯ JSON åã便å©</strong>ã§ããã¾ããããã¹ãå½¢å¼ã§ããã°ä½ã§ãæ ¼ç´ã§ãã STRING åã¨æ¯ã¹ã¦ããããã©ã¼ãã³ã¹é¢ã¨ã³ã¹ãé¢ã§ JSON åãæå©ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/blog/ja/products/databases/how-bigquery-powers-semi-structured-data-storage">BigQuery ã® JSON åãæ´»ç¨ãã¦åæ§é åãã¼ã¿ã®åãå¼ãåºã</a></li>
</ul>
<h2 id="ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã°">ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã°</h2>
<p>BigQuery ã®<strong>ãã¼ãã£ã·ã§ã³</strong>ã¨<strong>ã¯ã©ã¹ã¿ãªã³ã°</strong>ã«ã¤ãã¦ã¯æ£ããç解ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-paritioning-and-clustering" title="BigQueryã®ãã¼ãã£ã·ã§ã³ã¨ã¯ã©ã¹ã¿ãªã³ã°ã«ã¤ãã¦ã®è§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-paritioning-and-clustering">blog.g-gen.co.jp</a></cite></p>
<p>ã¾ãããã¼ãã£ã·ã§ã³ã«ã¯<strong>æå¹æé</strong>ãè¨å®ã§ããä½æããä¸å®æéãçµéãããã¼ã¿ãåé¤ãããã¨ãã§ãã¾ãããããããã¦ã¹ãã¼ãã³ã°ã®èªååã«æé©ã§ãã</p>
<h2 id="å¤é¨ãã¼ãã«">å¤é¨ãã¼ãã«</h2>
<p><strong>å¤é¨ãã¼ãã«</strong>ï¼External Tablesï¼æ©è½ã使ãã¨ãCloud Storage ã«æ ¼ç´ãã CSVãJSONãParquetãAvro ãã¡ã¤ã«ã Google ã¹ãã¬ããã·ã¼ãã®ãã¼ã¿ãããã㯠Bigtable ã«å¯¾ãã¦ãBigQuery ãã SQL ã使ã£ã¦ã¯ã¨ãªãããã¨ãã§ãã¾ãã</p>
<p>ãã ãå¤é¨ãã¼ãã«å®ç¾©ãè¡ã£ã¦ãããã¼ã¿ã BigQuery ã«åãè¾¼ãããã§ã¯ãªããããã¾ã§ãã¼ã¿ã¯å¤é¨ã«ç½®ããã¾ã¾ã¯ã¨ãªãããããããã©ã¼ãã³ã¹ï¼å¦çé度ï¼ã¯é«ãããã¾ãããããã¾ã§ãã¯ã¨ãªããã©ã¼ãã³ã¹ãæ±ããããªãå ´åãããã¼ã¿ãå°ãªãå ´åãã¾ã1åããï¼one-timeï¼ã®ãªã³ããã³ããªåæãªã©ã«å©ç¨ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/external-tables?hl=ja">å¤é¨ãã¼ãã«ã®æ¦è¦</a></li>
</ul>
<h2 id="SQL">SQL</h2>
<p>Google Cloud èªå®è³æ ¼ã§ã¯çãããå½è©¦é¨ã§ã¯ SQL ã®å
·ä½çãªã½ã¼ã¹ã³ã¼ããé¸æè¢ããé¸ã°ããåé¡ãåºé¡ããã¾ããã¨ã¯ãããè¤éã«ãã¹ããããé·å¤§ãª SQL ãåºé¡ãããããã§ã¯ããã¾ããã</p>
<p>åºæ¬ç㪠SELECT æãã¾ã JOIN ã UNION ALL ãªã©ã使ã£ã¦è¤æ°ãã¼ãã«ãçµã¿åããã¦è¡¨ç¤ºããéã® SQL ãªã©ãç解ãã¦ããã¦ãã ããã</p>
<h2 id="ã¦ã¤ã³ãã¦é¢æ°">ã¦ã¤ã³ãã¦é¢æ°</h2>
<p>åæç¨éã§ç¨ãããã<strong>ã¦ã¤ã³ãã¦é¢æ°</strong>ã¯ã<strong>ææ³ãç解</strong>ãã¦ããå¿
è¦ãããã¾ãã以ä¸ã¯å
¬å¼ããã¥ã¡ã³ãã§ãããå¿
ãããããããããã¨ã¯è¨ãé£ããããã¤ã³ã¿ã¼ãããä¸ã®æ
å ±ãå種æ¸ç±ãåèã«ãã¦ãææ³ãç解ãã¦ããã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls">Window function calls</a></li>
</ul>
<p>ä¾ãã° <code>RANK ()</code> é¢æ°ã使ã£ã¦ããååºèã®æ¥æ¬¡å£²ä¸ãéè¨ããä¸ä½5ä½ã表示ãããã¨ãã£ãç°¡å㪠SQL ãã©ã®ãããªãã®ã«ãªããããããããã«ãã¦ããã¦ãã ããã</p>
<h2 id="ã³ãã¯ãããã·ã¼ã">ã³ãã¯ãããã·ã¼ã</h2>
<p><strong>ã³ãã¯ãããã·ã¼ã</strong>ï¼Connected Sheetsï¼ã¯ãGoogle ã¹ãã¬ããã·ã¼ãï¼Google Sheetsï¼ãã BigQuery ã®ãã¼ã¿ãèªã¿åããã¨ãã§ããæ©è½ã§ãã</p>
<p>å対ã«ãBigQuery ã®<strong>å¤é¨ãã¼ãã«</strong>æ©è½ã§ã¯ãGoogle ã¹ãã¬ããã·ã¼ãã® URI ãæå®ãããã¨ã§ã¹ãã¬ããã·ã¼ããå¤é¨ãã¼ãã«ã¨ãã¦å®ç¾©ããSQL ã§ã¯ã¨ãªãããã¨ãã§ãã¾ãã</p>
<p>ããããçµã¿åããã㨠BigQuery å¤é¨ãã¼ãã«ã使ã£ã¦ã¹ãã¬ããã·ã¼ãã®ä¸èº«ãèªã¿åããBigQuery ã®ãã¼ã¿ã¨çµåãã¦çµæããã¼ãã«ã«ä¿åãããã®çµæãã³ãã¯ãããã·ã¼ãã使ã£ã¦ã¹ãã¬ããã·ã¼ãããèªã¿åããã¨ãã£ãç¸äºã®é£æºã容æã«å®ç¾ã§ãã¾ãã</p>
<h1 id="BigQuery-ã®ã¢ã¯ã»ã¹å¶å¾¡ã¨æå·å">BigQuery ã®ã¢ã¯ã»ã¹å¶å¾¡ã¨æå·å</h1>
<h2 id="権é管çIAM">権é管çï¼IAMï¼</h2>
<p>BigQuery ã¸ã®ã¢ã¯ã»ã¹å¶å¾¡ã¯ã<strong>IAM</strong>ï¼Identity and Access Managementï¼ãç¨ãã¦è¡ãã¾ãã<strong>æå°æ¨©éã®åå</strong>ã«å¾ãã®ããã¼ã§ãã</p>
<p>BigQuery 㨠IAM ã«ã¤ãã¦ã¯ä»¥ä¸ã®è¨äºã§è©³ç´°ã«è§£èª¬ãã¦ãã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-iam-permission" title="BigQueryã®ã¢ã¯ã»ã¹å¶å¾¡ã¨æ¨©éè¨è¨ã解説 - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-iam-permission">blog.g-gen.co.jp</a></cite></p>
<p>è¨äºã§ãç´¹ä»ãã¦ããã¨ããããã¨ãã° BigQuery ã®ãã¼ã¿ã¸ã®èªã¿åãã¢ã¯ã»ã¹ã®ããã«å¿
è¦ãªæå°æ¨©éãä¸ããå ´åã対象ã¢ã«ã¦ã³ãï¼ã°ã«ã¼ãï¼ã«ä»¥ä¸ã®æ¨©éãããã¸ã§ã¯ãã¬ãã«ã§ä»ä¸ãã¾ãã</p>
<ul>
<li>BigQuery ã¸ã§ãã¦ã¼ã¶ã¼ï¼<code>roles/bigquery.jobUser</code>ï¼</li>
<li>BigQuery ãã¼ã¿é²è¦§è
ï¼<code>roles/bigquery.dataViewer</code>ï¼</li>
</ul>
<p>ãã¼ã¿ã®ç·¨éï¼UPDATE ã DELETEï¼ãå¿
è¦ãªå ´åã¯ãä¸è¨ã®ãBigQuery ãã¼ã¿é²è¦§è
ãã®ä»£ããã«ãBigQuery ãã¼ã¿ç·¨éè
ï¼<code>roles/bigquery.dataEditor</code>ï¼ããããã¯ãBigQuery ãã¼ã¿ãªã¼ãã¼ï¼<code>roles/bigquery.dataOwner</code>ï¼ããä»ä¸ãã¾ãããã¤ã³ãã¯ãã¸ã§ãï¼ã¯ã¨ãªï¼ã®å®è¡ã«ã¯ãBigQuery ã¸ã§ãã¦ã¼ã¶ã¼ï¼<code>roles/bigquery.jobUser</code>ï¼ããå¿
è¦ã«ãªãã¨ããç¹ã§ãã詳細ã¯åæ²ã®å½ç¤¾è¨äºãåç
§ãã¦ãã ããã</p>
<h2 id="æ¿èªããããã¥ã¼">æ¿èªããããã¥ã¼</h2>
<p><strong>æ¿èªããããã¥ã¼</strong>ï¼Authorized viewï¼æ©è½ã使ãã¨ããã¥ã¼ã¸ã®ã¢ã¯ã»ã¹å¶å¾¡ãç°¡ç´ åã§ãã¾ããã·ã³ãã«ã§å¹çã®è¯ãæ¹æ³ã§ããã¥ã¼ï¼ç¹å®ã®ã¯ã¨ãªçµæï¼ã¸ã®ã¢ã¯ã»ã¹ãå¶å¾¡ãããå ´åã«å©ç¨ã§ãã¾ãã以ä¸ã®è¨äºãåç
§ãã¦ãä»æ§ãç解ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fbigquery-authorized-view-and-dataset" title="BigQueryãæ¿èªããããã¥ã¼ãã¨ãæ¿èªããããã¼ã¿ã»ããã - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/bigquery-authorized-view-and-dataset">blog.g-gen.co.jp</a></cite></p>
<h2 id="ééçãªæå·å">ééçãªæå·å</h2>
<p><strong>ééçãªæå·å</strong>ã§ã¯ãæå·éµã¸ã®é©åãªã¢ã¯ã»ã¹æ¨©éãæã£ã¦ããã°ãå©ç¨è
ã¯æå·åãæèããã«ã¹ãã¬ã¼ã¸ä¸ã®ãã¼ã¿ãå©ç¨ã§ãã¾ãã</p>
<p>Google Cloud ã§ã¯<strong>転éä¸ã®ãã¼ã¿</strong>ï¼data in transitï¼ã¨<strong>ä¿ç®¡ä¸ã®ãã¼ã¿</strong>ï¼data at restï¼ã¯å
±ã«<strong>ããã©ã«ãã§æå·å</strong>ããã¦ãã¾ããããã<strong>ããã©ã«ãã®æå·å</strong>ã¨å¼ã³ã¾ããããã©ã«ãã®æå·åã§æå·éµã¨ãã¦ä½¿ãããéµã¯ Google ã管çããã¦ãããé©åã«ä¿ç®¡ããã¼ãã¼ã·ã§ã³ãå»æ£ãè¡ããã¾ãããã®éµã®ãã¨ã <strong>Google-managed encryption keys</strong>ãç¥ã㦠GMEK ã¨å¼ç§°ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/docs/security/encryption/default-encryption?hl=ja">ããã©ã«ãã®ä¿åãã¼ã¿ã®æå·å</a></li>
<li>åè : <a href="https://cloud.google.com/docs/security/encryption-in-transit?hl=ja">転éãã¼ã¿ã®æå·å</a></li>
</ul>
<p>ã¾ããBigQuery ã®ã³ã³ã½ã¼ã«ç»é¢ï¼BigQuery Studioï¼ã bq ã³ãã³ãã使ãã¨ãããã¼ã¿ã¯ã¤ã³ã¿ã¼ããããçµç±ãã¦è»¢éããã¾ãããé信㯠HTTPS ã§æå·åããã¦ãã¾ãããã㯠BigQuery ã ãã§ãªããã¹ã¦ã®ãµã¼ãã¹ã§å
±éã§ããã¤ã¾ããã¦ã¼ã¶ã¼ãä½ãããªãã¦ããGoogle Cloud ãå©ç¨ãã¦ããéãã転éä¸ã®ãã¼ã¿ï¼data in transitï¼ã¨ä¿ç®¡ä¸ã®ãã¼ã¿ï¼data at restï¼ã¯ã¨ãã«ãæå·åããã¦ãããã¨ã«ãªãã¾ãã</p>
<p>ãã ãã»ãã¥ãªãã£åä¸ãæ³çè¦å¶ã®è¦ä»¶ã¸ã®éµå®ãªã©ã®ç®çã§ãGMEK ã§ã¯ãªãç¬èªã®æå·éµãå©ç¨ããå¿
è¦ãããå ´åãããã¾ãããã®å ´åã¯ã<strong>Cloud KMS</strong> ã使ã£ã¦ç¬èªã®æå·éµã管çãããã¨ãã§ãã¾ãããã®ã¨ãããã®é¡§å®¢ç¬èªã®éµã®ãã¨ã <strong>Customer-managed encryption keys</strong>ï¼CMEKï¼ã¨å¼ã³ã¾ãã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-kms-explained" title="Cloud KMSãå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-kms-explained">blog.g-gen.co.jp</a></cite></p>
<p>ããã«å³ããè¦å¶è¦ä»¶çã§ã¯ãã¯ã©ã¦ãç°å¢ã«éµãä¿ç®¡ãããã¨ã許ãããªãå ´åãããã¾ãããã®å ´åã¯é¡§å®¢ã®ç¬èªç°å¢ã§éµãä¿ç®¡ã»ç®¡çããæå·åã»å¾©å·ã®ãã³ã«éµãä¿ç®¡å ´æããåãåºãã¦å©ç¨ãããã¨ãã§ãã¾ãããã®ã¨ãããã®éµã®ãã¨ã <strong>Customer-supplied
encryption keys</strong>ï¼CSEKï¼ã¨å¼ã³ã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/docs/security/encryption/customer-supplied-encryption-keys?hl=ja">顧客æå®ã®æå·éµ</a></li>
</ul>
<p>GMEK < CMEK < CSEK ã®é ã§ä¿å®ãéç¨ã®å·¥æ°ã¯å¤§ãããªãã¾ãããå³ããè¦ä»¶ã«å¯¾å¿ãããã¨ãã§ãã¾ãã試é¨ã§ã¯ãããã3種é¡ã®éµã®<strong>æå³ãæ£ããç解</strong>ãã¦ããã°ãæ£çãé¸ã¶ãã¨ãã§ãã¾ãã</p>
<h1 id="BigQuery-ML">BigQuery ML</h1>
<h2 id="BigQuery-ML-ã®åºæ¬">BigQuery ML ã®åºæ¬</h2>
<p>å½è©¦é¨ã§ã¯ <strong>BigQuery ML</strong> ã®åºæ¬çãªç解ãåããã¾ããBigQuery ML ã§ã¯ä½ãå®ç¾ã§ããã®ããã¾ããªã¢ã¼ãã¢ãã«ã«ãã Vertex AI ã¢ãã«ã®å¼ã³åºãã¨ãã£ãæ¦å¿µãç解ãã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/bqml-introduction?hl=ja">BigQuery ã® AI 㨠ML ã®æ¦è¦</a></li>
</ul>
<h2 id="çµã¿è¾¼ã¿ã¢ãã«">çµã¿è¾¼ã¿ã¢ãã«</h2>
<p>BigQuery ML ã«ã¯ãããã«å©ç¨å¯è½ãªãã«ãã¤ã³ã¢ãã«ãåå¨ãã¾ãããããã®ã¢ãã«ãæå®ãããã¬ã¼ãã³ã°ãã¼ã¿ãæå
¥ããã°ãSQL ã ãã§ç°¡åã«ç¬èªã¢ãã«ãéçºå¯è½ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/bqml-introduction?hl=ja#internally_trained_models">å
é¨ã§ãã¬ã¼ãã³ã°ãããã¢ãã«</a></li>
</ul>
<p>代表çãªã¢ãã«ã¨ã¦ã¼ã¹ã±ã¼ã¹ãé ã«å
¥ãã¦ããã¦ãã ãããæç³»åï¼Time seriesï¼ã¨ç·å½¢å帰ï¼Linear regressionï¼ã¯ããä¼¼ã¦ãã¾ãããä¾ãã°åºèã®éè¦äºæ¸¬ã®éãã»ã¼ã«ãªã©ã®ç°å¸¸å¤ãå£ç¯æ§ã®å¤åãèæ
®ã«å
¥ãã¦ãã¬ã¼ãã³ã°ã§ããã®ã¯æç³»åäºæ¸¬ã§ãã</p>
<table>
<thead>
<tr>
<th> ã¢ãã«å </th>
<th> ç¨é </th>
</tr>
</thead>
<tbody>
<tr>
<td> æç³»åï¼Time seriesï¼ </td>
<td> æç³»åäºæ¸¬ã<strong>ç°å¸¸å¤ãå£ç¯æ§ãä¼æ¥ãèæ
®</strong>ããã </td>
</tr>
<tr>
<td> ç·å½¢å帰ï¼Linear regressionï¼ </td>
<td> <strong>ç·å½¢ã®äºæ¸¬</strong>ãä¾ãã°ãç¹å®ã®æ¥ã®ååå£²ä¸ </td>
</tr>
<tr>
<td> ãã¸ã¹ãã£ãã¯å帰ï¼Logistic regressionï¼ </td>
<td> True ã§ããå¯è½æ§ã<strong>0ã¨1ã®éã§</strong>äºæ¸¬ </td>
</tr>
<tr>
<td> K å¹³åæ³ã¯ã©ã¹ã¿ãªã³ã°ï¼K-means clusteringï¼ </td>
<td> ãã¼ã¿ã®<strong>åé¡</strong>ã顧客ã»ã°ã¡ã³ãã®åå¥ãªã© </td>
</tr>
<tr>
<td> è¡åå解ï¼Matrix factorizationï¼ </td>
<td> <strong>ååã®ã¬ã³ã¡ã³ãã¼ã·ã§ã³</strong>çãéå»ã®è¡åãè©ä¾¡ãã¦ãããããä½æ </td>
</tr>
<tr>
<td> 主æååæï¼Principal component analysisãPCAï¼ </td>
<td> ãã¼ã¿ã®æ¬¡å
åæ¸ </td>
</tr>
</tbody>
</table>
<p>ã¾ãã¢ãã«ããã¬ã¼ãã³ã°ããéã«ã©ã®ãã㪠SQL ãæ¸ãã°ããã®ãã¨ããç´°ããç¹ãåºé¡ããã¾ããä¾ãã°ä»¥ä¸ã®ããã¥ã¡ã³ãã§ã¯ããã¸ã¹ãã£ãã¯å帰ã®ç®çå¤æ°ã¨ãªãåã®ååã <code>input_label_cols</code> ãªãã·ã§ã³ã§æå®ãã¦ãã¾ããããã©ã«ãã§ã¯ç®çå¤æ°å㯠<code>label</code> ã¨ãªããããCREATE MODEL æã®ä¸ã® SELECT æ㧠<code>as label</code> ã¨ãã¦åãé¸æããã°ããã®åãç®çå¤æ°ã¨ãã¦ãã¬ã¼ãã³ã°ããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/logistic-regression-prediction?hl=ja#create_a_logistic_regression_model">ãã¸ã¹ãã£ãã¯å帰ã¢ãã«ãä½æãã</a></li>
</ul>
<h2 id="ã¹ãã¥ã¼ã¨ããªãã">ã¹ãã¥ã¼ã¨ããªãã</h2>
<p>ãã¬ã¼ãã³ã°ããã¢ãã«ãæ¬çªéç¨ããéã«éè¦ãªãã¼ã¯ã¼ãã¨ãã¦ã<strong>ãã¼ã¿ã¹ãã¥ã¼</strong>ï¼Data skewï¼ã¨<strong>ãã¼ã¿ããªããï¼Data driftï¼</strong>ã¨ããè¨èãç解ãã¦ããã¦ãã ãããBigQuery ML ã®å
¬å¼ããã¥ã¡ã³ãã§ã¯ä»¥ä¸ã®ããã«å®ç¾©ãã¦ãã¾ãã</p>
<table>
<thead>
<tr>
<th> å称 </th>
<th> æå³ </th>
</tr>
</thead>
<tbody>
<tr>
<td> ãã¼ã¿ã¹ãã¥ã¼ï¼Data skewï¼ </td>
<td> ãã¬ã¼ãã³ã°ãã¼ã¿ã®åå¸ããæ¬çªç°å¢ã§ãµã¼ãããããã¼ã¿ã¨å¤§ããç°ãªãå ´åã«çºç </td>
</tr>
<tr>
<td> ãã¼ã¿ããªããï¼Data driftï¼ </td>
<td> æ¬çªç°å¢ã§ã®ãã¼ã¿ãæéã®çµéã¨ã¨ãã«å¤§ããå¤åããå ´åã«çºç </td>
</tr>
</tbody>
</table>
<p>ããªãã¡ããã¼ã¿ã¹ãã¥ã¼ãç£è¦ãããã¨ã§ãã¬ã¼ãã³ã°ã¨å®è·µã®ãã¼ã¿ã®ãããããã¼ã¿ããªãããç£è¦ãããã¨ã§æéçµéã«ä¼´ãã¢ãã«ã®å£åããããããæ¤ç¥ãããã¨ãã§ããã¨ããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/model-monitoring-overview?hl=ja">ã¢ãã« ã¢ãã¿ãªã³ã°ã®æ¦è¦</a></li>
</ul>
<h2 id="Gemini">Gemini</h2>
<p>BigQuery ã§ã¯ããªã¢ã¼ãã¢ãã«ãä½æãããã¨ã§ LLM ã§ãã <strong>Gemini ãå¼ã³åºã</strong>ãã¨ãã§ãã¾ãã<code>CREATE OR REPLACE MODEL</code> ã§ãªã¢ã¼ãã¢ãã«ãå®ç¾©ãããã¨ã<code>ML.GENERATE_TEXT</code> 㧠Gemini ãå¼ã³åºããBigQuery å
é¨ã®ãã¼ã¿ãã¤ã³ããããã¦ããã¹ããçæããããã¨ãå¯è½ã§ãã</p>
<h1 id="AutoML">AutoML</h1>
<p><strong>AutoML</strong> ã«é¢ããåé¡ããè¥å¹²åºé¡ããã¾ããGoogle Cloud ã® AutoML ã§ã¯ã大éã®æ師ãã¼ã¿ã Cloud Storage çã«é
ç½®ãã¦ãããAutoML ã®ãã¬ã¼ãã³ã°ãå®è¡ãããã¨ã§ãç°¡åã«ç¬èªã®æ©æ¢°å¦ç¿ã¢ãã«ããã¬ã¼ãã³ã°ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/vertex-ai/docs/beginner/beginners-guide?hl=ja">AutoML åå¿è
åãã¬ã¤ã</a></li>
</ul>
<h1 id="Cloud-Storage">Cloud Storage</h1>
<h2 id="Cloud-Storage-ã®åºæ¬">Cloud Storage ã®åºæ¬</h2>
<p><strong>Cloud Storage</strong> ã¯é »åºãããã¯ãã§ãã以ä¸ã®è¨äºãåç
§ããæ©è½ãç解ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-storage-explained" title="Cloud Storage(GCS)ãå¾¹åºè§£èª¬ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-storage-explained">blog.g-gen.co.jp</a></cite></p>
<p>ç¹ã«ããã®å¾ã®è¦åºãã§åæããæ©è½åã¯å¿
ãæ¼ããã¦ãã ããã</p>
<h2 id="ã¹ãã¬ã¼ã¸ã¯ã©ã¹">ã¹ãã¬ã¼ã¸ã¯ã©ã¹</h2>
<p><strong>Cloud Storage</strong> ã® <strong>ã¹ãã¬ã¼ã¸ã¯ã©ã¹</strong>ã®æ¦å¿µã¯æ£ç¢ºã«ç解ãã¦ãã ããã</p>
<table>
<thead>
<tr>
<th> ã¹ãã¬ã¼ã¸ã¯ã©ã¹ </th>
<th> ä¿ç®¡æé </th>
<th> ãªãã¬ã¼ã·ã§ã³æé </th>
<th> æä½ä¿ç®¡æé </th>
</tr>
</thead>
<tbody>
<tr>
<td> Standard Storage </td>
<td> é«ã </td>
<td> å®ã </td>
<td> ãªã </td>
</tr>
<tr>
<td> Nearline Storage </td>
<td> â </td>
<td> â </td>
<td> 30 æ¥ </td>
</tr>
<tr>
<td> Coldline Storage </td>
<td> â </td>
<td> â </td>
<td> 90 æ¥ </td>
</tr>
<tr>
<td> Archive Storage </td>
<td> å®ã </td>
<td> é«ã </td>
<td> 365 æ¥ </td>
</tr>
</tbody>
</table>
<p>Standard > Nearline > Coldline > Archive ã®é ã§ä¿ç®¡æéãå®ããªã£ã¦ãããã¨ããæä½ä¿ç®¡æéï¼ãã®æéããçããªãã¸ã§ã¯ããåé¤ããã¨ããã®æéåã®ä¿ç®¡æéã¯çºçããï¼ãé·ããªã£ã¦ãããã¨ãç解ãã¦ãã ãããæä½ä¿ç®¡æéã¯0ã30ã90ã365ã¨è¦ããã¹ãã¬ã¼ã¸ã¯ã©ã¹ã®å称ã¨åããã¦è¦ãã¦ããã¦ãã ããã</p>
<h2 id="ãªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«">ãªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«</h2>
<p><strong>ãªãã¸ã§ã¯ãã©ã¤ããµã¤ã¯ã«</strong>ï¼ã©ã¤ããµã¤ã¯ã«ã«ã¼ã«ï¼ãè¨å®ãããã¨ã§ãå¤ããªã£ããªãã¸ã§ã¯ããèªåçã«ããã¢ã¼ã«ã¤ãå¯ãã®ã¹ãã¬ã¼ã¸ã¯ã©ã¹ã«ç§»åããããåé¤ãããã§ãã¾ããã©ã¤ããµã¤ã¯ã«ã®ã¢ã¯ã·ã§ã³ã¯ã以ä¸ã®3ã¤ã®ã¿ã§ãã</p>
<ul>
<li><code>Delete</code>ï¼ãªãã¸ã§ã¯ããåé¤ããï¼</li>
<li><code>SetStorageClass</code>ï¼ã¹ãã¬ã¼ã¸ã¯ã©ã¹ãè¨å®ããï¼</li>
<li><code>AbortIncompleteMultipartUpload</code>ï¼éä¸ã ã£ããã«ããã¼ãã¢ãããã¼ããåé¤ããï¼</li>
</ul>
<p>ã©ã¤ããµã¤ã¯ã«ã«ã¼ã«ãè¨å®ãããã¨ã§ããä½æãã30æ¥çµéãããªãã¸ã§ã¯ã㯠Nearline ã«ç§»åã90æ¥çµéããã Coldline ã«ç§»åã1å¹´éçµéãããåé¤ããããªã©ã®è¤éãªã«ã¼ã«è¨å®ãå¯è½ã§ãã</p>
<h2 id="ãã¼ã¸ã§ãã³ã°">ãã¼ã¸ã§ãã³ã°</h2>
<p><strong>ãã¼ã¸ã§ãã³ã°</strong>ã®æ©è½ãå¿
ãç解ãã¦ããã¦ãã ããããªãã¸ã§ã¯ããä¸æ¸ãããã¦ããæå®ããä¸ä»£ãæ®ãã¦ãããã¨ãã§ãã¾ããåè¿°ã®ã©ã¤ããµã¤ã¯ã«ã«ã¼ã«ã¨çµã¿åããã¦ãããªãã¸ã§ã¯ãã¯3ä¸ä»£ä¿ç®¡ãããä½æãã30æ¥çµéãããªãã¸ã§ã¯ã㯠Nearline ã«ç§»åã...ãã¨ãã£ãè¨å®ãå¯è½ã§ãã</p>
<h2 id="Autoclass">Autoclass</h2>
<p><strong>Autoclass</strong> æ©è½ãåºé¡ããã¾ããAutoclass ãæå¹åããã¨ããªãã¸ã§ã¯ãã®ã¢ã¯ã»ã¹ç¶æ³ã«å¿ãã¦èªåçã«ã¹ãã¬ã¼ã¸ã¯ã©ã¹ãè¨å®ãã¦ããã¾ãã®ã§ã<strong>éç¨å·¥æ°ãç¯æ¸</strong>ãããã¨ãå¯è½ã§ãã</p>
<h2 id="ãã¥ã¢ã«ãªã¼ã¸ã§ã³ãã«ããªã¼ã¸ã§ã³">ãã¥ã¢ã«ãªã¼ã¸ã§ã³ããã«ããªã¼ã¸ã§ã³</h2>
<p>Cloud Storage ãã±ãããä½ææããã±ããã®é
ç½®å ´æãã·ã³ã°ã«ãªã¼ã¸ã§ã³ããã¥ã¢ã«ãªã¼ã¸ã§ã³ããã«ããªã¼ã¸ã§ã³ã®ä¸ããé¸æã§ãã¾ããããããã®ç¹å¾´ã¯ã以ä¸ã®ããã¥ã¡ã³ãããç解ãã¦ããã¦ãã ããã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/storage/docs/locations?hl=ja#considerations">ãã±ã¼ã·ã§ã³ã«é¢ããçæäºé
</a></li>
</ul>
<p>ãã¼ã¿ã®åé·æ§ã確ä¿ãã¤ã¤ããã¼ã¿ã®æå¨ãæããã«ãã¦ããããã«ã¯ãã¥ã¢ã«ãªã¼ã¸ã§ã³ãé¸æããã·ãã¥ã¨ã¼ã·ã§ã³ããããã¾ãããã¼ã¿ã®åé·åã¯éåæã§è¡ããã¾ããããã©ã«ãã®éåæã¬ããªã±ã¼ã·ã§ã³ã§ã¯ã1æé以å
ã«99.9%ã®ãªãã¸ã§ã¯ããè¤è£½ããã12æé以å
ã«100%ã«éãã¾ããããã§ã¯ RPOï¼Recovery Point Objectiveï¼è¦ä»¶ãæºãããªãå ´åã<strong>ã¿ã¼ãã¬ããªã±ã¼ã·ã§ã³</strong>ï¼Turbo replicationï¼ãæå¹åãããã¨ã§ã15å以å
ã«100%ã®ãã¼ã¿ãè¤è£½ã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/storage/docs/availability-durability?hl=ja">ãã¼ã¿ã®å¯ç¨æ§ã¨èä¹
æ§</a></li>
</ul>
<h2 id="Storage-Transfer-Service">Storage Transfer Service</h2>
<p><strong>Storage Transfer Service</strong> ã¯ãAmazon S3 ãªã©ã®å¤é¨ã¹ãã¬ã¼ã¸ãµã¼ãã¹ãããªã³ãã¬ãã¹ã®ãã¡ã¤ã«ãµã¼ãã¼çãã Cloud Storage ã«ãã¼ã¿ã転éããããã®ãã«ããã¼ã¸ããµã¼ãã¹ã§ãã</p>
<p>BigQuery Transfer Service ã <strong>BigQuery ã¸ã®è»¢é</strong>ã管çãããµã¼ãã¹ã§ããä¸æ¹ãStorage Transfer Service 㯠<strong>Cloud Storage ã¸ã®è»¢é</strong>ã管çãããµã¼ãã¹ã§ããã¨è¦ãã¦ãã ããã</p>
<p>å
å«æ¥é è¾ï¼include filterï¼ãé¤å¤æ¥é è¾ï¼exclude filterï¼ã使ãã<strong>対象ç¯å²ãçµã£ã¦ã¸ã§ãè¤æ°ä½ãã並åå®è¡</strong>ãããã¨ã§è»¢éæéãçãããããéã«ç´åã§å®è¡ãããã¨ã§ API å®è¡å¶éãåé¿ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/storage-transfer/docs/performance?hl=ja">転éé度ãåä¸ããã</a></li>
</ul>
<p>ã¾ã Storage Transfer Service ã§ã¯ããªã³ãã¬ãã¹ã®ãã¡ã¤ã«ãµã¼ãã¼ããã®ãã¼ã¿è»¢éãå®ç¾ã§ãã¾ãããã®å ´åããªã³ãã¬ãã¹å´ã« Docker ãã¼ã¹ã®<strong>ã¨ã¼ã¸ã§ã³ããèµ·åããå¿
è¦</strong>ãããã¾ããã¾ããããã¯ã¼ã¯å¸¯åãéããã¦ããå ´åã¯ãã¨ã¼ã¸ã§ã³ããå©ç¨ãã<strong>帯åã®ä¸éãè¨å®</strong>ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/storage-transfer/docs/on-prem-set-up?hl=ja">ãã¡ã¤ã« ã·ã¹ãã 転éã®è¦ä»¶</a></li>
<li>åè : <a href="https://cloud.google.com/storage-transfer/docs/obtaining-bandwidth-on-prem?hl=ja">ãããã¯ã¼ã¯å¸¯åå¹
ã管çãã</a></li>
</ul>
<h2 id="Storage-Transfer-Appliance">Storage Transfer Appliance</h2>
<p><strong>Storage Transfer Appliance</strong> ã¯ç©ççãªã¢ãã©ã¤ã¢ã³ã¹ãã¦ã¼ã¶ã¼ã®ãã¼ã¿ãåå¨ããå ´æã«é
éããç©ççã«çµç·ãã¦ãã¼ã¿ãåãè¾¼ã¿ãã¾ã Google ã«è¿éãããã¨ã§ Google ã®ãã¼ã¿ã»ã³ã¿ã¼ã«ç´æ¥ãã¼ã¿ãæã¡è¾¼ãããµã¼ãã¹ã§ããæã¡è¾¼ã¿å
㯠Cloud Storage ãã±ããã«ãªãã¾ããã¤ã³ã¿ã¼ããããå°ç¨ç·çµç±ã§ã®ãã¼ã¿è»¢éã§ã¯ãã¾ãã«æéãããã£ã¦ãã¾ãå ´åããååãªå¸¯åã確ä¿ã§ããªãå ´åã«å©ç¨ãã¾ãããªããæ¥æ¬ã§ãå©ç¨å¯è½ã§ããé¡ä¼¼ãµã¼ãã¹ã¨ãã¦ãAmazon Web Servicesï¼AWSï¼ã® AWS Snowball ãããã¾ãã</p>
<p><strong>ãã¿ãã¤ãï¼PBï¼ç´ã®éã®ãã¼ã¿</strong>ã Google Cloud ã«æã¡è¾¼ãå ´åããæ°ç¾ TB ã®ãã¼ã¿ã移è¡ãããã<strong>ãããã¯ã¼ã¯å¸¯åãéããã¦ãã</strong>å ´åçã«ã¯ãæåãªé¸æè¢ã®1ã¤ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/transfer-appliance/docs/4.0/overview">Overview</a></li>
</ul>
<h1 id="Looker">Looker</h1>
<h2 id="Looker-ã®åºæ¬">Looker ã®åºæ¬</h2>
<p><strong>Looker</strong> ã¯ãGoogle Cloud ãæä¾ãã BI ãã©ãããã©ã¼ã ãµã¼ãã¹ã§ãã<strong>LookML</strong> ã¨ãããã¼ã¿ã¢ããªã³ã°è¨èªã使ã£ã¦ãããããã»ãã³ãã£ãã¯ã¬ã¤ã¤ãå®ç¾©ãããã¨ã§ãé«åº¦ãªãã¼ã¿ã¬ããã³ã¹ãå®ç¾ã§ããã®ãç¹å¾´ã§ãã</p>
<p>LookML ã«ãããã¼ã¿ã¢ããªã³ã°ããåæããå¾ç¶ã®æ½çã«ç¹ããè±å¯ãªæ©è½ãã¾ãçµç¹å¤ã¸ã®ãã¼ã¿å
±æã«é¢ããæ©è½ãªã©ã«ãããLooker ã¯åãªã BI ãã¼ã«ã§ã¯ãªããé«åº¦ãªãã¼ã¿ãã©ãããã©ã¼ã ã¨ãã¦ç¨ãããã¾ãã</p>
<p>ãªããLooker ã«ã¯ãå¾æ¥åã® Lookerï¼Originalï¼ ã¨ãGoogle Cloud ã¨é«åº¦ã«çµ±åããã Lookerï¼Google Cloud Coreï¼ ã®2ãã¼ã¸ã§ã³ãããã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/looker/docs/looker-core-feature-differences?hl=ja">Lookerï¼Google Cloud ã³ã¢ï¼ã§å©ç¨å¯è½ãªæ©è½ </a></li>
</ul>
<h2 id="ã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³">ã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³</h2>
<p>Looker ã使ãã«ã¯ããã¼ã¿ãã¼ã¹ä¸ã®ãã¼ã¿ã使ããäºåã« LookML ã§<strong>ã¡ã¸ã£ã¼</strong>ï¼measuresï¼ã¨<strong>ãã£ã¡ã³ã·ã§ã³</strong>ï¼dimensionsï¼ãå®ç¾©ãã¾ãã</p>
<p>ã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³ã¯ãBI ãã¼ã«çã§ã¯ä¸è¬çãªç¨èªã§ãã®ã§ãæå³ãç解ãã¦ããã¦ãã ããã</p>
<p>ã¾ããã¡ã¸ã£ã¼ã¨ãã£ã¡ã³ã·ã§ã³ã¯ Looker ä¸ã§ã¯ <strong>view ãã¡ã¤ã«</strong>ã¨å¼ã°ããå®ç¾©ãã¡ã¤ã«ã«å®ç¾©ãã¾ãã</p>
<h2 id="Looker-ã«ããã権é管ç">Looker ã«ããã権é管ç</h2>
<p>Looker ã§ã¯ãããã·ã¥ãã¼ãçã¸ã®æ¨©é管çã®ãããã¦ã¼ã¶ã¼ã<strong>ã°ã«ã¼ã</strong>ã«æ ¼ç´ã§ãã¾ãã</p>
<p>é¨ç½²ããã¼ã ãã¨ã«ã°ã«ã¼ããä½æããã¦ã¼ã¶ã¼ããã®ä¸ã«é
ç½®ãããããã©ã«ãã«ããã¦ã°ã«ã¼ãåä½ã§æ¨©éãä»ä¸ããã®ããã¹ããã©ã¯ãã£ã¹ã§ããéç¨è² è·è»½æ¸ã®ããã<strong>åã
ã®ã¦ã¼ã¶ã¼ã«ã§ã¯ãªãã°ã«ã¼ãã«æ¨©éãä»ä¸ããã¹ã</strong>ã§ããã¨ããåå㯠Google Cloud ã® IAM ã¨ãå
±éãã¦ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/looker/docs/admin-panel-users-groups?hl=ja">ã°ã«ã¼ã </a></li>
</ul>
<h1 id="Analytics-Hub">Analytics Hub</h1>
<p><strong>Analytics Hub</strong> ã¯ãç°ãªãçµç¹éã§ãã¼ã¿ãå¹çãããã»ãã¥ã¢ã«æä¾ãããããã®ãã©ãããã©ã¼ã ã§ããAnalytics Hub 㯠BigQuery ã Pub/Sub ã®ãã¼ã¿äº¤æã«å¯¾å¿ãã¦ãã¾ãã</p>
<p>èªç¤¾ã®ãã¼ã¿ããã¢ã¯ã»ã¹æ¨©éãé©åã«ç®¡çããªããå¹çããä»ç¤¾ã«æä¾ãããã·ãã¥ã¨ã¼ã·ã§ã³ã§ã¯ãAnalytics Hub ãé¸æã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/bigquery/docs/analytics-hub-introduction?hl=ja">Analytics Hub ã®æ¦è¦</a></li>
</ul>
<h1 id="Colab-Enterprise">Colab Enterprise</h1>
<p><strong>Colab Enterprise</strong> ã¯ããã«ããã¼ã¸ãã® Python ãã¼ãããã¯ãµã¼ãã¹ã§ããBigQuery ã Dataproc ãªã©ä»ã® Google Cloud ãµã¼ãã¹ã¨ãæè»ã«é£æºã§ãã¾ãã</p>
<p>Colab Enterprise ã®ãã¼ãããã¯ä¸ãã Python ã使ã£ã¦ BigQuery ä¸ã®ãã¼ã¿ãæä½ãããã¨ããªã©ã«ãGoogle ã¢ã«ã¦ã³ãã®èªè¨¼æ
å ±ã使ã£ã¦ã¹ã ã¼ãºã«ãã¼ã¿é£æºãå¯è½ã§ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/colab/docs/introduction">Introduction to Colab Enterprise</a></li>
</ul>
<h1 id="Cloud-SQL">Cloud SQL</h1>
<p><strong>Cloud SQL</strong> ã«é¢ããåé¡ãè¥å¹²åºé¡ããã¾ãã以ä¸ã®è¨äºãèªã¿ãåºæ¬ãç解ãã¦ãã ããã</p>
<p><iframe src="https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.g-gen.co.jp%2Fentry%2Fcloud-sql-explained" title="Cloud SQLãå¾¹åºè§£èª¬ï¼ - G-gen Tech Blog" class="embed-card embed-blogcard" scrolling="no" frameborder="0" style="display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;" loading="lazy"></iframe><cite class="hatena-citation"><a href="https://blog.g-gen.co.jp/entry/cloud-sql-explained">blog.g-gen.co.jp</a></cite></p>
<p>Cloud SQL ã®é«å¯ç¨æ§ï¼HAï¼ã¤ã³ã¹ã¿ã³ã¹ã使ãã¨ãç°¡åãªè¨å®ã§ããããªã¼ã¸ã§ã³ã®ä¸ã®è¤æ°ã®ã¾ã¼ã³ã« Primary ã¤ã³ã¹ã¿ã³ã¹ã¨ Secondary ã¤ã³ã¹ã¿ã³ã¹ãèµ·åããé«ãå¯ç¨æ§ãå®ç¾ãããã¨ãã§ãã¾ããã¾ããããã«å ãã¦éåæã¬ããªã±ã¼ã·ã§ã³ã®<strong>ã¬ããªã«</strong>ãå ãããã¨ã§ããªã¼ã¸ã§ã³åä½ã§ã®é害ã«å¯¾å¿ãããã¨ãã§ãã¾ãã</p>
<ul>
<li>åè : <a href="https://cloud.google.com/sql/docs/mysql/intro-to-cloud-sql-disaster-recovery?hl=ja#dr-architecture">é害復æ§ã¢ã¼ããã¯ãã£</a></li>
</ul>
<div class="profile-cards-list">
<div class="profile-card-container">
<div class="sw-profile">
<div class="sw-profile__img" style="background-image:url(https://cdn-ak.f.st-hatena.com/images/fotolife/g/ggen-sugimura/20240805/20240805190556.jpg);"></div>
<div class="sw-profile__txt-wrap">
<p class="sw-profile__name">ææ å馬 <a href="https://blog.g-gen.co.jp/archive/author/ggen-sugimura">(è¨äºä¸è¦§)</a></p>
<p class="sw-profile__txt">å·è¡å½¹å¡ CTO / ã¯ã©ã¦ãã½ãªã¥ã¼ã·ã§ã³é¨ é¨é·</p>
<p class="sw-profile__txt">å
è¦å¯å®ã¨ããçµæ´ãæã¤ç¾ IT ã¨ã³ã¸ãã¢ãã¯ã©ã¦ã管çã»éç¨ããããã¯ã¼ã¯ã«ç¥è¦ãAWS 12è³æ ¼ãGoogle Cloudèªå®è³æ ¼11è³æ ¼ãX (æ§ Twitter) ã§ã¯ Google Cloud ã AWS ã®ã¢ãããã¼ãæ
å ±ãã¤ã¶ããã¦ãã¾ãã</p>
<a href="https://twitter.com/y_sugi_it?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @y_sugi_it</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p class="sw-profile__txt"></p>
</div>
</div>
</div>
</div>
ggen-sugimura