gpt4 book ai didi

amazon-web-services - AWS CodeBuild Webhook - CloudFormation

转载 作者:行者123 更新时间:2023-12-03 07:28:43 42 4
gpt4 key购买 nike

我知道我们可以从 AWS Web Console 启用 Webhook,但是我们可以从 yml 中的 cloudformation 模板启用 CodeBuild Webhook 吗?

codebuild.yml

Resources:

CodeBuildProject:
Type: AWS::CodeBuild::Project
DependsOn:
- CodeBuildSourceCredential
.
.
Properties:
Source:
Type: GITHUB
Location: https://github.com/path/project.git
BuildSpec: buildspec.yml
.
.

Triggers:
Webhook: true
FilterGroups:
- - Type: EVENT
Pattern: PUSH

CodeBuildSourceCredential:
Type: 'AWS::CodeBuild::SourceCredential'
Properties:
Token: '<TokenString>'
ServerType: GITHUB
AuthType: PERSONAL_ACCESS_TOKEN

我尝试创建此堆栈,但似乎不起作用,堆栈因此错误而失败

Failed to call CreateWebhook, reason: Unable to create webhook at this time. Please try again later. (Service: AWSCodeBuild; Status Code: 400; Error Code: OAuthProviderException; Request ID: xxxxxx-5ddf-xxxx-88a1-xxxxxx; Proxy: null)

最佳答案

CloudFormation 模板片段示例如下:

Resources:
Project:
Type: AWS::CodeBuild::Project
Properties:
Name: CFN-Project
# Other properties ............................................
Source:
Location: https://github.com/shariqmus/private-repo.git
Type: GITHUB
Auth:
Type: OAUTH
Resource: !Ref GitHubToken # Personal Access Token
SourceVersion: master # Branch name
Triggers:
Webhook: true
FilterGroups:
- - Type: EVENT
Pattern: PUSH
ExcludeMatchedPattern: false
- Type: HEAD_REF
Pattern: refs/heads/master # 'master' is Branch name
ExcludeMatchedPattern: false

关于amazon-web-services - AWS CodeBuild Webhook - CloudFormation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63143638/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com