赛尔校园公共服务平台 Logo
平台使用
阿里云
百度云
移动云
智算服务
教育生态
登录 →
赛尔校园公共服务平台 Logo
平台使用 阿里云 百度云 移动云 智算服务 教育生态
登录
  1. 首页
  2. 阿里云
  3. 函数计算 FC 3.0
  4. 常见问题
  5. 代码开发FAQ
  6. 咨询类FAQ
  7. 使用函数Context参数中的AccessKey ID等信息访问其他云资源时,收到The Access Key ID does not exist的报错怎么办?

使用函数Context参数中的AccessKey ID等信息访问其他云资源时,收到The Access Key ID does not exist的报错怎么办?

  • 咨询类FAQ
  • 发布于 2025-04-16
  • 0 次阅读
文档编辑
文档编辑

函数Context参数中提供了访问云资源的临时密钥,包含AccessKey ID、AccessKey Secret及Security Token,如果遗漏了Security Token,会收到The Access Key ID does not exist的报错。

以下是在Python函数中访问OSS代码的示例。

import json
import oss2
def my_handler(event, context):
    evt = json.loads(event)
    creds = context.credentials
    # 身份验证时,请不要遗漏了security_token!
    # Do not miss the "security_token" for the authentication!
    auth = oss2.StsAuth(creds.access_key_id, creds.access_key_secret, creds.security_token)
    bucket = oss2.Bucket(auth, evt['endpoint'], evt['bucket'])
    bucket.put_object(evt['objectName'], evt['message'])
    return 'success'
            
相关文章

我可以使用什么语言编写函数? 2025-04-16 14:38

函数计算支

函数计算如何保证代码的安全? 2025-04-16 14:38

函数计算对

使用函数Context参数中的AccessKey ID等信息访问其他云资源时,收到The Access Key ID does not exist的报错怎么办? 2025-04-16 14:38

函数Context参数中提供了访问云资源的临时密钥,包含AccessKey ID、AccessKey Secret及Security Token,如果遗漏了Security Token,会收到The Access Key ID does not exist的报错。

函数计算只支持Node.js,用C++写的程序怎么运行? 2025-04-16 14:38

函数计算会根据您的需求不断拓

函数计算的运行环境中所依赖的包如何自动安装? 2025-04-16 14:38

函数计算不

Java Runtime如何配置函数入口? 2025-04-16 14:38

在函数计算中使用Java编程语言时,需要定义一个函数入口,即请求处理程序。

目录
Copyright © 2025 your company All Rights Reserved. Powered by 赛尔网络.
京ICP备14022346号-15
gongan beian 京公网安备11010802041014号