Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed Apr 30, 2024
1 parent a0961d2 commit 11b5cad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 3 additions & 8 deletions packages/amplify-graphql-schema-generator/src/certs/cert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import * as path from 'path';
// This logic to get the SSL config must match with the SQL Lambda Layer.
// If you are changing this, please make sure to change the logic in the SQL Lambda Layer as well.
export const getSSLConfig = (
host: string
host: string,
): {
rejectUnauthorized: boolean;
ca?: string;
} => {
const AWS_RDS_HOSTS = ['rds.amazonaws.com'];
const isRDS = AWS_RDS_HOSTS.some((rdsHost) =>
host.toLowerCase().endsWith(rdsHost)
);
const isRDS = AWS_RDS_HOSTS.some((rdsHost) => host.toLowerCase().endsWith(rdsHost));
const sslConfig = {
rejectUnauthorized: true,
...(isRDS && { ca: getRDSCertificate() }),
Expand All @@ -25,9 +23,6 @@ const getRDSCertificate = (): string => {
// The certificate is publicly available and downloaded from https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem
// Proxies require
const RDS_CERT_FILE_NAME = 'aws-rds-global-bundle.pem';
const RDS_CERT_FILE_PATH = path.join(
__dirname,
RDS_CERT_FILE_NAME
);
const RDS_CERT_FILE_PATH = path.join(__dirname, RDS_CERT_FILE_NAME);
return fs.readFileSync(RDS_CERT_FILE_PATH, 'utf-8');
};
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export const establishDBConnection = (config: any): any => {
const getRDSCertificate = (): string => {
// This certificate file is copied from the parent folder `amplify-graphql-schema-generator/src/certs/aws-rds-global-bundle.pem`.
const RDS_CERT_FILE_NAME = 'aws-rds-global-bundle.pem';
const RDS_CERT_FILE_PATH = path.join(
__dirname,
RDS_CERT_FILE_NAME
);
const RDS_CERT_FILE_PATH = path.join(__dirname, RDS_CERT_FILE_NAME);
return fs.readFileSync(RDS_CERT_FILE_PATH, 'utf-8');
};

0 comments on commit 11b5cad

Please sign in to comment.