This is an AWS Lambda designed to resolve appsync requests to Parameter Store.
- ssm:GetParameter
- ssm:GetParameters
- ssm:GetParametersByPath
- ssm:PutParameter
function.handler
The event is passed in as a JSON object. Examples:
{ "operation": "getParameter", "arguments": { "name": "name" } } { "operation": "getParameters", "arguments": { "names": ["name1", "name2] } } { "operation": "getParametersByPath", "arguments": { "path": "path", "recursive": true | false } } { "operation": "putParameter", "arguments": { "name": "", "description": "", "value": "string", "secure": true | false, "overwrite": true|false }, "keyId": "" }
- operation - REQUIRED
- Can be one of
getParameter
,getParameters
,getParametersByPath
, orputParameter
. - getParameter
name: the name of the parameter to get - REQUIRED - getParameters
names: the names of the parameters to get - REQUIRED - getParametersByPath
path: the path to get parameters under - REQUIRED recursive: true
orfalse
- REQUIRED- putParameter
name: the name of the paramter to put - REQUIRED description: the description of the parameter - OPTIONAL value: the value of the parameter. If this contains a ,
then aStringList
will be used - REQUIREDsecure: true
orfalse
- OPTIONAL, defaults tofalse
overwrite: true
orfalse
- OPTIONAL, defaults totrue
keyId: the KMS Key ARN or ID to encrypt the parameter - OPTIONAL, defaults to the account key
Each of these requests can be batched via the BatchInvoke protocol from Appsync.
For getParameter
and putParameter
:
{ "name": "string", "value": "string", "lastModifiedDate": "iso8601 datetime", "version": int }
For getParameters
and getParametersByPath
:
[ { "name": "string", "value": "string", "lastModifiedDate": "iso8601 datetime", "version": int } ]
type Mutation { putParameter( name: String!, value: String!, description: String, secure: Boolean, overwrite: Boolean ): Parameter } type Parameter { name: String! value: String! lastModifiedDate: AWSDateTime! version: Int! } type Query { getParameter(name: String!): Parameter getParameters(names: [String]!): [Parameter] getParametersByPath(path: String!, recursive: Boolean!): [Parameter] } schema { query: Query mutation: Mutation }
License: APL2