-
Notifications
You must be signed in to change notification settings - Fork 2
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
storing config in dynamodb table poc #12
base: master
Are you sure you want to change the base?
storing config in dynamodb table poc #12
Conversation
src/cli.js
Outdated
type: 'input', | ||
name: 'env', | ||
message: 'Environment: ', | ||
default: 'devevelop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. should be develop
setParameter, | ||
setParametersByService, | ||
getEnvironments, | ||
getServicesForEnvironment, | ||
getAllOrgParams | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to update README
file too - with the 2 new commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit is still pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated thanks.
tests/index.js
Outdated
should.exist(found) | ||
found.value.should.equal(getSharedConfigParams[i].value) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is same as the one before - to test if cached value returned, you would need to first retrieve the values, then update them - and then retrieve them again to verify that you are NOT getting the updated value... thus proving that it is indeed read from cache.
However, you don't have to write such a test right now. So you can remove this one.
Great work on this btw! |
https://github.com/opentorc/torc-serverless/issues/557
This PR is a POC for storing config parameters in Config table - related PR https://github.com/opentorc/platform-api/pull/1133 - added two methods to the cli to be able to test it.
Create Config table mentioned in the related PR
1.a Creat SSM variable
DYNAMODB_CONFIG_TABLE
undercommon
pathinstall
config-wrapper
package locallynpm i path../.../config-wrapper
create
sharedConfig.json
eg
with the cli create service parameters
config-wrapper putSharedConfigFromFile --infile sharedConfig.json --env develop --service resolvers
with the cli get service parameters
config-wrapper getSharedConfigByService --env develop --service resolvers
—-
NOTE: When
configWrapper.awsManager.getSharedConfigByService()
method is called in a lambda function. Lambda function should havedynamodb:Query
permission for the Config_Table including Config_Table/index/*