@ossy/deployment-tools 0.0.29 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "Collection of scripts and tools to aid deployment of containers and static files",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -16,6 +16,7 @@
16
16
  "@actions/core": "^1.10.0",
17
17
  "@aws-sdk/client-sqs": "^3.186.0",
18
18
  "@aws-sdk/client-sts": "^3.188.0",
19
+ "@aws-sdk/types": "^3.193.0",
19
20
  "arg": "^5.0.2",
20
21
  "express": "^4.18.1",
21
22
  "nanoid": "^4.0.0",
@@ -1,24 +1,25 @@
1
1
  import * as core from '@actions/core'
2
- import { STSClient, AssumeRoleWithWebIdentityCommand, Credentials } from '@aws-sdk/client-sts'
2
+ import { STSClient, AssumeRoleWithWebIdentityCommand } from '@aws-sdk/client-sts'
3
3
  import { DeploymentPlatform } from 'types'
4
- import { log } from 'log'
4
+ import { logDebug, logInfo, logError } from 'log'
5
+ import { Credentials } from '@aws-sdk/types'
5
6
 
6
7
  export class AwsCredentialsClient {
7
8
 
8
- static resolveAwsCredentials({ awsAccountId, awsRegion, awsRoleToAssume }: DeploymentPlatform) {
9
+ static resolveAwsCredentials({ awsAccountId, awsRegion, awsRoleToAssume }: DeploymentPlatform): Promise<Credentials | undefined> {
9
10
  // If awsRoleToAssume is present, then we assume we run in a github workflow
10
11
  // If awsRoleToAssume is not present, then we assume they are resolved localy by aws-sdk
11
12
  if (!awsRoleToAssume) {
12
- log({ type: 'info', message: `[AwsCredentialsClient] No aws role to assume was found, leaving auth logic to @aws-sdk package` })
13
+ logInfo({ message: `[AwsCredentialsClient] No aws role to assume was found, leaving auth logic to @aws-sdk package` })
13
14
  return Promise.resolve(undefined)
14
15
  }
15
16
 
16
17
  const stsClient = new STSClient({ region: awsRegion })
17
18
 
18
- log({ type: 'info', message: '[AwsCredentialsClient] Fetching GitHub ID token' })
19
+ logInfo({ message: '[AwsCredentialsClient] Fetching GitHub ID token' })
19
20
  return core.getIDToken('sts.amazonaws.com')
20
21
  .then(webIdentityToken => {
21
- log({ type: 'info', message: `[AwsCredentialsClient] Attempting to resolve aws credentials by assuming the role: ${awsRoleToAssume}` })
22
+ logInfo({ message: `[AwsCredentialsClient] Attempting to resolve aws credentials by assuming the role: ${awsRoleToAssume}` })
22
23
  return stsClient.send(new AssumeRoleWithWebIdentityCommand({
23
24
  RoleArn: `arn:aws:iam::${awsAccountId}:role/${awsRoleToAssume}`,
24
25
  RoleSessionName: 'GitHubActions',
@@ -26,13 +27,18 @@ export class AwsCredentialsClient {
26
27
  WebIdentityToken: webIdentityToken
27
28
  }))
28
29
  })
29
- .then(responseData => ({
30
- AccessKeyId: responseData.Credentials.AccessKeyId,
31
- SessionToken: responseData.Credentials.SessionToken,
32
- SecretAccessKey: responseData.Credentials.SecretAccessKey,
33
- }))
30
+ // .then(responseData => ({
31
+ // AccessKeyId: responseData.Credentials.AccessKeyId,
32
+ // SessionToken: responseData.Credentials.SessionToken,
33
+ // SecretAccessKey: responseData.Credentials.SecretAccessKey,
34
+ // }))
35
+ .then(responseData => responseData.Credentials)
36
+ .then(data => {
37
+ logDebug({ message: '[AwsCredentialsClient] AssumeRoleWithWebIdentityCommand responseData.Credentials', data })
38
+ return data
39
+ })
34
40
  .catch(error => {
35
- log({ type: 'error', message: '[AwsCredentialsClient] Could not resolve temporary credentials', error })
41
+ logError({ message: '[AwsCredentialsClient] Could not resolve temporary credentials', error })
36
42
  return undefined
37
43
  })
38
44
  }
@@ -1,5 +1,5 @@
1
1
  import fetch from 'node-fetch'
2
- import { log } from './log'
2
+ import { logInfo, logError } from './log'
3
3
  import { DeploymentPlatform, ContainerDeploymentRequest } from 'types'
4
4
 
5
5
  export const Matchers = {
@@ -24,10 +24,7 @@ export class CaddyClient {
24
24
 
25
25
  const url = `${deploymentRequest.subdomain}.${deploymentPlatform.activeEnvironment}.${deploymentPlatform.domain}`
26
26
 
27
- log({
28
- type: 'info',
29
- message: `[CaddyClient] Updating caddy config to route ${url} to localhost:${deploymentRequest.hostPort}`
30
- })
27
+ logInfo({ message: `[CaddyClient] Updating caddy config to route ${url} to localhost:${deploymentRequest.hostPort}` })
31
28
 
32
29
  return fetch(`http://localhost:2019/config/apps/http/servers/${deploymentPlatform.ciServerName}/routes/0/handle`, {
33
30
  method: 'POST',
@@ -39,11 +36,11 @@ export class CaddyClient {
39
36
  }
40
37
  ]))
41
38
  })
42
- .catch(error => log({ type: 'error', message: `[CaddyClient] Could not update caddy config to include ${url}`, error }))
39
+ .catch(error => logError({ message: `[CaddyClient] Could not update caddy config to include ${url}`, error }))
43
40
  }
44
41
 
45
42
  static applyDefaultServerConfig(deploymentPlatform: DeploymentPlatform) {
46
- log({ type: 'info', message: '[CaddyClient] Applying default caddy config' })
43
+ logInfo({ message: '[CaddyClient] Applying default caddy config' })
47
44
  return fetch('http://localhost:2019/load', {
48
45
  method: 'POST',
49
46
  headers: { 'Content-Type': 'application/json' },
@@ -105,7 +102,7 @@ export class CaddyClient {
105
102
  }
106
103
  })
107
104
  })
