modern-diamond-82589
08/28/2018, 8:45 PMaws.apigateway.Method
. If I pass in authorization: 'NONE'
to the constructor, everything works fine. If I pass authorization: 'COGNITO_USER_POOLS'
and authorizerId: authorizer.id
(where authorizer is a successfully created aws.apigateway.Authorizer
), then I receive this error: "NotFoundException: Invalid parameter name specified".aws.apigateway.MethodArgs
properties are named identically to AWS SDK equivalents, but it looks like pulumi's authorizer
maps to AWS SDK's authorizerType
.authorizationType
from 'NONE'
to 'COGNITO_USER_POOLS'
and the presence of authorizerId: 'xxx123'
. This leads me to think that I am assigning the necessary properties to the aws.apigateway.MethodArgs
.big-piano-35669
modern-diamond-82589
08/29/2018, 12:43 PMwhite-balloon-205
import * as aws from "@pulumi/aws";
const pool = new aws.cognito.UserPool("pool");
const api = new aws.apigateway.RestApi("api");
const auth = new aws.apigateway.Authorizer("auth", {
type: "COGNITO_USER_POOLS",
restApi: api,
providerArns: [pool.arn],
});
const res = new aws.apigateway.Resource("res", {
restApi: api,
parentId: api.rootResourceId,
pathPart: "{proxy+}",
});
const method = new aws.apigateway.Method("meth", {
restApi: api,
resourceId: res.id,
httpMethod: "ANY",
authorization: "COGNITO_USER_POOLS",
authorizerId: auth.id,
});
modern-diamond-82589
08/29/2018, 4:27 PMPOST /foo
), it works fine. But If I try to add an authorizer to a Method of a parameterized path (like GET /foo/{bar}
), it fails with the aforementioned "NotFoundException: Invalid parameter name specified". So the error message is pertaining to the path parameter, not the authorization/authorizationType
property I previously suspected, which means I'm dealing with API Gateway configuration issues, not a pulumi problem per se. I am perplexed, though, as I'm defining path parameters as I believe I should by setting Method.requestParameters: {"method.request.path.bar":true}
and Integration.requestParameters: {"integration.request.path.bar":"method.request.path.bar"}
. I'm also experiencing the issue without an authorizer if I try to define a method with multiple path parameters (like GET /foo/{bar}/baz/{qux}
). Although this is no longer your problem, if you have any insight I'd be grateful.white-balloon-205
aws.serverless.API
to make the common cases of using this manageable. Sounds like you are building things that are outside the current support that higher-level library provides - but once you have things working here, it would be interesting to think about what we could add in that helper library to make what you are doing easier for users who have similar needs in the future.modern-diamond-82589
08/30/2018, 7:57 PM