TRY AND ERROR

気になったこと、勉強したこと、その他雑記など色々メモしていきます。。Sometimes these posts will be written in English.,

Entries from 2018-01-01 to 1 month

My convenient snippet for showing information of EC2 instance.

AWS

If you want to make sure ec2 instance information from inner itself, you should check this post. (Describes about in the case of EC2-AmazonLinux which has already installed `aws` command.)For instance this is an alias named `me` that outpu…

ELBのヘルスチェック(200)を受け入れつつBasic認証をかける

ELB (ALB) + EC2*2(apache)にvirtual hostでマッピングしたサービスにBasic認証をかけたい。 ただしELBはstatus=200のチェックのままで、この辺はいじりたくないなぁって時の話です。上記のようなAWS上の設定やアプリの設定を極力変えずにBasic認証をかける…

【AWS CodeDeploy】Resource permissions by appspec.yml

AWS

I had misunderstanding for "permissions" in appspec.yml of AWS CodeDeploy. Say around that we have an app which directory structure is like below. CodeDeployのappspec.ymlで使うpermissionセクションについて誤解してた。。 例えば以下のような構…

AWS CodeDeploy logs that you should watch.

AWS

We have a web service with AWS, located in like below environment. (This time in case of using AmazonLinux) WebServer: - Production: - ALB * 1 - EC2 * 2 - Dev: - EC2 * 1 DB: - Production: Aurora * 1 - Dev: Aurora * 1 Our source code is m…

【Golang】sliceのcapacityとは?

Go

sliceは可変長の配列を扱うデータ型で、ベースとなる配列のポインタと要素数、および容量(capacity)を持っている。sliceリテラルやmakeはベースとなる配列を作成した上でそのsliceを返している。 sliceは参照型なので、sliceの要素を変更すればベースとなる…

Goでjsonのunmarshal結果を構造体に入れる時のフィールド名について

Go

Goでjsonを扱う場合、json文字列をbyte配列にしたものをencoding/jsonパッケージのunmarshalに渡し、あらかじめ定義しておいた構造体に入れるといったのが定番ですが、その際に構造体のフィールド名を先頭を大文字にしていないとマッピングできないというこ…