108
- .catch(error => log({ type: 'error', message: '[CaddyClient] Could not apply default caddy config', error }))
105
+ .catch(error => logError({ message: '[CaddyClient] Could not apply default caddy config', error }))
109
106
  }
110
107
 
111
108
  }
@@ -1,6 +1,6 @@
1
1
  import express from 'express'
2
2
  import { DeploymentPlatform } from 'types'
3
- import { log } from './log'
3
+ import { logInfo } from './log'
4
4
 
5
5
  export class CiRestApi {
6
6
 
@@ -18,7 +18,7 @@ export class CiRestApi {
18
18
  })
19
19
 
20
20
  server.listen(deploymentPlatform.ciInternalServerPort, () => {
21
- log({ type: 'info', message: `[ContainerManagerServer] API is live on port ${deploymentPlatform.ciInternalServerPort}`})
21
+ logInfo({ message: `[ContainerManagerServer] API is live on port ${deploymentPlatform.ciInternalServerPort}`})
22
22
  })
23
23
  }
24
24
 
@@ -1,9 +1,9 @@
1
1
  import arg from 'arg'
2
- import { log } from '../log'
2
+ import { logInfo } from '../log'
3
3
  import { DeploymentPlatformClient } from 'deployment-platform-client'
4
4
 
5
5
  export const deployHandler = cliArgs => {
6
- log({ type: 'info', message: 'Running deploy command' })
6
+ logInfo({ message: 'Running deploy command' })
7
7
 
8
8
  const parsedArgs = arg({
9
9
  '--username': String,
@@ -1,4 +1,4 @@
1
- import { log } from '../log'
1
+ import { logError } from '../log'
2
2
  import { startHandler } from './start-handler'
3
3
  import { stopHandler } from './stop-handler'
4
4
  import { statusHandler } from './status-handler'
@@ -6,7 +6,7 @@ import { deployHandler } from './deploy-handler'
6
6
 
7
7
  export const runCliCommand = ({ name, args }) => {
8
8
 
9
- if (!name) return log({ type: 'error', message: 'No command provided' })
9
+ if (!name) return logError({ message: 'No command provided' })
10
10
 
11
11
  const commandHandler = {
12
12
  start: startHandler,
@@ -16,7 +16,7 @@ export const runCliCommand = ({ name, args }) => {
16
16
  }[name]
17
17
 
18
18
  if (!commandHandler) {
19
- return log({ type: 'error', message: 'Command not implemented, did you spell it correctly?' })
19
+ return logError({ message: 'Command not implemented, did you spell it correctly?' })
20
20
  }
21
21
 
22
22
  commandHandler(args)
@@ -1,10 +1,10 @@
1
1
  import arg from 'arg'
2
2
  import { platform } from 'os'
3
- import { log } from '../log'
3
+ import { logInfo, logError } from '../log'
4
4
  import { DeploymentPlatformClient } from 'deployment-platform-client'
5
5
 
6
6
  export const startHandler = cliArgs => {
7
- log({ type: 'info', message: 'Running start command' })
7
+ logInfo({ message: 'Running start command' })
8
8
 
9
9
  const Platforms = {
10
10
  windows: 'win32',
@@ -12,7 +12,7 @@ export const startHandler = cliArgs => {
12
12
  }
13
13
 
14
14
  if ([Platforms.windows].includes(platform())) {
15
- return log({ type: 'error', message: 'Deployment tools do not support this os' })
15
+ return logError({ message: 'Deployment tools do not support this os' })
16
16
  }
17
17
 
18
18
  const parsedArgs = arg({
@@ -1,7 +1,7 @@
1
1
  import { exec } from 'child_process'
2
- import { log } from '../log'
2
+ import { logInfo } from '../log'
3
3
 
4
4
  export const statusHandler = () => {
5
- log({ type: 'info', message: 'Running status command' })
5
+ logInfo({ message: 'Running status command' })
6
6
  exec('systemctl status deployment-tools.service')
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { exec } from 'child_process'
2
- import { log } from '../log'
2
+ import { logInfo } from '../log'
3
3
 
4
4
  export const stopHandler = () => {
5
- log({ type: 'info', message: 'Running stop command' })
5
+ logInfo({ message: 'Running stop command' })
6
6
  exec('systemctl stop deployment-tools.service')
7
7
  }
@@ -6,13 +6,14 @@ import {
6
6
  ContainerDeploymentRequest,
7
7
  DeploymentTemplate,
8
8
  ContainerDeploymentTemplate,
9
- SupportedDeploymentTypes
9
+ SupportedDeploymentTypes,
10
+ SupportedRegions
10
11
  } from 'types'
11
12
  import { CaddyClient } from './caddy-client'
12
13
  import { DockerClient } from './docker-client'
13
14
  import { DeploymentQueueClient } from './deployment-queue-client'
14
15
  import { CiRestApi } from './ci-rest-api'
15
- import { log } from 'log'
16
+ import { logInfo, logError } from 'log'
16
17
 
17
18
  export class DeploymentPlatformClient {
18
19
 
@@ -20,7 +21,7 @@ export class DeploymentPlatformClient {
20
21
  DeploymentPlatformClient.getDeploymentPlatforms(pathToDeploymentPlatforms).then(([firstPlatformFound]) => {
21
22
 
22
23
  if (!firstPlatformFound) {
23
- log({ type: 'error', message: '[DeploymentPlatformClient] Could not find a deployment platform' })
24
+ logError({ message: '[DeploymentPlatformClient] Could not find a deployment platform' })
24
25
  return Promise.reject()
25
26
  }
26
27
 
@@ -37,7 +38,7 @@ export class DeploymentPlatformClient {
37
38
  )
38
39
 
39
40
  })
40
- .catch(error => log({ type: 'error', message: '[DeploymentPlatformClient] Could not start the deployment platform', error }))
41
+ .catch(error => logError({ message: '[DeploymentPlatformClient] Could not start the deployment platform', error }))
41
42
  }
42
43
 
43
44
  //eslint-disable-next-line max-params
@@ -55,22 +56,19 @@ export class DeploymentPlatformClient {
55
56
  .then(([platforms, deploymentTemplates]) => {
56
57
  deploymentTemplates.map(deploymentTemplate => {
57
58
 
58
- log({
59
- type: 'info',
60
- message: `[DeploymentPlatformClient]: Found deployment platforms [${platforms.map(x => x.platformName).join(', ')}]`
61
- })
59
+ logInfo({ message: `[DeploymentPlatformClient]: Found deployment platforms [${platforms.map(x => x.platformName).join(', ')}]` })
62
60
 
63
61
  const deploymentPlatform = platforms.find(platform => platform.platformName === deploymentTemplate.targetDeploymentPlatform)
64
62
 
65
63
  if (!deploymentPlatform) {
66
- log({ type: 'error', message: `[DeploymentPlatformClient] Could not find a deployment platform with the name ${deploymentTemplate.targetDeploymentPlatform}` })
64
+ logError({ message: `[DeploymentPlatformClient] Could not find a deployment platform with the name ${deploymentTemplate.targetDeploymentPlatform}` })
67
65
  return Promise.reject()
68
66
  }
69
67
 
70
68
  process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
71
69
 
72
70
  if (deploymentTemplate.type !== SupportedDeploymentTypes.Container) {
73
- log({ type: 'error', message: `[DeploymentPlatformClient] Unsupported deployment type of ${deploymentTemplate.type}` })
71
+ logError({ message: `[DeploymentPlatformClient] Unsupported deployment type of ${deploymentTemplate.type}` })
74
72
  return Promise.reject()
75
73
  }
76
74
 
@@ -85,7 +83,7 @@ export class DeploymentPlatformClient {
85
83
 
86
84
  })
87
85
  })
88
- .catch(error => log({ type: 'error', message: '[DeploymentPlatformClient] Could not send deployment request', error }))
86
+ .catch(error => logError({ message: '[DeploymentPlatformClient] Could not send deployment request', error }))
89
87
  }
90
88
 
91
89
  static getDeploymentTemplates(pathToOssyFile: string): Promise<DeploymentTemplate[]> {
@@ -125,7 +123,8 @@ export class DeploymentPlatformClient {
125
123
  ciInternalServerPort: 3000,
126
124
  ciServerName: 'ci-client',
127
125
  ciDockerNetworkName: 'deployment-tools',
128
- // awsRoleToAssume: 'github-ci-role',
126
+ awsRegion: SupportedRegions.North,
127
+ // awsRoleToAssume: 'github-ci-role', //todo: find a way to have this a a default value and still keep the same logic when resolving aws credentials
129
128
  ...deploymentPlatform
130
129
  }
131
130
  }
@@ -6,12 +6,12 @@ import {
6
6
  } from '@aws-sdk/client-sqs'
7
7
  import { DeploymentPlatform, ContainerDeploymentRequest } from 'types'
8
8
  import { AwsCredentialsClient } from 'aws-credentials-client'
9
- import { log } from 'log'
9
+ import { logInfo, logError } from 'log'
10
10
 
11
11
  export class DeploymentQueueClient {
12
12
 
13
13
  static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest) {
14
- log({ type: 'info', message: '[DeploymentQueueClient] Sending deployment request...' })
14
+ logInfo({ message: '[DeploymentQueueClient] Starting deployment sequence' })
15
15
  return DeploymentQueueClient.createAwsSqsClient(deploymentPlatform)
16
16
  .then(sqsClient => {
17
17
 
@@ -21,19 +21,14 @@ export class DeploymentQueueClient {
21
21
  })
22
22
 
23
23
  return sqsClient.send(command)
24
- .then(() => log({ type: 'info', message: '[DeploymentQueueClient] Deployment request sent' }))
25
- .catch(error => log({
26
- type: 'error',
27
- message: '[DeploymentQueueClient] Could not send deployment request',
28
- error
29
- }))
30
-
24
+ .then(() => logInfo({ message: '[DeploymentQueueClient] Deployment request sent' }))
25
+ .catch(error => logError({ message: '[DeploymentQueueClient] Could not send deployment request', error }))
31
26
  })
32
27
 
33
28
  }
34
29
 
35
30
  static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>) {
36
- log({ type: 'info', message: '[DeploymentQueueClient] Starting polling for deployment requests' })
31
+ logInfo({ message: '[DeploymentQueueClient] Starting polling for deployment requests' })
37
32
  DeploymentQueueClient.createAwsSqsClient(deploymentPlatform).then(sqsClient => {
38
33
  const FIVE_MINUTES = 3000
39
34
 
@@ -44,7 +39,7 @@ export class DeploymentQueueClient {
44
39
  sqsClient.send(receiveMessageCommand)
45
40
  .then(data => data.Messages.map(message => {
46
41
 
47
- log({ type: 'info', message: '[DeploymentQueueClient] Received deployment request' })
42
+ logInfo({ message: '[DeploymentQueueClient] Received deployment request' })
48
43
 
49
44
  handleDeploymentRequest(JSON.parse(message.Body))
50
45
  .then(() => {
@@ -55,12 +50,12 @@ export class DeploymentQueueClient {
55
50
  })
56
51
 
57
52
  sqsClient.send(deleteMessageCommand)
58
- .then(() => log({ type: 'info', message: '[DeploymentQueueClient] Removing deployment request from queue' }))
59
- .catch(error => log({ type: 'error', message: '[DeploymentQueueClient] Could not delete message from queue', error }))
53
+ .then(() => logInfo({ message: '[DeploymentQueueClient] Removing deployment request from queue' }))
54
+ .catch(error => logError({ message: '[DeploymentQueueClient] Could not delete message from queue', error }))
60
55
  })
61
56
 
62
57
  }))
63
- .catch(error => log({ type: 'error', message: '[ContainerManagerServer] Could not handle incoming deployment request', error }))
58
+ .catch(error => logError({ message: '[ContainerManagerServer] Could not handle incoming deployment request', error }))
64
59
  }, FIVE_MINUTES)
65
60
 
66
61
  })
@@ -3,7 +3,7 @@ import fs from 'fs'
3
3
  import { nanoid } from 'nanoid'
4
4
  import path from 'path'
5
5
  import { fileURLToPath } from 'url'
6
- import { log } from './log'
6
+ import { logInfo, logError } from './log'
7
7
  import { DeploymentPlatform, ContainerDeploymentRequest } from 'types'
8
8
 
9
9
  const __filename = fileURLToPath(import.meta.url)
@@ -12,13 +12,13 @@ const __dirname = path.dirname(__filename)
12
12
  export class DockerClient {
13
13
 
14
14
  static createDockerNetworkForContainerManagerServer(deploymentPlatform: DeploymentPlatform) {
15
- log({ type: 'info', message: '[DockerClient] Creating docker network for comunication between containers' })
15
+ logInfo({ message: '[DockerClient] Creating docker network for comunication between containers' })
16
16
  exec(`sudo docker network create ${deploymentPlatform.ciDockerNetworkName}`)
17
17
  }
18
18
 
19
19
  static stopContainer(deploymentRequest: ContainerDeploymentRequest) {
20
20
  const name = deploymentRequest.image.replaceAll('/', '_')
21
- log({ type: 'info', message: `Running docker stop for image with the name of ${name}` })
21
+ logInfo({ message: `Running docker stop for image with the name of ${name}` })
22
22
  return `sudo docker stop ${name} ||`
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ export class DockerClient {
26
26
  const name = image.replaceAll('/', '_')
27
27
  const imageUrl = !!registry ? `${registry}/${image}` : image
28
28
  const envsAsString = Object.entries(env || {}).reduce((envs, [name, value]) => `${envs} --env ${name}=${value}`, '')
29
- log({ type: 'info', message: `Running docker start for image with the name of ${name} with port mapping ${hostPort}:${containerPort} and source ${imageUrl}` })
29
+ logInfo({ message: `Running docker start for image with the name of ${name} with port mapping ${hostPort}:${containerPort} and source ${imageUrl}` })
30
30
  return `sudo docker run -d -p ${hostPort}:${containerPort} --name=${name} --network=${deploymentPlatform.ciDockerNetworkName} --network-alias=${name} --rm ${envsAsString} ${imageUrl}`
31
31
  }
32
32
 
@@ -34,17 +34,17 @@ export class DockerClient {
34
34
  const shouldAuthenticate = username || authentication
35
35
 
36
36
  if (!shouldAuthenticate) {
37
- log({ type: 'info', message: 'No docker credentials provided, assuming image is publicly hosted' })
37
+ logInfo({ message: 'No docker credentials provided, assuming image is publicly hosted' })
38
38
  return ''
39
39
  }
40
40
 
41
- log({ type: 'info', message: `Resolving docker credentials for ${registry}` })
41
+ logInfo({ message: `Resolving docker credentials for ${registry}` })
42
42
  return `sudo docker login ${registry} -u ${username} -p ${authentication}`
43
43
  }
44
44
 
45
45
  static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void> {
46
46
  return new Promise(resolve => {
47
- log({ type: 'info', message: 'Starting docker deployment sequence' })
47
+ logInfo({ message: 'Starting docker deployment sequence' })
48
48
 
49
49
  const dockerCommandScript = `'#!/bin/bash'
50
50
  ${DockerClient.stopContainer(deploymentRequest)}
@@ -61,15 +61,15 @@ ${DockerClient.startContainer(deploymentPlatform, deploymentRequest)}`
61
61
  const command = exec(`bash ${FilePaths.DeploymentScript}`)
62
62
 
63
63
  command.stdout.on('data', data => {
64
- log({ type: 'info', message: `[DockerClient]: ${data}` })
64
+ logInfo({ message: `[DockerClient]: ${data}` })
65
65
  })
66
66
 
67
67
  command.stderr.on('data', (data) => {
68
- log({ type: 'error', message: `[DockerClient]: ${data}` })
68
+ logError({ message: `[DockerClient]: ${data}` })
69
69
  })
70
70
 
71
71
  command.on('close', code => {
72
- log({ type: 'info', message: `[DockerClient] command exited with code ${code}` })
72
+ logInfo({ message: `[DockerClient] command exited with code ${code}` })
73
73
  fs.unlinkSync(FilePaths.DeploymentScript)
74
74
  resolve()
75
75
  })
package/src/log/index.ts CHANGED
@@ -1,11 +1,39 @@
1
1
  interface LogInput {
2
- type: 'info' | 'error';
2
+ type: TypeOfMessage;
3
3
  message: string;
4
- error?: any;
4
+ data?: any;
5
+ dataPrefix: string;
5
6
  }
6
7
 
7
- export const log = ({ type, message, error }: LogInput = { type: 'info', message: '' }) => {
8
- const messagePrefix = `[${type.toUpperCase()}]${message.startsWith('[') ? '' : ': '}`
9
- console.log(`${messagePrefix}${message}`)
10
- error && console.log('[Reason]:', error)
8
+ enum TypeOfMessage {
9
+ Info = 'INFO',
10
+ Error = 'ERROR',
11
+ Debug = 'DEBUG'
12
+ }
13
+
14
+ const log = (...params) => {
15
+ console.log(...params)
16
+ }
17
+
18
+ function prefixTo(prefix: string, message: string) {
19
+ `[${prefix}]${message.startsWith('[') ? '' : ': '}`
20
+ }
21
+
22
+ export const logInfo = logInput => {
23
+ const messagePrefix = prefixTo(TypeOfMessage.Info, logInput.message)
24
+ log(`${messagePrefix}${logInput.message}`)
25
+ }
26
+
27
+ export const logError = logInput => {
28
+ const messagePrefix = prefixTo(TypeOfMessage.Error, logInput.message)
29
+ log(`${messagePrefix}${logInput.message}`)
30
+ logInput.error && log('\n[Reason]:', logInput.error, '\n')
31
+ }
32
+
33
+ export const logDebug = logInput => {
34
+ const isDebugOn = process.env.DEBUG || false
35
+ if (!isDebugOn) return
36
+ const messagePrefix = prefixTo(TypeOfMessage.Debug, logInput.message)
37
+ log(`${messagePrefix}${logInput.message}`)
38
+ logInput.data && log('\n[Debug data]:', logInput.data, '\n')
11
39
  }
@@ -3,7 +3,7 @@ export interface DeploymentPlatformTemplate {
3
3
  domain: string;
4
4
  supportedDeploymentTypes: SupportedDeploymentTypes[];
5
5
  supportedEnvironments: SupportedEnvironments[];
6
- awsRegion: string;
6
+ awsRegion?: string;
7
7
  awsAccountId: string;
8
8
  awsKeyPairName?: string;
9
9
  awsRoleToAssume?: string;