amazon-web-services - AWS CLI:找不到配置文件
问题描述
目前正在将 yml 文件部署到 CloudFormation,我已经创建了这个名为 awsbootsrap 的配置文件,但是当我的脚本运行时出现错误。我的脚本:
#!/bin/bash
STACK_NAME=awsbootstrap
REGION=us-east-2c
CLI_PROFILE=awsbootstrap
EC2_INSTANCE_TYPE=t2.micro
# Deploy the CloudFormation template
echo $CLI_PROFILE
echo -e "\n\n=========== Deploying main.yml ==========="
aws cloudformation deploy --region $REGION --profile $CLI_PROFILE --stack-name $STACK_NAME --template-file main.yml --no-fail-on-empty-changeset --capabilities CAPABILITY_NAMED_IAM --parameter-overrides EC2InstanceType=$EC2_INSTANCE_TYPE
# If the deploy succeeded, show the DNS name of the created instance
if [ $? -eq 0 ]; then
aws cloudformation list-exports --profile awsbootstrap --query "Exports[?Name=='InstanceEndpoint'].Value"
fi
其中 $CLI_PROFILE=awsbootstrap
我得到找不到配置文件(awsbootstrap)
运行aws configure list-profile
显示我的个人资料 -> awsbootstrap
跑步aws configure list
节目
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key <not set> None None
secret_key <not set> None None
region <not set> None None
我的~/.aws/config
样子是这样的(也尝试过 us-east-1 / us-east-2):
[profile awsbootstrap]
region = us-east-2c
output = json
我的~/.aws/credentials
样子是这样的:
[awsbootstrap]
aws_access_key_id = redacted
aws_secret_access_key = redacted
我没有产生问题的环境变量......
解决方案
推荐阅读
- python - 没有 xcom 的任务之间的气流通信
- shell - 在不使用 IFolderView::GetItemPosition 的情况下获取 shell 文件夹列表视图项的位置
- mariadb - ProxySQL:如何配置故障转移?
- z3 - z3py 优化作为从列表中选择的变量
- ios - 如何在不使用 UIActivityViewController 的情况下在 WhatsApp 上分享视频?
- jquery - 页面加载后无法运行 jQuery 脚本
- gitlab - Gitlab 究竟是如何检测项目中的语言的?
- r - 当我使用 assignTaxonomy 时 R 会话中止
- if-statement - 得到答案的两个表达式(如果 X = Y 且 A = B,则答案为 D)
- angular - 通过 Ionic 4 中的侧菜单路由页面