-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1177-feature-implement-appconfig…
…-provider' into 1177-feature-implement-appconfig-provider
- Loading branch information
Showing
92 changed files
with
22,272 additions
and
25,380 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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
lts/gallium | ||
lts/hydrogen |
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,6 @@ | ||
// Get the DynamoDB table name from environment variables | ||
const tableName = process.env.SAMPLE_TABLE; | ||
|
||
export { | ||
tableName | ||
}; |
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,29 @@ | ||
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; | ||
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; | ||
import { tracer } from './powertools'; | ||
|
||
// Create DynamoDB Client and patch it for tracing | ||
const ddbClient = tracer.captureAWSv3Client(new DynamoDBClient({})); | ||
|
||
const marshallOptions = { | ||
// Whether to automatically convert empty strings, blobs, and sets to `null`. | ||
convertEmptyValues: false, // false, by default. | ||
// Whether to remove undefined values while marshalling. | ||
removeUndefinedValues: false, // false, by default. | ||
// Whether to convert typeof object to map attribute. | ||
convertClassInstanceToMap: false, // false, by default. | ||
}; | ||
|
||
const unmarshallOptions = { | ||
// Whether to return numbers as a string instead of converting them to native JavaScript numbers. | ||
wrapNumbers: false, // false, by default. | ||
}; | ||
|
||
const translateConfig = { marshallOptions, unmarshallOptions }; | ||
|
||
// Create the DynamoDB Document client. | ||
const docClient = DynamoDBDocumentClient.from(ddbClient, translateConfig); | ||
|
||
export { | ||
docClient | ||
}; |
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,32 @@ | ||
import { Logger } from '@aws-lambda-powertools/logger'; | ||
import { Metrics } from '@aws-lambda-powertools/metrics'; | ||
import { Tracer } from '@aws-lambda-powertools/tracer'; | ||
|
||
const awsLambdaPowertoolsVersion = '1.5.0'; | ||
|
||
const defaultValues = { | ||
region: process.env.AWS_REGION || 'N/A', | ||
executionEnv: process.env.AWS_EXECUTION_ENV || 'N/A' | ||
}; | ||
|
||
const logger = new Logger({ | ||
persistentLogAttributes: { | ||
...defaultValues, | ||
logger: { | ||
name: '@aws-lambda-powertools/logger', | ||
version: awsLambdaPowertoolsVersion, | ||
} | ||
}, | ||
}); | ||
|
||
const metrics = new Metrics({ | ||
defaultDimensions: defaultValues | ||
}); | ||
|
||
const tracer = new Tracer(); | ||
|
||
export { | ||
logger, | ||
metrics, | ||
tracer | ||
}; |
Oops, something went wrong.