Updated on 2024-08-15 GMT+08:00

Using Permanent AK/SK

  1. Log in to the FunctionGraph console and choose My Credentials.
    Figure 1 My credentials
  2. Choose Access Keys and click Create Access Key. For details, see Managing Access Keys for an IAM User.
    Figure 2 Creating an access key
  3. Return to the FunctionGraph console, choose Functions > Function List, and click a function name to go to the function details page.
    Figure 3 Viewing function details
  4. Choose Configuration > Environment Variables, click Edit Environment Variable, add the AK/SK environment variables, enable Encrypted, and click OK.
    Figure 4 Adding AK/SK environment variables
  5. Click the Code tab and replace context.getAccessKey() and context.getSecretKey() in the original code with context.getUserData("ak") and context.getUserData("sk"), respectively. (Python is used as an example.)
    Figure 5 Modifying the code for obtaining AK/SK
  6. Click Deploy to refresh the code.