简体   繁体   English

获取错误'NoCredentialProviders:链中没有有效的提供者。 已弃用。 在 golang 中调用 acmpca.GetCertificate()

[英]Getting Error 'NoCredentialProviders: no valid providers in chain. Deprecated.' while calling acmpca.GetCertificate() in golang

I am facing error while calling acmpca.GetCertificate() function to get certificate,我在调用 acmpca.GetCertificate() function 获取证书时遇到错误,

NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment
SharedCredsLoad: failed to load shared credentials file
caused by: FailedRead: unable to open file
caused by: open /root/.aws/credentials: no such file or directory
EC2RoleRequestError: no EC2 instance role found
caused by: RequestError: send request failed
caused by: Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp 169.254.169.254:80: connect: no route to host

My AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is stored in ~/.aws/credentials file, below is the code我的 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 存储在 ~/.aws/credentials 文件中,下面是代码

sess := acmpca.New(session.New(&aws.Config{
        Region: aws.String("us-east-1"),
    }))
    params := &acmpca.GetCertificateInput{
        CertificateArn:          aws.String("ARN"),
        CertificateAuthorityArn: aws.String("ARN"),
    }
    resp, err := sess.GetCertificate(params)
    if err != nil {
        fmt.Println("got error := ", err.Error())
    }
    fmt.Printf("++++ response ++++:= %+V", resp)

Can anyone please help me on this?谁能帮我解决这个问题? Thanks in advance!提前致谢!

The credentials you provided are either expired or they don't have proper permissions set for them.您提供的凭据已过期或没有为其设置适当的权限。 You can try creating new credentials with permissions that are sufficient for code.您可以尝试创建具有足够代码权限的新凭据。

暂无
暂无

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

相关问题 Amazon SQS:: 尝试创建队列时出错:NoCredentialProviders:链中没有有效的提供商。 弃用 - Amazon SQS:: Got an error while trying to create queue: NoCredentialProviders: no valid providers in chain. Deprecated 注册错误:NoCredentialProviders: no valid providers in chain ECS 代理错误 - Error registering: NoCredentialProviders: no valid providers in chain ECS agent error Docker Windows:awslogs 日志记录驱动程序 - NoCredentialProviders:链中没有有效的提供程序 - Docker Windows: awslogs logging driver - NoCredentialProviders: no valid providers in chain 我收到 First argument "email" must be a valid string error while firebase authentication in react - I am getting First argument "email" must be a valid string error while firebase authentication in react 从 Angular 应用程序调用/授权 Azure Active Directory 时出现 CORS 错误 - Getting CORS error while calling /authorize of Azure Active Directory from Angular Application 无法使用区域提供商链找到区域。 必须在构建器或设置环境中提供明确的区域以提供区域 - Unable to find a region using the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region Dialogflow 代理在调用时出现忙错误 - Dialogflow Agent gives Busy Error while calling 无法从链 AwsCredentialsProviderChain 中的任何提供程序加载凭据 - Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain firebase.auth.Auth.signInWithCredential 已弃用。 请改用 firebase.auth.Auth.signInAndRetrieveDataWithCredential - firebase.auth.Auth.signInWithCredential is deprecated. Please use firebase.auth.Auth.signInAndRetrieveDataWithCredential instead golang 可以在没有 for/while if/else 的情况下实现这个获取数组摘要的面试问题吗? - Could golang implement this interview question of getting array summary without for/while if/else?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM