import { declareRuntimeEnv } from 'resolve-scripts'

const cloudConfig = {
  target: 'cloud',
  mode: 'production',
  staticPath: declareRuntimeEnv('RESOLVE_CLOUD_STATIC_URL'),
  subscribeAdapter: {
    module: 'resolve-subscribe-mqtt',
    options: {}
  },
  storageAdapter: {
    module: 'resolve-storage-postgresql-serverless',
    options: {
      awsSecretStoreArn: declareRuntimeEnv('RESOLVE_ES_SECRET_STORE_ARN'),
      dbClusterOrInstanceArn: declareRuntimeEnv('RESOLVE_ES_CLUSTER_ARN'),
      databaseName: declareRuntimeEnv('RESOLVE_ES_DATABASE'),
      tableName: declareRuntimeEnv('RESOLVE_ES_TABLE'),
      region: declareRuntimeEnv('AWS_REGION'),
      secretsTableName: declareRuntimeEnv('RESOLVE_ES_SECRETS_TABLE')
    }
  },
  readModelConnectors: {
    default: {
      module: 'resolve-readmodel-postgresql-serverless',
      options: {
        dbClusterOrInstanceArn: declareRuntimeEnv(
          'RESOLVE_READMODEL_POSTGRESQL_CLUSTER_ARN'
        ),
        awsSecretStoreArn: declareRuntimeEnv(
          'RESOLVE_READMODEL_POSTGRESQL_SECRET_ARN'
        ),
        databaseName: declareRuntimeEnv(
          'RESOLVE_READMODEL_POSTGRESQL_DATABASE_NAME'
        ),
        region: declareRuntimeEnv('AWS_REGION')
      }
    }
  },
  schedulers: {
    scheduler: {
      adapter: {
        module: 'resolve-scheduler-cloud',
        options: {}
      },
      connectorName: 'default'
    }
  }
}

export default cloudConfig

@@ -1406,16 +1406,382 @@
 '%0A    %7D%0A
+  %7D,%0A  uploadAdapter: %7B%0A    module: 'resolve-upload-cloud',%0A    options: %7B%0A      encryptedDeploymentId: declareRuntimeEnv(%0A        'RESOLVE_ENCRYPTED_DEPLOYMENT_ID'%0A      ),%0A      deploymentId: declareRuntimeEnv('RESOLVE_DEPLOYMENT_ID'),%0A      CDN: declareRuntimeEnv('RESOLVE_UPLOADER_URL'),%0A      uploaderArn: declareRuntimeEnv('RESOLVE_UPLOADER_LAMBDA_ARN')%0A    %7D%0A
   %7D%0A%7D%0A%0Ae

Add cloud uploader config