How to use the tencent-component-toolkit.Scf function in tencent-component-toolkit

To help you get started, we’ve selected a few tencent-component-toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless-components / tencent-laravel / src / serverless.js View on Github external
async remove() {
    console.log(`Removing ${CONFIGS.compFullname} App...`)

    const { state } = this
    const { regionList = [] } = state

    const credentials = this.getCredentials()

    const removeHandlers = []
    for (let i = 0; i < regionList.length; i++) {
      const curRegion = regionList[i]
      const curState = state[curRegion]
      const scf = new Scf(credentials, curRegion)
      const apigw = new Apigw(credentials, curRegion)
      const handler = async () => {
        await scf.remove({
          functionName: curState.functionName,
          namespace: curState.namespace
        })
        // if disable apigw, no need to remove
        if (state.apigwDisabled !== true) {
          await apigw.remove({
            created: curState.created,
            environment: curState.environment,
            serviceId: curState.serviceId,
            apiList: curState.apiList,
            customDomains: curState.customDomains
          })
        }
github serverless-components / tencent-laravel / src / serverless.js View on Github external
const funcDeployer = async (curRegion) => {
      const code = await uploadCodeToCos(this, appId, credentials, inputs, curRegion)
      const scf = new Scf(credentials, curRegion)
      const tempInputs = {
        ...inputs,
        code
      }
      const scfOutput = await scf.deploy(deepClone(tempInputs))
      outputs[curRegion] = {
        functionName: scfOutput.FunctionName,
        runtime: scfOutput.Runtime,
        namespace: scfOutput.Namespace
      }

      this.state[curRegion] = {
        ...(this.state[curRegion] ? this.state[curRegion] : {}),
        ...outputs[curRegion]
      }