Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Parameters Utility #167

Merged
merged 48 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b676ef5
add parameters feature
amirkaws Sep 21, 2022
76b6354
continue working on parameters feature
amirkaws Sep 22, 2022
0557b3f
continue working on parameters feature
amirkaws Sep 22, 2022
2791e7e
continue working on parameters feature
amirkaws Sep 22, 2022
bbba488
continue working on parameters feature
amirkaws Sep 22, 2022
ba35798
continue working on parameters feature
amirkaws Sep 26, 2022
fafd2db
continue working on parameters feature
amirkaws Sep 26, 2022
f3e0fba
continue working on parameters feature
amirkaws Sep 30, 2022
92e7f7f
continue working on parameters feature
amirkaws Oct 3, 2022
46bc23f
formattting & cleanup
amirkaws Oct 3, 2022
85b6fe6
continue working on parameters feature
amirkaws Oct 4, 2022
068db92
continue working on parameters feature
amirkaws Oct 5, 2022
5114c13
continue working on parameters feature
amirkaws Oct 5, 2022
24d4bb6
continue working on parameters feature
amirkaws Oct 7, 2022
8c8b7fe
continue working on parameters feature
amirkaws Oct 7, 2022
5ac0877
continue working on parameters feature
amirkaws Oct 11, 2022
9f86ec5
add transformation functionality to GetMultiple
amirkaws Oct 14, 2022
a7b11b0
Add TransformationException
amirkaws Oct 14, 2022
a3497b4
Add document readme
amirkaws Oct 14, 2022
82959bf
continue documentation
amirkaws Oct 16, 2022
6c2c7a2
add parameters utilities to the navigation menu
amirkaws Oct 16, 2022
e1b20cf
continue working on parameters feature
amirkaws Oct 16, 2022
81b33cc
continue working on parameters feature
amirkaws Oct 17, 2022
3cc28fb
continue working on parameters feature
amirkaws Oct 17, 2022
8df80a9
continue working on code documenation
amirkaws Oct 17, 2022
417c359
continue working on code documenation
amirkaws Oct 17, 2022
5cdf2d1
continue working on code documenation
amirkaws Oct 17, 2022
04ffb15
continue working on code documenation
amirkaws Oct 18, 2022
5cec486
continue working on code documenation
amirkaws Oct 18, 2022
2b3e57d
continue working on code documenation
amirkaws Oct 18, 2022
ece6b14
continue working on code documenation
amirkaws Oct 19, 2022
2b56d85
continue working on code documenation
amirkaws Oct 19, 2022
71eb12a
continue working on code documenation
amirkaws Oct 19, 2022
5d7849b
continue working on code documenation
amirkaws Oct 19, 2022
b7f0f01
continue working on code documenation
amirkaws Oct 19, 2022
1532a81
continue working on code documenation
amirkaws Oct 19, 2022
c811460
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Jan 18, 2023
bc94f68
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Mar 23, 2023
e39d0f7
make parameters more generic
amirkaws Mar 30, 2023
8f524e7
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 6, 2023
71ccb30
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 6, 2023
72b3362
Merge branch 'awslabs:develop' into amirkaws-feature-parameters
amirkaws Apr 14, 2023
8416d25
remove AppConfig implementation
amirkaws May 9, 2023
349a5d5
sync with develop
amirkaws May 9, 2023
8c9f41a
adress the review comments
amirkaws May 9, 2023
6eef6ce
docs: fixed formatting and updated content
sliedig May 11, 2023
bd3c4db
feat: add package readme
sliedig May 11, 2023
f02a712
Merge pull request #1 from sliedig/amirkaws-feature-parameters
amirkaws May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
733 changes: 733 additions & 0 deletions docs/utilities/parameters.md

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions libraries/AWS.Lambda.Powertools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS.Lambda.Powertools.Traci
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS.Lambda.Powertools.Common.Tests", "tests\AWS.Lambda.Powertools.Common.Tests\AWS.Lambda.Powertools.Common.Tests.csproj", "{4EC48E6A-45B5-4E25-ABBD-C23FE2BD6E1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS.Lambda.Powertools.Parameters", "src\AWS.Lambda.Powertools.Parameters\AWS.Lambda.Powertools.Parameters.csproj", "{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AWS.Lambda.Powertools.Parameters.Tests", "tests\AWS.Lambda.Powertools.Parameters.Tests\AWS.Lambda.Powertools.Parameters.Tests.csproj", "{386A9769-59BF-4BE3-99D4-A9603E300729}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -132,6 +136,30 @@ Global
{4EC48E6A-45B5-4E25-ABBD-C23FE2BD6E1E}.Release|x64.Build.0 = Release|Any CPU
{4EC48E6A-45B5-4E25-ABBD-C23FE2BD6E1E}.Release|x86.ActiveCfg = Release|Any CPU
{4EC48E6A-45B5-4E25-ABBD-C23FE2BD6E1E}.Release|x86.Build.0 = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|x64.ActiveCfg = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|x64.Build.0 = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|x86.ActiveCfg = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Debug|x86.Build.0 = Debug|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|Any CPU.Build.0 = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|x64.ActiveCfg = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|x64.Build.0 = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|x86.ActiveCfg = Release|Any CPU
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0}.Release|x86.Build.0 = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|Any CPU.Build.0 = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|x64.ActiveCfg = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|x64.Build.0 = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|x86.ActiveCfg = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Debug|x86.Build.0 = Debug|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|Any CPU.ActiveCfg = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|Any CPU.Build.0 = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|x64.ActiveCfg = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|x64.Build.0 = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|x86.ActiveCfg = Release|Any CPU
{386A9769-59BF-4BE3-99D4-A9603E300729}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection

GlobalSection(NestedProjects) = preSolution
Expand All @@ -143,5 +171,7 @@ Global
{A422C742-2CF9-409D-BDAE-15825AB62113} = {1CFF5568-8486-475F-81F6-06105C437528}
{4EC48E6A-45B5-4E25-ABBD-C23FE2BD6E1E} = {1CFF5568-8486-475F-81F6-06105C437528}
{A040AED5-BBB8-4BFA-B2A5-BBD82817B8A5} = {1CFF5568-8486-475F-81F6-06105C437528}
{1ECB31E8-2EF0-41E2-8C71-CB9876D207F0} = {73C9B1E5-3893-47E8-B373-17E5F5D7E6F5}
{386A9769-59BF-4BE3-99D4-A9603E300729} = {1CFF5568-8486-475F-81F6-06105C437528}
EndGlobalSection
EndGlobal

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.AppConfigData" Version="3.7.0.110" />
hjgraca marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.5.10" />
hjgraca marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="AWSSDK.SecretsManager" Version="3.7.2.88" />
<PackageReference Include="AWSSDK.SimpleSystemsManagement" Version="3.7.18.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

namespace AWS.Lambda.Powertools.Parameters.Cache;

/// <summary>
/// Represents a type used to manage cache.
/// </summary>
public interface ICacheManager
{
/// <summary>
/// Retrieves a cached value by key.
/// </summary>
/// <param name="key">The key to retrieve.</param>
/// <returns>The cached object.</returns>
object? Get(string key);

/// <summary>
/// Adds a value to the cache by key for a specific duration.
/// </summary>
/// <param name="key">The key to store the value.</param>
/// <param name="value">The value to store.</param>
/// <param name="duration">The expiry duration.</param>
void Set(string key, object? value, TimeSpan duration);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

namespace AWS.Lambda.Powertools.Parameters.Cache;

/// <summary>
/// Represents a type used to wrap datetime.
/// </summary>
public interface IDateTimeWrapper
{
/// <summary>
/// Gets the current UTC time.
/// </summary>
DateTime UtcNow { get; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

using AWS.Lambda.Powertools.Parameters.Transform;

namespace AWS.Lambda.Powertools.Parameters.Configuration;

/// <summary>
/// ParameterProviderConfiguration class.
/// </summary>
public class ParameterProviderConfiguration
{
/// <summary>
/// Fetches the latest value from the store regardless if already available in cache.
/// </summary>
public bool ForceFetch { get; set; }

/// <summary>
/// The cache maximum age.
/// </summary>
public TimeSpan? MaxAge { get; set; }

/// <summary>
/// The transformer instance.
/// </summary>
public ITransformer? Transformer { get; set; }
}
Loading