-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
region param required refactor to compose ssm client init this is a WIP - uploading to save progress, but not ready to use
- Loading branch information
1 parent
23bb8eb
commit da18ab7
Showing
5 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
lib/services/parameter-store/stores/ssm/make-delete-parameters.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const chunk = require('lodash/chunk'); | ||
|
||
const makeDeleteParameters = ({ ssm }) => ({ parameterNames }) => { | ||
const chunks = chunk(parameterNames, 10); | ||
const promises = chunks.map(chunkedParameterNames => | ||
ssm | ||
.deleteParameters({ | ||
Names: chunkedParameterNames | ||
}) | ||
.promise() | ||
); | ||
return Promise.all(promises); | ||
}; | ||
|
||
module.exports = { makeDeleteParameters }; |
10 changes: 10 additions & 0 deletions
10
lib/services/parameter-store/stores/ssm/make-ssm-client.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const AWS = require('aws-sdk'); | ||
|
||
const makeSsmClient = ({ region }) => { | ||
AWS.config.update({ region }); | ||
return new AWS.SSM(); | ||
}; | ||
|
||
module.exports = { | ||
makeSsmClient | ||
}; |