Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/core/src/helpers/S3Cache.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { GetBucketLifecycleConfigurationCommand } from '@aws-sdk/client-s3';
import { S3Client } from '@aws-sdk/client-s3';
import { Logger } from '@sre/helpers/Log.helper';
const console = Logger('S3Cache');
const lifeCycleRuleNotExistsErrorCode = 'NoSuchLifecycleConfiguration';

export function generateLifecycleRules() {
const rules = [];
Expand Down Expand Up @@ -121,7 +122,7 @@ export async function checkAndInstallLifecycleRules(bucketName: string, s3Client
console.log('Lifecycle configuration already exists');
}
} catch (error) {
if (error.code === 'NoSuchLifecycleConfiguration') {
if (error.code === lifeCycleRuleNotExistsErrorCode || error.name === lifeCycleRuleNotExistsErrorCode) {
console.log('No lifecycle configuration found. Creating new configuration...');

const lifecycleRules = generateLifecycleRules();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
GetSecretValueCommandOutput,
} from '@aws-sdk/client-secrets-manager';

const defaultPrefix = 'smythos';
const console = Logger('SecretsManager');

export type SecretsManagerConfig = {
Expand All @@ -29,7 +30,7 @@ export class SecretsManager extends VaultConnector {
constructor(protected _settings: SecretsManagerConfig) {
super(_settings);
//if (!SmythRuntime.Instance) throw new Error('SRE not initialized');
this.prefix = _settings.prefix || '';
this.prefix = _settings.prefix || defaultPrefix;
this.secretsManager = new SecretsManagerClient({
region: _settings.region,
...(_settings.awsAccessKeyId && _settings.awsSecretAccessKey
Expand Down