Skip to content

Commit

Permalink
fix(cdk): roll back jsonValue
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jun 9, 2024
1 parent ce38680 commit b9ad00d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/cdk/src/methods/secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import { DotStack } from '../constructs/Stack';

interface AddSecretOptions {
consumers?: IGrantable[];
/** WARNING: It's advised not to use this unless the use case specifically calls for creating the secret value programattically */
jsonValue?: Record<string, SecretValue>;
name: string;
scope: DotStack;
secretName: string;
/** WARNING: It's advised not to use this unless the use case specifically calls for creating the secret value programattically */
value?: SecretValue;
value?: string;
}

interface GrantRemoteOptions {
Expand All @@ -25,14 +23,12 @@ interface GrantRemoteOptions {
type SecretArn = string;

export const addSecret = (options: AddSecretOptions) => {
const { consumers = [], jsonValue, name, scope, secretName, value } = options;
const { consumers = [], name, scope, secretName, value } = options;
const baseName = DotStack.baseName(name, 'secret');
const logicalName = `${scope.appName}-${baseName}`;
const secretObjectValue = jsonValue;
const secretStringValue = value;
const secretStringValue = value ? SecretValue.unsafePlainText(value) : void 0;
const secret = new Secret(scope, logicalName, {
secretName,
secretObjectValue,
secretStringValue
});

Expand Down

0 comments on commit b9ad00d

Please sign in to comment.