我正在尝试使用 awscli 设置一个新的命名配置文件
我曾经aws configure --profile example设置过配置文件,但我将所有内容都保留为默认值
现在我得到 The config profile (example) could not be found
我什至尝试~\.aws\config使用以下内容创建和修改文件但无济于事
[example]
region=eu-west-1
output=text
Run Code Online (Sandbox Code Playgroud)
我尝试执行的任何命令都会导致上述错误
我也尝试重新安装 awscli
非常感谢帮助,谢谢!
我在这里做错了什么?
我的 %UserProfile%.aws\config 文件如下所示:
[profile foo]
output = json
region = us-east-1
Run Code Online (Sandbox Code Playgroud)
我的 %UserProfile%.aws\credentials 文件如下所示:
[foo]
aws_access_key_id = BAOAIGKMPRBTLBNOSCZQ
aws_secret_access_key = OcML0LadbbD3Nt+PmAlhzNTmoS6Xx9M3M6DkBx4m
Run Code Online (Sandbox Code Playgroud)
所以没有配置默认配置文件:我只想为 Powershell 会话设置。
在 Powershell 中,我运行:
set AWS_PROFILE=foo
Run Code Online (Sandbox Code Playgroud)
然后我尝试执行 cli 命令,但它说找不到凭据:
PS D:\> aws ec2 describe-instances
You must specify a region. You can also configure your region by running "aws configure".
PS D:\> aws ec2 describe-instances --region us-east-1
Unable to locate credentials. You can configure credentials by running "aws configure".
Run Code Online (Sandbox Code Playgroud) 我想同步 S3 存储桶中的目录并删除目标中的文件,而不是源中的文件。
我尝试使用此命令,但是保留了仅位于目标中的文件。
aws s3 sync my-directory/ s3://my-bucket
Run Code Online (Sandbox Code Playgroud) 我正在尝试为使用以下 aws cli 命令创建的 ebs 卷手动应用标签。手动应用标签的原因是 Pivotal cloud Foundry 的安装错误。
我的标签键/值对包含空格。有没有办法添加空格并仍然使 cli 命令工作。这是我的 cli 命令:
不起作用: aws ec2 create-tags --resources ami-4778889 vol-1445333--tags Key=Name,Value=PCF Key=Product Family,Value=Enterprise Services
使用下划线 aws ec2 create-tags --resources ami-4778889 vol-1445333--tags Key=Name,Value=PCF Key=Product_Family,Value=Enterprise_Services
关于如何解决这个问题的任何想法?感谢你的帮助!
AWS CLI:aws-cli/1.16.24 Python/3.6.0 Windows/10 botocore/1.12.14
我正在尝试更改所有上传的图像文件扩展名。如果图像为 .png,.gif,.jpeg,则应为 .jpg 格式。我不想从 S3 存储桶下载所有图像文件。我想在 S3 存储桶本身上执行此过程。请让我知道正确的方法和解决方案。
我创建了一个 Jenkins 作业,每次部署我的前端项目时都会使缓存无效。问题是,虽然 AWS 网站显示缓存无效,但当作业完成时,缓存并未完全清除,因此我需要通过 AWS 网站手动使其无效...
我使用的自动使缓存无效的方法是通过aws 容器,我在其中执行以下命令:
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths /* > output.json输出文件将包含一个 json,我可以在其中获取不同的键:值。我使用的其中两个是Id和Status。创建失效后,我执行以下另一个管道步骤:
aws cloudfront get-invalidation --distribution-id ${DISTRIBUTION_ID} --id ${id_invalidator} > status_invalidation.json使用之前的命令,我每 50 秒(通过 a sleep 50)向API 请求一次失效状态。当验证返回“Status = Completed”时,作业就完成了。此条件在 while 循环内。
有人知道为什么会这样吗?
pipeline amazon-web-services jenkins amazon-cloudfront aws-cli
这是我的批处理文件:
aws s3 sync ./dummy_dist s3://www.mywebsite.com --delete --profile www.mywebsite.com_deploy --debug
echo ________________ here 1 __________________
Run Code Online (Sandbox Code Playgroud)
回声线永远不会运行!
这是 aws 命令的调试输出:
2018-12-23 10:51:52,518 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.16.81 Python/3.7.2rc1 Windows/10 botocore/1.12.71
2018-12-23 10:51:52,518 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3', 'sync', './dummy_dist', 's3://www.mywebsite.com', '--delete', '--profile', 'www.mywebsite.com_deploy', '--debug']
2018-12-23 10:51:52,521 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x0000025A115B4488>
2018-12-23 10:51:52,521 - MainThread - botocore.hooks - DEBUG …Run Code Online (Sandbox Code Playgroud) 我试图拉出我们所有实例的列表,格式如下:
Tag:Name.Value instance-id private-ip-address
这是我正在使用的命令:
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[Tags[?Key==`Name`].Value[],InstanceId,PrivateIpAddress]' --output text
Run Code Online (Sandbox Code Playgroud)
这就是我得到的输出:
instance-id private-ip-address
tag:name.value
Run Code Online (Sandbox Code Playgroud)
即使我在其他所有事情之前都得到了 Tag 位,它仍然列在相应 ID/IP 下方的新行上。
有任何解决这个问题的方法吗?还有任何方法来检索这样的格式:
Tag:name.value,instance-id,private-ip-address
谢谢
在我拥有 Lambda 版本和别名之前,基于 API update-function-code我可以通过以下方式成功部署
aws lambda update-function-code --function-name myFunction --zip-file fileb://archive.zip
Run Code Online (Sandbox Code Playgroud)
添加版本和别名后,我有 Lambda 版本
和别名
我尝试部署到登台(版本1),
aws lambda update-function-code --function-name arn:aws:lambda:us-west-2:123456789000:function:myFunction:staging --zip-file fileb://archive.zip
Run Code Online (Sandbox Code Playgroud)
给出错误
当前操作不支持 $LATEST 以外的版本。请将版本设置为 $LATEST 或不要在您的请求中设置版本。
aws lambda update-function-code --function-name myFunction --zip-file fileb://archive.zip --s3-object-version 1
Run Code Online (Sandbox Code Playgroud)
或者
aws lambda update-function-code --function-name myFunction --zip-file fileb://archive.zip --s3-object-version staging
Run Code Online (Sandbox Code Playgroud)
给出错误
提供 ZipFile 时请不要提供其他 FunctionCode 参数。
如何使用 AWS CLI 将 lambda 函数正确部署到特定别名或版本?谢谢
我需要在 Hasura Docker Image 中安装 awscli 和 jq 库。我尝试使用 yum、apt-get 或 apk 命令来安装依赖项,但它们都不起作用。
Docker 镜像:https : //hub.docker.com/r/hasura/graphql-engine/
如何在 Hasura Docker Image 中安装这些依赖项?任何帮助表示赞赏。
Dockerfile:
FROM hasura/graphql-engine:latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD ["./entrypoint.sh"]
Run Code Online (Sandbox Code Playgroud)
入口点.sh:
#!/bin/sh
set -o errexit -o nounset -o pipefail
DB_HOST=${DB_HOST:-postgres}
DB_PORT=${DB_PORT:-5432}
if [ -z "${DB_NAME}" ]; then
echo "Must provide DB_NAME environment variable. Exiting...."
exit 1
fi
if [ -z "${DB_USER}" ]; then
echo "Must provide DB_USER environment variable. Exiting...."
exit 1
fi
if [ …Run Code Online (Sandbox Code Playgroud) aws-cli ×10
amazon-s3 ×3
amazon-ec2 ×1
aws-lambda ×1
aws-sdk ×1
bash ×1
batch-file ×1
docker ×1
dockerfile ×1
hasura ×1
installation ×1
jenkins ×1
jq ×1
linux ×1
macos ×1
pipeline ×1
powershell ×1