flaviostutz / cdk-practical-constructs

A collection of CDK constructs for making the development of AWS based applications easier and safer in a practical way
MIT License
5 stars 6 forks source link

feat: add stage name to the api gateway #14

Open MarcioMeier opened 6 months ago

MarcioMeier commented 6 months ago

Summary

Currently we are creating the api in the api-gateway with the prod stage, because it is the default value. But we should match the api stage with the props.stage then we're really creating an staged api.

The user can still override the stageName by passing it via construct's prop.

flaviostutz commented 6 months ago

note: I kept this way because we are not really using the "stage" of the api gw as we create a whole new api for each stage, so I kept it "prod" because it's the default behavior. But if you think this can make things more sane, let's merge this one!

In the future one might want to create multiple "stages" for a single API entity, but we didn't thought of this construct doing this and we should have to break its interface probably, so let's keep this for later if needed.

MarcioMeier commented 6 months ago

Yes, I think we should let it more sane. In this case, it uses the api stage to build the URL, so it is nice that to keep the same stage as provide to the stack for the api gateway/url.

In a scenario that we will create multiple stages, it should be less impactful if we already are using the stage name as the stack stage