Hi everyone, I have a quick question regarding API...
# general
h
Hi everyone, I have a quick question regarding API Gateway. Is there a way I can create a REGIONAL Api Gateway endpoint type with awsx? The code below defaults to EDGE
Copy code
new awsx.classic.apigateway.API(
            "balance-api",
            {
                stageName: this.stage,

                routes: [
                    {
                        path: "/v1/balance",
                        method: "GET",
                        eventHandler: getBalanceLambda,
                    },
                ],
            },
        )
l
Hey @hundreds-airport-72212, I believe this is possible though I haven't tested it out. Here was my logic: 1. Went to Pulumi nodeJS reference page for the resource you are creating. 2. Saw that it takes APIArgs as part of its constructor 3. Part of APIArgs is a property called restAPIArgs, which are additional args that can be passed along to the
aws.apigateway.RestApi
that is created by the
awsx.apigateway.API
4. Looking at the documentation for aws.apigateway.RestApi, there is a types property which defaults to EDGE but can be set to REGIONAL or PRIVATE. 5. Here is where you would go about setting your desired configuration Just for context the goal of AWS crosswalk (awsx) is to simplify some of the detail that users have to worry about when deploying resources but if you find that you need fine grain level of control over the properties of many of the resources you're creating then recommendation is to use the AWS Classic provider.
🙌 1
h
Hey @lemon-scooter-94063 Thank you so much for your guidance, this worked. I'm not sure how I missed this
Copy code
new awsx.classic.apigateway.API("balance-service-api", {
            stageName: this.stage,
            restApiArgs: {
                name: `${this.stage}-balance-service-api`,
                endpointConfiguration: {
                    types: "REGIONAL",
                },
            },
            routes: [...]
})
🙌 1