[英]NoCredentialProviders: no valid providers in chain. Deprecated. (DNSControl)
I am trying to implement dnscontrol to use route 53, but it seems it does not see what I put inside creds.json file when I run any command eg "dnscontrol get-zones gcloud GCLOUD mydomain.com"我正在尝试实现 dnscontrol 以使用路由 53,但是当我运行任何命令(例如“dnscontrol get-zones gcloud GCLOUD mydomain.com”)时,它似乎看不到我放入 creds.json 文件中的内容
It returns the error:它返回错误:
NoCredentialProviders: no valid providers in chain. NoCredentialProviders:链中没有有效的提供者。 Deprecated.
已弃用。 For verbose messaging see aws.Config.CredentialsChainVerboseErrors
有关详细消息,请参阅 aws.Config.CredentialsChainVerboseErrors
I did place the credentials inside creds.json in the format below:我确实将凭据放入 creds.json 中,格式如下:
{ "r53_main": { "KeyId": "mywhateverkeyid", "SecretKey": "mywhateversecretkey" } } {“r53_main”:{“KeyId”:“mywhateverkeyid”,“SecretKey”:“mywhateversecretkey”}}
My gcloud credentials work fine inside the same creds.json file.我的 gcloud 凭据在相同的 creds.json 文件中工作正常。
Thanks谢谢
If you're trying to authenticate against Google (Cloud DNS), you will need to use a (Google) Service Account JSON key as described here .如果您尝试针对 Google (Cloud DNS) 进行身份验证,则需要使用 (Google) 服务帐户 JSON 密钥,如此处所述。
It appears you may be trying to use Route 53 credentials as described here .看来您可能正在尝试使用此处所述的 Route 53 凭据。
PROJECT=[[PROJECT]]
BILLING=[[BILLING]]
DNSNAME=[[DNSNAME]]
ACCOUNT=[[ACCOUNT]]
gcloud projects create ${PROJECT}
gcloud beta billing projects link ${PROJECT} --billing-account=${BILLING}
gcloud services enable dns.googleapis.com --project=${PROJECT}
# Create a test DNS Managed Zone
gcloud dns managed-zones create test \
--description=test \
--dns-name=${DNSNAME} \
--project=${PROJECT}
# Create a Service Account (permitted to use DNS) and Key
gcloud iam service-accounts create ${ACCOUNT} --project=${PROJECT}
gcloud projects add-iam-policy-binding ${PROJECT} \
--member=serviceAccount:${ACCOUNT}@${PROJECT}.iam.gserviceaccount.com \
--role=roles/dns.admin
gcloud iam service-accounts keys create ./${ACCOUNT}.json \
--iam-account=${ACCOUNT}@${PROJECT}.iam.gserviceaccount.com \
--project=${PROJECT}
You will need to then combine the key into a creds.json
:然后,您需要将密钥组合成
creds.json
:
echo "{\"gcloud\":$(cat ./${ACCOUNT}.json)}" > ./creds.json
Then:然后:
./dnscontrol check-creds gcloud GCLOUD
${DNSNAME}
./dnscontrol get-zones gcloud GCLOUD ${DNSNAME}
$ORIGIN ${DNSNAME}.
$TTL 300
@ 21600 IN NS ns-cloud-b1.googledomains.com.
21600 IN NS ns-cloud-b2.googledomains.com.
21600 IN NS ns-cloud-b3.googledomains.com.
21600 IN NS ns-cloud-b4.googledomains.com.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.