OCI Terraform エラー「dial tcp 140.204.8.221:443: i/o timeout」

エラー出現!

今日出社してTerafform実行するといきなりエラーが出て失敗してしまいました。。。。
今日が月曜で一昨日の土曜日には使えていたので、その間になにか設定を変更したのが原因と思います。。
とはいえterraformコンフィグはバックアップも取得しており、バックアップデータで実行してもダメでした。。。
とりあえずググりました。

原因&解決

原因

こちらのGithubに答えがありました。
原因の答え↓

I also got this same error. In my case, it had to do with the security group. Essentially, I was working out of a coffee shop and forgot to add my CIDR block to the Security Groups. Therefore, terraform was not able to reach the machine via ssh due to Security Group restrictions.

I modified my CIDR block list variable to include the IP of my current location and had no issues.

解決方法

土曜日にセキュリティグループの変更していたのが原因だったようです。
なので、Terraformを動かしているOCIインスタンスが所属しているSGに
エグレスで0.0.0.0/0宛のポート443を開放でうまく実行できました。
f:id:kyamisama:20200601114859p:plain