Skip to content

Commit

Permalink
fix: allow param value to be string | object
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdFire87 committed Apr 2, 2020
1 parent c852499 commit 629eaaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class ServerlessSSMPublish {
{
Name: param.path,
Description: param.description || `Placed by ${this.serverless.service.getServiceName()} - serverless-ssm-plugin`,
Value: param.value,
Value: typeof param.value === 'string' ? param.value : JSON.stringify(param.value),
Overwrite: true,
Type: param.secure ? 'SecureString' : 'String',
},
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface SSMParamCloudFormation extends BaseSSMParam {
}

export interface SSMParamWithValue extends BaseSSMParam {
value: string;
value: string | object;
}

export type SSMParam = SSMParamWithValue | SSMParamCloudFormation;
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const compareParams = (localParams: SSMParamWithValue[], remoteParams: SS
acc.nonExistingParams.push(curr);
return acc;
}
if (existingParam.Value === curr.value) {
if (existingParam.Value === (typeof curr.value === 'string' ? curr.value : JSON.stringify(curr.value))) {
acc.existingUnchangedParams.push(curr);
return acc;
}
Expand Down

0 comments on commit 629eaaa

Please sign in to comment.