2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

テンセントクラウドのバケット(COS)をServerless Framework経由で作成する

Posted at

前提

  • テンセントクラウドのアカウントを作成しておく
  • Cloud Access ManagementのAPI KeysからシークレットID、シークレットキーを作成しておく

作成する

まずドキュメントをそのまま読んで実行してもうまくいかずに唸っていたところ、FAQsに、どうも中国以外の国では .env に追記する必要があることを見つけた。**"How do I deploy if my development environment is outside Mainland China?"**の部分。自分はchromeの翻訳機能で読んだ。
これを踏まえて .env はこういう感じに書く。

.env
SERVERLESS_PLATFORM_VENDOR=tencent
TENCENT_SECRET_ID=xxxxxxxxxx
TENCENT_SECRET_KEY=xxxxxxxxxx

ドキュメントを参考にしつつ serverless.yml に必要最低限の項目のみ記載してデプロイしてみる。

serverless.yml
component: cos
name: serverless-cos

inputs:
  bucket: 作りたいバケット名
  region: ap-tokyo

sls deploy コマンドを実行。

$ sls deploy

中略

前往控制台查看应用详细信息: https://serverless.cloud.tencent.com/xxxxxxxxxx

10s › serverless-cos › Success

うまくいった。
テンセントクラウドのServerless Framework上で確認できる(上記のような成功後に出てくるターミナルのリンク)。
もしかすると反映に時間がかかるかもしれないが、テンセントクラウドのCloud Object Storageのコンソールにもちゃんとバケットが作られたのが確認できる。

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?