Skip to content
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

feat: custom resource #384

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: custom resource #384

wants to merge 1 commit into from

Conversation

sam-goodwin
Copy link
Owner

This is a draft experiment of implementing a custom resource primitive for CRUD lifecycle events implemented directly in eventual

Comment on lines +69 to +70
// This will need to be a ngrok URL when running locally
// And then the API Gateway URL when deployed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .env

export const serviceUrl = () => tryGetEnv<string>(ENV_NAMES.SERVICE_URL);

smsUrl: process.env.SERVER_URL,
});

export const sms = api.post("/sms", (request) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is triggering this webhook? Is twillio asking for the SMS contents?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twilio will call this when a message is received. It needs to return the response

Comment on lines +65 to +66
// PROBLEM: attributes.sid won't exist during infer/synth
// can use a Proxy to intercept these references, not sure if good idea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you'd need to load the data into an env variable and then pull the values out via a proxy. And then we'd either need to always inject every custom resource value into all functions or compute a dependency map.

Or you could do runtime lookups on demand to a SSM parameter, app config, or secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants