scf deploy
, you can scan the QR code for quick authorization and deployment. After you authorize by scanning the code, temporary key information will be generated (which will expire in 60 minutes) and written into the .env file in the current directory.TENCENT_APP_ID=xxxxxx # `AppId` of authorizing accountTENCENT_SECRET_ID=xxxxxx # `SecretId` of authorizing accountTENCENT_SECRET_KEY=xxxxxx # `SecretKey` of authorizing accountTENCENT_TOKEN=xxxxx # Temporary token
.env
file in the root directory of the project to be deployed and configure the Tencent Cloud SecretId
and SecretKey
information:# .envTENCENT_SECRET_ID=xxxxxxxxxx # `SecretId` of your accountTENCENT_SECRET_KEY=xxxxxxxx # `SecretKey` of your account
scf credentials
command to quickly set the persistent storage of the global key information. This command must be configured under the created SCF project. Make sure that you have created a project with serverless.yml
through scf init
or manually.scf credentials Manage global user authorization informationset Store user authorization information--secretId / -i (Required) Tencent Cloud CAM account's `secretId`--secretKey / -k (Required) Tencent Cloud CAM account's `secretKey`--profile / -n {name} Authorization name, which is `default` by default--overwrite / -o Overwrite the key with an existing authorization nameremove Remove user authorization information--profile / -n {name} (Required) authorization namelist View user authorization information
# Configure authorization information through the default profile name$ scf credentials set --secretId xxx --secretKey xxx# Configure authorization information through the specified profile name$ scf credentials set --secretId xxx --secretKey xxx --profile profileName1# Update the authorization information in the specified profile name$ scf credentials set --secretId xxx --secretKey xxx --profile profileName1 --overwrite
$ scf credentials remove --profile profileName1
$ scf credentials list
# Deploy through the default profile$ scf deploy# Deploy through the specified profile$ scf deploy --profile newP# Ignore global variables and scan the QR code for deployment$ scf deploy --login
QcloudscfFullAccess
in the pop-up window and click OK to grant the sub-account the permission to manipulate all Serverless Cloud Framework resources.
{"version": "2.0","statement": [{"action": ["cam:PassRole"],"resource": ["qcs::cam::uin/${enter the account's uin}:roleName/scf_QcsRole"],"effect": "allow"},{"resource": ["*"],"action": ["name/sts:AssumeRole"],"effect": "allow"}]}
scf_QcsRole
. At this point, your sub-account should have a custom policy and a preset policy QcloudscfFullAccess and can use Serverless Framework normally.
scf_QcsRole
role, you can also grant the sub-account the permission to call a custom role and control the sub-account permissions with refined permission policies in the custom role. For more information, see Configuring Role for Specified Operation.Policy | Description |
QcloudCOSFullAccess | Full access to COS |
QcloudSCFFullAccess | Full access to SCF |
QcloudSSLFullAccess | Full access to SSL Certificate Service |
QcloudTCBFullAccess | Full access to TCB |
QcloudAPIGWFullAccess | Full access to API Gateway |
QcloudVPCFullAccess | Full access to VPC |
QcloudMonitorFullAccess | Full access to Cloud Monitor |
QcloudslsFullAccess | Full access to SLS. |
QcloudCDNFullAccess | Full access to CDN |
QcloudCKafkaFullAccess | Full access to CKafka |
QcloudCodingFullAccess | Full access to CODING DevOps |
QcloudPostgreSQLFullAccess | Full access to TencentDB for PostgreSQL |
QcloudCynosDBFullAccess | Full access to TDSQL-C for MySQL |
QcloudCLSFullAccess | Full access to CLS |
QcloudAccessForscfRole | This policy can be associated with the SLS service role (scf_QCSRole) for SCF's quick experience feature to access other Tencent Cloud service resources. It contains permissions of CAM-related operations. |
Was this page helpful?