对于使用无服务器的NodeJS应用程序,我有一个非常简单的设置。在比特桶管道中,除了通过serverless deploy的标准命令进行部署外,所有构建都可以找到,其中我得到了以下错误消息:
User: arn:aws:iam::123456789012:user/bitbucket-build-user未被授权执行: cloudformation:DescribeStackResources on resource: arn:aws:cloudformation:my-#en0#:123456789012:堆栈/mylambda-dev/*
在当地,它工作得很好。以下是管道配置:
image:
name: mydocker/serverless-docker:latest
username: $MY_DOCKER_HUB_USERNAME
password: $MY_DOCKER_HUB_PASSWORD
email: $MY_DOCKER_HUB_EMAIL
pipelines:
default:
- step:
script:
- npm install
- npm run lint
branches:
master:
- step:
script:
- npm install
- npm run lint
- serverless config credentials --overwrite --provider aws --key $MY_AWS_KEY --secret $MY_AWS_SECRET
- serverless deploy这里有什么东西我遗漏了吗?
发布于 2017-09-07 21:34:08
由于Serverless使用AWS CloudFormation进行完全部署(您对serverless deploy所做的部署),bitbucket构建用户必须拥有管理CloudFormation堆栈的特定权限。因此,在最低限度内,您将需要一个附加如下所示的策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudformation:Describe*",
"cloudformation:List*",
"cloudformation:Get*",
"cloudformation:PreviewStackUpdate",
"cloudformation:CreateStack",
"cloudformation:UpdateStack",
"cloudformation:DeleteStack"
],
"Resource": "*"
}
}看一看https://github.com/serverless/serverless/issues/1439,了解bitbucket构建用户可能需要什么样的权限。
就我个人而言,我只是使用https://github.com/dancrumb/generator-serverless-policy生成这些策略,而不是每次手动编写它们。
https://stackoverflow.com/questions/46101770
复制相似问题