Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit e5e635f

Browse files
maxtacujxpearce-godaddy
authored andcommitted
fix(secret): fix SSM parameter store code
1 parent 93f01a4 commit e5e635f

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ Add your secret data to your backend. For example, AWS Secrets Manager:
9393
aws secretsmanager create-secret --name hello-service/password --secret-string "1234"
9494
```
9595

96+
AWS Parameter Store:
97+
98+
```
99+
aws ssm put-parameter --name "/hello-service/password" --type "String" --value "1234"
100+
```
101+
96102
and then create a `hello-service-external-secret.yml` file:
97103

98104
```yml
@@ -106,6 +112,18 @@ secretDescriptor:
106112
- key: hello-service/password
107113
name: password
108114
```
115+
or
116+
```yml
117+
apiVersion: 'kubernetes-client.io/v1'
118+
kind: ExternalSecret
119+
metadata:
120+
name: hello-service
121+
secretDescriptor:
122+
backendType: systemManager
123+
data:
124+
- key: /hello-service/password
125+
name: password
126+
```
109127
110128
Save the file and run:
111129
File renamed without changes.

examples/ssm-example.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: 'kubernetes-client.io/v1'
2+
kind: ExternalSecret
3+
metadata:
4+
name: ssm-secret-key
5+
secretDescriptor:
6+
backendType: systemManager
7+
data:
8+
- key: /path/variable-name
9+
name: variable-name

lib/backends/system-manager-backend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SystemManagerBackend extends KVBackend {
2626
WithDecryption: true
2727
})
2828
.promise()
29-
return data.Value
29+
return data.Parameter.Value
3030
}
3131
}
3232

lib/backends/system-manager-backend.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ describe('SystemManagerBackend', () => {
2929

3030
it('returns secret property value', async () => {
3131
getParameterPromise.promise.resolves({
32-
Value: 'fakeSecretPropertyValue'
32+
Parameter: {
33+
Value: 'fakeSecretPropertyValue'
34+
}
3335
})
3436

3537
const secretPropertyValue = await systemManagerBackend._get({

0 commit comments

Comments
 (0)