Beispiel #1
0
        /// <summary>
        /// Load config from env var
        /// </summary>
        /// <returns></returns>
        public static Config LoadConfigFromEnvVar()
        {
            var awsConfig = EnvVarParser.GetAWSBaseConfig();

            return(new Config
            {
                AWSAccessKey = awsConfig.AWSAccessKey,
                AWSAccountId = awsConfig.AWSAccountId,
                AWSRegionEndpoint = awsConfig.AWSRegionEndpoint,
                AWSSecretKey = awsConfig.AWSSecretKey,
                ContactsServiceApiEndpoint = EnvVarParser.GetRequiredString("CONTACTS_SERVICE_API_ENDPOINT"),
                RemoteDataConfig = Shared.Services.RemoteData.Config.LoadConfigFromEnvVar(),
                SalesforceOAuthServiceClientConfig = SalesforceOAuthServiceClientConfig.LoadConfigFromEnvVar(),
                SlackAlertRefreshTokenChannel = EnvVarParser.GetRequiredString("SLACK_ALERT_REFRESH_TOKEN_CHANNEL")
            });
        }
Beispiel #2
0
        /// <summary>
        /// Loads the configuration from env variable.
        /// </summary>
        /// <returns></returns>
        public static Config LoadConfigFromEnvVar()
        {
            var awsConfig = EnvVarParser.GetAWSBaseConfig();

            return(new Config
            {
                AWSAccessKey = awsConfig.AWSAccessKey,
                AWSAccountId = awsConfig.AWSAccountId,
                AWSRegionEndpoint = awsConfig.AWSRegionEndpoint,
                AWSSecretKey = awsConfig.AWSSecretKey,
                ServiceBusClientConfig = new ServiceBusClientConfig
                {
                    AWSAccessKey = awsConfig.AWSAccessKey,
                    AWSAccountId = awsConfig.AWSAccountId,
                    AWSRegionEndpoint = awsConfig.AWSRegionEndpoint,
                    AWSSecretKey = awsConfig.AWSSecretKey
                },
                SyncHoursOffset = EnvVarParser.GetInteger("SYNC_HOURS_OFFSET", 2),
                SalesforceOAuthServiceClientConfig = SalesforceOAuthServiceClientConfig.LoadConfigFromEnvVar(),
                ForceFullSync = EnvVarParser.GetBoolean("SALESFORCE_FORCE_FULL_SYNC"),
                RedisConnectionString = EnvVarParser.GetRequiredString("REDIS_REDLOCK_CONNECTION_STRING"),
                SlackAlertRefreshTokenChannel = EnvVarParser.GetRequiredString("SLACK_ALERT_REFRESH_TOKEN_CHANNEL")
            });
        }