@tencent-serverless/tencent-cam-policy-beta
v1.5.9
Published
Tencent Cloud Serverless CAM policy
Downloads
8
Readme
Tencent-cam-policy
Easily provision Tencent CAM policy using Serverless Components.
This version is an experience version and does not guarantee stability.
1. Install
$ npm install -g serverless
2. Create
Just create a serverless.yml
file
$ touch serverless.yml
$ touch .env # your Tencent api keys
If you don't have a Tencent Cloud account, you could sign up first.
If you already login in, find TENCENT_SECRET_ID
and TENCENT_SECRET_KEY
in Tencent Console.
# .env
TENCENT_SECRET_ID=123
TENCENT_SECRET_KEY=123
3. Configure
# serverless.yml
myPolicy:
component: "@tencent-serverless/tencent-cam-policy-beta"
inputs:
name: my-policy
description: A policy created by Serverless Components
policy:
statement:
- effect: allow
action:
- cos:GetService
resource: '*'
4. Deploy
$ sls --debug
DEBUG ─ Resolving the template's static variables.
DEBUG ─ Collecting components from the template.
DEBUG ─ Downloading any NPM components found in the template.
DEBUG ─ Analyzing the template's components dependencies.
DEBUG ─ Creating the template's components graph.
DEBUG ─ Syncing template state.
DEBUG ─ Executing the template's components graph.
myPolicy:
id: 27710257
7s › myPolicy › done
5. Remove
$ sls remove --debug
DEBUG ─ Flushing template state and removing all components.
1s › myPolicy › done
New to Components?
Checkout the Serverless Components repo for more information.