Skip to content

Commit 196996b

Browse files
CCM-8861: Fixes to environment variables and logging
1 parent 0009891 commit 196996b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

infrastructure/terraform/modules/backend-api/module_lambda_sftp_poll.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ module "lambda_sftp_poll" {
1212
execution_role_policy_document = data.aws_iam_policy_document.sftp_poll.json
1313

1414
environment_variables = {
15-
CREDENTIALS_TTL_MS = 900 * 1000
16-
CSI = local.csi
17-
QUARANTINE_BUCKET_NAME = module.s3bucket_quarantine.id
18-
NODE_OPTIONS = "--enable-source-maps",
19-
REGION = var.region
20-
SFTP_ENVIRONMENT = local.sftp_environment
15+
CREDENTIALS_TTL_SECONDS = 900
16+
CSI = local.csi
17+
QUARANTINE_BUCKET_NAME = module.s3bucket_quarantine.id
18+
NODE_OPTIONS = "--enable-source-maps",
19+
REGION = var.region
20+
SFTP_ENVIRONMENT = local.sftp_environment
2121
}
2222

2323
timeout = 20

lambdas/sftp-letters/src/app/poll.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export class App {
1818
copyPath: string,
1919
pastePath: string
2020
) {
21+
this.logger.info({
22+
description: 'Copying folder',
23+
copyPath,
24+
pastePath,
25+
});
2126
const isDir = (await sftpClient.exists(copyPath)) === 'd';
2227

2328
if (!isDir) {
@@ -29,11 +34,6 @@ export class App {
2934

3035
for (const sftpFile of sftpFiles) {
3136
if (sftpFile.type === 'd') {
32-
this.logger.info({
33-
description: 'Copying folder',
34-
copyPath,
35-
pastePath,
36-
});
3737
await this.copyFolder(
3838
sftpClient,
3939
`${copyPath}/${sftpFile.name}`,
@@ -42,7 +42,6 @@ export class App {
4242
}
4343

4444
if (sftpFile.type === '-') {
45-
this.logger.info({ description: 'Copying file', copyPath, pastePath });
4645
await this.copyFile(
4746
sftpClient,
4847
`${copyPath}/${sftpFile.name}`,
@@ -70,6 +69,7 @@ export class App {
7069
copyPath: string,
7170
pastePath: string
7271
) {
72+
this.logger.info({ description: 'Copying file', copyPath, pastePath });
7373
try {
7474
const data = (await sftpClient.get(copyPath)) as Buffer;
7575

0 commit comments

Comments
 (0)