I set the AuthorizationType to AWS_IAM as follows:
resources:
Resources:
ApiGatewayMethodUsersMePost:
Properties:
AuthorizationType: AWS_IAM
This works well in 1.0.0-RC2. AWS_IAM shows up in the Amazon console. When I use 1.0.0 the AuthorizationType stays “NONE”.
Did I miss something, or is this a bug?
In the template file in .serverless
is AWS_IAM set correctly or what is the Authorization type there?
Could you post the relevant serverless.yml and CF template parts so we can check those out.
This is my serverless.yml
service: userService
provider:
name: aws
runtime: nodejs4.3
region: eu-west-1
stage: test
functions:
createUpdate:
handler: handler.createUpdate
events:
- http:
path: users/me
method: post
- http:
path: users/me
method: put
resources:
Resources:
ApiGatewayMethodUsersMePost:
Properties:
AuthorizationType: AWS_IAM
ApiGatewayMethodUsersMePut:
Properties:
AuthorizationType: AWS_IAM
With RC2 this works “out-of-the-box”
I tried to reproduce the problem from scratch, starting totally clean, but now with 1.0.0.
But now I can not even get the userService to be deployed
It fails with error:
Template format error: [/Resources/ApiGatewayMethodUsersMePost]
Every Resources object must contain a Type member.
At this point the relevant CF template part is:
"ApiGatewayMethodUsersMePost": {
"Properties": {
"AuthorizationType": "AWS_IAM"
}
},
"ApiGatewayMethodUsersMePut": {
"Properties": {
"AuthorizationType": "AWS_IAM"
}
}
Earlier today I’ve seen that the Authorization type was “NONE” in the one of the CF files. But due to the error above I can not get to that point anymore.
When I try to add the type to the resources (in an attempt to solve the error)
Type: AWS::ApiGateway::Method
the stack also fails to create
I can confirm that this is fixed in 1.0.3
thanks a lot