Skip to content

Commit fe168fc

Browse files
sumitdeshpandedessumiLAYTATrezabekf
authored
Added Feature lambda hooks (#272)
* first commit for lambda hooks * Lambda hook intro * Lambda hook intro and deploy function instructions * Deploy Lambda function code overview update * deploy instructions updated for lambda function * adding hook lambda * added content for lambda hook * fixed sequencing for the topics * test lambda hook content * merged code and readme updates * Rearranged Test section and added console navigation and CLI for deployments. * added yaml templates for hooks * moved into lambda_hook folder * updated * Review of changes and added placeholders for content simplification * task segregation and content clarification * moved cleanup instructions * updated Cleanup instructions * Updated on all todos and remove preview tool * Updated weights for reordering Custom Hooks after Lambda Hooks * Added Cleanup instructions * Update based on PM's comments * updated based on peer review feedback * updated with better instructions * [Draft] Lambda hooks feedback (#271) * Add Japanese placeholder * Update intro and some misspell * Fix misspell * Add comma * Fix misspell * Fix misspell * Fix misspell * Bump version: 3.5.0 → 3.5.1 --------- Co-authored-by: dessumi <dessumi@amazon.com> Co-authored-by: JJ Lei <jjlei@amazon.com> Co-authored-by: Franco Rezabek <43790446+rezabekf@users.noreply.github.com>
1 parent a21913d commit fe168fc

55 files changed

Lines changed: 1006 additions & 47 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[bumpversion]
2-
current_version = 3.5.0
2+
current_version = 3.5.1
33
commit = True
44
tag = False
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Resources:
3+
CompliantDynamoDB:
4+
Type: 'AWS::DynamoDB::Table'
5+
Properties:
6+
TableName: CompliantTable
7+
AttributeDefinitions:
8+
- AttributeName: "Id"
9+
AttributeType: "S"
10+
KeySchema:
11+
- AttributeName: "Id"
12+
KeyType: "HASH"
13+
BillingMode: "PAY_PER_REQUEST"
14+
PointInTimeRecoverySpecification:
15+
PointInTimeRecoveryEnabled: true
16+
GlobalSecondaryIndexes:
17+
- IndexName: "GSI1"
18+
KeySchema:
19+
- AttributeName: "Id"
20+
KeyType: "HASH"
21+
Projection:
22+
ProjectionType: "ALL"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Description: 'IAM roles for DynamoDB Configuration Hook'
3+
4+
Resources:
5+
HookExecutionRole:
6+
Type: 'AWS::IAM::Role'
7+
Properties:
8+
AssumeRolePolicyDocument:
9+
Version: '2012-10-17'
10+
Statement:
11+
- Effect: Allow
12+
Principal:
13+
Service: hooks.cloudformation.amazonaws.com
14+
Action: 'sts:AssumeRole'
15+
ManagedPolicyArns:
16+
- 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole'
17+
Policies:
18+
- PolicyName: DynamoDBHookPolicy
19+
PolicyDocument:
20+
Version: '2012-10-17'
21+
Statement:
22+
- Effect: Allow
23+
Action:
24+
- 'dynamodb:DescribeTable'
25+
- 'dynamodb:ListTables'
26+
Resource: '*'
27+
- PolicyName: InvokeHookFunction
28+
PolicyDocument:
29+
Version: '2012-10-17'
30+
Statement:
31+
- Effect: Allow
32+
Action:
33+
- 'lambda:InvokeFunction'
34+
Resource: 'arn:aws:lambda:us-east-1:832978051484:function:DynamoDBConfigValidationHook'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Resources:
3+
NonCompliantDynamoDB:
4+
Type: 'AWS::DynamoDB::Table'
5+
Properties:
6+
TableName: NonCompliantTable
7+
AttributeDefinitions:
8+
- AttributeName: "Id"
9+
AttributeType: "S"
10+
KeySchema:
11+
- AttributeName: "Id"
12+
KeyType: "HASH"
13+
ProvisionedThroughput:
14+
ReadCapacityUnits: 25 # Exceeds allowed limit
15+
WriteCapacityUnits: 10
16+
GlobalSecondaryIndexes: [] # No GSI defined
17+
PointInTimeRecoverySpecification:
18+
PointInTimeRecoveryEnabled: false # Must be enabled
19+
BillingMode: "PROVISIONED" # Must be PAY_PER_REQUEST
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Challenge"
3-
weight: 490
3+
weight: 690
44
---
55

66
Japanese translation is not available yet. Please use the English version.

content/advanced/hooks/example-in-python/challenge/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Challenge"
3-
weight: 490
3+
weight: 690
44
---
55

66
Previously on this lab, you've written unit tests to validate the core logic of your hook. One of the requirements you were given was to allow for a mechanism to ignore S3 buckets whose names are specified by the hook administrator in the hook's configuration. You've used contract tests and end-to-end tests to validate aspects for this use case: in this challenge, you are tasked to write unit test code for this use case.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Cleanup"
3-
weight: 495
3+
weight: 695
44
---
55

66
Japanese translation is not available yet. Please use the English version.

content/advanced/hooks/example-in-python/cleanup/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Cleanup"
3-
weight: 495
3+
weight: 695
44
---
55

66
You'll start with deregistering your hook:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Conclusion"
3-
weight: 499
3+
weight: 699
44
---
55

66
Japanese translation is not available yet. Please use the English version.

content/advanced/hooks/example-in-python/conclusion/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Conclusion"
3-
weight: 499
3+
weight: 699
44
---
55

66
Congratulations! You have built and tested a sample hook in Python! You've learned key concepts, expectations and objectives for you to keep in mind when writing your proactive validation controls with Hooks.

0 commit comments

Comments
 (0)