Hi folks, I am creating an AWS api gateway for a l...
# getting-started
b
Hi folks, I am creating an AWS api gateway for a lambda function using code similar to pasted below, while defining the route I want to enable AWS IAM auth for the method how can I do that? I see an option of specifying it if I create a new resource & method but here I don't want to create any additional resource just enable auth on the one create by default
Copy code
const api = new apigateway.RestAPI("api", {
  routes: [
    {
      path: "/",
      method: "GET",
      eventHandler: helloHandler,
    },
  ],
});
Or do I need to create the resources, method etc separately and create an integration object to combine them
Got it
iamAuthEnabled
is the key, got confused between
apigateway.RestAPI
&
apigateway.RestApi