[英]SharedConfigLoadError while creating Amazon EKS Cluster
當嘗試在終端上運行它時,
eksctl create cluster \
--name dev \
--version 1.14 \
--region us-west-2 \
--nodegroup-name demo \
--node-type t3.medium \
--nodes 3 \
--nodes-min 1 \
--nodes-max 4 \
--ssh-access \
--ssh-public-key my-public-key.pub \
--managed
收到此錯誤:
恐慌:SharedConfigLoadError:無法加載配置文件,/home/thira/.aws/credentials 導致:INIParseError:ASTKind 狀態無效 {completed_stmt {0 NONE 0 []} false [{section_stmt {1 STRING 0 [78 111 110 101] ]} true []}]} 和 TokenType 操作
我遇到了類似的問題,我使用 powershell 作為 cicd 代理。 我需要使用 s3 后端作為 terraform 狀態存儲。 所以我只是將 aws access id 和 secret 回顯到 ~/.aws/credentials 中,但是發生了這個錯誤。 然后我發現根本原因是windows文件格式,我們需要把文件轉成linux文件格式。 我在互聯網上的powershell中查找了如何將windows文件傳輸到linux文件,所以我的問題的最終解決方案是:
[string]::Join( "`n", (gc ~/.aws/cred)) | sc ~/.aws/credentials
以下是我的全部代碼:
if (Test-Path ~/.aws) {
Remove-Item ~/.aws -Recurse -Force -EA SilentlyContinue
}
mkdir ~/.aws
echo "[services]" > ~/.aws/cred
echo "aws_access_key_id = ${bamboo.S3_BACK_ACCESS}" >> ~/.aws/cred
echo "aws_secret_access_key = ${bamboo.S3_BACK_SECRET}" >> ~/.aws/cred
[string]::Join( "`n", (gc ~/.aws/cred)) | sc ~/.aws/credentials
cat ~/.aws/credentials
關於如何在PowerShell中將window文件轉換為linux文件,我參考了鏈接: UNIX format files with Powershell
希望它可以幫助別人!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.