简体   繁体   English

如何读取与 AWS Lambda function 关联的标签?

[英]how to read tags associated to AWS Lambda function?

I'm trying to read the tags associated to AWS lambda function using boto3 API with python我正在尝试使用 boto3 API 和 Z23EEEB7947BDD25BDDZBAD6

    import boto3
    client = boto3.client('lambda')
    response = client.list_tags(Resource=arn)

when I test the above code from lambda function, i see network API error.Is there any way to read the tags from context?当我从 lambda function 测试上述代码时,我看到网络 API 错误。有没有办法从上下文中读取标签? I appreciate your help.我感谢您的帮助。

set your client variable as:将您的客户端变量设置为:

 client = boto3.client('lambda', aws_access_key_id=Awscred.aws_access_key_id, aws_secret_access_key=Awscred.aws_secret_access_key, region_name=Awscred.region_name)

this worked for me这对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM