Skip to content
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

Translated workshop Prerequisites section in Japanese #175

Merged
merged 4 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions content/prerequisites/account/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "AWS アカウントの作成"
weight: 100
---

## 検証のために AWS アカウントを作成

アプリケーションをデプロイするために、AWS アカウントへのアクセスが必要です。すでにアカウントをお持ちで、さらに管理者権限を持っているユーザが利用する環境に設定されている場合は、[次のステップ](../awscli)に移動しても大丈夫です。

:::alert{type="warning"}
既存の個人アカウントまたは会社のアカウントを利用する場合は、そのアカウントにリソースを作成する場合の影響とポリシーをご確認ください。
:::

AWS アカウントを持ちでない場合は、[こちらで無料で AWS アカウントを作成](https://portal.aws.amazon.com/billing/signup)できます。

## 管理者ユーザ

1. AWS アカウントにログインします。
1. AWS IAM コンソールに遷移して、[ユーザを追加](https://console.aws.amazon.com/iam/home?#/users$new)します。
1. ユーザ名を入力し (例えば `cfn-workshop`)、**アクセスキー - プログラムによるアクセス** と **パスワード - AWS マネジメントコンソールへのアクセス** にチェックを入れます。

![new-user-1-png](/static/prerequisites/account/new-user-1.ja.png)

1. **次のステップ: アクセス権限** を選択します。
1. **既存のポリシーを直接アタッチ** を選択し、**AdministratorAccess** にチェックを入れます。

![new-user-2-png](/static/prerequisites/account/new-user-2.ja.png)

1. **次のステップ: タグ** を選択します。
1. **次のステップ: 確認** を選択します。
1. **ユーザーの作成** を選択します。
1. 次の画面で利用する **アクセスキー ID** が表示されます。**シークレットアクセスキー** の隣の **表示** をクリックすると、その値が表示されます。

![new-user-3-png](/static/prerequisites/account/new-user-3.ja.png)

::alert[重要: 次のステップでアクセスキー ID とシークレットアクセスキーが必要になるので、この画面をこのまま維持するか、メモに保存してください。]{type="info"}
25 changes: 25 additions & 0 deletions content/prerequisites/awscli/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "AWS CLI のインストールと設定"
weight: 200
---

[AWS CLI](https://aws.amazon.com/cli/) によって、ターミナルのセッションから AWS のサービスを操作することができます。必ず最新版の AWS CLI がインストールされていることをご確認ください。

[AWS CLI の最新バージョンをインストールまたは更新します。](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) ページで自分のオペレーティングシステムに合う手順を確認できます。

## 認証情報の設定

ターミナルを開き、`aws configure` を実行して、環境を設定します。

:::code{language=shell showLineNumbers=false showCopyAction=true}
aws configure
:::

[前のステップ](/prerequisites/account)で作成した **アクセスキー ID** と **シークレットアクセスキー** を入力し、デフォルトのAWS リージョン (例えば `ap-northeast-1`) を入力します。できれば、まだリソースが作成されていないリージョンが望ましいです。

:::code{language=shell showLineNumbers=false showCopyAction=false}
AWS Access Key ID [None]: <アクセスキー ID を入力>
AWS Secret Access Key [None]: <シークレットアクセスキーを入力>
Default region name [None]: <リージョンを入力 (e.g. "us-east-1", "ap-northeast-1")>
Default output format [None]: <空欄のまま>
:::
68 changes: 68 additions & 0 deletions content/prerequisites/default-vpc/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: "デフォルト VPC"
weight: 600
---

デフォルト VPC では、すぐに利用開始出来ます。例えば、外部に公開するブログや簡単なウェブサイトを作成できます。

ワークショップの **[初級編](../../Basics)** では、CloudFormation のテンプレートを実行するリージョンにデフォルト VPC が必須です。

意識的に削除されていない場合は、デフォルト VPC が必ず存在しています。わからない場合は、コマンドラインの手順に記載されている方法で確認してください。

デフォルト VPC を削除した場合は、以下のどちらかの手順で作り直すことができます。

### 1. Amazon VPC のコンソールでデフォルトVPCの作成

1. Amazon VPC のコンソールを [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) で開きます。
1. ナビゲーションペインで **お使いの VPC** を選択します。
1. **アクション** から **デフォルト VPC を作成** を選択します。
1. **デフォルト VPC を作成** で確認画面を閉じます。

### 2. コマンドラインでデフォルト VPC の作成

ひとまず、デフォルト VPC の存在を確認します。AWS CLI を使って、リージョン内の全ての VPC のリストから取得します。

1. 以下のコマンドラインをターミナルにコピーしてください。`--region` フラグで指定するリージョンをCloudFormation をデプロイする予定のリージョンに合わせてください。

:::code{language=shell showLineNumbers=false showCopyAction=true}
aws ec2 describe-vpcs --filters Name=isDefault,Values=true --query "Vpcs[].VpcId" --region ap-northeast-1
:::

デフォルト VPC が存在している場合は、出力されるはずです。このセクションの残りを飛ばして、[次のステップ](../../Basics) に移行してください。

回答が空欄 `[]` の場合は、リージョンのデフォルト VPC がないということです。

2. 以下のコマンドをターミナルにコピーしてください。`--region` フラグで指定するリージョンをCloudFormation をデプロイする予定のリージョンに合わせてください。

:::code{language=shell showLineNumbers=false showCopyAction=true}
aws ec2 create-default-vpc --region ap-northeast-1
:::

コマンドの結果は、以下の通りに新しく作成された VPC の情報が表示されます。

:::code{language=json showLineNumbers=false showCopyAction=false}
{
"Vpc": {
"CidrBlock": "172.31.0.0/16",
"DhcpOptionsId": "dopt-c1422ea9",
"State": "pending",
"VpcId": "vpc-088b5ae6628fbf3ac",
"OwnerId": "123456789012",
"InstanceTenancy": "default",
"Ipv6CidrBlockAssociationSet": [],
"CidrBlockAssociationSet": [
{
"AssociationId": "vpc-cidr-assoc-0ab2ffabcbe0548bc",
"CidrBlock": "172.31.0.0/16",
"CidrBlockState": {
"State": "associated"
}
}
],
"IsDefault": true,
"Tags": []
}
}
:::

::alert[ワークショップの後にデフォルト VPC を削除されたい場合は、上記の **VpcId** のメモを取ると削除時に確実に正しい VPC を削除できます。]{type="info"}
18 changes: 18 additions & 0 deletions content/prerequisites/editor/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "コードエディタのインストール"
weight: 300
---

[YAML](https://yaml.org/) の編集をサポートするお好みのコードエディタや IDE を利用できますが、このワークショップでは macOS、Linux、Windows でうまく動作する [Visual Studio Code](https://code.visualstudio.com/) の利用を前提とします。

VS Code をインストールするためには、オペレーティングシステムのパッケージマネージャ(例: macOS の `brew cask install visual-studio-code`)を使うか、[VS Code のサイトの指示](https://code.visualstudio.com/) に従ってインストールしてください。

## CloudFormation Linter

[AWS CloudFormation Linter](https://github.com/aws-cloudformation/cfn-lint) のインストールを推奨します。[Linter](https://ja.wikipedia.org/wiki/Lint) は CloudFormation のテンプレートをデプロイする前に、基本的なエラーを事前に警告してくれます。

もし VS Code をお使いの場合、[cfn-lint](https://marketplace.visualstudio.com/items?itemName=kddejong.vscode-cfn-lint) プラグインをインストールしてください。

:::alert{type="info"}
`cfn-lint` は VS Code の `cfn-lint` プラグインと自動的にインストールされません。別途 [インストール手順](https://github.com/aws-cloudformation/cfn-lint#install) に沿ってインストールしてください。
:::
44 changes: 44 additions & 0 deletions content/prerequisites/git/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Gitのインストール"
weight: 400
---

Git がすでにインストールされている可能性があります。確認するために、ターミナルで `git --version` を実行します。インストールされていない場合は、自分のオペレーティングシステムに合わせて以下の手順に沿ってインストールしてください。

## macOS で Git のインストール

macOS で Git をインストールするために、二つの方法があります。[Xcode](https://developer.apple.com/jp/xcode/) か [Homebrew](https://brew.sh/) でインストールできます。

### Xcode で Git のインストール

1. ターミナルで以下のコマンドを実行してください。

:::code{language=shell showLineNumbers=false showCopyAction=true}
xcode-select --install
:::

1. 表示されるソフトウェアアップデートウィンドーの指示に従ってインストールしてください。

## Linux で Git のインストール

全ての Linux ディストリビューションのメインパッケージリポジトリに Git が含まれています。パッケージマネージャを使ってインストールしてください (例えば、`apt install git`)。

ターミナルで `git --version` を実行すると、インストールの確認ができます。

:::code{language=shell showLineNumbers=false showCopyAction=true}
git --version
git version 2.30.0
:::

## Windows で Git をインストール

### Git for Windows のスタンドアローンインストーラ

1. 最新の [Git for Windows](https://git-for-windows.github.io/) のインストーラをダウンロードしてください。
1. インストーラを実行したら、Git のセットアップウィザードの画面が表示されます。Next や Finish を使って、インストールを完了させてください。デフォルトのオプションはほとんどのユーザで問題ありません。
1. コマンドプロンプトを開いてください(それとも、インストール時に Git を Windows のコマンドプロンプトから実行しないオプションを選んだ場合は、 Git Bash を実行してください)。
1. `git --version` コマンドを実行してください。
:::code{language=shell showLineNumbers=false showCopyAction=true}
git --version
git version 2.23.0.windows.1
:::
12 changes: 12 additions & 0 deletions content/prerequisites/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "事前準備"
weight: 20
---

このワークショップを完了するには、次を実施する必要があります。

::children

すでにお使いの環境に上記のツールがインストールされている場合は、そのステップを省略することができます。

最初のステップに進むためには、Next をクリックしてください。
20 changes: 20 additions & 0 deletions content/prerequisites/lab-resources/index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "ラボのリソースの取得"
weight: 500
---

CloudFormation のテンプレートは `cfn101-workshop` フォルダの `code/` ディレクトリにあります。

1. 作業用のディレクトリにリポジトリをクローンしてください

:::code{language=shell showLineNumbers=false showCopyAction=true}
git clone https://github.com/aws-samples/cfn101-workshop
:::

または、[GitHub のリポジトリのページ](https://github.com/aws-samples/cfn101-workshop) から ZIP ファイルをダウンロードしてください。

![git-download-png](/static/prerequisites/lab-resources/git-download.png)

2. [前のステップ](/prerequisites/editor) でインストールしたコードエディタでダウンロードしたフォルダーを開いてください。

![vscode-png](/static/prerequisites/lab-resources/vscode.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/prerequisites/account/new-user-2.ja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/prerequisites/account/new-user-3.ja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.