Exemple #1
0
 /// <summary>
 /// For testing only
 /// </summary>
 /// <param name="ssm"></param>
 /// <param name="variableReader"></param>
 /// <param name="injector"></param>
 public SecretHandler(IAmazonSimpleSystemsManagement ssm, IEnvironmentVariableReader variableReader, SsmInjector injector)
 {
     Console.WriteLine("this constructor should only be used for unit testing.  It was not designed for production use.");
     _envreader = variableReader;
     _injector  = injector;
     Initialize();
 }
Exemple #2
0
        /// <summary>
        /// Pulls all of the SSM parameters for a given region and path.  This package requires running with a role
        /// or that AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set as environment variables.
        ///
        /// Additionally,
        /// DEFAULT_AWS_REGION (us-east-1 is assumed if none provided)
        /// and SSM_PARAMETER_PATH ("/" is assumed if none provided)
        /// should be set as environment variables
        /// </summary>
        public SecretHandler()
        {
            _envreader = new EnvironmentVariableReader();

            _region        = _envreader.GetValue("DEFAULT_AWS_REGION") ?? "us-east-1";
            _parameterPath = _envreader.GetValue("SSM_PARAMETER_PATH");
            _injector      = new SsmInjector();
            Initialize();
        }