コード例 #1
0
        /// <summary>
        /// Read a DynamoDB table ARN from <see cref="LambdaConfig"/> and convert it to a table name.
        /// </summary>
        /// <param name="config">The <see cref="LambdaConfig"/> instance.</param>
        /// <param name="key">The key to read.</param>
        /// <returns>DynamoDB table name.</returns>
        public static string ReadDynamoDBTableName(this LambdaConfig config, string key)
        {
            var value = config.ReadText(key);

            return((value.StartsWith("arn:", StringComparison.Ordinal))
                ? ConvertDynamoDBArnToName(value)
                : value);
        }
コード例 #2
0
        //--- Extension Methods ---

        /// <summary>
        /// Read an SQS queue ARN from <see cref="LambdaConfig"/> and convert it to a queue URL.
        /// </summary>
        /// <param name="config">The <see cref="LambdaConfig"/> instance.</param>
        /// <param name="key">The key to read.</param>
        /// <returns>SQS queue URL.</returns>
        public static string ReadSqsQueueUrl(this LambdaConfig config, string key)
        {
            var value = config.ReadText(key);

            return((value.StartsWith("arn:", StringComparison.Ordinal))
                ? ConvertQueueArnToUrl(value)
                : value);
        }