public string GetParamValue(string paramKey) { lock (_ResolveCache) { string paramKeyWithoutPhs = paramKey; foreach (var phName in this.ParameterKeyPlaceholderResolvers.Keys) { string pt = "{" + phName + "}"; if (paramKeyWithoutPhs.Contains(pt)) { string pv = this.ParameterKeyPlaceholderResolvers[phName].Invoke(); paramKeyWithoutPhs = paramKeyWithoutPhs.Replace(pt, pv); } } if (_ResolveCache.ContainsKey(paramKeyWithoutPhs)) { return(_ResolveCache[paramKeyWithoutPhs]); } string pValue = null; using (var client = new AmazonSimpleSystemsManagementClient(this.AwsCredentials, this.AwsRegion)) { var request = new GetParameterRequest() { Name = paramKeyWithoutPhs }; var t = client.GetParameterAsync(request); t.Wait(); if (t.IsCompleted && t.Result is object && t.Result.Parameter is object) { _ResolveCache.Add(paramKeyWithoutPhs, t.Result.Parameter.Value); pValue = t.Result.Parameter.Value; } } if (pValue is object) { lock (_BoundObjects) { foreach (var adapter in _BoundObjects.Values) { adapter.InjectValue(paramKey, pValue); if (!((paramKeyWithoutPhs ?? "") == (paramKey ?? ""))) { adapter.InjectValue(paramKeyWithoutPhs, pValue); } } } } return(pValue); } }