Kum*_*vek 3 amazon-s3 amazon-web-services aws-cloudformation aws-codepipeline aws-codebuild
一直在尝试按照此处的教程设置 AWS 管道:https : //docs.aws.amazon.com/lambda/latest/dg/build-pipeline.html
以下是一些我已经尝试过的操作:
下面是我的 buildspec.yml
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
build:
commands:
- npm install
- export BUCKET=xx-test
- aws cloudformation package --template-file template.yaml --s3-bucket $BUCKET --output-template-file outputtemplate.yml
artifacts:
type: zip
files:
- template.yml
- outputtemplate.yml
Run Code Online (Sandbox Code Playgroud)
下面是我的 template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
helloWorld
DZ Bank API Gateway connectivity helloWorld
Globals:
Function:
Timeout: 3
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./
Handler: app.lambdaHandler
Runtime: nodejs12.x
Events:
HelloWorld:
Type: Api
Properties:
Path: /hello
Method: get
Run Code Online (Sandbox Code Playgroud)
该错误实际上与 CodeBuild 而非 CodePipeline 有关。CodeBuild 似乎对其附加的服务角色没有有效的权限。
在控制台中,您可以通过执行以下操作找到附加的服务角色:
如果此 IAM 角色尚未存在,则需要为其授予所需的权限(在您的情况下为“s3:PutObject”)。
AWS 在创建 CodeBuild 服务角色文档中提供了完整策略。
| 归档时间: |
|
| 查看次数: |
407 次 |
| 最近记录: |