Skip to content

Commit

Permalink
fix(amplify-category-api): remove random words
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed Aug 10, 2024
1 parent 208b8ca commit fa59fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/amplify-e2e-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"url": "https://github.com/aws-amplify/amplify-category-api.git",
"directory": "packages/amplify-e2e-core"
},
"type": "module",
"author": "Amazon Web Services",
"license": "Apache-2.0",
"main": "lib/index.js",
Expand Down
8 changes: 5 additions & 3 deletions packages/amplify-e2e-core/src/utils/rds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
DBInstance,
DeleteDBInstanceCommand,
waitUntilDBInstanceAvailable,
CreateDBClusterCommandInput,
CreateDBClusterMessage,
waitUntilDBClusterAvailable,
DeleteDBClusterCommand,
Expand All @@ -28,7 +27,6 @@ import { KMSClient, CreateKeyCommand, ScheduleKeyDeletionCommand } from '@aws-sd
import { knex } from 'knex';
import axios from 'axios';
import { sleep } from './sleep';
import { generate as generateWord } from 'random-words';

const DEFAULT_DB_INSTANCE_TYPE = 'db.m5.large';
const DEFAULT_DB_STORAGE = 8;
Expand Down Expand Up @@ -432,7 +430,11 @@ const createInstanceIdentifier = (prefix: string): string => {
return `${prefix}instance`;
};

export const generateDBName = (): string => (generateWord() as string).toLowerCase();
export const generateDBName = (): string =>
generator
.generate({ length: 8 })
.toLowerCase()
.replace(/[^a-zA-Z0-9_]/g, '');

/**
* Adds the given inbound rule to the security group.
Expand Down

0 comments on commit fa59fd3

Please sign in to comment.