-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter 3 : サーバーを構築する #2
Conversation
a-know
commented
Jan 22, 2017
•
edited
Loading
edited
- セキュリティグループの生成
AWS の EC2 インスタンス生成ウィザードではセキュリティグループも一緒に新規作成できるが、 以上を参考に↓のように生成完了。 |
"MyPublicSecurityGroup": { | ||
"Type" : "AWS::EC2::SecurityGroup", | ||
"Properties" : { | ||
"GroupDescription" : "SecurityGroup for web-server instance in public-subnet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この value には ASCII 文字しか使えなかった
{ | ||
"IpProtocol" : "tcp", | ||
"FromPort" : "22", | ||
"ToPort" : "22", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS コンソールで言うところの「タイプ」は、プロトコルやポート番号で自動判定するっぽい
"Type" : "AWS::EC2::SecurityGroup", | ||
"Properties" : { | ||
"GroupDescription" : "SecurityGroup for web-server instance in public-subnet", | ||
"SecurityGroupIngress" : [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Egress(アウトバウンド)の方は指定しなければデフォルト(「すべてのトラフィック」をどこへでも( 0.0.0.0/0
)送信可)になる。
"Properties" : { | ||
"ImageId" : "ami-4985b048", | ||
"InstanceType" : "t2.nano", | ||
"KeyName" : "macbook12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キーペアは予め作成済みのものを使用。
CloudFormation でキーペアの作成もできるのかな?
"NetworkInterfaces": [ | ||
{ | ||
"AssociatePublicIpAddress": "true", | ||
"DeviceIndex": "0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tags" : [ | ||
{ "Key" : "Name", "Value" : "Webサーバー" } | ||
], | ||
"NetworkInterfaces": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このプロパティはEC2 NetworkInterface 埋め込みプロパティタイプのドキュメントも参照する。
"GroupSet": [ { "Ref" : "MyPublicSecurityGroup" } ] | ||
} | ||
], | ||
"BlockDeviceMappings" : [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
"DeviceName" : "/dev/sda1", | ||
"Ebs" : { | ||
"VolumeType" : "standard", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
選択可能なタイプはAmazon EBS Volume Types参照。
standard
は全世代のものだが、一応選択可能。
} | ||
}, | ||
"MyPublicEC2Instance": { | ||
"Type" : "AWS::EC2::Instance", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS::EC2::Instance の包括的なドキュメントはAWS::EC2::Instance のリファレンス。
2fe4f22 で、本の中で指定しているものと同等のスペック(インスタンスタイプだけ t2.nano にした)・設定のインスタンスを立てられた。 stopped 状態で生成されて、今回のような学習目的にはマッチするけど、running 状態で構築することもできるのだろうか?(わからない) |