-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIGW not being deployed for endpoints #15
Comments
sls info
doesn't list endpoints
Actually I guess it doesn't make any APIGW resources at all...
No APIGateway resources are deployed |
Hey @revmischa, thanks for raising this. One of the aims of this project is to reduce extra magic in the On your other point around printing outputs, since the plugin doesn't have knowledge of these things, it can't print outputs; instead, it's recommended that you use stack outputs which are printed out by CDK by default. I've created a PR (#16) to update the README to address both of these and make it explicit, as well as to provide extra examples for those use cases |
Oh, that's disappointing. I still have to define the events because I want to test my endpoints with serverless-offline, and use httpApi authorizers and whatnot. |
Ah, that makes sense - I don't think I'll get a chance to dedicate much time to implementing that myself any time soon, but if it's required for interop with other plugins I'm more than happy to take a look at any PRs for it |
I'm looking at trying to do this manually for now, I assume it'd go something like this: import { api } from "serverless-aws-cdk"
import * as cdk from "@aws-cdk/core"
import { HttpApi, LambdaProxyIntegration, HttpMethod,PayloadFormatVersion } from "@aws-cdk/aws-apigatewayv2"
export class Api extends api.InfrastructureConstruct {
constructor(scope: cdk.Construct, id: string, props: api.InfrastructureProps) {
super(scope, id, props)
// there will probably be a nicer L2 way of doing this
const api = new HttpApi(this, "API", {
corsPreflight: { allowCredentials: true, allowOrigins: ["*"] },
createDefaultStage: true,
})
api.addRoutes({
path: "/test",
methods: [HttpMethod.GET],
integration: new LambdaProxyIntegration({
payloadFormatVersion: PayloadFormatVersion.VERSION_2_0,
handler: ????? // what goes here?
})
})
}
} I'd need to connect my existing sls function by passing something that conforms to an IFunction |
|
Thanks! |
Normal AWS provider outputs APIGW base URL and endpoint URLs. It's very helpful to have after doing a new deployment. Would be nice to have.
The text was updated successfully, but these errors were encountered: