我对AWS和野兽比较陌生。在进行API网关到Lambda代理集成的工作后,我得到了Execution failed due to configuration error: Invalid permissions on Lambda function
我按照以下记录进行了设置,该记录确实有据可查terraform documentation
,并且正是我所需要的。但是在API Gateway控制台上进行测试时,出现上述错误。
resource "aws_lambda_permission" "apigw" {
statement_id = "AllowAPIGatewayInvoke"
action = "lambda:InvokeFunction"
function_name = "${aws_lambda_function.resource_name.arn}"
principal = "apigateway.amazonaws.com"
# The /*/* portion grants access from any method on any resource
# within the API Gateway "REST API".
source_arn = "${aws_api_gateway_deployment.resource_name_of_deployment.execution_arn}/*/*"
}
Run Code Online (Sandbox Code Playgroud) 我正在使用Terraform通过连接到DynamoDb API的API网关创建基础结构。我正在创建resource
aws_api_gateway_integration
定义与DynamoDb的集成,type
属性设置为AWS
。
但是以某种方式我无法获得uri
正确的分贝值。
文档说它应该是格式arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
。
当前配置为arn:aws:apigateway:us-east-1:dynamodb:GetItem
。
我不确定是什么service_api
。有人遇到过吗?请帮助。
我有groovy jenkins管道步骤,我想将循环值作为参数传递给循环中的多行sh
脚本.但参数没有通过.
或者如果有更好的方法在jenkins阶段添加步骤?
for (int i = 0; i < elements.size(); i++) {
sh '''
cd terraform/
terraform init
terraform workspace select ${elements[i]}-${envtype}
terraform plan -var-file="./configs/${elements[i]}/var.tf"
'''
}
Run Code Online (Sandbox Code Playgroud)