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
Appconfig middleware throws error when trying to fetch configuration of type "feature flag" #1009
Comments
Thanks for reporting! I think you might be the first to use this middleware, so sorry you're running into these issues. Would you like to put a PR together to resolve this? |
Sure I could try putting something together soon-ish but I'd need help with deciding what should be done with appconfig Fetching app config flow is.
According to docs
So options could be something like
Option 2 seems valid as AWS docs say:
Seems like option 2 stays consistent with middy design in other middlewares? but not really sure what design should be. |
One more thing that i'll point out is AWS provides Lambda extension that already handles polling for appconfig. Seems like it's doing same thing as this middleware would. |
Sorry on the delay, been a busy week. Because this is the only AWS SDK that has this polling feature that I know of let's go with option 2
and include in the docs that |
Alright. I'll try to put something together on a weekend |
Hey, just wanted to follow up on this. |
Yeah sorry for being quiet, been busy with preparation for bunch of presentations internally in company. I'd like to try to do this on weekend but im not sure if i'll manage to. If its not going happen on this weekend I don't want to keep this stalled forever |
…getConfiguration command
…getConfiguration command
…getConfiguration command
…getConfiguration command
…getConfiguration command
…getConfiguration command
…r-when-fetching-feature-flag-configuration fix(appconfig): #1009 rewrite to not use deprecated appconfig getConfiguration command
Thanks for all of your work on this. I'm published 5.0.0-alpha.0 with just your PR. |
The same issue with ssm middleware export const handler = middy(lambda)
.use(ssm({
fetchData: {
chatProxy: `/${process.env.ENVIRONMENT}/chat-proxy/api-key`,
},
setToContext: true,
})); throws an error {
"errorType": "Error",
"errorMessage": "Failed to resolve internal values",
"stack": [
"Error: Failed to resolve internal values",
" at getInternal (/var/task/index.js:54653:11)",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
" at async ssmMiddlewareBefore (/var/task/index.js:54867:20)",
" at async runMiddlewares (/var/task/index.js:54580:17)",
" at async runRequest (/var/task/index.js:54537:5)"
]
} |
Solved. |
Describe the bug
Not sure if this is a bug or a feature request but when trying to fetch Appconfig configuration of type "Feature flag" middleware throws
Failed to resolve internal value
error.To Reproduce
How to reproduce the behaviour:
Prepare configuration in appconfig of type feature flag
Sample code
Expected behaviour
Middleware should fetch configuration of type "feature flag" without throwing error
Environment (please complete the following information):
Additional context
I called
GetConfigurationCommand
used by appconfig middleware directly in index.js. Underlying error i got is:It seems that
GetConfigurationCommand
is deprecated andGetLatestConfiguration
from@aws-sdk/client-appconfig
should be used instead to retrive configs. API is bit different.https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appconfig/classes/getconfigurationcommand.html
https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-retrieving-the-configuration.html
The text was updated successfully, but these errors were encountered: