<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
  <title>Architect&#39;s Log</title>
  
  <subtitle>I&#39;m a Cloud Architect. I&#39;m highly motivated to reduce toils with driving DevOps.</subtitle>
  
  <link href="https://blog.jhashimoto.net/"/>
  <updated>2025-09-27T21:41:32+09:00</updated>
  <author>
    <name>JHashimoto</name>
  </author>
  <generator uri="https://blog.hatena.ne.jp/" version="dd1dc12ea5c05e203be39af96d7695">Hatena::Blog</generator>
  <id>hatenablog://blog/12921228815716984990</id>

  
    
    
    <entry>
        <title>GitHub認証にGitHub CLIを利用するには</title>
        <link href="https://blog.jhashimoto.net/entry/2025/09/27/214132"/>
        <id>hatenablog://entry/6802888565257437733</id>
        <published>2025-09-27T21:41:32+09:00</published>
        <updated>2025-09-27T21:54:43+09:00</updated>        <summary type="html">コマンドラインから GitHub にアクセスする際に、認証する方法は複数あります。 GitHub CLI (gh) を使用しブラウザで認証すると、persnal access token の発行が不要になります。プロトコルは SSH も選べますが、今回は鍵の作成が不要な HTTPS を使用します。 環境 Ubuntu 24.04.3 LTS on WSL 手順 GitHub CLI (gh) をインストールします。 $ sudo apt update $ sudo apt install gh $ gh --version # gh version 2.45.0 (2025-07-18 Ubu…</summary>
        <content type="html">&lt;p&gt;コマンドラインから GitHub にアクセスする際に、認証する方法は複数あります。&lt;/p&gt;

&lt;p&gt;GitHub CLI (gh) を使用しブラウザで認証すると、persnal access token の発行が不要になります。プロトコルは SSH も選べますが、今回は鍵の作成が不要な HTTPS を使用します。&lt;/p&gt;

&lt;h3 id=&quot;環境&quot;&gt;環境&lt;/h3&gt;

&lt;p&gt;Ubuntu 24.04.3 LTS on WSL&lt;/p&gt;

&lt;h3 id=&quot;手順&quot;&gt;手順&lt;/h3&gt;

&lt;p&gt;GitHub CLI (gh) をインストールします。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ sudo apt update
$ sudo apt install gh                                                                                 
$ gh &lt;span class=&quot;synSpecial&quot;&gt;--version&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# gh version 2.45.0 (2025-07-18 Ubuntu 2.45.0-1ubuntu0.3)                                                                                                                      ```&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;gh auth login&lt;/code&gt; を実行し、以下のように入力します。ブラウザで提示された URL にアクセスし、認証コードを入力します。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ gh auth login
? What account &lt;span class=&quot;synStatement&quot;&gt;do&lt;/span&gt; you want to log into? GitHub.com
? What is your preferred protocol &lt;span class=&quot;synStatement&quot;&gt;for&lt;/span&gt; Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
&lt;/pre&gt;


&lt;p&gt;gh が Git の credential helper として設定され、今後 git clone 等の際に認証が不要になります。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ git config &lt;span class=&quot;synSpecial&quot;&gt;--list&lt;/span&gt; | &lt;span class=&quot;synStatement&quot;&gt;grep&lt;/span&gt; credential
&lt;span class=&quot;synComment&quot;&gt;# credential.https://github.com.helper=&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# credential.https://github.com.helper=!/usr/bin/gh auth git-credential&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# credential.https://gist.github.com.helper=&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# credential.https://gist.github.com.helper=!/usr/bin/gh auth git-credential&lt;/span&gt;
&lt;/pre&gt;


&lt;h3 id=&quot;参考&quot;&gt;参考&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/about-authentication-to-github&quot;&gt;https://docs.github.com/ja/authentication/keeping-your-account-and-data-secure/about-authentication-to-github&lt;/a&gt;&lt;/p&gt;
</content>        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/6802888565257437733/1758977683" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>なぜKMSキーが割り当てられていないエイリアスが存在するのか？</title>
        <link href="https://blog.jhashimoto.net/entry/2024/09/03/083007"/>
        <id>hatenablog://entry/6802340630903437213</id>
        <published>2024-09-03T08:30:07+09:00</published>
        <updated>2024-09-03T08:30:07+09:00</updated>        <summary type="html">AWS CLI list-aliases のレスポンスに、TargetKeyId フィールドがないエイリアスが含まれていることがあります。 aws kms list-aliases { &quot;Aliases&quot;: [ { &quot;AliasName&quot;: &quot;alias/aws/codecommit&quot;, &quot;AliasArn&quot;: &quot;arn:aws:kms:ap-northeast-1:xxxxxxxxxxxx:alias/aws/codecommit&quot;, &quot;TargetKeyId&quot;: &quot;xxxx...&quot;, &quot;CreationDate&quot;: &quot;2024-06-17T00:34:07.222000+00:00&quot;, &quot;…</summary>
        <content type="html">&lt;p&gt;AWS CLI &lt;code&gt;list-aliases&lt;/code&gt; のレスポンスに、TargetKeyId フィールドがないエイリアスが含まれていることがあります。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;aws kms list-aliases
&lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Aliases&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;AliasName&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;alias/aws/codecommit&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;,
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;AliasArn&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;arn:aws:kms:ap-northeast-1:xxxxxxxxxxxx:alias/aws/codecommit&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;,
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;TargetKeyId&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;xxxx...&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;,
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;CreationDate&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;2024-06-17T00:34:07.222000+00:00&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;,
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;LastUpdatedDate&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;2024-06-17T00:34:07.222000+00:00&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;,
        &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;AliasName&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;alias/aws/dynamodb&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;,
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;AliasArn&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;: &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;arn:aws:kms:ap-northeast-1:xxxxxxxxxxxx:alias/aws/dynamodb&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;,
        ...
&lt;/pre&gt;


&lt;p&gt;なぜ、KMSキーが割り当てられていないエイリアスが存在するのか疑問に思い、調べてみました。&lt;/p&gt;

&lt;p&gt;これらは、AWS が作成した定義済みのエイリアスで、まだ KMS キーとは関連付けられていないものでした。これらの定義済みエイリアスは、通常、サービスの使用をスタートすると AWS 管理キーに関連付けられます。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.aws.amazon.com%2Fja_jp%2Fkms%2Flatest%2Fdeveloperguide%2Fprogramming-aliases.html&quot; title=&quot;エイリアスの使用 - AWS Key Management Service&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot; loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.aws.amazon.com/ja_jp/kms/latest/developerguide/programming-aliases.html&quot;&gt;docs.aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;レスポンスには、TargetKeyId フィールドがないエイリアスが含まれている場合もあります。これらは AWS が作成した定義済みのエイリアスですが、まだ KMS キーとは関連付けられていません。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.aws.amazon.com%2Fja_jp%2Fkms%2Flatest%2Fdeveloperguide%2Falias-about.html&quot; title=&quot;エイリアスについて - AWS Key Management Service&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot; loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.aws.amazon.com/ja_jp/kms/latest/developerguide/alias-about.html&quot;&gt;docs.aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;一部の AWS エイリアスには KMS キーがありません。これらの定義済みエイリアスは、通常、サービスの使用をスタートすると、AWS マネージドキー に関連付けられます。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;ちなみに、CreateAlias API は TargetKeyId が必須なので、KMS キーが割り当てられないエイリアスを作成することはできません。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.aws.amazon.com%2Fja_jp%2Fkms%2Flatest%2FAPIReference%2FAPI_CreateAlias.html&quot; title=&quot;CreateAlias - AWS Key Management Service&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot; loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.aws.amazon.com/ja_jp/kms/latest/APIReference/API_CreateAlias.html&quot;&gt;docs.aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="AWS" label="AWS" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/6802340630903437213/1725323567" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>2022年に買って良かったもの８選</title>
        <link href="https://blog.jhashimoto.net/entry/2022/12/31/195000"/>
        <id>hatenablog://entry/4207112889949766984</id>
        <published>2022-12-31T19:50:00+09:00</published>
        <updated>2022-12-31T19:50:00+09:00</updated>        <summary type="html">2022年に買って良かったものを厳選して紹介します。</summary>
        <content type="html">&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20221231/20221231202644.jpg&quot; width=&quot;640&quot; height=&quot;427&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;2022年に買って良かったものを厳選して紹介します。&lt;/p&gt;

&lt;h2 id=&quot;昇降式スタンディングデスク&quot;&gt;昇降式スタンディングデスク&lt;/h2&gt;

&lt;p&gt;腰痛を患ったので買いました。立って仕事をするようになり、腰の負担はかなり軽くなった気がします。&lt;/p&gt;

&lt;p&gt;普通のデスクに乗せて使用するタイプです。ほとんど力を入れずに昇降でき、無段階で高さを調整できます。キーボード、マウス、ディスプレイを置いていますが、十分な広さがあります。構造はしっかりしていて揺れを気にせずに打鍵できます。その分重量はかなりあります (7.8Kg) 。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;Fenge スタンディングデスク 昇降式デスク リフティングテーブル 高さ調整 PCデスク 小型 持ち運び 折りたたみ無段階座位立位両用オフィスワークテーブル SD255006WO&quot;,&quot;b&quot;:&quot;Fenge&quot;,&quot;t&quot;:&quot;SD255006WO&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/51rqECurDDL._SL500_.jpg&quot;,&quot;\/51ORwSKq6jL._SL500_.jpg&quot;,&quot;\/41WCQceU--L._SL500_.jpg&quot;,&quot;\/51GUQK7OV+L._SL500_.jpg&quot;,&quot;\/412hjHa5YtL._SL500_.jpg&quot;,&quot;\/51eszEiicmL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B088LWSZXJ&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B088LWSZXJ&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/Fenge%20%E3%82%B9%E3%82%BF%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E3%83%87%E3%82%B9%E3%82%AF%20%E6%98%87%E9%99%8D%E5%BC%8F%E3%83%87%E3%82%B9%E3%82%AF%20%E3%83%AA%E3%83%95%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%20%E9%AB%98%E3%81%95%E8%AA%BF%E6%95%B4%20PC%E3%83%87%E3%82%B9%E3%82%AF%20%E5%B0%8F%E5%9E%8B%20%E6%8C%81%E3%81%A1%E9%81%8B%E3%81%B3%20%E6%8A%98%E3%82%8A%E3%81%9F%E3%81%9F%E3%81%BF%E7%84%A1%E6%AE%B5%E9%9A%8E%E5%BA%A7%E4%BD%8D%E7%AB%8B%E4%BD%8D%E4%B8%A1%E7%94%A8%E3%82%AA%E3%83%95%E3%82%A3%E3%82%B9%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%20SD255006WO\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=Fenge%20%E3%82%B9%E3%82%BF%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E3%83%87%E3%82%B9%E3%82%AF%20%E6%98%87%E9%99%8D%E5%BC%8F%E3%83%87%E3%82%B9%E3%82%AF%20%E3%83%AA%E3%83%95%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%20%E9%AB%98%E3%81%95%E8%AA%BF%E6%95%B4%20PC%E3%83%87%E3%82%B9%E3%82%AF%20%E5%B0%8F%E5%9E%8B%20%E6%8C%81%E3%81%A1%E9%81%8B%E3%81%B3%20%E6%8A%98%E3%82%8A%E3%81%9F%E3%81%9F%E3%81%BF%E7%84%A1%E6%AE%B5%E9%9A%8E%E5%BA%A7%E4%BD%8D%E7%AB%8B%E4%BD%8D%E4%B8%A1%E7%94%A8%E3%82%AA%E3%83%95%E3%82%A3%E3%82%B9%E3%83%AF%E3%83%BC%E3%82%AF%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%20SD255006WO&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;sV7QS&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-sV7QS&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;ノイズキャンセリングイヤーセット&quot;&gt;ノイズキャンセリングイヤーセット&lt;/h2&gt;

&lt;p&gt;ノイズキャンセリング付きです。以前からリモート会議中にPCの打鍵音がマイクに拾われていないか気になっていました。Zoomでテストしたところ、打鍵音は全く聞こえませんでした。高価なだけあって通話・音声は非常に安定しています。USBドングルを差し替えるだけで、複数デバイスで利用できます。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;Plantronics(プラトロニクス) Voyager 5200 UC イヤーセット&quot;,&quot;b&quot;:&quot;ポリー(Poly)&quot;,&quot;t&quot;:&quot;206110-01&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/31Nw4SFyO4L._SL500_.jpg&quot;,&quot;\/51pMFRlm7VL._SL500_.jpg&quot;,&quot;\/41EHg83Mn8L._SL500_.jpg&quot;,&quot;\/416OutE9L4L._SL500_.jpg&quot;,&quot;\/41EuqnU2I0L._SL500_.jpg&quot;,&quot;\/51omOUQjY-L._SL500_.jpg&quot;,&quot;\/41IBE7ub42L._SL500_.jpg&quot;,&quot;\/41wbNdE05WL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B07DFQWGYB&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B07DFQWGYB&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/Plantronics(%E3%83%97%E3%83%A9%E3%83%88%E3%83%AD%E3%83%8B%E3%82%AF%E3%82%B9)%20Voyager%205200%20UC%20%E3%82%A4%E3%83%A4%E3%83%BC%E3%82%BB%E3%83%83%E3%83%88\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=Plantronics(%E3%83%97%E3%83%A9%E3%83%88%E3%83%AD%E3%83%8B%E3%82%AF%E3%82%B9)%20Voyager%205200%20UC%20%E3%82%A4%E3%83%A4%E3%83%BC%E3%82%BB%E3%83%83%E3%83%88&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;6TnDn&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-6TnDn&quot;&gt;リンク&lt;/div&gt;





&lt;p&gt;ケースがドッキングスタンドになっており、置くだけで充電できます。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.poly.com%2Fjp%2Fja%2Fproducts%2Fheadsets%2Faccessories%2Fvoyager-5200-charge-case&quot; title=&quot;Voyager 5200 充電ケース - 充電ケース&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot; loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.poly.com/jp/ja/products/headsets/accessories/voyager-5200-charge-case&quot;&gt;www.poly.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;尚、単体モデルはケースとUSBドングルが付属していないので、ご注意ください。&lt;/p&gt;

&lt;h2 id=&quot;コンパクトデジタルスケール&quot;&gt;コンパクトデジタルスケール&lt;/h2&gt;

&lt;p&gt;封筒の計量に使っています。郵便局まで計量に行くのが面倒で購入しました。コンパクトでよいです。カバーが測る物を載せる容器になるのも便利です。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;YUUICHI コンパクトデジタルスケール 0.1gから3000gまで計量可能 はかり デジタル 測り 料理 調理 お菓子作り 封筒 レタースケール 風袋引き 計量はかり 日本語取扱説明書付き　電池付き&quot;,&quot;b&quot;:&quot;YUUICHI&quot;,&quot;t&quot;:&quot;N\\C&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/41SNM2X7pXL._SL500_.jpg&quot;,&quot;\/41OILJ5BF2L._SL500_.jpg&quot;,&quot;\/51lda9ilXhL._SL500_.jpg&quot;,&quot;\/51G5AJReANL._SL500_.jpg&quot;,&quot;\/41dONBxjqXL._SL500_.jpg&quot;,&quot;\/41F9WVgVqCL._SL500_.jpg&quot;,&quot;\/41+sZXFkMUL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09XXWJY2L&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09XXWJY2L&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/YUUICHI%20%E3%82%B3%E3%83%B3%E3%83%91%E3%82%AF%E3%83%88%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%E3%82%B9%E3%82%B1%E3%83%BC%E3%83%AB%200.1g%E3%81%8B%E3%82%893000g%E3%81%BE%E3%81%A7%E8%A8%88%E9%87%8F%E5%8F%AF%E8%83%BD%20%E3%81%AF%E3%81%8B%E3%82%8A%20%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%20%E6%B8%AC%E3%82%8A%20%E6%96%99%E7%90%86%20%E8%AA%BF%E7%90%86%20%E3%81%8A%E8%8F%93%E5%AD%90%E4%BD%9C%E3%82%8A%20%E5%B0%81%E7%AD%92%20%E3%83%AC%E3%82%BF%E3%83%BC%E3%82%B9%E3%82%B1%E3%83%BC%E3%83%AB%20%E9%A2%A8%E8%A2%8B%E5%BC%95%E3%81%8D%20%E8%A8%88%E9%87%8F%E3%81%AF%E3%81%8B%E3%82%8A%20%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%8F%96%E6%89%B1%E8%AA%AC%E6%98%8E%E6%9B%B8%E4%BB%98%E3%81%8D%E3%80%80%E9%9B%BB%E6%B1%A0%E4%BB%98%E3%81%8D\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=YUUICHI%20%E3%82%B3%E3%83%B3%E3%83%91%E3%82%AF%E3%83%88%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%E3%82%B9%E3%82%B1%E3%83%BC%E3%83%AB%200.1g%E3%81%8B%E3%82%893000g%E3%81%BE%E3%81%A7%E8%A8%88%E9%87%8F%E5%8F%AF%E8%83%BD%20%E3%81%AF%E3%81%8B%E3%82%8A%20%E3%83%87%E3%82%B8%E3%82%BF%E3%83%AB%20%E6%B8%AC%E3%82%8A%20%E6%96%99%E7%90%86%20%E8%AA%BF%E7%90%86%20%E3%81%8A%E8%8F%93%E5%AD%90%E4%BD%9C%E3%82%8A%20%E5%B0%81%E7%AD%92%20%E3%83%AC%E3%82%BF%E3%83%BC%E3%82%B9%E3%82%B1%E3%83%BC%E3%83%AB%20%E9%A2%A8%E8%A2%8B%E5%BC%95%E3%81%8D%20%E8%A8%88%E9%87%8F%E3%81%AF%E3%81%8B%E3%82%8A%20%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%8F%96%E6%89%B1%E8%AA%AC%E6%98%8E%E6%9B%B8%E4%BB%98%E3%81%8D%E3%80%80%E9%9B%BB%E6%B1%A0%E4%BB%98%E3%81%8D&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;nneCv&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-nneCv&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;ダンボールストッカー&quot;&gt;ダンボールストッカー&lt;/h2&gt;

&lt;p&gt;洗面所の隙間にぴったり収まるサイズなので購入しました。景観を損なわずにダンボールを保管できます。&lt;/p&gt;

&lt;p&gt;保管したままダンボールを縛れるのも便利です。キャスター付きで移動できます。マグネットでカッターなどの小物をくっつけられます。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;ビーワーススタイル ダンボールストッカー fillete(フィレッテ) 段ボールストッカー (ダンボールストッカー ホワイト×グレー W120)&quot;,&quot;b&quot;:&quot;be worth style&quot;,&quot;t&quot;:&quot;&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/2155xoqI4DL._SL500_.jpg&quot;,&quot;\/41qoH3lTwIL._SL500_.jpg&quot;,&quot;\/41uQcWekkLL._SL500_.jpg&quot;,&quot;\/4114T8N49gL._SL500_.jpg&quot;,&quot;\/41cZQwk6Q5L._SL500_.jpg&quot;,&quot;\/31vb8bOpjSL._SL500_.jpg&quot;,&quot;\/4126QriaxpL._SL500_.jpg&quot;,&quot;\/31Rb5QXuj0L._SL500_.jpg&quot;,&quot;\/418OTIAZC1L._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09MCH6R65&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09MCH6R65&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/%E3%83%93%E3%83%BC%E3%83%AF%E3%83%BC%E3%82%B9%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AB%20%E3%83%80%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20fillete(%E3%83%95%E3%82%A3%E3%83%AC%E3%83%83%E3%83%86)%20%E6%AE%B5%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20(%E3%83%80%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20%E3%83%9B%E3%83%AF%E3%82%A4%E3%83%88%C3%97%E3%82%B0%E3%83%AC%E3%83%BC%20W120)\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=%E3%83%93%E3%83%BC%E3%83%AF%E3%83%BC%E3%82%B9%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AB%20%E3%83%80%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20fillete(%E3%83%95%E3%82%A3%E3%83%AC%E3%83%83%E3%83%86)%20%E6%AE%B5%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20(%E3%83%80%E3%83%B3%E3%83%9C%E3%83%BC%E3%83%AB%E3%82%B9%E3%83%88%E3%83%83%E3%82%AB%E3%83%BC%20%E3%83%9B%E3%83%AF%E3%82%A4%E3%83%88%C3%97%E3%82%B0%E3%83%AC%E3%83%BC%20W120)&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;daB01&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-daB01&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;ダンボール開梱カッター&quot;&gt;ダンボール開梱カッター&lt;/h2&gt;

&lt;p&gt;ダンボールを簡単に開梱できます。700円で粘着テープを剥がすストレスから解放されました。ボタンを押したときだけロックが外れる安全設計です。マグネット付きなのでダンボールストッカーにくっつけています。&lt;/p&gt;

&lt;p&gt;レターオープナーとの二役でコスパがよいです。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;サンスター文具 レターオープナー 開梱カッター SHUTTO シュット ブラック S3720799&quot;,&quot;b&quot;:&quot;サンスター文具(Sun-Star Stationery)&quot;,&quot;t&quot;:&quot;S3720799&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/41dUN1am26L._SL500_.jpg&quot;,&quot;\/41PejMJH+dL._SL500_.jpg&quot;,&quot;\/41QqzFWmMhL._SL500_.jpg&quot;,&quot;\/512M-PRektL._SL500_.jpg&quot;,&quot;\/519xRMOUKtL._SL500_.jpg&quot;,&quot;\/41NC0Zq0lKL._SL500_.jpg&quot;,&quot;\/51bF7xetUyL._SL500_.jpg&quot;,&quot;\/41PjOgYEO5L._SL500_.jpg&quot;,&quot;\/31TqsXJXKBL._SL500_.jpg&quot;,&quot;\/41k7P-B2huL._SL500_.jpg&quot;,&quot;\/31OxmBSNSyL._SL500_.jpg&quot;,&quot;\/41ABbWkntvL._SL500_.jpg&quot;,&quot;\/312J-8+S3sL._SL500_.jpg&quot;,&quot;\/31+N1fbx+vL._SL500_.jpg&quot;,&quot;\/4181adeN1BL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09STL9DQG&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B09STL9DQG&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/%E3%82%B5%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%BC%E6%96%87%E5%85%B7%20%E3%83%AC%E3%82%BF%E3%83%BC%E3%82%AA%E3%83%BC%E3%83%97%E3%83%8A%E3%83%BC%20%E9%96%8B%E6%A2%B1%E3%82%AB%E3%83%83%E3%82%BF%E3%83%BC%20SHUTTO%20%E3%82%B7%E3%83%A5%E3%83%83%E3%83%88%20%E3%83%96%E3%83%A9%E3%83%83%E3%82%AF%20S3720799\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=%E3%82%B5%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%BC%E6%96%87%E5%85%B7%20%E3%83%AC%E3%82%BF%E3%83%BC%E3%82%AA%E3%83%BC%E3%83%97%E3%83%8A%E3%83%BC%20%E9%96%8B%E6%A2%B1%E3%82%AB%E3%83%83%E3%82%BF%E3%83%BC%20SHUTTO%20%E3%82%B7%E3%83%A5%E3%83%83%E3%83%88%20%E3%83%96%E3%83%A9%E3%83%83%E3%82%AF%20S3720799&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;rFjLV&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-rFjLV&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;ドアストッパー&quot;&gt;ドアストッパー&lt;/h2&gt;

&lt;p&gt;ネットスーパーをよく利用します。商品受け渡し中にドアを開放しておくのに使っています。強力なマグネットでドアをしっかり固定してくれます。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;ドアストッパー マグネット ネオガチット アイデア 便利&quot;,&quot;b&quot;:&quot;マクティー&quot;,&quot;t&quot;:&quot;007554742&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/41-snYtVirL._SL500_.jpg&quot;,&quot;\/51N+xWhkwHL._SL500_.jpg&quot;,&quot;\/31pawy4W4kL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B008CH4MDY&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B008CH4MDY&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/%E3%83%89%E3%82%A2%E3%82%B9%E3%83%88%E3%83%83%E3%83%91%E3%83%BC%20%E3%83%9E%E3%82%B0%E3%83%8D%E3%83%83%E3%83%88%20%E3%83%8D%E3%82%AA%E3%82%AC%E3%83%81%E3%83%83%E3%83%88%20%E3%82%A2%E3%82%A4%E3%83%87%E3%82%A2%20%E4%BE%BF%E5%88%A9\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=%E3%83%89%E3%82%A2%E3%82%B9%E3%83%88%E3%83%83%E3%83%91%E3%83%BC%20%E3%83%9E%E3%82%B0%E3%83%8D%E3%83%83%E3%83%88%20%E3%83%8D%E3%82%AA%E3%82%AC%E3%83%81%E3%83%83%E3%83%88%20%E3%82%A2%E3%82%A4%E3%83%87%E3%82%A2%20%E4%BE%BF%E5%88%A9&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;4tOQN&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-4tOQN&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;Kindle-Oasis&quot;&gt;Kindle Oasis&lt;/h2&gt;

&lt;p&gt;就寝後にマンガを読むのに利用しています。iPhoneのKindleアプリでも読めますが、ブルーライトが気になるので購入しました。反応の遅さが少し気になりますが、概ね満足しています。&lt;/p&gt;

&lt;p&gt;Oasisは購入当時の最上位モデルで、ページ送りボタンとディスプレイサイズを理由に選びました。広告なしモデルを選んで正解でした。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;Kindle Oasis 色調調節ライト搭載 wifi+4G 32GB 電子書籍リーダー&quot;,&quot;b&quot;:&quot;Amazon&quot;,&quot;t&quot;:&quot;53-015865&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/41Y+N+ZHOvL._SL500_.jpg&quot;,&quot;\/514HLx2qc0L._SL500_.jpg&quot;,&quot;\/41AKedyOt4S._SL500_.jpg&quot;,&quot;\/41X5VWm4G3L._SL500_.jpg&quot;,&quot;\/51343mEk1hL._SL500_.jpg&quot;,&quot;\/5186+K31ESL._SL500_.jpg&quot;,&quot;\/41jSwklYHsL._SL500_.jpg&quot;,&quot;\/41kn9w395SL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B07GM846NR&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B07GM846NR&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/Kindle%20Oasis%20%E8%89%B2%E8%AA%BF%E8%AA%BF%E7%AF%80%E3%83%A9%E3%82%A4%E3%83%88%E6%90%AD%E8%BC%89%20wifi%2B4G%2032GB%20%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=Kindle%20Oasis%20%E8%89%B2%E8%AA%BF%E8%AA%BF%E7%AF%80%E3%83%A9%E3%82%A4%E3%83%88%E6%90%AD%E8%BC%89%20wifi%2B4G%2032GB%20%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;UwKyu&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-UwKyu&quot;&gt;リンク&lt;/div&gt;





&lt;p&gt;カバーも同時に購入しました。指を通すバンドが付属しており落下を防げます。私は電車の中でも読むので、このカバーが必須です。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;電子書籍リーダー保護カバー Kindle Oasis カバー （2019年 第10世代 \/ 2017年 第9世代）電子書籍リーダー専用PU革製保護ケース H01 – パープル&quot;,&quot;b&quot;:&quot;TECHRAME&quot;,&quot;t&quot;:&quot;JP-CaseKO-H01-Fuschia&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/51Xy07Kea4L._SL500_.jpg&quot;,&quot;\/51UtXAPlqWL._SL500_.jpg&quot;,&quot;\/314jwLH3n8S._SL500_.jpg&quot;,&quot;\/41V7RWUwWZL._SL500_.jpg&quot;,&quot;\/41zf-kuvkhL._SL500_.jpg&quot;,&quot;\/51Gqd0MC44L._SL500_.jpg&quot;,&quot;\/51D2LmGc1cL._SL500_.jpg&quot;,&quot;\/41hsUYIL16L._SL500_.jpg&quot;,&quot;\/411lkbYCVVL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B08XNN5F3N&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B08XNN5F3N&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC%E4%BF%9D%E8%AD%B7%E3%82%AB%E3%83%90%E3%83%BC%20Kindle%20Oasis%20%E3%82%AB%E3%83%90%E3%83%BC%20%EF%BC%882019%E5%B9%B4%20%E7%AC%AC10%E4%B8%96%E4%BB%A3%20%2F%202017%E5%B9%B4%20%E7%AC%AC9%E4%B8%96%E4%BB%A3%EF%BC%89%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC%E5%B0%82%E7%94%A8PU%E9%9D%A9%E8%A3%BD%E4%BF%9D%E8%AD%B7%E3%82%B1%E3%83%BC%E3%82%B9%20H01%20%E2%80%93%20%E3%83%91%E3%83%BC%E3%83%97%E3%83%AB\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC%E4%BF%9D%E8%AD%B7%E3%82%AB%E3%83%90%E3%83%BC%20Kindle%20Oasis%20%E3%82%AB%E3%83%90%E3%83%BC%20%EF%BC%882019%E5%B9%B4%20%E7%AC%AC10%E4%B8%96%E4%BB%A3%20%2F%202017%E5%B9%B4%20%E7%AC%AC9%E4%B8%96%E4%BB%A3%EF%BC%89%E9%9B%BB%E5%AD%90%E6%9B%B8%E7%B1%8D%E3%83%AA%E3%83%BC%E3%83%80%E3%83%BC%E5%B0%82%E7%94%A8PU%E9%9D%A9%E8%A3%BD%E4%BF%9D%E8%AD%B7%E3%82%B1%E3%83%BC%E3%82%B9%20H01%20%E2%80%93%20%E3%83%91%E3%83%BC%E3%83%97%E3%83%AB&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;K2Gtz&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-K2Gtz&quot;&gt;リンク&lt;/div&gt;





&lt;h2 id=&quot;Apple-Watch-Series-7&quot;&gt;Apple Watch Series 7&lt;/h2&gt;

&lt;p&gt;ジョギングにRunKeeperを使っています。ジョギングにiPhoneを携帯するのが煩わしく、Apple Watchを購入しました。&lt;/p&gt;

&lt;p&gt;また、つい仕事に集中し過ぎてしまう自分にとっては、一定時間座り続けていると「スタンドの時間です！ 立ち上がって1分間ほど動きましょう」とリマインドしてくれる機能がよいです。&lt;/p&gt;




&lt;script type=&quot;text/javascript&quot;&gt;
(function(b,c,f,g,a,d,e){b.MoshimoAffiliateObject=a;
b[a]=b[a]||function(){arguments.currentScript=c.currentScript
||c.scripts[c.scripts.length-2];(b[a].q=b[a].q||[]).push(arguments)};
c.getElementById(a)||(d=c.createElement(f),d.src=g,
d.id=a,e=c.getElementsByTagName(&quot;body&quot;)[0],e.appendChild(d))})
(window,document,&quot;script&quot;,&quot;//dn.msmstatic.com/site/cardlink/bundle.js?20220329&quot;,&quot;msmaflink&quot;);
msmaflink({&quot;n&quot;:&quot;Apple Watch Series 7 (GPS + Cellularモデル) - 45mm グリーンアルミニウムケース - バンド無し (整備済み品)&quot;,&quot;b&quot;:&quot;Apple(アップル)&quot;,&quot;t&quot;:&quot;&quot;,&quot;d&quot;:&quot;https:\/\/m.media-amazon.com&quot;,&quot;c_p&quot;:&quot;\/images\/I&quot;,&quot;p&quot;:[&quot;\/31g0JI9LU6L._SL500_.jpg&quot;,&quot;\/514OUi1RrzS._SL500_.jpg&quot;,&quot;\/41366VTTgJL._SL500_.jpg&quot;],&quot;u&quot;:{&quot;u&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B0BGMT2XCJ&quot;,&quot;t&quot;:&quot;amazon&quot;,&quot;r_v&quot;:&quot;&quot;},&quot;v&quot;:&quot;2.1&quot;,&quot;b_l&quot;:[{&quot;id&quot;:1,&quot;u_tx&quot;:&quot;Amazonで見る&quot;,&quot;u_bc&quot;:&quot;#f79256&quot;,&quot;u_url&quot;:&quot;https:\/\/www.amazon.co.jp\/dp\/B0BGMT2XCJ&quot;,&quot;a_id&quot;:119719,&quot;p_id&quot;:170,&quot;pl_id&quot;:27060,&quot;pc_id&quot;:185,&quot;s_n&quot;:&quot;amazon&quot;,&quot;u_so&quot;:1},{&quot;id&quot;:2,&quot;u_tx&quot;:&quot;楽天市場で見る&quot;,&quot;u_bc&quot;:&quot;#f76956&quot;,&quot;u_url&quot;:&quot;https:\/\/search.rakuten.co.jp\/search\/mall\/Apple%20Watch%20Series%207%20(GPS%20%2B%20Cellular%E3%83%A2%E3%83%87%E3%83%AB)%20-%2045mm%20%E3%82%B0%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%A2%E3%83%AB%E3%83%9F%E3%83%8B%E3%82%A6%E3%83%A0%E3%82%B1%E3%83%BC%E3%82%B9%20-%20%E3%83%90%E3%83%B3%E3%83%89%E7%84%A1%E3%81%97%20(%E6%95%B4%E5%82%99%E6%B8%88%E3%81%BF%E5%93%81)\/&quot;,&quot;a_id&quot;:119718,&quot;p_id&quot;:54,&quot;pl_id&quot;:27059,&quot;pc_id&quot;:54,&quot;s_n&quot;:&quot;rakuten&quot;,&quot;u_so&quot;:2},{&quot;id&quot;:3,&quot;u_tx&quot;:&quot;Yahoo!ショッピングで見る&quot;,&quot;u_bc&quot;:&quot;#66a7ff&quot;,&quot;u_url&quot;:&quot;https:\/\/shopping.yahoo.co.jp\/search?first=1\u0026p=Apple%20Watch%20Series%207%20(GPS%20%2B%20Cellular%E3%83%A2%E3%83%87%E3%83%AB)%20-%2045mm%20%E3%82%B0%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%A2%E3%83%AB%E3%83%9F%E3%83%8B%E3%82%A6%E3%83%A0%E3%82%B1%E3%83%BC%E3%82%B9%20-%20%E3%83%90%E3%83%B3%E3%83%89%E7%84%A1%E3%81%97%20(%E6%95%B4%E5%82%99%E6%B8%88%E3%81%BF%E5%93%81)&quot;,&quot;a_id&quot;:3758086,&quot;p_id&quot;:1225,&quot;pl_id&quot;:27061,&quot;pc_id&quot;:1925,&quot;s_n&quot;:&quot;yahoo&quot;,&quot;u_so&quot;:3}],&quot;eid&quot;:&quot;veGHb&quot;,&quot;s&quot;:&quot;s&quot;});
&lt;/script&gt;


&lt;div id=&quot;msmaflink-veGHb&quot;&gt;リンク&lt;/div&gt;







&lt;div class=&quot;pochireba&quot; style=&quot;text-align:left;font-size:small;padding:20px 0;zoom: 1;overflow: hidden;&quot;&gt;&lt;a href=&quot;https://apps.apple.com/jp/app/asics-runkeeper-%E3%83%A9%E3%83%B3%E3%83%8B%E3%83%B3%E3%82%B0%E3%82%A2%E3%83%97%E3%83%AA/id300235330?uo=4&amp;at=10lrC7&quot; target=&quot;_blank&quot; &gt;&lt;img src=&quot;https://is5-ssl.mzstatic.com/image/thumb/Purple112/v4/01/f2/a6/01f2a680-8edd-708e-c687-c5bcb81dbaec/AppIcon-1x_U007emarketing-0-5-0-85-220.png/60x60bb.jpg&quot; alt=&quot;ASICS Runkeeper: ランニングアプリ&quot; width=&quot;60&quot; height=&quot;60&quot; style=&quot;float:left;margin:0 15px 0 0;width:60px;height:60px;&quot; class=&quot;pochi_img&quot; &gt;&lt;/a&gt;&lt;div class=&quot;pochi_info&quot; style=&quot;text-align:left;zoom: 1;overflow: hidden;&quot;&gt;&lt;div class=&quot;pochi_name&quot;&gt;&lt;a href=&quot;https://apps.apple.com/jp/app/asics-runkeeper-%E3%83%A9%E3%83%B3%E3%83%8B%E3%83%B3%E3%82%B0%E3%82%A2%E3%83%97%E3%83%AA/id300235330?uo=4&amp;at=10lrC7&quot; target=&quot;_blank&quot; &gt;ASICS Runkeeper: ランニングアプリ&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;pochi_price&quot; style=&quot;display:inline;&quot;&gt;無料&lt;/div&gt;&lt;div class=&quot;pochi_time&quot; style=&quot;font-size:x-small;display:inline;&quot;&gt;(2022.12.31時点)&lt;/div&gt;&amp;nbsp;&lt;a href=&quot;https://apps.apple.com/jp/app/asics-runkeeper-%E3%83%A9%E3%83%B3%E3%83%8B%E3%83%B3%E3%82%B0%E3%82%A2%E3%83%97%E3%83%AA/id300235330?uo=4&amp;at=10lrC7&quot; style=&quot;width:60px;color:#ffffff;background:#000000;font-size:8px;font-weight:bold;text-align:center;display:inline;text-decoration:none;border:0px;padding:2px;border-radius:5px;white-space:nowrap;&quot; target=&quot;_blank&quot; &gt;App Store&lt;/a&gt;&lt;div class=&quot;pochi_seller&quot;&gt;&lt;a href=&quot;https://apps.apple.com/jp/developer/fitnesskeeper-inc/id300226026?uo=4&amp;at=10lrC7&quot; target=&quot;_blank&quot; &gt;FitnessKeeper, Inc.&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;pochi_post&quot; style=&quot;font-size:x-small;&quot;&gt;posted with &lt;a href=&quot;http://pochireba.com&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;ポチレバ&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;pochireba-footer&quot; style=&quot;clear: left&quot;&gt;&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;一昨年の開業で立て込んでいたこともありアウトプットが滞ってましたが、2023年はブログの再開に本腰を入れたいと思います。ではよいお年を。&lt;/p&gt;
</content>        
        <category term="買い物" label="買い物" />
        
        <category term="ライフハック" label="ライフハック" />
        
        <link rel="enclosure" href="https://cdn.image.st-hatena.com/image/scale/735c8ae4068bc899aad8f350dab4c72bdb985673/backend=imagemagick;version=1;width=1300/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1561715276-a2d087060f1d%3Fixlib%3Drb-4.0.3%26ixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26auto%3Dformat%26fit%3Dcrop%26w%3D2070%26q%3D80" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【Terraform】movedブロックでmoduleをリファクタリングする</title>
        <link href="https://blog.jhashimoto.net/entry/2022/05/08/192946"/>
        <id>hatenablog://entry/13574176438090501137</id>
        <published>2022-05-08T19:29:46+09:00</published>
        <updated>2022-05-08T19:29:46+09:00</updated>        <summary type="html">movedブロックはTerraform1.1で導入された新機能です。moduleのリファクタリングに使えるか検証しました。</summary>
        <content type="html">&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20220508/20220508192237.png&quot; width=&quot;1200&quot; height=&quot;424&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;moved&lt;/code&gt;ブロックはTerraform1.1で導入された新機能です。moduleのリファクタリングに使えるか検証しました。&lt;/p&gt;

&lt;h2&gt;実行環境&lt;/h2&gt;

&lt;p&gt;ubuntu-20.04 on Windows 10 (WSL2)&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform &lt;span class=&quot;synSpecial&quot;&gt;--version&lt;/span&gt;
Terraform v1.&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;.&lt;span class=&quot;synConstant&quot;&gt;9&lt;/span&gt;
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.&lt;span class=&quot;synConstant&quot;&gt;55&lt;/span&gt;.&lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;
&lt;/pre&gt;


&lt;h2&gt;コード&lt;/h2&gt;

&lt;p&gt;準備したコードです。事前にapplyまで済ませてあります。&lt;/p&gt;

&lt;h3&gt;modules/vpc/variables.tf&lt;/h3&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;variable &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc_name&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  type &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; string
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

variable &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc_cidr&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  type &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; string
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

variable &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  type &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;(&lt;/span&gt;object&lt;span class=&quot;synSpecial&quot;&gt;({&lt;/span&gt;
    name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; string
    cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; string
  &lt;span class=&quot;synSpecial&quot;&gt;}))&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h3&gt;modules/vpc/main.tf&lt;/h3&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_vpc&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_cidr
  tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  for_each &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;for&lt;/span&gt; i in var.subnet &lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt; i.name &lt;span class=&quot;synStatement&quot;&gt;=&amp;gt;&lt;/span&gt; i &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this.id
  cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.cidr
  tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

output &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc_id&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  value &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this.id
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h3&gt;main.tf&lt;/h3&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;module &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  source &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;../modules/vpc&lt;/span&gt;&amp;quot;

  vpc_name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc-sample&lt;/span&gt;&amp;quot;
  vpc_cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/16&lt;/span&gt;&amp;quot;
  subnet &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&amp;quot;
      cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/20&lt;/span&gt;&amp;quot;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;,
    &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&amp;quot;
      cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.16.0/20&lt;/span&gt;&amp;quot;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;synStatement&quot;&gt;/&lt;/span&gt;/ moduleを使わない
resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  name        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&amp;quot;
  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; module.vpc.vpc_id
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h2&gt;moduleを使わないリソースのリネーム&lt;/h2&gt;

&lt;p&gt;まずmoduleを使わず定義したリソースで試します。&lt;/p&gt;

&lt;p&gt;セキュリティグループのリソース名を&lt;code&gt;default&lt;/code&gt;に変更します。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;diff &lt;span class=&quot;synSpecial&quot;&gt;--git&lt;/span&gt; a/vpc_sample/main.tf b/vpc_sample/main.tf
index 6b09809..bfa4756 &lt;span class=&quot;synConstant&quot;&gt;100755&lt;/span&gt;
--- a/vpc_sample/main.tf
+++ b/vpc_sample/main.tf
@@ &lt;span class=&quot;synConstant&quot;&gt;-15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;7&lt;/span&gt; +&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;7&lt;/span&gt; @@ module &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   ]
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

-resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   name        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
   vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; module.vpc.vpc_id
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;当然ですが、リソースを作り直すplanが出力されます。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan
aws_security_group.this: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;-02a601a6be35932e4&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_vpc.this: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;-0c91c8c5673d89ee5&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create
  - destroy

Terraform will perform the following actions:

  &lt;span class=&quot;synComment&quot;&gt;# aws_security_group.default will be created&lt;/span&gt;
  + resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      + arn                    &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + description            &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Managed by Terraform&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
      + egress                 &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + id                     &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + ingress                &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + name                   &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
      + name_prefix            &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + owner_id               &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + revoke_rules_on_delete &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;false&lt;/span&gt;
      + tags_all               &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synPreProc&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;synPreProc&quot;&gt;)&lt;/span&gt;
      + vpc_id                 &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc-0c91c8c5673d89ee5&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;synComment&quot;&gt;# aws_security_group.this will be destroyed&lt;/span&gt;
  &lt;span class=&quot;synComment&quot;&gt;# (because aws_security_group.this is not in configuration)&lt;/span&gt;
  - resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      - arn                    &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;arn:aws:ec2:ap-northeast-1:601660378746:security-group/sg-02a601a6be35932e4&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - description            &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Managed by Terraform&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - egress                 &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;[]&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - id                     &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg-02a601a6be35932e4&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - ingress                &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;[]&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - name                   &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - owner_id               &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;601660378746&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - revoke_rules_on_delete &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;false&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - tags                   &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{}&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - tags_all               &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{}&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
      - vpc_id                 &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc-0c91c8c5673d89ee5&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; null
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

Plan: &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; to add, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to change, &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; to destroy.
&lt;/pre&gt;


&lt;p&gt;これを避けるには、従来は&lt;code&gt;terraform state mv&lt;/code&gt;でリソース名をリネームする必要がありました。Terraform 1.1からはmovedブロックが利用できます。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Farticles%2Fterraform-1-1-generally-available%2F&quot; title=&quot;Terraform のVersion 1.1がGAになりました | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/articles/terraform-1-1-generally-available/&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;movedブロックを追加して、再度planを実行してみます。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ git diff
diff &lt;span class=&quot;synSpecial&quot;&gt;--git&lt;/span&gt; a/vpc_sample/main.tf b/vpc_sample/main.tf
index 6b09809..2cb6d0b &lt;span class=&quot;synConstant&quot;&gt;100755&lt;/span&gt;
--- a/vpc_sample/main.tf
+++ b/vpc_sample/main.tf
@@ &lt;span class=&quot;synConstant&quot;&gt;-15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;7&lt;/span&gt; +&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;13&lt;/span&gt; @@ module &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   ]
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

-resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   name        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
   vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; module.vpc.vpc_id
-&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
\ No newline at end of file
+&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
+
+moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_security_group.this
+  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_security_group.default
+&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;




&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan
module.vpc.aws_vpc.this: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;-0c91c8c5673d89ee5&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
aws_security_group.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;-02a601a6be35932e4&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

Terraform will perform the following actions:

  &lt;span class=&quot;synComment&quot;&gt;# aws_security_group.this has moved to aws_security_group.default&lt;/span&gt;
    resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
        id                     &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg-02a601a6be35932e4&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        name                   &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        tags                   &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{}&lt;/span&gt;
        &lt;span class=&quot;synComment&quot;&gt;# (8 unchanged attributes hidden)&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

Plan: &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to add, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to change, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to destroy.
&lt;/pre&gt;


&lt;p&gt;今度はリソース名をリネームするplanが出力されました。&lt;code&gt;add&lt;/code&gt;/&lt;code&gt;destroy&lt;/code&gt;が0であることを確認して、applyします。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform apply
...
Apply &lt;span class=&quot;synStatement&quot;&gt;complete&lt;/span&gt;! Resources: &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; added, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; changed, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; destroyed.
&lt;/pre&gt;


&lt;p&gt;無事にリソースを再作成することなくapplyできました。念のため再度planします。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan
module.vpc.aws_vpc.this: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;-0c91c8c5673d89ee5&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
aws_security_group.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;-02a601a6be35932e4&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
&lt;/pre&gt;


&lt;p&gt;コードとstateが同期されていることを確認できました。&lt;/p&gt;

&lt;h2&gt;module内リソースのリネーム&lt;/h2&gt;

&lt;p&gt;ここからが本題のmoduleのリファクタリングです。&lt;/p&gt;

&lt;p&gt;vpcのリソース名を変更するので、先に確認しておきます。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform state list | &lt;span class=&quot;synStatement&quot;&gt;grep&lt;/span&gt; aws_vpc
module.vpc.aws_vpc.this
&lt;/pre&gt;


&lt;p&gt;リソース名を変更し、movedを定義します。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ git diff
diff &lt;span class=&quot;synSpecial&quot;&gt;--git&lt;/span&gt; a/modules/vpc/main.tf b/modules/vpc/main.tf
index 15d46e6..b6848a6 &lt;span class=&quot;synConstant&quot;&gt;100755&lt;/span&gt;
--- a/modules/vpc/main.tf
+++ b/modules/vpc/main.tf
@@ &lt;span class=&quot;synConstant&quot;&gt;-1&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt; +&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;20&lt;/span&gt; @@
-resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
   cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_cidr
   tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

+moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this
+  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default
+&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

 resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   for_each &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;synStatement&quot;&gt;in&lt;/span&gt; var.subnet : i.name &lt;span class=&quot;synStatement&quot;&gt;=&amp;gt;&lt;/span&gt; i &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
-  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this.id
+  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default.id
   cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.cidr
   tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

 output &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc_id&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
-  value &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this.id
+  value &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default.id
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;planを実行します。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan
module.vpc.aws_vpc.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;-0c91c8c5673d89ee5&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
aws_security_group.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;-02a601a6be35932e4&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

Terraform will perform the following actions:

  &lt;span class=&quot;synComment&quot;&gt;# module.vpc.aws_vpc.this has moved to module.vpc.aws_vpc.default&lt;/span&gt;
    resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
        id                               &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc-0c91c8c5673d89ee5&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        tags                             &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc-sample&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;synComment&quot;&gt;# (15 unchanged attributes hidden)&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

Plan: &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to add, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to change, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to destroy.
&lt;/pre&gt;


&lt;p&gt;期待通りに、リネームするplanが出力されました。applyします（ログは省略）。&lt;/p&gt;

&lt;h2&gt;foreachを使ったリソースのリネーム&lt;/h2&gt;

&lt;p&gt;最後にforeachを使って生成したリソースをリネームできるか検証します。&lt;/p&gt;

&lt;p&gt;サブネットのリソース名を確認しておきます。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform state list | &lt;span class=&quot;synStatement&quot;&gt;grep&lt;/span&gt; aws_subnet
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;サブネットのリソース名を変更し、movedを定義しました。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ git diff
diff &lt;span class=&quot;synSpecial&quot;&gt;--git&lt;/span&gt; a/modules/vpc/main.tf b/modules/vpc/main.tf
index b6848a6..9fd0774 &lt;span class=&quot;synConstant&quot;&gt;100755&lt;/span&gt;
--- a/modules/vpc/main.tf
+++ b/modules/vpc/main.tf
@@ &lt;span class=&quot;synConstant&quot;&gt;-15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;6&lt;/span&gt; +&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;15&lt;/span&gt; @@ resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

+moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
+  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
+&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
+moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
+  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
+  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;
+&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
+
 output &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc_id&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   value &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default.id
 &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
diff &lt;span class=&quot;synSpecial&quot;&gt;--git&lt;/span&gt; a/vpc_sample/main.tf b/vpc_sample/main.tf
index 2cb6d0b..009f1d2 &lt;span class=&quot;synConstant&quot;&gt;100755&lt;/span&gt;
--- a/vpc_sample/main.tf
+++ b/vpc_sample/main.tf
@@ &lt;span class=&quot;synConstant&quot;&gt;-5&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;11&lt;/span&gt; +&lt;span class=&quot;synConstant&quot;&gt;5&lt;/span&gt;,&lt;span class=&quot;synConstant&quot;&gt;11&lt;/span&gt; @@ module &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
   vpc_cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/16&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
   subnet &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;
     &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
-      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
+      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
       cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/20&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
     &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;,
     &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
-      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
+      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
       cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;172.16.16.0/20&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
     &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;planを実行します。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan
module.vpc.aws_vpc.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;-0c91c8c5673d89ee5&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
aws_security_group.default: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;-02a601a6be35932e4&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Refreshing state... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  &lt;span class=&quot;synComment&quot;&gt;# module.vpc.aws_subnet.pub[&amp;quot;pri-subnet-sample1&amp;quot;] will be updated in-place&lt;/span&gt;
  &lt;span class=&quot;synComment&quot;&gt;# (moved from module.vpc.aws_subnet.pub[&amp;quot;subnet-sample1&amp;quot;])&lt;/span&gt;
  ~ resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
        id                              &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-01629b6f8717a5523&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
      ~ tags                            &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
          ~ &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
      ~ tags_all                        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
          ~ &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;synComment&quot;&gt;# (9 unchanged attributes hidden)&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;synComment&quot;&gt;# module.vpc.aws_subnet.pub[&amp;quot;pri-subnet-sample2&amp;quot;] will be updated in-place&lt;/span&gt;
  &lt;span class=&quot;synComment&quot;&gt;# (moved from module.vpc.aws_subnet.pub[&amp;quot;subnet-sample2&amp;quot;])&lt;/span&gt;
  ~ resource &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
        id                              &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-0edf4b9618cf8f38f&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
      ~ tags                            &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
          ~ &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
      ~ tags_all                        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
          ~ &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
        &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;synComment&quot;&gt;# (9 unchanged attributes hidden)&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

Plan: &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to add, &lt;span class=&quot;synConstant&quot;&gt;2&lt;/span&gt; to change, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; to destroy.
&lt;/pre&gt;


&lt;p&gt;期待通りにリネームするplanが出力されました。&lt;code&gt;change&lt;/code&gt;が２件出力されているのは&lt;code&gt;tags&lt;/code&gt;を変更したためです。論点ではないので、このままapplyします。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform apply
...
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Modifying... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Modifying... &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Modifications &lt;span class=&quot;synStatement&quot;&gt;complete&lt;/span&gt; after 0s &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-0edf4b9618cf8f38f&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;
module.vpc.aws_subnet.pub&lt;span class=&quot;synStatement&quot;&gt;[&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;]&lt;/span&gt;: Modifications &lt;span class=&quot;synStatement&quot;&gt;complete&lt;/span&gt; after 0s &lt;span class=&quot;synStatement&quot;&gt;[&lt;/span&gt;id&lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;subnet&lt;/span&gt;-01629b6f8717a5523&lt;span class=&quot;synStatement&quot;&gt;]&lt;/span&gt;

Apply &lt;span class=&quot;synStatement&quot;&gt;complete&lt;/span&gt;! Resources: &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; added, &lt;span class=&quot;synConstant&quot;&gt;2&lt;/span&gt; changed, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; destroyed.
&lt;/pre&gt;


&lt;p&gt;無事applyできました。&lt;/p&gt;

&lt;h2&gt;変更後のコード&lt;/h2&gt;

&lt;p&gt;modules/vpc/variables.tfは変更なし。&lt;/p&gt;

&lt;h3&gt;modules/vpc/main.tf&lt;/h3&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_vpc&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_cidr
  tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; var.vpc_name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.this
  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_subnet&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pub&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  for_each &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;for&lt;/span&gt; i in var.subnet &lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt; i.name &lt;span class=&quot;synStatement&quot;&gt;=&amp;gt;&lt;/span&gt; i &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default.id
  cidr_block  &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.cidr
  tags        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt; Name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; each.value.name &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;&amp;quot;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample1&lt;/span&gt;&amp;quot;&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;&amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&amp;quot;&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;&amp;quot;&lt;span class=&quot;synConstant&quot;&gt;subnet-sample2&lt;/span&gt;&amp;quot;&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_subnet.pub&lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;&amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&amp;quot;&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

output &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc_id&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  value &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_vpc.default.id
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h3&gt;main.tf&lt;/h3&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;module &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  source &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;../modules/vpc&lt;/span&gt;&amp;quot;

  vpc_name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;vpc-sample&lt;/span&gt;&amp;quot;
  vpc_cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/16&lt;/span&gt;&amp;quot;
  subnet &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample1&lt;/span&gt;&amp;quot;
      cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.0.0/20&lt;/span&gt;&amp;quot;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;,
    &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
      name &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;pri-subnet-sample2&lt;/span&gt;&amp;quot;
      cidr &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;172.16.16.0/20&lt;/span&gt;&amp;quot;
    &lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;synStatement&quot;&gt;/&lt;/span&gt;/ moduleを使わない
resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;default&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  name        &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;securitygroup-sample1&lt;/span&gt;&amp;quot;
  vpc_id      &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; module.vpc.vpc_id
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

moved &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  from &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_security_group.this
  to &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; aws_security_group.default
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h2&gt;所感&lt;/h2&gt;

&lt;p&gt;moduleをリファクタリングするにはstateの移動がかなり面倒で、リファクタリングを後回しにする要因になっていました。movedブロックはリファクタリングのトイルを減らす待望の機能追加です。&lt;/p&gt;
</content>        
        <category term="Terraform" label="Terraform" />
        
        <link rel="enclosure" href="https://cdn.image.st-hatena.com/image/scale/02b150b2d224b93d4181665e02961a9ae0612dcf/backend=imagemagick;version=1;width=1300/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2FJ%2FJHashimoto%2F20220508%2F20220508192237.png" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>LINQPadでユニットテストを書くには？</title>
        <link href="https://blog.jhashimoto.net/entry/2021/12/26/141024"/>
        <id>hatenablog://entry/13574176438046305612</id>
        <published>2021-12-26T14:10:24+09:00</published>
        <updated>2021-12-26T14:10:24+09:00</updated>        <summary type="html">サマリー LINQPadはv.6.9からxUnitをサポートしていて、ユニットテストが書けます。 https://www.linqpad.net/LINQPad6.aspx You can now add xunit test support to your query via new option on the Query menu. This adds the required references, a runner, and a sample test method to get you started. There&#39;s also a option on the Query menu …</summary>
        <content type="html">&lt;h2&gt;サマリー&lt;/h2&gt;

&lt;p&gt;LINQPadはv.6.9からxUnitをサポートしていて、ユニットテストが書けます。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.linqpad.net/LINQPad6.aspx&quot;&gt;https://www.linqpad.net/LINQPad6.aspx&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;You can now &lt;strong&gt;add xunit test support&lt;/strong&gt; to your query via new option on the &lt;strong&gt;Query&lt;/strong&gt; menu. This adds the required references, a runner, and a sample test method to get you started. There&#39;s also a option on the Query menu Alt+Shift+T to execute all tests.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;この記事では、LINQPadでのユニットテストの書き方を説明します。&lt;/p&gt;

&lt;h2&gt;実行環境&lt;/h2&gt;

&lt;p&gt;LINQPad 7 (Premium Edition) v7.1.5 (X64) on Windows 10&lt;/p&gt;

&lt;h2&gt;セットアップ&lt;/h2&gt;

&lt;p&gt;新規でQueryを作成します。&lt;code&gt;Language&lt;/code&gt;は&lt;code&gt;C# Program&lt;/code&gt;を選びました。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;&lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Main() {
    
}

&lt;span class=&quot;synComment&quot;&gt;// You can define other methods, fields, classes and namespaces here&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;Query&lt;/code&gt;メニューから&lt;code&gt;Add XUnit Test Support&lt;/code&gt;を選ぶと、テンプレートが挿入されます。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;#load &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;xunit&amp;quot;&lt;/span&gt;

&lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Main() {
    &lt;span class=&quot;synComment&quot;&gt;//RunTests();  // Call RunTests() or press Alt+Shift+T to initiate testing.&lt;/span&gt;
}

&lt;span class=&quot;synComment&quot;&gt;// You can define other methods, fields, classes and namespaces here&lt;/span&gt;

&lt;span class=&quot;synPreProc&quot;&gt;#region private::Tests&lt;/span&gt;

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_Xunit() =&amp;gt; Assert.True (&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; + &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; == &lt;span class=&quot;synConstant&quot;&gt;2&lt;/span&gt;);

&lt;span class=&quot;synPreProc&quot;&gt;#endregion&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;初回はConfirmationダイアログが表示されるので、&lt;code&gt;はい&lt;/code&gt;を選んで、xUnitのPackageをダウンロードします。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20211226/20211226135655.png&quot; alt=&quot;f:id:JHashimoto:20211226135655p:plain&quot; width=&quot;338&quot; height=&quot;198&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Alt + Shift + T&lt;/code&gt;でテストを実行できます。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20211226/20211226135719.png&quot; alt=&quot;f:id:JHashimoto:20211226135719p:plain&quot; width=&quot;528&quot; height=&quot;135&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;コードを修正して、NGをテストします。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;&lt;span class=&quot;synPreProc&quot;&gt;#region private::Tests&lt;/span&gt;

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_Xunit() =&amp;gt; Assert.True (&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; + &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; == &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;);

&lt;span class=&quot;synPreProc&quot;&gt;#endregion&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;期待通りNGになりました。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20211226/20211226135742.png&quot; alt=&quot;f:id:JHashimoto:20211226135742p:plain&quot; width=&quot;707&quot; height=&quot;201&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;コードをテストしてみる&lt;/h2&gt;

&lt;p&gt;文字列を返す簡単なメソッドとテストコードを書きます。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;&lt;span class=&quot;synType&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;synType&quot;&gt;string&lt;/span&gt; GetGreeting(&lt;span class=&quot;synType&quot;&gt;string&lt;/span&gt; name) {
    &lt;span class=&quot;synStatement&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello {name}&amp;quot;&lt;/span&gt;;
}

&lt;span class=&quot;synPreProc&quot;&gt;#region private::Tests&lt;/span&gt;

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_Xunit() =&amp;gt; Assert.True (&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; + &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; == &lt;span class=&quot;synConstant&quot;&gt;2&lt;/span&gt;);

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_GetGreeting_OK() =&amp;gt; Assert.Equal(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello Bob&amp;quot;&lt;/span&gt;, GetGreeting(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;));
[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_GetGreeting_NG() =&amp;gt; Assert.NotEqual(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello Bob&amp;quot;&lt;/span&gt;, GetGreeting(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Alice&amp;quot;&lt;/span&gt;));

&lt;span class=&quot;synPreProc&quot;&gt;#endregion&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;期待通りのテスト結果になりました。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20211226/20211226135832.png&quot; alt=&quot;f:id:JHashimoto:20211226135832p:plain&quot; width=&quot;547&quot; height=&quot;193&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;テストコードを別ファイルにする&lt;/h2&gt;

&lt;p&gt;コード量が多くなると、テストコードを別ファイルにした方が見通しがよくなります。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/52798462/is-it-possible-to-use-xunit-with-linqpad&quot;&gt;Is it possible to use xUnit with LINQPad? - Stack Overflow&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;This will add a query with required boilerplate code &lt;a href=&quot;https://www.linqpad.net/LinqReference.aspx&quot;&gt;referenced via #load&lt;/a&gt; so you can start testing facts and theories instantly.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;#load&lt;/code&gt;ディレクティブでできるようなので、試してみます。&lt;/p&gt;

&lt;p&gt;GetGreetingメソッドを&lt;code&gt;GetGreeting.linq&lt;/code&gt;に移動しました。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;&lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Main() {
    &lt;span class=&quot;synComment&quot;&gt;//RunTests();  // Call RunTests() or press Alt+Shift+T to initiate testing.&lt;/span&gt;
    GetGreeting(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;).Dump();
}

&lt;span class=&quot;synComment&quot;&gt;// You can define other methods, fields, classes and namespaces here&lt;/span&gt;

&lt;span class=&quot;synType&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;synType&quot;&gt;string&lt;/span&gt; GetGreeting(&lt;span class=&quot;synType&quot;&gt;string&lt;/span&gt; name) {
    &lt;span class=&quot;synStatement&quot;&gt;return&lt;/span&gt; $&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello {name}&amp;quot;&lt;/span&gt;;
}
&lt;/pre&gt;


&lt;p&gt;テストコードに&lt;code&gt;#load &quot;GetGreeting&quot;&lt;/code&gt;を入れます。&lt;/p&gt;

&lt;pre class=&quot;code lang-cs&quot; data-lang=&quot;cs&quot; data-unlink&gt;#load &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;xunit&amp;quot;&lt;/span&gt;
#load &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;GetGreeting&amp;quot;&lt;/span&gt;

&lt;span class=&quot;synPreProc&quot;&gt;#region private::Tests&lt;/span&gt;

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_Xunit() =&amp;gt; Assert.True (&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; + &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt; == &lt;span class=&quot;synConstant&quot;&gt;2&lt;/span&gt;);

[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_GetGreeting_OK() =&amp;gt; Assert.Equal(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello Bob&amp;quot;&lt;/span&gt;, GetGreeting(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;));
[Fact] &lt;span class=&quot;synType&quot;&gt;void&lt;/span&gt; Test_GetGreeting_NG() =&amp;gt; Assert.NotEqual(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Hello Bob&amp;quot;&lt;/span&gt;, GetGreeting(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;Alice&amp;quot;&lt;/span&gt;));

&lt;span class=&quot;synPreProc&quot;&gt;#endregion&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;別ファイルのメソッドをテストできました。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20211226/20211226135905.png&quot; alt=&quot;f:id:JHashimoto:20211226135905p:plain&quot; width=&quot;547&quot; height=&quot;193&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;まとめ&lt;/h2&gt;

&lt;p&gt;LINQPadはVisual Studioに比べてコードを書くまでのオーバーヘッドが小さく、検証・テスト用途で便利に使っていました。一方でテストが書けないためコード量が多くなるにつれ、開発効率が落ちる傾向がありました。&lt;/p&gt;

&lt;p&gt;ユニットテストを用意することで、今後は複雑なコードもLINQPadで書けそうな感触を得ました。&lt;/p&gt;

&lt;h2&gt;参考&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linqpad.net/LinqReference.aspx&quot;&gt;https://www.linqpad.net/LinqReference.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fforum.linqpad.net%2Fdiscussion%2F2144%2Flinqpad-6-and-xunit-test-framework&quot; title=&quot;LinqPad 6 and xUnit test framework&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://forum.linqpad.net/discussion/2144/linqpad-6-and-xunit-test-framework&quot;&gt;forum.linqpad.net&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="C#" label="C#" />
        
        <category term="LINQPad" label="LINQPad" />
        
        <category term="xUnit" label="xUnit" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/13574176438046305612/1641161398" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>Terraform作業ディレクトリの容量を節約するには？</title>
        <link href="https://blog.jhashimoto.net/entry/2021/12/24/090000"/>
        <id>hatenablog://entry/13574176438045601804</id>
        <published>2021-12-24T09:00:00+09:00</published>
        <updated>2021-12-24T09:00:08+09:00</updated>        <summary type="html">問題 ディスク領域不足のアラートが出た。 terraformerのimportを何度も繰り返したせいで、作業ディレクトリ全部にTerrafromのプロバイダープラグインがダウンロードされていたのが原因。 サマリ― Terraform作業ディレクトリの容量を節約するには、プラグインをキャッシュするとよい。</summary>
        <content type="html">&lt;h2&gt;問題&lt;/h2&gt;

&lt;p&gt;ディスク領域不足のアラートが出た。&lt;/p&gt;

&lt;p&gt;terraformerのimportを何度も繰り返したせいで、作業ディレクトリ全部にTerrafromのプロバイダープラグインがダウンロードされていたのが原因。&lt;/p&gt;

&lt;h2&gt;サマリ―&lt;/h2&gt;

&lt;p&gt;Terraform作業ディレクトリの容量を節約するには、プラグインをキャッシュするとよい。&lt;/p&gt;

&lt;h2&gt;作業ログ&lt;/h2&gt;

&lt;p&gt;作業ログを残しておきます。&lt;/p&gt;

&lt;p&gt;ホームディレクトリに&lt;code&gt;.terraformrc&lt;/code&gt;を作成し、キャッシュディレクトリを設定する。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ &lt;span class=&quot;synStatement&quot;&gt;cd&lt;/span&gt;    &lt;span class=&quot;synComment&quot;&gt;# ホームディレクトリに移動&lt;/span&gt;
$ cat &lt;span class=&quot;synStatement&quot;&gt;&amp;lt;&amp;lt; EOF&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; &amp;gt; .terraformrc&lt;/span&gt;

&lt;span class=&quot;synConstant&quot;&gt;plugin_cache_dir   = &amp;quot;&lt;/span&gt;&lt;span class=&quot;synPreProc&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;/.terraform.d/plugin-cache&amp;quot;&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;EOF&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;作業ディレクトリの使用容量を確認しておく。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ &lt;span class=&quot;synStatement&quot;&gt;du&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;-hs&lt;/span&gt;
235M    .
&lt;/pre&gt;


&lt;p&gt;プラグインを削除。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ &lt;span class=&quot;synStatement&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;-rf&lt;/span&gt; .terraform/
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;terraform init&lt;/code&gt;でエラーが発生。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform init
There are some problems with the CLI configuration:
╷
│ Error: The specified plugin cache dir /home/jhashimoto/.terraform.d/plugin-cache cannot be opened: stat /home/jhashimoto/.terraform.d/plugin-cache: no such file or directory
│
╵
&lt;/pre&gt;


&lt;p&gt;公式ドキュメントに情報があった。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.terraform.io/docs/cli/config/config-file.html&quot;&gt;CLI Configuration - Terraform by HashiCorp&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;This directory must already exist before Terraform will cache plugins; Terraform will not create the directory itself.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;キャッシュディレクトリはTeraformが作成してくれると思ってたが、事前に作らないといけなかった。&lt;/p&gt;

&lt;p&gt;ディレクトリを作成してリトライしたら、成功した。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ &lt;span class=&quot;synStatement&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synPreProc&quot;&gt;$HOME&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;/.terraform.d/plugin-cache&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;
$ terraform init

Initializing the backend...

Initializing provider plugins...
- terraform.io/&lt;span class=&quot;synStatement&quot;&gt;builtin&lt;/span&gt;/terraform is built &lt;span class=&quot;synError&quot;&gt;in&lt;/span&gt; to Terraform
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using hashicorp/aws v3.&lt;span class=&quot;synConstant&quot;&gt;68&lt;/span&gt;.&lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt; from the shared cache directory

...

Terraform has been successfully initialized!
...
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;Using hashicorp/aws v3.68.0 from the shared cache directory&lt;/code&gt;からキャッシュを利用しているのがわかる。&lt;/p&gt;

&lt;p&gt;プラグインをキャッシュした分使用量が減っている。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ &lt;span class=&quot;synStatement&quot;&gt;du&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;-hs&lt;/span&gt;
465K    .
&lt;/pre&gt;


&lt;p&gt;念のためplanできるか確認。&lt;/p&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform plan

...

You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Note: You didn&lt;span class=&quot;synStatement&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;t use the -out option to save this plan, so Terraform can&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&#39;&lt;/span&gt;t guarantee to take exactly these actions &lt;span class=&quot;synStatement&quot;&gt;if &lt;/span&gt;you run &lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;terraform apply&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;&amp;quot;&lt;/span&gt; now.
&lt;/pre&gt;


&lt;h2&gt;実行環境&lt;/h2&gt;

&lt;pre class=&quot;code lang-sh&quot; data-lang=&quot;sh&quot; data-unlink&gt;$ terraform &lt;span class=&quot;synSpecial&quot;&gt;--version&lt;/span&gt;
Terraform v1.&lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;.&lt;span class=&quot;synConstant&quot;&gt;9&lt;/span&gt;
on linux_amd64
&lt;/pre&gt;


&lt;p&gt;ubuntu-20.04 on Windows 10 (WSL2)&lt;/p&gt;

&lt;h2&gt;参考&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://qiita.com/tonishy/items/adcf67e959dffaa03f93&quot;&gt;知らず知らずのうちに Terraform がディスクをほとんど一杯にしてた - Qiita&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.terraform.io/docs/cli/config/config-file.html&quot;&gt;CLI Configuration - Terraform by HashiCorp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>        
        <category term="Terraform" label="Terraform" />
        
        <category term="トラブルシュート" label="トラブルシュート" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/13574176438045601804/1640304008" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【Terraform】moduleへの依存を明示する</title>
        <link href="https://blog.jhashimoto.net/entry/2021/08/15/173325"/>
        <id>hatenablog://entry/26006613797623387</id>
        <published>2021-08-15T17:33:25+09:00</published>
        <updated>2021-08-15T17:33:25+09:00</updated>        <summary type="html">Terraformはリソースの依存関係を自動的に解決してくれますが、明示的な指定が必要なケースがあります。</summary>
        <content type="html">&lt;p&gt;Terraformはリソースの依存関係を自動的に解決してくれますが、明示的な指定が必要なケースがあります。&lt;/p&gt;

&lt;h2&gt;シナリオ&lt;/h2&gt;

&lt;p&gt;次のシナリオを考えます。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;リソース

&lt;ol&gt;
&lt;li&gt;S3バケット (バケット)&lt;/li&gt;
&lt;li&gt;セキュリティグループ&lt;/li&gt;
&lt;li&gt;EC2インスタンス (インスタンス)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;依存関係

&lt;ol&gt;
&lt;li&gt;インスタンスにセキュリティグループをアタッチする&lt;/li&gt;
&lt;li&gt;インスタンスはバケットに依存する（起動時にバケットからアプリケーションをダウンロードする）&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;リソースへの依存を明示する&lt;/h2&gt;

&lt;p&gt;インスタンスのセキュリティグループへの依存はTerraformが解決してくれますが、バケットへの依存はTerraformは検知できません（知りようがありません）。&lt;/p&gt;

&lt;p&gt;このようなケースでは&lt;code&gt;aws_instance.ec2&lt;/code&gt;の&lt;code&gt;depends_on&lt;/code&gt;でバケットへの依存を指定します。&lt;/p&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_s3_bucket&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
...
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_security_group&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;this&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
...
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_instance&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;ec2&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
...
    depends_on &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;aws_s3_bucket.this&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h2&gt;リソースをmodule化する&lt;/h2&gt;

&lt;p&gt;では、インスタンスに必要なリソースをmodule化したい場合は、どうすればいいのでしょうか。&lt;/p&gt;

&lt;p&gt;こんなケースです。&lt;/p&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;module &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;bucket&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  source &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;../modules/storage/s3/private_bucket&lt;/span&gt;&amp;quot;
....
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

module &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;sg&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
  source &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;../modules/network/security_group&lt;/span&gt;&amp;quot;
....
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;

resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_instance&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;ec2&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
...
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h2&gt;検証&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;depends_on = [module.bucket]&lt;/code&gt;でmoduleへの依存を明示できそうな気がします。検証してみました。&lt;/p&gt;

&lt;h3&gt;depends_onなし&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;terraform graph | dot -Tpng &amp;gt; graph.png&lt;/code&gt;で依存関係を可視化すると、aws_instance_ec2はmodule.bucketに依存していないことがわかります。&lt;/p&gt;

&lt;p&gt;サイズが大きいので、関係する箇所だけ貼ります。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20210815/20210815172754.png&quot; alt=&quot;f:id:JHashimoto:20210815172754p:plain&quot; width=&quot;1165&quot; height=&quot;200&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;h3&gt;depends_onあり&lt;/h3&gt;

&lt;p&gt;既出のコードにdepends_onを追加します。&lt;/p&gt;

&lt;pre class=&quot;code lang-tf&quot; data-lang=&quot;tf&quot; data-unlink&gt;resource &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;aws_instance&lt;/span&gt;&amp;quot; &amp;quot;&lt;span class=&quot;synConstant&quot;&gt;ec2&lt;/span&gt;&amp;quot; &lt;span class=&quot;synSpecial&quot;&gt;{&lt;/span&gt;
...
  depends_on &lt;span class=&quot;synStatement&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;[&lt;/span&gt;module.bucket&lt;span class=&quot;synSpecial&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;synSpecial&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;applyして依存関係を出力すると、aws_instance_ec2にmodule.bucketへの依存が設定されています。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20210815/20210815172131.png&quot; alt=&quot;f:id:JHashimoto:20210815172131p:plain&quot; width=&quot;1200&quot; height=&quot;162&quot; loading=&quot;lazy&quot; title=&quot;&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;後で確認したら、リファレンスにちゃんと書いてありました。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.terraform.io%2Fdocs%2Flanguage%2Fmeta-arguments%2Fdepends_on.html&quot; title=&quot;The depends_on Meta-Argument - Configuration Language - Terraform by HashiCorp&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.terraform.io/docs/language/meta-arguments/depends_on.html&quot;&gt;www.terraform.io&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Version note: Module support for depends_on was added in Terraform 0.13, and previous versions can only use it with resources.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;depends_onのmoduleサポートはver.0.13のアップデートで入っていました。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmedium.com%2Fhashicorp-engineering%2Fcreating-module-dependencies-in-terraform-0-13-4322702dac4a&quot; title=&quot;Creating Module Dependencies in Terraform 0.13&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://medium.com/hashicorp-engineering/creating-module-dependencies-in-terraform-0-13-4322702dac4a&quot;&gt;medium.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="Terraform" label="Terraform" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613797623387/1629016708" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【Thunderbird】メールリストのフォントサイズを変更するには？</title>
        <link href="https://blog.jhashimoto.net/entry/2020/03/15/085755"/>
        <id>hatenablog://entry/26006613535464114</id>
        <published>2020-03-15T08:57:55+09:00</published>
        <updated>2020-03-15T08:57:55+09:00</updated>        <summary type="html">Summary 拡張機能は公開が停止されているようなので、CSSをカスタマイズします。</summary>
        <content type="html">&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://addons.thunderbird.net/en-us/thunderbird/addon/theme-font-size-changer/&quot;&gt;拡張機能&lt;/a&gt;は公開が停止されているようなので、CSSをカスタマイズします。&lt;/p&gt;

&lt;h3&gt;環境&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10&lt;/li&gt;
&lt;li&gt;Thunderbird 68.6.0 (64bit)&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;手順&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Profileの確認

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\users\[User Name]\AppData\Roaming\Thunderbird\Profiles\&lt;/code&gt;にProfileがある。

&lt;ul&gt;
&lt;li&gt;複数のProfileフォルダがある場合、&lt;code&gt;Thunderbird -profilemanager&lt;/code&gt;を実行しProfile Managerを起動して、適用されているProfileを確認。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;cssファイル作成

&lt;ul&gt;
&lt;li&gt;Profileフォルダに&lt;code&gt;chrome/userChrome.css&lt;/code&gt;を作成する。&lt;code&gt;font-size&lt;/code&gt;はお好みで。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Thunderbird起動&lt;/li&gt;
&lt;/ol&gt;


&lt;h3&gt;userChrome.css&lt;/h3&gt;

&lt;pre class=&quot;code lang-css&quot; data-lang=&quot;css&quot; data-unlink&gt;&lt;span class=&quot;synComment&quot;&gt;/*&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt; * Do not remove the @namespace line -- it&#39;s required for correct functioning&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt; */&lt;/span&gt;
&lt;span class=&quot;synPreProc&quot;&gt;@namespace&lt;/span&gt; url(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&amp;quot;&lt;/span&gt;); &lt;span class=&quot;synComment&quot;&gt;/* set default namespace to XUL */&lt;/span&gt;

&lt;span class=&quot;synComment&quot;&gt;/* &lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt; * Make all the default font sizes 9 pt:&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt; */&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;synType&quot;&gt;font-size&lt;/span&gt;: &lt;span class=&quot;synConstant&quot;&gt;9pt&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;!important&lt;/span&gt;; &lt;span class=&quot;synIdentifier&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;h3&gt;Reference&lt;/h3&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsupport.mozilla.org%2Fen-US%2Fquestions%2F1198055&quot; title=&quot;Is there a way to increase the font size in the message list pane and folder list with MacOS? | Thunderbird Support Forum | Mozilla Support&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://support.mozilla.org/en-US/questions/1198055&quot;&gt;support.mozilla.org&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FMozilla%2FThunderbird%2FThunderbird_Configuration_Files&quot; title=&quot;Thunderbird Configuration Files&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Thunderbird_Configuration_Files&quot;&gt;developer.mozilla.org&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://kb.mozillazine.org/Moving_your_profile_folder_-_Thunderbird&quot;&gt;Moving your profile folder - Thunderbird - MozillaZine Knowledge Base&lt;/a&gt;&lt;/p&gt;
</content>        
        <category term="ツール" label="ツール" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613535464114/1587870089" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>Windows 10にMinikubeをインストールするには？</title>
        <link href="https://blog.jhashimoto.net/entry/2020/01/10/123000"/>
        <id>hatenablog://entry/26006613495588406</id>
        <published>2020-01-10T12:30:00+09:00</published>
        <updated>2020-01-10T12:30:01+09:00</updated>        <summary type="html">Summary Minikubeはローカルで稼働するKubernetesクラスタです。WindowsのHyper-V上にMinikubeをインストールしてみました。</summary>
        <content type="html">&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;Minikubeはローカルで稼働するKubernetesクラスタです。WindowsのHyper-V上にMinikubeをインストールしてみました。&lt;/p&gt;

&lt;h3&gt;Windows 10にMinikubeをインストールするには？&lt;/h3&gt;

&lt;p&gt;今回はChocolateyを使います。管理者権限で起動したPowershellで以下のコマンドを実行します。&lt;/p&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;PS &amp;gt; choco install minikube
...
PS &amp;gt; minikube start --&lt;span class=&quot;synStatement&quot;&gt;vm-driver&lt;/span&gt;=hyperv
...
PS &amp;gt; minikube config set &lt;span class=&quot;synStatement&quot;&gt;vm-driver&lt;/span&gt; hyperv    &lt;span class=&quot;synComment&quot;&gt;# To make hyperv the default driver:&lt;/span&gt;
! These changes will take effect upon a minikube delete and then a minikube start
PS &amp;gt; kubectl get pod -A    &lt;span class=&quot;synComment&quot;&gt;# for Command Testing&lt;/span&gt;
NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;coredns-6955765f44&lt;/span&gt;-lldqb           &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;coredns-6955765f44&lt;/span&gt;-tbtns           &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;etcd-minikube&lt;/span&gt;                      &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;kube-addon&lt;/span&gt;-&lt;span class=&quot;synStatement&quot;&gt;manager-minikube&lt;/span&gt;        &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;kube-apiserver&lt;/span&gt;-minikube            &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;kube-controller&lt;/span&gt;-&lt;span class=&quot;synStatement&quot;&gt;manager-minikube&lt;/span&gt;   &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;kube-proxy&lt;/span&gt;-j7nng                   &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;kube-scheduler&lt;/span&gt;-minikube            &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;span class=&quot;synStatement&quot;&gt;kube-system&lt;/span&gt;   &lt;span class=&quot;synStatement&quot;&gt;storage-provisioner&lt;/span&gt;                &lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;/&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;     Running   &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;          30m
&lt;/pre&gt;


&lt;h3&gt;Reference&lt;/h3&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fminikube.sigs.k8s.io%2Fdocs%2Fstart%2Fwindows%2F&quot; title=&quot;Windows&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://minikube.sigs.k8s.io/docs/start/windows/&quot;&gt;minikube.sigs.k8s.io&lt;/a&gt;&lt;/cite&gt;
&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.jhashimoto.net%2Fentry%2F2016%2F11%2F02%2F132736&quot; title=&quot;【自動化】ChocolateyでWindowsアプリのインストールを自動化する - プログラマーな日々&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://blog.jhashimoto.net/entry/2016/11/02/132736&quot;&gt;blog.jhashimoto.net&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="Kubernetes" label="Kubernetes" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613495588406/1578658265" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【Docker】Docker Desktopの自動起動を無効にできない</title>
        <link href="https://blog.jhashimoto.net/entry/2019/10/30/093800"/>
        <id>hatenablog://entry/26006613457869082</id>
        <published>2019-10-30T09:38:00+09:00</published>
        <updated>2019-10-30T09:38:00+09:00</updated>        <summary type="html">Start Docker Desktop when you log inを設定しても、Docker Desktopが自動起動する。 環境 Windows 10 バージョン1903 Docker Desktop 2.1.0.4(39773)</summary>
        <content type="html">&lt;p&gt;&lt;code&gt;Start Docker Desktop when you log in&lt;/code&gt;を設定しても、Docker Desktopが自動起動する。&lt;/p&gt;

&lt;h2&gt;環境&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10 バージョン1903&lt;/li&gt;
&lt;li&gt;Docker Desktop 2.1.0.4(39773)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;対応&lt;/h2&gt;

&lt;p&gt;レジストリを直接編集する。&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;から&lt;code&gt;Docker Desktop&lt;/code&gt;のエントリを削除する。&lt;/p&gt;

&lt;h2&gt;参考&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://forums.docker.com/t/docker-desktop-always-starts-although-disabled/63494/17&quot;&gt;Docker Desktop always starts although disabled - Docker Desktop for Windows - Docker Forums&lt;/a&gt;&lt;/p&gt;
</content>        
        <category term="Docker" label="Docker" />
        
        <category term="トラブルシュート" label="トラブルシュート" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613457869082/1572395880" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>AWS障害の振り返り</title>
        <link href="https://blog.jhashimoto.net/entry/2019/08/26/212311"/>
        <id>hatenablog://entry/26006613406169275</id>
        <published>2019-08-26T21:23:11+09:00</published>
        <updated>2019-08-26T21:23:11+09:00</updated>        <summary type="html">社内で共有した文書です。クラウド初心者向けに書いているので、割り引いて読んでください。</summary>
        <content type="html">&lt;p&gt;社内で共有した文書です。クラウド初心者向けに書いているので、割り引いて読んでください。&lt;/p&gt;

&lt;p&gt;2019/08/23の障害についてAWSがサマリーを公表しました。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faws.amazon.com%2Fjp%2Fmessage%2F56489%2F&quot; title=&quot;Summary of the Amazon EC2 Issues in the Asia Pacific (Tokyo) Region (AP-NORTHEAST-1)&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://aws.amazon.com/jp/message/56489/&quot;&gt;aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;AZ（データセンターのこと）の空調設備の障害によるオーバーヒートが原因とのことでした。&lt;/p&gt;

&lt;p&gt;一部のインスタンスについては、ハードウェアの障害によりリタイヤが必要だったと書かれています。&lt;/p&gt;

&lt;p&gt;顧客のインスタンスが一部復旧せず、休日のサーバー再構築が必要だったと聞きました。&lt;/p&gt;

&lt;p&gt;EC2は仮想サーバーなので、基盤の物理サーバーが壊れたらインスタンスも壊れます。それに対処するのは、AWSユーザーの責任です。このあたりは、責任共有モデルとして説明されています。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Faws.amazon.com%2Fjp%2Fcompliance%2Fshared-responsibility-model%2F&quot; title=&quot;責任共有モデル | AWS&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://aws.amazon.com/jp/compliance/shared-responsibility-model/&quot;&gt;aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;この記事がわかりやすいです。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.nikkeibp.co.jp%2Fit%2Fatcl%2Fcolumn%2F17%2F010400601%2F010400008%2F&quot; title=&quot;AWSのセキュリティや注意点、「責任共有モデル」を知り使いこなす&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://tech.nikkeibp.co.jp/it/atcl/column/17/010400601/010400008/&quot;&gt;tech.nikkeibp.co.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;AWSの設計指針として「クラウドコンピューティングのアーキテクチャ: ベストプラクティス」というホワイトペーパーがある。&lt;/p&gt;

&lt;p&gt;そこにいくつか記されている指針の中で、最も有名なのがDesign for failureだ。「システムは故障する可能性があるものだという前提を受け入れ、あらかじめ故障に備えた設計をする」という考え方である。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;では、具体的にどう対処したらいいのか？という話ですが、障害によるシステムダウンを回避する設計をする必要があります。&lt;/p&gt;

&lt;p&gt;クラウドらしい（クラウドの価値を十分に享受できる）順に以下となります。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;マネージドサービスを組み合わせる&lt;/li&gt;
&lt;li&gt;EC2のMultiAZ構成&lt;/li&gt;
&lt;li&gt;単一のEC2インスタンス&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;1.が最も望ましい選択肢です。非機能要件の実現をクラウドベンダーに任せることができ、運用フェーズが楽になります。&lt;/p&gt;

&lt;p&gt;公式の資料では、こちらがわかりやすいです。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://www.slideshare.net/slideshow/embed_code/key/2AcVbzd1IQOGI&quot; width=&quot;427&quot; height=&quot;356&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;&quot; allowfullscreen&gt; &lt;/iframe&gt; &lt;div style=&quot;margin-bottom:5px&quot;&gt; &lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/AmazonWebServicesJapan/aws-black-belt-online-seminar-2016&quot; title=&quot;AWS Black Belt Online Seminar 2016 クラウドのためのアーキテクチャ設計 -ベストプラクティス-&quot; target=&quot;_blank&quot;&gt;AWS Black Belt Online Seminar 2016 クラウドのためのアーキテクチャ設計 -ベストプラクティス-&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;https://www.slideshare.net/AmazonWebServicesJapan&quot; target=&quot;_blank&quot;&gt;Amazon Web Services Japan&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.slideshare.net/AmazonWebServicesJapan/aws-black-belt-online-seminar-2016/53&quot;&gt;www.slideshare.net&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;1.が困難な場合は2.を選択すると、可用性を高めることができます。&lt;/p&gt;

&lt;p&gt;ただし、&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;インフラとアプリケーションを冗長化できるよう設計する必要があります。シングルインスタンスで稼働しているシステムを単純にMultiAZに移行できるわけではありません。&lt;/li&gt;
&lt;li&gt;冗長化するので使用料金は上がる&lt;/li&gt;
&lt;li&gt;まじめに運用設計しないと、インスタンスが増える分だけ運用コストが上がる&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;3.は止むを得ないケース以外は避けてください。オンプレでサーバーを運用するのとほとんど変わりません。
他に選択肢がなく採用する場合は、インスタンスのバックアップ（AMI Or スナップショット）を定期的に取得するようにしてください。&lt;/p&gt;
</content>        
        <category term="AWS" label="AWS" />
        
        <category term="障害" label="障害" />
        
        <category term="設計" label="設計" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613406169275/1566822191" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【Microsoft To-Do】待望のアップデートでリストのグループ化が可能に！</title>
        <link href="https://blog.jhashimoto.net/entry/2019/08/14/000434"/>
        <id>hatenablog://entry/26006613394849583</id>
        <published>2019-08-14T00:04:34+09:00</published>
        <updated>2019-08-14T00:04:34+09:00</updated>        <summary type="html">Microsoft To-Doでリストのグループ化ができるようになりました。個人的には待望のアップデートです。 techcommunity.microsoft.com</summary>
        <content type="html">&lt;p&gt;Microsoft To-Doでリストのグループ化ができるようになりました。個人的には待望のアップデートです。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FMicrosoft-To-Do-Blog%2FYour-most-requested-feature-is-here-list-groups%2Fba-p%2F800168&quot; title=&quot;Your most requested feature is here – list groups!&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://techcommunity.microsoft.com/t5/Microsoft-To-Do-Blog/Your-most-requested-feature-is-here-list-groups/ba-p/800168&quot;&gt;techcommunity.microsoft.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;Wonderlistから移行して唯一不便だったのは、フォルダがないことでした。これで解決です。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20190814/20190814000332.png&quot; alt=&quot;f:id:JHashimoto:20190814000332p:plain&quot; title=&quot;f:id:JHashimoto:20190814000332p:plain&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;この機能は、ユーザーフォーラムで議論されていたものです。開発が活発なので今後に期待です。&lt;/p&gt;

&lt;p&gt;&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt; div.uv-card {background: #fff;border: 1px solid #CED6E6;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;color: #5C5F66;font: normal 11px/1.3em &quot;HelveticaNeue&quot;, Arial, sans-serif;margin: 0;max-width: 500px;padding: 10px 10px 5px 10px;text-rendering: optimizelegibility;zoom: 1;}div.uv-card:after {content: &quot;.&quot;;display: block;height: 0;clear: both;visibility: hidden;}.uv-card-info {line-height: 1em;margin-bottom: 10px;}.uv-card-topic {color: #A0A6B3;display: inline-block;}.uv-card-status {background: #DBF0B4;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;color: #446600;display: inline-block;font-size: 10px;font-weight: bold;margin-right: 5px;padding: 3px 5px;text-transform: uppercase;}.uv-card-meta {float: right;list-style: none;line-height: 16px;margin: 0 0 10px 20px;padding: 0;}.uv-card-meta li {margin: 0 0 .7em 0;padding: 0;}.uv-card-meta img {border: none;vertical-align: bottom;}.uv-card-votes {background: #F9FAFC;border: 1px solid #DBDEE6;display: inline-block;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;}.uv-card-votes-button {background: #F3F6FA;border: 1px solid #A0A6B3;-moz-border-radius: 3px;-webkit-border-radius: 3px;border-radius: 3px;color: #293E66;display: inline-block;font-weight: bold;margin: -1px;padding: 3px 7px 3px 5px;text-decoration: none;}.uv-card-votes-count {display: inline-block;padding-right: 7px;margin-left: 3px;}.uv-card-comments,.uv-card-votecount {display: inline-block;padding: 3px 5px;}.uv-card-votecount {color: #576800;}.uv-card-title {color: #293E66;font-size: 15px;font-weight: bold;margin: 0 0 10px 0;padding: 0;}h2.uv-card-title a {color: inherit;text-decoration: none;}.uv-card-description {margin-bottom: 10px;}.uv-card-description p {margin: 0 0 .7em 0;padding: 0;}&lt;/style&gt; &lt;div class=&quot;uv-card&quot;&gt; &lt;div class=&quot;uv-card-info&quot;&gt; &lt;div class=&quot;uv-card-status uv-card-status-we-have-this&quot;&gt;we have this&lt;/div&gt; &lt;div class=&quot;uv-card-topic&quot;&gt;How can we improve Microsoft To-Do?&lt;/div&gt; &lt;/div&gt; &lt;ul class=&quot;uv-card-meta&quot;&gt;    &lt;li&gt; &lt;div class=&quot;uv-card-votecount&quot;&gt; &lt;img alt=&quot;&quot; src=&quot;https://assets.uvcdn.com/pkg/oembed/votes-091211c9006da8621310a57b963f98502e22c56c4202c61f55909e9bf3689818.png&quot; /&gt;7831 votes&lt;/div&gt; &lt;li&gt;&lt;li&gt; &lt;div class=&quot;uv-card-comments&quot;&gt; &lt;img alt=&quot;&quot; src=&quot;https://assets.uvcdn.com/pkg/oembed/comments-29b68afad19ca16ed6c50416e3ab6570e5df8c9f035d0bdcb08a442830bb718a.png&quot; /&gt;        925 comments&lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;h2 class=&quot;uv-card-title&quot;&gt;&lt;a href=&quot;https://todo.uservoice.com/forums/597175-feature-suggestions/suggestions/18983857-folder-support-group-lists&quot;&gt;Folder support / Group lists&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;uv-card-description&quot;&gt; &lt;p&gt;&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://todo.uservoice.com/forums/597175-feature-suggestions/suggestions/18983857-folder-support-group-lists&quot;&gt;todo.uservoice.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="ツール" label="ツール" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613394849583/1565708674" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>WSLインストール環境設定メモ</title>
        <link href="https://blog.jhashimoto.net/entry/2019/08/04/114351"/>
        <id>hatenablog://entry/26006613386276707</id>
        <published>2019-08-04T11:43:51+09:00</published>
        <updated>2019-08-04T11:43:51+09:00</updated>        <summary type="html">WSLの環境構築のメモ。 WSLインストール [プログラムと機能の追加]からWindows Subsystem for Linuxをインストール Ubuntuインストール ストアからインストール ls配色 www.kwbtblog.com AWS CLI sudo apt install python3-pip pip3 install awscli --upgrade --user j-hashimoto@PC-02-280:~$ aws --version -bash: /mnt/c/Users/XXXX/AppData/Local/Programs/Python/Python36/Scr…</summary>
        <content type="html">&lt;p&gt;WSLの環境構築のメモ。&lt;/p&gt;

&lt;h2&gt;WSLインストール&lt;/h2&gt;

&lt;p&gt;[プログラムと機能の追加]から&lt;code&gt;Windows Subsystem for Linux&lt;/code&gt;をインストール&lt;/p&gt;

&lt;h2&gt;Ubuntuインストール&lt;/h2&gt;

&lt;p&gt;ストアからインストール&lt;/p&gt;

&lt;h2&gt;ls配色&lt;/h2&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.kwbtblog.com%2Fentry%2F2019%2F04%2F27%2F023411&quot; title=&quot;WSLのWindowsのフォルダの色が見づらいのを直す - 新しいことにはウェルカム&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.kwbtblog.com/entry/2019/04/27/023411&quot;&gt;www.kwbtblog.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h2&gt;AWS CLI&lt;/h2&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;sudo apt install python3-pip
pip3 install awscli --upgrade --user&lt;/pre&gt;




&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;j-hashimoto@PC-02-280:~$ aws --version                                                                                  
-bash: /mnt/c/Users/XXXX/AppData/Local/Programs/Python/Python36/Scripts/aws: c:\users\xxxx\appdata\local\programs\python\python36\python.exe^M: bad interpreter: No such file or directory&lt;/pre&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgokigenmaru.hatenablog.com%2Fentry%2F2018%2F12%2F07%2F142347&quot; title=&quot;Windows10 WSL(Ubuntu18.04)でawscliをインストールしてみた - gokigenmaruのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://gokigenmaru.hatenablog.com/entry/2018/12/07/142347&quot;&gt;gokigenmaru.hatenablog.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="WSL" label="WSL" />
        
        <category term="Linux" label="Linux" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613386276707/1567406024" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
    <entry>
        <title>viエディタTips</title>
        <link href="https://blog.jhashimoto.net/entry/2019/08/04/103451"/>
        <id>hatenablog://entry/26006613386205886</id>
        <published>2019-08-04T10:34:51+09:00</published>
        <updated>2019-08-04T10:34:51+09:00</updated>        <summary type="html">最近Linuxを使い始めたが、すぐ忘れるのでメモ。随時追記します。</summary>
        <content type="html">&lt;p&gt;最近Linuxを使い始めたが、すぐ忘れるのでメモ。随時追記します。&lt;/p&gt;

&lt;h2&gt;保存して終了&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/wq&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;検索&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/文字列&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;指定の行へ移動&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/行番号&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;行コピー&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/yy&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;ペースト&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/p&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;行削除（バッファにコピー）&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/dd&lt;/code&gt;&lt;/p&gt;
</content>        
        <category term="vi" label="vi" />
        
        <category term="Tips" label="Tips" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/26006613386205886/1577151631" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【PostgreSQL】データベースのグローバルな設定を変更する</title>
        <link href="https://blog.jhashimoto.net/entry/2019/07/18/181820"/>
        <id>hatenablog://entry/17680117127220197481</id>
        <published>2019-07-18T18:18:20+09:00</published>
        <updated>2019-07-18T18:18:20+09:00</updated>        <summary type="html">SELECT current_setting(&#39;hoge&#39;)で取得する値を変更したい。</summary>
        <content type="html">&lt;p&gt;&lt;code&gt;SELECT current_setting(&#39;hoge&#39;)&lt;/code&gt;で取得する値を変更したい。&lt;/p&gt;

&lt;h2&gt;set_config&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;set_config(setting_name, new_value, is_local)&lt;/code&gt;を実行したが、変更が反映されなかった。set_configによる変更のスコープはセッション単位であるため。&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;SETでセッション内でローカルに変更できるパラメータの値を変更することができます。対応する関数はset_config(setting_name, new_value, is_local)です。&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;ALTER DATABASE&lt;/h2&gt;

&lt;p&gt;ALTER DATABASEを使用すると、変更が永続化される（データベース単位のグローバルな設定値が変更される）。&lt;/p&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;&lt;span class=&quot;synStatement&quot;&gt;ALTER&lt;/span&gt; DATABASE db_name &lt;span class=&quot;synStatement&quot;&gt;SET&lt;/span&gt; setting_name &lt;span class=&quot;synSpecial&quot;&gt;TO&lt;/span&gt; new_value
&lt;/pre&gt;


&lt;blockquote&gt;&lt;p&gt;PostgreSQLは3つのSQLコマンドでデフォルト値を設定します。 すでに説明したALTER SYSTEMコマンドは、SQLによってグローバルな設定値を変更する方法を提供します; postgresql.confを編集するのと等価です。これに加え、データベース単位あるいはロール単位で設定するためのコマンドがあります:&lt;/p&gt;

&lt;p&gt;ALTER DATABASEコマンドはデータベース単位でグローバルな設定値を上書きします。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;ちなみに、サーバーのデフォルト値を変更する場合は、&lt;code&gt;ALTER SYSTEM&lt;/code&gt;またはpostgresql.confを編集する。&lt;/p&gt;

&lt;h2&gt;参考&lt;/h2&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.postgresql.jp%2Fdocument%2F10%2Fhtml%2Fconfig-setting.html&quot; title=&quot;19.1. パラメータの設定&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.postgresql.jp/document/10/html/config-setting.html&quot;&gt;www.postgresql.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="PostgreSQL" label="PostgreSQL" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/17680117127220197481/1563441662" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>.NET Frameworkのアップグレードによる影響を知りたい</title>
        <link href="https://blog.jhashimoto.net/entry/2019/07/11/203244"/>
        <id>hatenablog://entry/17680117127216809085</id>
        <published>2019-07-11T20:32:44+09:00</published>
        <updated>2019-07-11T20:32:44+09:00</updated>        <summary type="html">.NET 4.6.1と4.6.2の差異が知りたい🤔#.NET— jhashimoto (@JHashimoto0518) July 9, 2019</summary>
        <content type="html">&lt;p&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;HASH(0x556b899eacd0)&quot;&gt;&lt;p lang=&quot;ja&quot; dir=&quot;ltr&quot;&gt;.NET 4.6.1と4.6.2の差異が知りたい🤔&lt;br&gt;#.NET&lt;/p&gt;&amp;mdash; jhashimoto (@JHashimoto0518) &lt;a href=&quot;https://twitter.com/JHashimoto0518/status/1148455793991094272?ref_src=twsrc%5Etfw&quot;&gt;July 9, 2019&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;このサイトが便利。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.microsoft.com%2Fja-jp%2Fdotnet%2Fframework%2Fmigration-guide%2Fretargeting%2F&quot; title=&quot;.NET Framework における再ターゲットの変更点&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.microsoft.com/ja-jp/dotnet/framework/migration-guide/retargeting/&quot;&gt;docs.microsoft.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;現在のバージョンと移行先のバージョンを指定します。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20190711/20190711202336.png&quot; alt=&quot;f:id:JHashimoto:20190711202336p:plain&quot; title=&quot;f:id:JHashimoto:20190711202336p:plain&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;変更点が確認できます。&lt;/p&gt;

&lt;p&gt;&lt;span itemscope itemtype=&quot;http://schema.org/Photograph&quot;&gt;&lt;img src=&quot;https://cdn-ak.f.st-hatena.com/images/fotolife/J/JHashimoto/20190711/20190711202832.png&quot; alt=&quot;f:id:JHashimoto:20190711202832p:plain&quot; title=&quot;f:id:JHashimoto:20190711202832p:plain&quot; class=&quot;hatena-fotolife&quot; itemprop=&quot;image&quot;&gt;&lt;/span&gt;&lt;/p&gt;
</content>        
        <category term=".NET" label=".NET" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/17680117127216809085/1562846478" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
    <entry>
        <title>【ASP.NET】compilation要素とhttpRuntime要素のtargetFrameworkプロパティの使い分け</title>
        <link href="https://blog.jhashimoto.net/entry/2019/07/11/201821"/>
        <id>hatenablog://entry/17680117127216802306</id>
        <published>2019-07-11T20:18:21+09:00</published>
        <updated>2019-07-11T20:18:21+09:00</updated>        <summary type="html">.NET3.5のASP.NETアプリを.NET4.6にアップグレードした。</summary>
        <content type="html">&lt;p&gt;.NET3.5のASP.NETアプリを.NET4.6にアップグレードした。&lt;/p&gt;

&lt;pre class=&quot;code lang-xml&quot; data-lang=&quot;xml&quot; data-unlink&gt;&lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;system&lt;/span&gt;&lt;span class=&quot;synComment&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;web&amp;gt;&lt;/span&gt; 
    &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;compilation &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;debug&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;targetFramework&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;4.6&amp;quot;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; /&amp;gt;&lt;/span&gt; 
    &lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;httpRuntime &lt;/span&gt;&lt;span class=&quot;synType&quot;&gt;targetFramework&lt;/span&gt;=&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;4.6&amp;quot;&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt; /&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;synIdentifier&quot;&gt;&amp;lt;/system&lt;/span&gt;&lt;span class=&quot;synComment&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;web&amp;gt;&lt;/span&gt; 
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;compilation&lt;/code&gt;要素と&lt;code&gt;httpRuntime&lt;/code&gt;要素の&lt;code&gt;targetFramework&lt;/code&gt;プロパティの使い分け。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compilation要素のtargetFrameworkプロパティは、ビルド時に参照される.NETFrameworkのバージョン。&lt;/li&gt;
&lt;li&gt;httpRuntime要素のtargetFrameworkプロパティは、実行時に参照される.NETFrameworkのバージョン。

&lt;ul&gt;
&lt;li&gt;exeの場合は、app.configのsupportedRuntime要素で指定できるが、ASP.NETはapp.configが使えないので、httpRuntime要素を使用する。&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;参考&lt;/h3&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fstackoverrun.com%2Fja%2Fq%2F11062818&quot; title=&quot;ASP .NET MVCのweb.configでTargetFramework設定が意味することは何ですか？私たちのASP.NET MVC 5 Webアプリケーションの&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://stackoverrun.com/ja/q/11062818&quot;&gt;stackoverrun.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdevblogs.microsoft.com%2Faspnet%2Fall-about-httpruntime-targetframework%2F&quot; title=&quot;ASP.NET Blog | All about&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://devblogs.microsoft.com/aspnet/all-about-httpruntime-targetframework/&quot;&gt;devblogs.microsoft.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcodeday.me%2Fjp%2Fqa%2F20190513%2F818463.html&quot; title=&quot;c＃ – ASP.NET MVC 5のweb.configコンパイルとhttpRuntimeエラー - コードログ&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://codeday.me/jp/qa/20190513/818463.html&quot;&gt;codeday.me&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.microsoft.com%2Fja-jp%2Fvisualstudio%2Fide%2Fhow-to-target-a-version-of-the-dotnet-framework%3Fview%3Dvs-2015&quot; title=&quot;方法: .NET Framework のバージョンを対象 - Visual Studio 2015&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.microsoft.com/ja-jp/visualstudio/ide/how-to-target-a-version-of-the-dotnet-framework?view=vs-2015&quot;&gt;docs.microsoft.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fopentouryo.osscons.jp%2Findex.php%3FtargetFramework%25E3%2581%25AE%25E3%2583%2590%25E3%2583%25BC%25E3%2582%25B8%25E3%2583%25A7%25E3%2583%25B3%25E3%2582%25A2%25E3%2583%2583%25E3%2583%2597&quot; title=&quot;targetFrameworkのバージョンアップ - Open 棟梁 Wiki&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://opentouryo.osscons.jp/index.php?targetFramework%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%82%A2%E3%83%83%E3%83%97&quot;&gt;opentouryo.osscons.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="ASP.NET" label="ASP.NET" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/17680117127216802306/1562843901" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>RedshiftのよくあるTips</title>
        <link href="https://blog.jhashimoto.net/entry/2019/06/20/214109"/>
        <id>hatenablog://entry/17680117127203810436</id>
        <published>2019-06-20T21:41:09+09:00</published>
        <updated>2019-06-20T21:41:09+09:00</updated>        <summary type="html">RedshiftのよくあるTipsです。随時更新します。</summary>
        <content type="html">&lt;p&gt;RedshiftのよくあるTipsです。随時更新します。&lt;/p&gt;

&lt;h3&gt;テーブルの分散キーとソートキーを確認したい&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;fooSchama&lt;/code&gt;に&lt;code&gt;barTable&lt;/code&gt;があるとして、&lt;/p&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;&lt;span class=&quot;synComment&quot;&gt;-- 検索パスにスキーマを追加する（セッション内で有効）&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;set&lt;/span&gt; search_path &lt;span class=&quot;synSpecial&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;$user&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;, &lt;span class=&quot;synSpecial&quot;&gt;public&lt;/span&gt;, &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;fooSchama&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;;

&lt;span class=&quot;synStatement&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;synSpecial&quot;&gt;FROM&lt;/span&gt; pg_table_def &lt;span class=&quot;synSpecial&quot;&gt;WHERE&lt;/span&gt; schemaname = &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;fooSchama&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;AND&lt;/span&gt; tablename = &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;barTable&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;AND&lt;/span&gt; (distkey = &lt;span class=&quot;synSpecial&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;OR&lt;/span&gt; sortkey &amp;gt; &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;);
&lt;/pre&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Fcloud%2Faws%2Fredshift-system-view-sql%2F&quot; title=&quot;Amazon Redshiftのシステムテーブルを見る時によく使うSQL ９選 | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/redshift-system-view-sql/&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h3&gt;エクスポートするCSVにヘッダを付けたい&lt;/h3&gt;

&lt;p&gt;UNLOADでHEADERオプションを指定します。&lt;/p&gt;

&lt;p&gt;HEADERオプションがサポートされる前は、こんなSQLを書く必要がありました。&lt;/p&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;UNLOAD (
    &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;SELECT&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        column1,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        column2,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        column3&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;    FROM (&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        SELECT&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;column1&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; AS column1,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;column2&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; AS column2,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;column3&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; AS column3&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            1 as row_num&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        WHERE 1 = 1&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        UNION ALL&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        SELECT&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            CAST(column1 AS VARCHAR) AS column1,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            CAST(column2 AS VARCHAR) AS column2,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            CAST(column3 AS VARCHAR) AS column3,&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;            2 as row_rum&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;        FROM fooSchema.barTable&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;    ) T ORDER BY row_num)&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;TO &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;s3://bucketname/filename&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;CREDENTIALS &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;credentials&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;;&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;HEADERオプションを使うとシンプルに書けます。&lt;/p&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;UNLOAD (&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;SELECT * FROM fooSchema.barTable)&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;TO &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;s3://bucketname/filename&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;CREDENTIALS &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;credentials&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;
&lt;span class=&quot;synConstant&quot;&gt;HEADER;&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Fcloud%2Faws%2F20181016-amazon-redshift-unload-support-header-option%2F%23toc--header&quot; title=&quot;Amazon Redshift これでデータレイクの連携がスムーズになる！ UNLOADコマンドがヘッダー行に対応したので試してみました | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/20181016-amazon-redshift-unload-support-header-option/#toc--header&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h3&gt;キャッシュを無効化したい&lt;/h3&gt;

&lt;p&gt;パフォーマンステストで必須です。&lt;/p&gt;

&lt;blockquote cite=&quot;https://yohei-a.hatenablog.jp/entry/20180225/1519540121&quot; data-uuid=&quot;17680117127205811745&quot;&gt;&lt;p&gt;セッションレベルで無効化する方法 set enable_result_cache_for_session=off; ユーザーレベルで無効化する方法 ALTER USER awsuser SET enable_result_cache_for_session = off;&lt;/p&gt;&lt;cite&gt;&lt;a href=&quot;https://yohei-a.hatenablog.jp/entry/20180225/1519540121&quot;&gt;Redshift のリザルトキャッシュを無効化する方法 - ablog&lt;/a&gt;&lt;/cite&gt;&lt;/blockquote&gt;


&lt;h4&gt;検証&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;SELECT * FROM tableName LIMIT 1&lt;/code&gt;の結果セットがキャッシュされたものか？&lt;/p&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;&lt;span class=&quot;synStatement&quot;&gt;SELECT&lt;/span&gt; * &lt;span class=&quot;synSpecial&quot;&gt;FROM&lt;/span&gt; SVL_QLOG &lt;span class=&quot;synSpecial&quot;&gt;WHERE&lt;/span&gt; substring = &lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;SELECT * FROM tableName LIMIT 1&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&#39;&lt;/span&gt;;
&lt;/pre&gt;


&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt; userid    &lt;/th&gt;
&lt;th&gt; query     &lt;/th&gt;
&lt;th&gt; xid   &lt;/th&gt;
&lt;th&gt; pid   &lt;/th&gt;
&lt;th&gt; starttime     &lt;/th&gt;
&lt;th&gt; endtime   &lt;/th&gt;
&lt;th&gt; elapsed   &lt;/th&gt;
&lt;th&gt; aborted   &lt;/th&gt;
&lt;th&gt; label     &lt;/th&gt;
&lt;th&gt; substring     &lt;/th&gt;
&lt;th&gt; source_query  &lt;/th&gt;
&lt;th&gt; concurrency_scaling_status_txt    &lt;/th&gt;
&lt;th&gt; from_sp_call  &lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt; 112   &lt;/td&gt;
&lt;td&gt; 3901  &lt;/td&gt;
&lt;td&gt; 12973817  &lt;/td&gt;
&lt;td&gt; 31495     &lt;/td&gt;
&lt;td&gt; 2019/6/24 4:44    &lt;/td&gt;
&lt;td&gt; 2019/6/24 4:44    &lt;/td&gt;
&lt;td&gt; 8892  &lt;/td&gt;
&lt;td&gt; 0     &lt;/td&gt;
&lt;td&gt; default   &lt;/td&gt;
&lt;td&gt; SELECT * FROM tableName LIMIT 1   &lt;/td&gt;
&lt;td&gt;   &lt;/td&gt;
&lt;td&gt; 0 - Ran on the main cluster   &lt;/td&gt;
&lt;td&gt;   &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;


&lt;p&gt;&lt;code&gt;source_query&lt;/code&gt;がNullなので、キャッシュされていない。&lt;/p&gt;

&lt;h3&gt;ユーザーにテーブル権限を付与したい&lt;/h3&gt;

&lt;pre class=&quot;code lang-sql&quot; data-lang=&quot;sql&quot; data-unlink&gt;&lt;span class=&quot;synComment&quot;&gt;-- スキーマへのALL権限&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;ALL&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;ON&lt;/span&gt; SCHEMA schemaName &lt;span class=&quot;synSpecial&quot;&gt;TO&lt;/span&gt; userName;

&lt;span class=&quot;synComment&quot;&gt;-- スキーマの既存テーブルへのALL権限&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;ALL&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;ALL&lt;/span&gt; TABLES &lt;span class=&quot;synStatement&quot;&gt;IN&lt;/span&gt; SCHEMA schemaName &lt;span class=&quot;synSpecial&quot;&gt;TO&lt;/span&gt; userName;

&lt;span class=&quot;synComment&quot;&gt;-- デフォルト権限を設定して、新たに作成されたテーブルをreadOnlyUserNameが参照可能にする&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;DEFAULT&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;PRIVILEGES&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;IN&lt;/span&gt; SCHEMA schemaName &lt;span class=&quot;synStatement&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;ON&lt;/span&gt; TABLES &lt;span class=&quot;synSpecial&quot;&gt;TO&lt;/span&gt; readOnlyUserName;
&lt;/pre&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Fcloud%2Faws%2Famazon-redshift-grant-and-revoke-on-all-tables-in-schema%2F&quot; title=&quot;Amazon Redshift: テーブル権限付与設定(GRANT/REVOKE)がON ALL TABLES IN SCHEMA指定で一括実行出来る様になりました | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/amazon-redshift-grant-and-revoke-on-all-tables-in-schema/&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Fcloud%2Fredshift-alter-default-privileges%2F&quot; title=&quot;Redshiftのデフォルト権限設定でハマったこと | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/redshift-alter-default-privileges/&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h3&gt;ユーザーの実行権限確認&lt;/h3&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdev.classmethod.jp%2Fcloud%2Faws%2Famazon-redshift-useful-sql-access-privileges%2F&quot; title=&quot;Amazon Redshift Useful SQL: テーブル別実行権限設定の一覧をもう少し分かり易く表示する | DevelopersIO&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/amazon-redshift-useful-sql-access-privileges/&quot;&gt;dev.classmethod.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h3&gt;テーブルの分散キー確認&lt;/h3&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;SELECT &amp;#34;schema&amp;#34;, &amp;#34;table&amp;#34;, diststyle FROM SVV_TABLE_INFO&lt;/pre&gt;


&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdocs.aws.amazon.com%2Fja_jp%2Fredshift%2Flatest%2Fdg%2Fviewing-distribution-styles.html&quot; title=&quot;分散スタイルの表示 - Amazon Redshift&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://docs.aws.amazon.com/ja_jp/redshift/latest/dg/viewing-distribution-styles.html&quot;&gt;docs.aws.amazon.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="Redshift" label="Redshift" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/17680117127203810436/1567650819" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>Gitチートシート</title>
        <link href="https://blog.jhashimoto.net/entry/2019/06/18/115925"/>
        <id>hatenablog://entry/17680117127202481725</id>
        <published>2019-06-18T11:59:25+09:00</published>
        <updated>2019-06-18T11:59:25+09:00</updated>        <summary type="html">随時更新します。</summary>
        <content type="html">&lt;p&gt;随時更新します。&lt;/p&gt;

&lt;h3&gt;基本操作&lt;/h3&gt;

&lt;h4&gt;ブランチを作成したい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git branch [name]
git branch [name] [ハッシュ] // コミットを指定してブランチ作成
&lt;/pre&gt;


&lt;h4&gt;ブランチ移動&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git checkout
git checkout -b [name] // ブランチの作成と移動を同時にやる
&lt;/pre&gt;


&lt;h4&gt;コミット移動&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git reset             // 指定のコミットまで戻る。作業ファイルはそのまま
git reset --hard  // 作業ファイルの変更も元に戻る。注意！！
&lt;/pre&gt;


&lt;h4&gt;リモートリポジトリを追加&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git remote add origin [url]
&lt;/pre&gt;


&lt;h4&gt;リモートリポジトリを確認&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;$ git remote -v
&lt;/pre&gt;


&lt;h4&gt;変更をプッシュしたい&lt;/h4&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;git push origin master    // originというリモートリポジトリのmasterというブランチにプッシュ
&lt;/pre&gt;


&lt;h5&gt;git pushで毎回パラメータを指定するのが面倒&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;-u&lt;/code&gt;を指定すると、ローカルブランチがリモートブランチにリンクされます。次回以降は引数なしで&lt;code&gt;git push&lt;/code&gt;を実行できます。&lt;/p&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;git push -u origin master
&lt;/pre&gt;


&lt;h4&gt;リモートの更新を確認したい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git fetch　// 更新情報を取得（ファイルは更新しない）
&lt;/pre&gt;


&lt;h4&gt;リモートの更新をマージしたい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git merge origin/master // 更新をマージ。この例ではoriginが指すリポジトリのmasterブランチをマージ。
&lt;/pre&gt;


&lt;h4&gt;二つのcommit間の差分を出力したい&lt;/h4&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqiita.com%2Fkasyuu%2Fitems%2Fbc8489831e200b641456&quot; title=&quot;gitでcommit間の差分を出力する - Qiita&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://qiita.com/kasyuu/items/bc8489831e200b641456&quot;&gt;qiita.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git diff &amp;lt;コミットハッシュ1&amp;gt; &amp;lt;コミットハッシュ2&amp;gt;
&lt;/pre&gt;


&lt;h4&gt;コミットのログを見たい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git log
git log -p // ENTERを連続で押す、またはQで抜ける
&lt;/pre&gt;


&lt;h4&gt;コミットのログをグラフィカルに見たい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git log --graph
&lt;/pre&gt;


&lt;h4&gt;ローカルの単一ファイルの変更を元に戻したい&lt;/h4&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git checkout some_filename
&lt;/pre&gt;


&lt;h3&gt;トラブルシュート&lt;/h3&gt;

&lt;h4&gt;コミットメッセージを間違えてしまった&lt;/h4&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.granfairs.com%2Fblog%2Fstaff%2Fgit-commit-fix&quot; title=&quot;Gitのコミットメッセージを後から変更する方法をわかりやすく書いてみた | 株式会社グランフェアズ&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.granfairs.com/blog/staff/git-commit-fix&quot;&gt;www.granfairs.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h4&gt;クローンしたらdevelopブランチがない&lt;/h4&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqiita.com%2Fshim0mura%2Fitems%2F85aa7fc762112189bd73&quot; title=&quot;リモートのブランチをcloneする - Qiita&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://qiita.com/shim0mura/items/85aa7fc762112189bd73&quot;&gt;qiita.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;で、git branchすればわかるんだけど、このままだとmasterブランチしかローカルにcloneできてない。別のブランチ(developmentとする)もローカルにcloneしたい。&lt;/p&gt;&lt;/blockquote&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git checkout -b development origin/development
&lt;/pre&gt;


&lt;h4&gt;git configの変更が反映されない&lt;/h4&gt;

&lt;p&gt;globalよりもlocalのエントリが優先されます。&lt;/p&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git config --global user.name John
git config --list | grep user.name
user.name=Thomas
&lt;/pre&gt;


&lt;p&gt;&lt;code&gt;--show-origin&lt;/code&gt;でエントリのoriginを確認します。&lt;/p&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git config --list --show-origin | grep user.name
file:C:/Users/xxx/.gitconfig        user.name=John
file:.git/config        user.name=Thomas    // localが優先される
&lt;/pre&gt;


&lt;p&gt;globalのエントリを反映させたいなら、localのエントリを削除します。&lt;/p&gt;

&lt;pre class=&quot;code lang-git&quot; data-lang=&quot;git&quot; data-unlink&gt;git config --unset user.name
git config --list | grep user.name
user.name=John
&lt;/pre&gt;


&lt;h3&gt;その他&lt;/h3&gt;

&lt;h4&gt;gitignoreのテンプレートがほしい&lt;/h4&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhnw.hatenablog.com%2Fentry%2F20121221&quot; title=&quot;.gitignoreを作ってくれるgiboが便利すぎる - hnwの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://hnw.hatenablog.com/entry/20121221&quot;&gt;hnw.hatenablog.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="Git" label="Git" />
        
        <category term="チートシート" label="チートシート" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/17680117127202481725/1580863038" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【PostgreSQL】経過日数を取得する</title>
        <link href="https://blog.jhashimoto.net/entry/2019/02/08/160101"/>
        <id>hatenablog://entry/98012380861485868</id>
        <published>2019-02-08T16:01:01+09:00</published>
        <updated>2019-02-08T16:01:01+09:00</updated>        <summary type="html">PostgreSQLはDATEDIFFをサポートしていないので、調べました。</summary>
        <content type="html">&lt;p&gt;PostgreSQLはDATEDIFFをサポートしていないので、調べました。&lt;/p&gt;

&lt;h2&gt;テストデータ作成&lt;/h2&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;CREATE TEMP TABLE test AS SELECT TIMESTAMP &amp;#39;2019-01-08 10:00:00&amp;#39; AS created_at;&lt;/pre&gt;


&lt;h2&gt;検証&lt;/h2&gt;

&lt;p&gt;TIMESTAMP型で引き算すると、INTERVAL型で結果を取得できます。&lt;/p&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;SELECT CURRENT_TIMESTAMP - created_at AS elapsed FROM test;&lt;/pre&gt;




&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;30 days 20:52:11.601642&lt;/pre&gt;


&lt;p&gt;INTERVAL型から日数を取り出すには、EXTRACTを使います。&lt;/p&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;SELECT EXTRACT(DAY FROM (CURRENT_TIMESTAMP - created_at)) AS elapsed FROM test&lt;/pre&gt;




&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;30&lt;/pre&gt;

</content>        
        <category term="PostgreSQL" label="PostgreSQL" />
        
        <category term="SQL" label="SQL" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/98012380861485868/1549610787" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>アーキテクチャ設計書の雛形がほしいときは？</title>
        <link href="https://blog.jhashimoto.net/entry/2019/01/28/110214"/>
        <id>hatenablog://entry/98012380843353299</id>
        <published>2019-01-28T11:02:14+09:00</published>
        <updated>2019-01-28T11:02:14+09:00</updated>        <summary type="html">architecture template filetype:docxで検索。</summary>
        <content type="html">&lt;p&gt;&lt;code&gt;architecture template filetype:docx&lt;/code&gt;で検索。&lt;/p&gt;
</content>        
        <category term="アーキテクチャ" label="アーキテクチャ" />
        
        <category term="ドキュメント" label="ドキュメント" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/98012380843353299/1548640934" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【AWS Tools for Powershell】Data Pipelineの名前からパイプラインIDを取得する</title>
        <link href="https://blog.jhashimoto.net/entry/2019/01/27/105646"/>
        <id>hatenablog://entry/98012380841278032</id>
        <published>2019-01-27T10:56:46+09:00</published>
        <updated>2019-01-27T10:56:46+09:00</updated>        <summary type="html">動機 パイプラインIDはパイプラインを再作成（削除して作成）すると変わるので、パイプライン名から動的に取得したい。</summary>
        <content type="html">&lt;h2&gt;動機&lt;/h2&gt;

&lt;p&gt;パイプラインIDはパイプラインを再作成（削除して作成）すると変わるので、パイプライン名から動的に取得したい。&lt;/p&gt;

&lt;h2&gt;コード&lt;/h2&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;&lt;span class=&quot;synType&quot;&gt;[String[]]&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$pipelineIds&lt;/span&gt; = &lt;span class=&quot;synStatement&quot;&gt;Get-DPPipeline&lt;/span&gt; -ProfileName &lt;span class=&quot;synIdentifier&quot;&gt;$profile&lt;/span&gt; | &lt;span class=&quot;synStatement&quot;&gt;Where-Object&lt;/span&gt; -&lt;span class=&quot;synStatement&quot;&gt;EQ&lt;/span&gt; name &lt;span class=&quot;synIdentifier&quot;&gt;$pipelineName&lt;/span&gt; | &lt;span class=&quot;synStatement&quot;&gt;Select-Object&lt;/span&gt; -ExpandProperty Id
&lt;/pre&gt;

</content>        
        <category term="AWS Tools for PowerShell" label="AWS Tools for PowerShell" />
        
        <category term="AWS Data Pipeline" label="AWS Data Pipeline" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/98012380841278032/1548554206" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
    <entry>
        <title>【AWS Tools for PowerShell】Write-S3Objectで`The bucket you are attempting to access must be addressed using the specified endpoint.`のエラー</title>
        <link href="https://blog.jhashimoto.net/entry/2019/01/27/104001"/>
        <id>hatenablog://entry/98012380841254439</id>
        <published>2019-01-27T10:40:01+09:00</published>
        <updated>2019-01-27T10:40:01+09:00</updated>        <summary type="html">現象 Write-S3ObjectでThe bucket you are attempting to access must be addressed using the specified endpoint.のエラーが発生する。 &gt; Write-S3Object -BucketName test_bucket -File test_file.txt -Key test_file.txt -ProfileName profile Write-S3Object : The bucket you are attempting to access must be addressed using th…</summary>
        <content type="html">&lt;h2&gt;現象&lt;/h2&gt;

&lt;p&gt;Write-S3Objectで&lt;code&gt;The bucket you are attempting to access must be addressed using the specified endpoint.&lt;/code&gt;のエラーが発生する。&lt;/p&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;&amp;gt; &lt;span class=&quot;synStatement&quot;&gt;Write-S3Object&lt;/span&gt; -BucketName test_bucket -File test_file.txt -Key test_file.txt -ProfileName profile
&lt;span class=&quot;synStatement&quot;&gt;Write-S3Object&lt;/span&gt; : The bucket you are attempting to access must be addressed &lt;span class=&quot;synStatement&quot;&gt;using&lt;/span&gt; the specified endpoint. Please send all future requests to this endpoint.
&lt;/pre&gt;


&lt;h2&gt;原因&lt;/h2&gt;

&lt;p&gt;リージョン指定がない。&lt;/p&gt;

&lt;h2&gt;対応&lt;/h2&gt;

&lt;p&gt;リージョンを指定する。&lt;/p&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;&lt;span class=&quot;synStatement&quot;&gt;Write-S3Object&lt;/span&gt; -BucketName test_bucket -File test_file.txt -Key test_file.txt -ProfileName profile -Region &lt;span class=&quot;synStatement&quot;&gt;ap-northeast&lt;/span&gt;-&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;セッション内でまとめて指定することもできる。&lt;/p&gt;

&lt;pre class=&quot;code lang-ps1&quot; data-lang=&quot;ps1&quot; data-unlink&gt;&lt;span class=&quot;synStatement&quot;&gt;Set-DefaultAWSRegion&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;ap-northeast&lt;/span&gt;-&lt;span class=&quot;synConstant&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;

</content>        
        <category term="AWS Tools for PowerShell" label="AWS Tools for PowerShell" />
        
        <category term="トラブルシューティング" label="トラブルシューティング" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/98012380841254439/1548553201" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>第二回ボトムアップドメイン駆動設計に参加しました</title>
        <link href="https://blog.jhashimoto.net/entry/2018/12/30/120109"/>
        <id>hatenablog://entry/10257846132691921564</id>
        <published>2018-12-30T12:01:09+09:00</published>
        <updated>2018-12-30T12:01:09+09:00</updated>        <summary type="html">第二回ボトムアップドメイン駆動設計に参加してきました。第一回は補欠で参加できず残念でした。第二回を開催していただいて感謝です。 ddd-community-jp.connpass.com</summary>
        <content type="html">&lt;p&gt;第二回ボトムアップドメイン駆動設計に参加してきました。第一回は補欠で参加できず残念でした。第二回を開催していただいて感謝です。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fddd-community-jp.connpass.com%2Fevent%2F107106%2F&quot; title=&quot;第二回ボトムアップドメイン駆動設計 (2018/12/04 19:30〜)&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://ddd-community-jp.connpass.com/event/107106/&quot;&gt;ddd-community-jp.connpass.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h2&gt;Q&amp;amp;A&lt;/h2&gt;

&lt;p&gt;ディレクトリ構成について質問させていただいたので、そのやりとりを共有しておきます。&lt;/p&gt;

&lt;h3&gt;jhashimoto&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;UsersとCirclesフォルダに、それぞれの関連するクラス（エンティティ、値オブジェクト、リポジトリインターフェース）を配置していますが、この構成の場合、複数のエンティティで共通する値オブジェクトはどこに配置するのでしょうか？&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;成瀬さん&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;複数のエンティティで値オブジェクトを共通で使いたいケースってありますか？&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;jhashimoto&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;例えば、会社エンティティと社員エンティティが住所を持つ場合、それは概念として同一なので、１つの住所クラスとして実装したいです。&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;成瀬さん&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;その場合は、Commonフォルダに配置すればいいのではないでしょうか？&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;感想&lt;/h2&gt;

&lt;p&gt;自分は、値オブジェクトを共通化したいがために、以下のようにディレクトリを構成していました。&lt;/p&gt;

&lt;pre class=&quot;code&quot; data-lang=&quot;&quot; data-unlink&gt;Entities
├ Company
└ Employee
ValueObjects
├ Address ←共通で使用する
Repositories&lt;/pre&gt;


&lt;p&gt;開発当初は問題なかったものの、クラスの数が増えるにつれ、見通しが悪くなっていきました。主な要因は以下の２つです。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;業務の関心事でグルーピングできていない&lt;/li&gt;
&lt;li&gt;値オブジェクトがどのエンティティで使われるのかわからない&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;とはいえ、業務の概念でフォルダを切れば、共通の値オブジェクトを置く場所がなくなります。書籍を読んでもディレクトリ構成に言及しているものはなく、1人で３年ほど悩んでいました。&lt;/p&gt;

&lt;p&gt;Commonフォルダを導入することで、共通化と業務の概念の表現を両立することができます。これだけでも参加してよかったです。&lt;/p&gt;

&lt;p&gt;また、全体的な感想としては、終始初心者の気持ちに寄り添ってくれる安心感がありました。DDD入門の一歩目としてお勧めします。ぜひ第三回をご検討いただければと思います。ありがとうございました。&lt;/p&gt;
</content>        
        <category term="DDD" label="DDD" />
        
        <category term="勉強会" label="勉強会" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132691921564/1546487393" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【AWS】re:Invent2018まとめ</title>
        <link href="https://blog.jhashimoto.net/entry/2018/12/28/163618"/>
        <id>hatenablog://entry/10257846132691443623</id>
        <published>2018-12-28T16:36:18+09:00</published>
        <updated>2018-12-28T16:36:18+09:00</updated>        <summary type="html">re:Inventで発表されたサービスのうち、業務で使いそうなものをピックアップしました。</summary>
        <content type="html">&lt;p&gt;re:Inventで発表されたサービスのうち、業務で使いそうなものをピックアップしました。&lt;/p&gt;

&lt;h2&gt;新サービス&lt;/h2&gt;

&lt;h3&gt;AWS Transfer for SFTP&lt;/h3&gt;

&lt;p&gt;SFTPを使用してAmazon S3の内外にファイルを直接転送できるマネージドサービスです。&lt;/p&gt;

&lt;p&gt;FTPでS3にアクセスする要件に対応できるようになります。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/reinvent2018-release-aws-transfer-for-sftp/&quot;&gt;“AWS Transfer for SFTP”発表！S3がSFTPで連携可能に！！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;AWS Transit Gateway&lt;/h3&gt;

&lt;p&gt;これまではオンプレミスとVPCを繋ぐには、VPN接続が必要で構成が複雑でした。AWS Transit Gatewayを使うと、オンプレミスとVPCを簡単に接続できます。&lt;/p&gt;

&lt;p&gt;社内の環境もいずれこのサービスで置き換えます。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/reinvent-2018-report-transit-gateway/&quot;&gt;[新機能]激アツ！AWS Transit Gatewayが発表されました！VPC間、オンプレミスとVPC間をもっと簡単に接続！！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;AWS DataSync&lt;/h3&gt;

&lt;p&gt;オンプレミスとS3 や Amazon EFS間でデータを転送できるサービスです。&lt;/p&gt;

&lt;p&gt;Storage Gatewayとの使い分けを要調査。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/new-release-aws-datasync/&quot;&gt;新サービス] AWS DataSyncが発表されました！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Amazon Quantum Ledger Database&lt;/h3&gt;

&lt;p&gt;追記のみで変更・削除不可のデータベースです。&lt;/p&gt;

&lt;p&gt;変更を不可にする（イミュータブルにする）世の中の流れに則ったものです。これにより、状態が変更されなくなるので、トラッキングする必要性がなくなります。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/reinvent2018-amazon-quantum-ledger-database/&quot;&gt;[新サービス] フルマネージドの台帳データベースである、Amazon Quantum Ledger Database (QLDB) が発表されました！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Amazon Personalize&lt;/h3&gt;

&lt;p&gt;Amazonのおすすめ商品で使われているリコメンデーションエンジンをサービスとして利用できます。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/reinvent2018-report-aim365/&quot;&gt;[レポート]AIM365: Amazon Personalizeの紹介：リアルタイムなパーソナライゼーションとレコメンデーションを提供 #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;AWS Outposts&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;AWS Outpostsは、AWSが設計した、AWSのクラウドインフラで使われているものと同じハードウェアとソフトウェアをラックマウントのシステムとしてまとめたものをオンプレミスに持ち込むことで、オンプレミスでもAWSと一貫性のあるクラウドインフラが利用可能になるというもの。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://www.publickey1.jp/blog/18/awsaws_outposts_awsaws_reinvent_2018.html&quot;&gt;［速報］オンプレミス用AWS「AWS Outposts」発表！ AWSが設計したサーバラックをオンプレミスへ持ち込み。AWS re:Invent 2018 － Publickey&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;AWS Resource Access Manager&lt;/h3&gt;

&lt;p&gt;AWSアカウントを跨いでリソースを共有できるサービスです。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/reinvent-2018-ram/&quot;&gt;[新サービス]でた！AWS Resource Access Manager(RAM)でクロスアカウントのリソース共有が可能に #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;アップデート&lt;/h2&gt;

&lt;h3&gt;EC2&lt;/h3&gt;

&lt;h4&gt;EC2が休止可能に&lt;/h4&gt;

&lt;p&gt;休止中はメモリの状態が保持されます。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://aws.amazon.com/jp/about-aws/whats-new/2018/11/amazon-ec2-now-lets-you-pause-and-resume-your-workloads/&quot;&gt;Amazon EC2 でワークロードの一時停止と再開が可能に&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://aws.amazon.com/jp/blogs/news/new-hibernate-your-ec2-instances/&quot;&gt;新機能 – EC2インスタンスの休止 | Amazon Web Services ブログ&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;Predictive Scaling&lt;/h4&gt;

&lt;p&gt;機械学習によりEC2利用状況を推測して、自動的にスケーリングする機能です。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://aws.amazon.com/jp/blogs/news/new-predictive-scaling-for-ec2-powered-by-machine-learning/&quot;&gt;新機能 – Machine Learning を中核とする EC2 の予測スケーリング | Amazon Web Services ブログ&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Redshift&lt;/h3&gt;

&lt;h4&gt;Amazon Redshift concurrency scaling&lt;/h4&gt;

&lt;p&gt;Redshiftは複雑なクエリに対してすばやくレスポンスを返すのに適しており、大量のクエリを同時に捌くのは苦手です。このアップデートはその欠点を解消するものです。&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;concurrency scalingは、クエリがキューに待機することをきっかけにして、この機能を使ってクラスタを追加起動させ、一時的に大量のリクエストをさばき、負荷が減ったタイミングで自動的にクラスタを削除するという動きをするようです。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/new-feature-amazon-redshift-concurrency-scaling/&quot;&gt;[速報]待望の新機能”Amazon Redshift concurrency scaling”が発表されました！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;S3&lt;/h3&gt;

&lt;h4&gt;S3 Batch Operations&lt;/h4&gt;

&lt;p&gt;複数オブジェクトに一括で操作を適用する機能です。&lt;/p&gt;

&lt;p&gt;100個のオブジェクトに手動でタグを付けた経験のある自分としては、うれしいアップデートです。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/s3-batch-operations/&quot;&gt;S3が数十億におよぶ大量オブジェクトへのバッチ処理機能を発表！（プレビュー） #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;S3 Intelligent-Tiering&lt;/h4&gt;

&lt;p&gt;アクセス頻度の低いオブジェクトを自動的にアーカイブし、コストを最適化します。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/s3-new-storage-class-intelligent-tiering/&quot;&gt;【アップデート】S3に新しいストレージクラス”Intelligent-Tiering”が登場しました #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;AWS Lambda&lt;/h3&gt;

&lt;h4&gt;Rubyをサポート&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://www.publickey1.jp/blog/18/aws_lambdarubyaws_reinvent_2018.html&quot;&gt;［速報］AWS LambdaがRubyに対応。さらにカスタムランタイムであらゆるプログラミング言語にも対応へ。AWS re:Invent 2018 － Publickey&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;LambaがVS Codeで開発可能に&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/lambda-vscode-extension/&quot;&gt;[速報] Lambda開発向けのVS Code拡張機能が公式提供されました! #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;カスタムランタイム&lt;/h4&gt;

&lt;p&gt;独自のRuntimeを搭載することが可能になりました。これによりLinuxのあらゆる言語をサポートします。&lt;/p&gt;

&lt;h5&gt;AWSがサポートするランタイム&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;C++&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;/ul&gt;


&lt;h5&gt;パートナー企業がサポートするランタイム&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Elixir&lt;/li&gt;
&lt;li&gt;Erlang&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;li&gt;N|Solid&lt;/li&gt;
&lt;li&gt;COBOL&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;Lambda Layer&lt;/h4&gt;

&lt;p&gt;複数のLambda関数から参照されるコンポ―ネントを共有できるようになりました。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/reinvent2018-keynote-2-lambdalayer/&quot;&gt;【速報】【アップデート】Lambdaが複数のファンクションで共有するコードを持てるようになりました(Lambda Layer) #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;CloudWatch Logs Insights&lt;/h3&gt;

&lt;p&gt;AWSサービスやカスタムアプリケーションのログ可視化、分析ができるサービスです。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://aws.amazon.com/jp/blogs/news/new-amazon-cloudwatch-logs-insights-fast-interactive-log-analytics/&quot;&gt;新機能 – Amazon CloudWatch Logs Insights – 高速でインタラクティブなログ分析 | Amazon Web Services ブログ&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Elastic Load Balancing&lt;/h3&gt;

&lt;h4&gt;ALBのバックエンドにLambdaを選択可能に&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/reinvent-2018-lambda-alb/&quot;&gt;[速報]ALB HTTP(S)のバックエンドにLambdaを選択できるようになりました！#reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;API Gateway&lt;/h3&gt;

&lt;h4&gt;WebSocket対応&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://aws.amazon.com/jp/blogs/news/announcing-websocket-apis-in-amazon-api-gateway/&quot;&gt;[発表]Amazon API GatewayでWebsocketが利用可能 | Amazon Web Services ブログ&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Aurora&lt;/h3&gt;

&lt;h4&gt;Preview of Amazon Aurora PostgreSQL Serverless&lt;/h4&gt;

&lt;blockquote&gt;&lt;p&gt;Amazon Aurora サーバーレスは、アプリケーションのニーズに合わせて自動的に起動、シャットダウン、スケールアップまたはスケールダウンされるオンデマンドの自動スケーリング構成です。&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/preview-for-amazon-aurora-postgresql-announced/&quot;&gt;Amazon Aurora PostgreSQL サーバーレスのプレビュー開始がアナウンスされました #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;DymamoDB&lt;/h3&gt;

&lt;h4&gt;Amazon DynamoDB On-Demand&lt;/h4&gt;

&lt;p&gt;自動スケーリングしてくれるので、事前のキャパシティプランニングが不要になります。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/amazon-dynamodb-on-demand-reinvent/&quot;&gt;Amazon DynamoDB On-Demandをためしてみた！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;DynamoDBトランザクションサポート&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.classmethod.jp/cloud/aws/new-release-dynamodb-transactions/&quot;&gt;[速報]待望のDynamoDBのトランザクションがリリースされました！ #reinvent ｜ DevelopersIO&lt;/a&gt;&lt;/p&gt;
</content>        
        <category term="AWS" label="AWS" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132691443623/1545982578" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>「初めてのAWS」のスライドを共有します</title>
        <link href="https://blog.jhashimoto.net/entry/2018/12/10/154454"/>
        <id>hatenablog://entry/10257846132682968066</id>
        <published>2018-12-10T15:44:54+09:00</published>
        <updated>2018-12-10T15:44:54+09:00</updated>        <summary type="html">社内勉強会で使ったスライドを共有します。AWSを初めて触る人向けです。 AWSサポートをうまく活用する方法 サポートを活用する前に リフト &amp; シフト 無料相談会 AWS Loft Tokyo</summary>
        <content type="html">&lt;p&gt;社内勉強会で使ったスライドを共有します。AWSを初めて触る人向けです。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWSサポートをうまく活用する方法&lt;/li&gt;
&lt;li&gt;サポートを活用する前に

&lt;ol&gt;
&lt;li&gt;リフト &amp;amp; シフト&lt;/li&gt;
&lt;li&gt;無料相談会&lt;/li&gt;
&lt;li&gt;AWS Loft Tokyo&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&quot;blogCard&quot;&gt;&lt;div class=&quot;blogCardCont&quot;&gt;&lt;div class=&quot;blogCardTxt&quot;&gt;&lt;p class=&quot;blogCardTitle&quot;&gt;&lt;a href=&quot;https://speakerdeck.com/jhashimoto/the-first-aws&quot; target=&quot;_blank&quot;&gt;初めてのAWS / The first AWS - Speaker Deck&lt;/a&gt;&lt;/p&gt;&lt;p&gt;undefined&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;blogCardImg&quot;&gt;&lt;div class=&quot;blogCardImg__wrap&quot;&gt;&lt;a href=&quot;https://speakerdeck.com/jhashimoto/the-first-aws&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/6b99803c8ba74e69865dc5d8321c640b/slide_0.jpg?480801&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;blogCardFooter&quot;&gt;&lt;a href=&quot;https://speakerdeck.com/jhashimoto/the-first-aws&quot;&gt;&lt;img src=&quot;http://www.google.com/s2/favicons?domain=https://speakerdeck.com/jhashimoto/the-first-aws&quot; alt=&quot;&quot;&gt;speakerdeck.com&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;

</content>        
        <category term="スライド" label="スライド" />
        
        <category term="AWS" label="AWS" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132682968066/1544424294" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>【.NET】SqlConnectionのインスタンス生成で例外がスローされる</title>
        <link href="https://blog.jhashimoto.net/entry/2018/11/09/182736"/>
        <id>hatenablog://entry/10257846132666831228</id>
        <published>2018-11-09T18:27:36+09:00</published>
        <updated>2018-11-09T18:27:36+09:00</updated>        <summary type="html">KB4462919の不具合のようです。</summary>
        <content type="html">&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-us/help/4462919/windows-10-update-kb4462919&quot;&gt;KB4462919&lt;/a&gt;の不具合のようです。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-us/help/4470809/sqlconnection-install-throws-error-dot-net-4-6-after-recent-net-update&quot;&gt;SqlConnection install throws error on .NET 4.6 after recent .NET Framework updates&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Use of a SqlConnection constructor can lead to a stack trace that resembles the following:&lt;/p&gt;

&lt;p&gt; System.Runtime.Serialization.SerializationException
   at System.AppDomain.get_Evidence()
   at System.AppDomain.get_Evidence()
   at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String&amp;amp; typeName)
   at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
   at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
   at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
   at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object&amp;amp; result, Object&amp;amp; resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.Data.SqlClient.SqlConnection..cctor()&lt;/p&gt;&lt;/blockquote&gt;
</content>        
        <category term=".NET" label=".NET" />
        
        <category term="トラブルシュート" label="トラブルシュート" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132666831228/1541755656" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
    <entry>
        <title>【Windows 10】拡張子と既定のアプリケーションの関連付けを変更できない</title>
        <link href="https://blog.jhashimoto.net/entry/2018/11/09/181105"/>
        <id>hatenablog://entry/10257846132666820018</id>
        <published>2018-11-09T18:11:05+09:00</published>
        <updated>2018-11-09T18:11:05+09:00</updated>        <summary type="html">Windows 10で、拡張子と既定のアプリケーションの関連付けを変更できない現象を確認しました。 .txtで検証したところ、Windowsプリインストールのエディタ（メモ帳、ワードパッド）には関連付けを変更できますが、サードパーティーのエディタ（Visual Studio Code、Sublime Textなど）には変更できませんでした（変更しても反映されない） 調べたところ、KB4462919の不具合のようです。</summary>
        <content type="html">&lt;p&gt;Windows 10で、拡張子と既定のアプリケーションの関連付けを変更できない現象を確認しました。&lt;/p&gt;

&lt;p&gt;.txtで検証したところ、Windowsプリインストールのエディタ（メモ帳、ワードパッド）には関連付けを変更できますが、サードパーティーのエディタ（Visual Studio Code、Sublime Textなど）には変更できませんでした（変更しても反映されない）&lt;/p&gt;

&lt;p&gt;調べたところ、KB4462919の不具合のようです。&lt;/p&gt;

&lt;h2&gt;Issue&lt;/h2&gt;

&lt;p&gt;issueが上がっていました。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://support.microsoft.com/en-us/help/4462919/windows-10-update-kb4462919&quot;&gt;October 9, 2018—KB4462919 (OS Build 17134.345)&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;h3&gt;Symptom&lt;/h3&gt;

&lt;p&gt;After installing this update, some users cannot set Win32 program defaults for certain app and file type combinations using the Open with… command or Settings &gt; Apps &gt; Default apps.&lt;/p&gt;

&lt;p&gt;In some cases, Microsoft Notepad or other Win32 programs cannot be set as the default.&lt;/p&gt;

&lt;h3&gt;Workaround&lt;/h3&gt;

&lt;p&gt;In some cases, Microsoft Notepad or other Win32 programs cannot be set as the default.  &lt;br/&gt;
In some cases, attempting to set application defaults again will succeed.&lt;/p&gt;

&lt;p&gt;Microsoft is working on a resolution and estimates a solution will be available in late November 2018.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;Google翻訳&lt;/h2&gt;

&lt;h3&gt;症状&lt;/h3&gt;

&lt;p&gt;このアップデートをインストールすると、Open with ...コマンドまたは設定 &gt; アプリケーション &gt; 既定のアプリケーションを使用して、特定のアプリケーションとファイルの種類の組み合わせに対してWin32プログラムの既定値を設定できないユーザーがいます。&lt;/p&gt;

&lt;h3&gt;回避策&lt;/h3&gt;

&lt;p&gt;場合によっては、Microsoft Notepadまたは他のWin32プログラムをデフォルトとして設定することはできません。&lt;br/&gt;
場合によっては、アプリケーションのデフォルトを再度設定しようとすると成功します。&lt;/p&gt;

&lt;p&gt;マイクロソフトは解決策に取り組んでおり、2018年11月下旬にソリューションが提供される見込みです。&lt;/p&gt;

&lt;h2&gt;2018/12/13追記&lt;/h2&gt;

&lt;p&gt;本件Fixされたことを確認しました。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fforest.watch.impress.co.jp%2Fdocs%2Fnews%2F1156927.html&quot; title=&quot;「October 2018 Update」に新しいパッチ、ファイルの関連付けとネットワークドライブの問題を修正／「Windows Media Player」のシークバー問題は12月中旬に修正される予定&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://forest.watch.impress.co.jp/docs/news/1156927.html&quot;&gt;forest.watch.impress.co.jp&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
</content>        
        <category term="Windows" label="Windows" />
        
        <category term="トラブルシュート" label="トラブルシュート" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132666820018/1544672199" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
    <entry>
        <title>Alexa Salon Lab ＠東京〜AWS × Alexa実践講座〜に参加しました</title>
        <link href="https://blog.jhashimoto.net/entry/2018/11/09/161438"/>
        <id>hatenablog://entry/10257846132666756299</id>
        <published>2018-11-09T16:14:38+09:00</published>
        <updated>2018-11-09T16:14:38+09:00</updated>        <summary type="html">Alexa Salon Lab ＠東京〜AWS × Alexa実践講座〜に参加したので、メモを共有します。 classmethod.connpass.com</summary>
        <content type="html">&lt;p&gt;Alexa Salon Lab ＠東京〜AWS × Alexa実践講座〜に参加したので、メモを共有します。&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fclassmethod.connpass.com%2Fevent%2F100090%2F&quot; title=&quot;【9/28（金） 東京】Alexa Salon Lab ＠東京〜AWS × Alexa実践講座〜 (2018/09/28 19:00〜)&quot; class=&quot;embed-card embed-webcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 155px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://classmethod.connpass.com/event/100090/&quot;&gt;classmethod.connpass.com&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h2&gt;Nodeの基礎&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SDK-V2ではNode.js8.10を使う&lt;/li&gt;
&lt;li&gt;Node.8.10の特徴

&lt;ul&gt;
&lt;li&gt;Async/Awaitが使えるようになった&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Async/Await

&lt;ul&gt;
&lt;li&gt;コールバックの新しい書き方&lt;/li&gt;
&lt;li&gt;Promiseとかで書いてたやつ&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;try-catchで囲んでcatchにエラー処理を書く&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;一限:Dynamodbを使ったスキル構築&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;NoSQL形式のデータベース&lt;/li&gt;
&lt;li&gt;サーバースペックや容量は気にしなくてもよい&lt;/li&gt;
&lt;li&gt;永続化サービスとしてAlexa-SDKにデフォルトで操作APIがついている&lt;/li&gt;
&lt;li&gt;初心者が引っかかるのは「キー」と「ユニット」&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;検索&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;キー/インデックスのついているItemが検索できる&lt;/li&gt;
&lt;li&gt;プライマリーキー

&lt;ul&gt;
&lt;li&gt;HashKey&lt;/li&gt;
&lt;li&gt;HashKey+RangeKey&lt;/li&gt;
&lt;li&gt;HashKey（連続しないもの）&lt;/li&gt;
&lt;li&gt;RangeKey（連続するもの）&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HashKey：ID

&lt;ul&gt;
&lt;li&gt;ID=5&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HashKey：ID&lt;/li&gt;
&lt;li&gt;TimeStamp=今日から　5日以内&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;セカンダリーインデックス&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Local Secondaly Index&lt;/li&gt;
&lt;li&gt;Global Secondaly Index&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;ユニット&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;キャパシティーユニット

&lt;ul&gt;
&lt;li&gt;RCU

&lt;ul&gt;
&lt;li&gt;1秒間に2回読み込める&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;WCU

&lt;ul&gt;
&lt;li&gt;1秒間で書き込めるユニット

&lt;ul&gt;
&lt;li&gt;5：1秒間に5回書き込める&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;DynamoDBの読み込み&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;GetItem&lt;/li&gt;
&lt;li&gt;BatchGetItem

&lt;ul&gt;
&lt;li&gt;Batchで使うもの&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Query&lt;/li&gt;
&lt;li&gt;Scan&lt;/li&gt;
&lt;li&gt;Query/ScanとBatchGetItemでRCUの計算の仕方が違う

&lt;ul&gt;
&lt;li&gt;後者は1レコードずつ計算&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;読み込み容量&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;属性名＋属性値&lt;/li&gt;
&lt;li&gt;属性名はできるだけ短くつけましょう&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;シミュレーター&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Alexa Developer ConsoleからAlexaスキルのテストができる（しゃべる）

&lt;ul&gt;
&lt;li&gt;Alexaシミュレーター&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;Alexaのセッション情報&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;AttributeManager

&lt;ul&gt;
&lt;li&gt;RequestAttributes&lt;/li&gt;
&lt;li&gt;SessionAttributes&lt;/li&gt;
&lt;li&gt;PersistentAttributes

&lt;ul&gt;
&lt;li&gt;DynmamoDBに残す&lt;/li&gt;
&lt;li&gt;セッションが終わっても残る&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;注意点

&lt;ul&gt;
&lt;li&gt;alexa-sdk-coreには入っていない&lt;/li&gt;
&lt;li&gt;カステムSkillBuilderには入っていない

&lt;ul&gt;
&lt;li&gt;DynamoDBPersistenceAdapterを入れる&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Standardの場合、テーブル作成はど頭に書く&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;API Gateway&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AWSのAPIサービス&lt;/li&gt;
&lt;li&gt;手軽にAPIエンドポイントを作成できる&lt;/li&gt;
&lt;li&gt;裏側にはLambdaやSNSなどのAWSサービスを配置したりプロキシとして設定したりできる&lt;/li&gt;
&lt;li&gt;Account Linkのプロキシとして配置することでOAuth2接続の内容をロギングすることができる&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;OAuth&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;認可のプロトコル&lt;/li&gt;
&lt;li&gt;Implicit Grant

&lt;ul&gt;
&lt;li&gt;Webブラウザ&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Authenticated code grant

&lt;ul&gt;
&lt;li&gt;サーバー同士

&lt;ul&gt;
&lt;li&gt;複雑&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;How to Set up Amazon API Gateway as a Proxy to Debug Account Linking&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;三限:CloudWatch Logsを使ったログ自動抽出&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;LambdaのAlias

&lt;ul&gt;
&lt;li&gt;Version&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;AWSのログサービス&lt;/li&gt;
&lt;li&gt;最大10年までのログ保管が可能&lt;/li&gt;
&lt;li&gt;サブスクリプションフィルタ

&lt;ul&gt;
&lt;li&gt;ERRORが含まれる行のみ抽出&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ポイント

&lt;ul&gt;
&lt;li&gt;Base64エンコードされている&lt;/li&gt;
&lt;li&gt;Zipで固められている&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

</content>        
        <category term="Alexa" label="Alexa" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132666756299/1541747678" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
    
    
    <entry>
        <title>エンタープライズアジャイル勉強会 2018年10月セミナーに参加しました</title>
        <link href="https://blog.jhashimoto.net/entry/2018/11/07/142330"/>
        <id>hatenablog://entry/10257846132665476268</id>
        <published>2018-11-07T14:23:30+09:00</published>
        <updated>2018-11-07T14:23:30+09:00</updated>        <summary type="html">エンタープライズアジャイル勉強会 2018年10月セミナーに参加したので、メモを共有します。 エンタープライズアジャイル勉強会</summary>
        <content type="html">&lt;p&gt;エンタープライズアジャイル勉強会 2018年10月セミナーに参加したので、メモを共有します。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://easg.smartcore.jp/C22/notice_details/QjI5UllnPT0=&quot;&gt;&amp;#x30A8;&amp;#x30F3;&amp;#x30BF;&amp;#x30FC;&amp;#x30D7;&amp;#x30E9;&amp;#x30A4;&amp;#x30BA;&amp;#x30A2;&amp;#x30B8;&amp;#x30E3;&amp;#x30A4;&amp;#x30EB;&amp;#x52C9;&amp;#x5F37;&amp;#x4F1A;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe src=&quot;https://www.slideshare.net/slideshow/embed_code/key/ElAefU4lvhCz8P&quot; width=&quot;427&quot; height=&quot;356&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;&quot; allowfullscreen&gt; &lt;/iframe&gt; &lt;div style=&quot;margin-bottom:5px&quot;&gt; &lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/yusuke/201810-119738489&quot; title=&quot;エンタープライズアジャイルでチームが超えるべきこと - エンタープライズアジャイル勉強会 2018年10月セミナー&quot; target=&quot;_blank&quot;&gt;エンタープライズアジャイルでチームが超えるべきこと - エンタープライズアジャイル勉強会 2018年10月セミナー&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;https://www.slideshare.net/yusuke&quot; target=&quot;_blank&quot;&gt;Yusuke SUZUKI&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;&lt;cite class=&quot;hatena-citation&quot;&gt;&lt;a href=&quot;https://www.slideshare.net/yusuke/201810-119738489&quot;&gt;www.slideshare.net&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;

&lt;h2&gt;エンタープライズアジャイルでチームが超えるべきこと&lt;/h2&gt;

&lt;p&gt;グロースエクスパートナーズ株式会社鈴木雄介様のセッションでした。&lt;/p&gt;

&lt;h3&gt;スコープを管理する&lt;/h3&gt;

&lt;h4&gt;ウォーターフォール&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;S-QCD&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;アジャイル&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;QCD→S

&lt;ul&gt;
&lt;li&gt;アジャイルではチームとリズムが先にある

&lt;ul&gt;
&lt;li&gt;チームサイズとリリースサイクルが決まればコストとスケジュールは確定してしまう&lt;/li&gt;
&lt;li&gt;その中で実施できるスコープを決定する&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;チームの固定：効率的だから

&lt;ul&gt;
&lt;li&gt;繰り返すことが前提のため調達コストが省かれる

&lt;ul&gt;
&lt;li&gt;人の学習能力と依存 &gt; 適切な要因の調達&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;日付の固定：リズムが安定するから

&lt;ul&gt;
&lt;li&gt;次のリリース日があることでスコープ調整がしやすい

&lt;ul&gt;
&lt;li&gt;イテレーション後には次のリリースが来る&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ゆるやかに変更することは許容される&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;従来型

&lt;ul&gt;
&lt;li&gt;常に全体&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;アジャイル

&lt;ul&gt;
&lt;li&gt;概要と部分&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;スコープを管理する&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;いかにして部分のスコープを確定するか？

&lt;ul&gt;
&lt;li&gt;機能そのものよりも使われ方

&lt;ul&gt;
&lt;li&gt;使い方を基準にして部分が成立することを保証する&lt;/li&gt;
&lt;li&gt;部分で価値があること

&lt;ul&gt;
&lt;li&gt;例：マスタ登録できるだけでは意味がない。ユーザーは商品を閲覧したい&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;リーンキャンバス

&lt;ul&gt;
&lt;li&gt;誰にとって価値があるサービスなのか&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;インセプションデッキ&lt;/li&gt;
&lt;li&gt;エレベーターピッチ&lt;/li&gt;
&lt;li&gt;カスタマージャーニー&lt;/li&gt;
&lt;li&gt;サービスブループリント

&lt;ul&gt;
&lt;li&gt;いわゆる業務フロー&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ユーザーストーリー

&lt;ul&gt;
&lt;li&gt;＜ロール＞が＜機能＞を行う。なぜなら＜ビジネス価値＞をしたいから&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;プロジェクトを立ち上げる稟議書との戦い&lt;/li&gt;
&lt;li&gt;MVP（実用最小限の製品）

&lt;ul&gt;
&lt;li&gt;どうやって部分を積み重ねるかが肝&lt;/li&gt;
&lt;li&gt;全部、大事なんです。

&lt;ul&gt;
&lt;li&gt;優先順位が決められず要件が決まった機能から作ってしまう&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ウォーターフォールはPMに依存する。アジャイルはその部分をプロセスに移譲&lt;/li&gt;
&lt;/ul&gt;

</content>        
        <category term="アジャイル" label="アジャイル" />
        
        <category term="勉強会" label="勉強会" />
        
        <link rel="enclosure" href="https://ogimage.blog.st-hatena.com/12921228815716984990/10257846132665476268/1541568210" type="image/png" length="0" />

        <author>
            <name>JHashimoto</name>
        </author>
    </entry>
    
  
</feed>
