sst / ion

SST v3
https://sst.dev
MIT License
2k stars 234 forks source link

(Aurora Postgres) component name and cluster_identifier name conflict #288

Open urosbelov opened 5 months ago

urosbelov commented 5 months ago

Hello to all, There is small conflict upon Aurora Postgres creation.

SST Ion component name must start with upercase while cluster_identifier name must be lowercase. If we override cluster_identifier name to lowercase, another error is showing that say:

The name of "cluster_identifier_lowercase_name" is not prefixed with parent's name.

urosbelov commented 5 months ago

FIX IS

app(input) { return { name: "appname", removal: input?.stage === "production" ? "retain" : "remove", home: "aws", }; },

"appname" cannot have underscore because it violates with creating another resources

fwang commented 5 months ago

Hi @urosbelov, the cluster identifier should be automatically converted to lower case already — https://github.com/sst/ion/blob/cc062a7eca4b698da8ea234cf6755c426f0d165c/pkg/platform/src/components/component.ts#L74-L75

Just to clarify, was the error caused by having uppercase letters in the component name? Or by having underscores _ in the app name?

urosbelov commented 4 months ago

Error was because of having underscores in the app name. It would be good if there is some validation on the app name , it took me a while to figure it out then.

jayair commented 4 months ago

I think we should have this now? Not sure if you've tried a newer version recently.