简体   繁体   English

gitlab 管道无法使用 aws 服务

[英]gitlab pipeline fail to use aws service

This error show "An HTTP Client raised an unhandled exception: Invalid header value b'AWS4-HMAC-SHA256 Credential=********************************************" in gitlab ci pipeline此错误显示“HTTP 客户端引发了未处理的异常:无效的 header 值 b'AWS4-HMAC-SHA256 凭证=*************************** ******************”在 gitlab ci 管道

I am already create AWS varible in gitlab ci and created s3 bucket in aws console.我已经在 gitlab ci 中创建了 AWS 变量,并在 aws 控制台中创建了 s3 存储桶。 my gitlab ci config is我的 gitlab ci 配置是

upload to s3: image: name: banst/awscli entrypoint: [""] script: - aws configure set region us-east-1 - aws s3 ls上传到 s3:图片:名称:banst/awscli 入口点:[""] 脚本:-aws configure set region us-east-1 - aws s3 ls

please answer me!请回答我!

How are you doing?你好吗?

Next I will present the step by step to list the buckets through gitlab-ci.接下来我将逐步介绍通过gitlab-ci列出buckets。

1- Create a repository in gitlab. 1-在 gitlab 中创建一个存储库。

2- In your GitLab project, go to Settings > CI/CD . 2-在您的 GitLab 项目中,go 到Settings > CI/CD Set the following CI/CD variables : AWS_ACCESS_KEY_ID: Your Access key ID.设置以下CI/CD 变量AWS_ACCESS_KEY_ID:您的访问密钥 ID。

AWS_SECRET_ACCESS_KEY: Your secret access key. AWS_SECRET_ACCESS_KEY:您的秘密访问密钥。

AWS_DEFAULT_REGION: Your region code. AWS_DEFAULT_REGION:您的区域代码。 Variables of Aws' credentials Aws 凭据的变量

3- Create a file called .gitlab-ci.yml in your repository. 3-在您的存储库中创建一个名为.gitlab-ci.yml的文件。 I left attached an example of the pipeline with listing and creating buckets in S3.我留下了一个在 S3 中列出和创建存储桶的管道示例。 Aws has as a rule that the name of the bucket is unique in all accounts, so be creative or specific in the name. Aws 的规则是存储桶的名称在所有帐户中都是唯一的,因此名称要有创意或具体。 File of gitlab.ci - Pipeline S3文件 gitlab.ci - 管道 S3

4- When you commit to the repository, it will open a pipeline. 4-当您提交到存储库时,它将打开一个管道。 I left the steps manually , so I need to press to perform the step.手动离开了步骤,所以我需要按 来执行该步骤。 Steps of the Pipeline流水线的步骤

I hope I have helped, if you have any questions I am at your disposal.我希望我有所帮助,如果您有任何问题,我随时为您服务。

 - build_s3 - create_s3 create-s3: stage: create_s3 image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest when: manual script: - aws s3api create-bucket --bucket my-bucket-stackoverflow-mms --region us-east-1 build-s3: stage: build_s3 image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest when: manual script: - aws s3 ls

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

相关问题 我们可以使用 GitLab 作为 AWS CDK 管道源代码的主机吗? - Can we use GitLab as host for source code with AWS CDK pipeline? Gitlab 管道:在触发路径中使用变量 - Gitlab pipeline: use variable in trigger path 在 CDK ShellStep(管道)步骤中使用 AWS CLI - Use the AWS CLI in a CDK ShellStep (pipeline) step 在 Gitlab CI 管道中的每个环境中使用不同的 Azure 订阅 ID - Use different Azure Subscription ID per environment in a Gitlab CI pipeline 如何在 .gitlab-ci.yml 中使用 AWS CLI 和 kubectl - How to use AWS CLI and kubectl in .gitlab-ci.yml 更新 gitlab ci 以使用最新的 docker 和最新的 aws cli - Update gitlab ci to use latest docker and latest aws cli Gitlab CI管道解压问题 - Unzip problems in Gitlab CI pipeline 如何使用 impersonate_service_account 进行流式光束管道 - How to use impersonate_service_account for streaming beam pipeline 将 AWS Data Pipeline 导出为 CloudFormation 模板以在 Terraform 中使用它 - Exporting AWS Data Pipeline as CloudFormation template to use it in Terraform AWS Database Migration Service 中如何使用 MapBooleanAsBoolean? - How to use MapBooleanAsBoolean in AWS Database Migration Service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM