LoginSignup
0
0

More than 1 year has passed since last update.

GCP触ってみた⑤

Posted at

Google App Engine(GAE)

AWSでいうLambda?
アプリケーション以下のレイヤはフルマネージドとなるサービス
インスタンスの起動停止、スケーリングなんかも自動

触ってみる

gcloud app create --project=<projectID>
You are creating an app for project <projectID>.
WARNING: Creating an App Engine application for a project is irreversible and the region
cannot be changed. More information about regions is at
<https://cloud.google.com/appengine/docs/locations>.

Please choose the region where you want your App Engine application located:

 [1] asia-east1    (supports standard and flexible)
 [2] asia-east2    (supports standard and flexible and search_api)
 [3] asia-northeast1 (supports standard and flexible and search_api)
 [4] asia-northeast2 (supports standard and flexible and search_api)
 [5] asia-northeast3 (supports standard and flexible and search_api)
 [6] asia-south1   (supports standard and flexible and search_api)
 [7] asia-southeast1 (supports standard and flexible)
 [8] asia-southeast2 (supports standard and flexible and search_api)
 [9] australia-southeast1 (supports standard and flexible and search_api)
 [10] europe-central2 (supports standard and flexible)
 [11] europe-west   (supports standard and flexible and search_api)
 [12] europe-west2  (supports standard and flexible and search_api)
 [13] europe-west3  (supports standard and flexible and search_api)
 [14] europe-west6  (supports standard and flexible and search_api)
 [15] northamerica-northeast1 (supports standard and flexible and search_api)
 [16] southamerica-east1 (supports standard and flexible and search_api)
 [17] us-central    (supports standard and flexible and search_api)
 [18] us-east1      (supports standard and flexible and search_api)
 [19] us-east4      (supports standard and flexible and search_api)
 [20] us-west1      (supports standard and flexible)
 [21] us-west2      (supports standard and flexible and search_api)
 [22] us-west3      (supports standard and flexible and search_api)
 [23] us-west4      (supports standard and flexible and search_api)
 [24] cancel
Please enter your numeric choice:  18

Creating App Engine application in project <projectID> and region [us-east1]....done.     
Success! The app is now created. Please use `gcloud app deploy` to deploy your first app.

#Hello Worldのサンプルコードをダウンロード
git clone https://github.com/GoogleCloudPlatform/golang-samples.git
Cloning into 'golang-samples'...
remote: Enumerating objects: 23227, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 23227 (delta 29), reused 48 (delta 15), pack-reused 23152
Receiving objects: 100% (23227/23227), 49.43 MiB | 21.19 MiB/s, done.
Resolving deltas: 100% (14706/14706), done.

# ディレクトリの移動
cd golang-samples/appengine/go11x/helloworld

# アプリのデプロイ
gcloud app deploy

# アプリのブラウズ

gcloud app browse
Did not detect your browser. Go to this link to view your app:
https://<url>

無事Hello Worldが表示できた
image.png

GUIから見たGAE

image.png

後片付け

基本的にはプロジェクトを破壊することになる?

gcloud projects delete <projectID>
Your project will be deleted.

Do you want to continue (Y/n)?  y

Deleted [https://cloudresourcemanager.googleapis.com/v1/projects/<projectID>].

You can undo this operation for a limited period by running the command below.
    $ gcloud projects undelete <projectID>

See https://cloud.google.com/resource-manager/docs/creating-managing-projects for information on shutting down projects.

今日はここまで、お疲れ様でした

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0