Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add IsolatedStackPrefix parameter to SAM template - Conditionally deploy pipeline based resources - Ensure named resources include the IsolatedStackPrefix - Add Environment Variable to Lambda functions for DynamoDB - Add DynmoDB helper to create a context with the correct prefix
- Loading branch information
1 parent
55ebf6c
commit 3f32a60
Showing
4 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Amazon.DynamoDBv2; | ||
using Amazon.DynamoDBv2.DataModel; | ||
using Amazon.DynamoDBv2.Model; | ||
using System; | ||
|
||
namespace CovidAPI | ||
{ | ||
public static class DynamoDBHelper | ||
{ | ||
public static DynamoDBContext CreateDynamoDBContext(this IAmazonDynamoDB client) | ||
{ | ||
var prefix = Environment.GetEnvironmentVariable("TablePrefix"); | ||
var config = new DynamoDBContextConfig(); | ||
if (!string.IsNullOrEmpty(prefix)) | ||
{ | ||
config.TableNamePrefix = prefix; | ||
} | ||
|
||
return new DynamoDBContext(client, config); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters