ranisputnik / dotssm Goto Github PK
View Code? Open in Web Editor NEWDot-env but for SSM
License: MIT License
Dot-env but for SSM
License: MIT License
While our primary use case is gathering all of an applications config all at once, it is certainly useful to do a simpler fetch by name. We should consider supporting the individual parameter use case also.
For testing purposes it might be useful to be able to create getConfig
stubs without having to create a local file in the filesystem. My thoughts for how that API works are something like the following:
import { withStub } from 'dot-ssm'
const getConfig = withStub({ some: { namespace: { name: 'Hello, tests' }}})
const config = await getConfig('/some/namespace')
console.log(config) // { "/name": "Hello, tests" }
The value passed to the withStub
method has the exact same constraints of the .ssm.json
file and functions in exactly the same way (except it is not loaded from the filesystem).
Currently the Terraform state for acceptance tests lives on my machine and is ignored. It would be better to have a remote state solution so we could apply acceptance test infrastructure in CI before running the acceptance tests.
While this could easily be done with Terraform I've wanted to experiment with Pulumi for a while, plus it would be nice to have the whole repo written in Typescript.
Note: GitHub Package Registry only supports scoped NPM packages. Scoped packages have names with the format of @owner/name. Scoped packages always begin with an @ symbol. You may need to update the name in your package.json to use the scoped name. For example, "name": "@codertocat/hello-world-npm".
Currently this package is not scoped. To publish to Github either it needs to be, or we should remove this step from the release workflow (I think removing it for now is the better option).
It seems like the maximum number of results that the getParametersByPath
SSM function can return is 10. Setting "MaxResults" to anything higher results in the following:
ValidationException: 1 validation error detected: Value '100000' at 'maxResults'
failed to satisfy constraint: Member must have value less than or equal to 10
We should check for a NextToken
in the response and continue pulling results until no NextToken
is present.
Currently we assume that groups of parameters in SSM share a common prefix, eg:
/mydomain/someapp/foo
/mydomain/someapp/bar
/mydomain/otherapp/greeting
One other baked in assumption is that a "namespace" for a given group is delineated using the /
character. I don't see any reason why we couldn't also support other naming strategies eg:
mydomain.someapp.foo
mydomain.someapp.bar
mydomain.otherapp.greeting
Currently that assumption is used to make creating the .ssm.json
file nice and simple. We assume a slash separator whenever we see a nested object, eg:
{
"foo": {
"bar": "Something"
}
}
Becomes /foo/bar
in SSM.
If we instead made the .ssm.json
file format "dumber" and made it simply:
{
"/foo/bar": "Something",
"/foo/baz": "Something else"
}
Then we can remove all of this magic.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.