Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions content/design-patterns/ex8streams/Step5.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ aws lambda create-event-source-mapping \
The following is the expected result.
```json
{
"UUID": "0dcede66-709c-4073-a628-724d01b92095",
"BatchSize": 100,
"MaximumBatchingWindowInSeconds": 0,
"UUID": "be5884e0-bcd9-4301-b535-329e8c13bb73",
"ParallelizationFactor": 1,
"EventSourceArn": "arn:aws:dynamodb:<REGION>:<ACCOUNTID>:table/logfile/stream/2021-12-31T00:00:00.000",
"FunctionArn": "arn:aws:lambda:<REGION>:<ACCOUNTID>:function:ddbreplica_lambda",
"LastModified": 1663286115.972,
"LastProcessingResult": "No records processed",
"State": "Creating",
"StateTransitionReason": "User action",
"LastModified": 1607986748.972,
"BatchSize": 100,
"DestinationConfig": {
"OnFailure": {}
},
"EventSourceArn": "arn:aws:dynamodb:<REGION>:<ACCOUNTID>:table/logfile/stream/2020-12-31T00:00:00.000",
"FunctionArn": "arn:aws:lambda:<REGION>:<ACCOUNTID>:function:ddbreplica_lambda",
"State": "Creating",
"ParallelizationFactor": 1,
"LastProcessingResult": "No records processed",
"MaximumRetryAttempts": 10000,
"MaximumRecordAgeInSeconds": 604800,
"BisectBatchOnFunctionError": false
"MaximumRecordAgeInSeconds": -1,
"BisectBatchOnFunctionError": false,
"MaximumRetryAttempts": -1
}
```
6 changes: 3 additions & 3 deletions content/design-patterns/setup/Step2.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python --version
```
Output:
```plain
Python 3.6.8
Python 3.6.12
```


Expand All @@ -26,7 +26,7 @@ aws --version
Sample output:
```bash
#Note that your linux kernel version may differ from the example.
aws-cli/1.16.310 Python/3.6.8 Linux/4.14.138-89.102.amzn1.x86_64 botocore/1.13.50
aws-cli/1.18.139 Python/3.6.12 Linux/4.14.193-113.317.amzn1.x86_64 botocore/1.17.62
```

**Note**: *Make sure you have AWS CLI version 1.16.310 and python 3.6.8 before proceeding. If you do not have these versions, review [Step 1]({{< ref "design-patterns/setup/Step1" >}}) to ensure you have completed each command correctly.*
**Note**: *Make sure you have AWS CLI version 1.18.139 and python 3.6.12 before proceeding. If you do not have these versions, review [Step 1]({{< ref "design-patterns/setup/Step1" >}}) to ensure you have completed each command correctly.*
21 changes: 19 additions & 2 deletions design-patterns/cloudformation/UserData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,21 @@ function configure_python_and_install
/usr/bin/pip-3.6 install -r /home/ec2-user/workshop/requirements.txt

log frustrating pip user installs
mkdir /home/ec2-user/.local
mkdir /home/ec2-user/.local 1>&2 2>/dev/null
chattr +i /home/ec2-user/.local

}
function verify_configuration_and_signal
{
log verify_configuration_and_signal running.
log Checking if python36 installed by yum.
yum list installed python36 1>/dev/null || signal_failure_and_exit "Python3.6 not installed correctly."

log Checking if python scripts are in workshop directory.
ls -l /home/ec2-user/workshop/*.py 1>/dev/null || signal_failure_and_exit "Python scripts not in workshop directory."

signal_success
}
function lock_instance
{
cat > /etc/profile.d/motd.sh << "EOF"
Expand Down Expand Up @@ -171,6 +182,12 @@ function signal_success
{
/opt/aws/bin/cfn-signal --success true $CFN_WAIT_HANDLE
}
function signal_failure_and_exit
{
/opt/aws/bin/cfn-signal --success false $CFN_WAIT_HANDLE --reason "$@"
log failure signal sent to CloudFormation: "${@}"
exit 0
}

#Main Execution
lock_instance
Expand All @@ -183,5 +200,5 @@ lock_repo_version
update_yum_packages

configure_python_and_install
verify_configuration_and_signal
unlock_instance
signal_success
84 changes: 42 additions & 42 deletions design-patterns/cloudformation/lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,58 +36,58 @@ Conditions:

Mappings:
AmazonLinuxAMI:
eu-central-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-07a06e1c9f42df03e
GUID: fd3054b03123
us-east-1:
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0b46d3491dbc6c19e
GUID: 6f7652f821ac
us-east-2:
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-045ded0b933b76edd
GUID: 6f7652f821ac
us-west-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-01daf83d8a6f588c5
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-098679a260e1209d1
GUID: 6f7652f821ac
us-west-2:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-09b92cd132204c704
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0bd66fad2c6056e19
GUID: 6f7652f821ac
eu-west-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-0ce6dfbc4cb843402
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-04fb47915aaea1e62
GUID: 6f7652f821ac
eu-west-2:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-0e30eafcc0935e6a7
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0b71de60f601e6897
GUID: 6f7652f821ac
eu-central-1:
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-08d125a524c37d22e
GUID: 6f7652f821ac
sa-east-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-0e7d312b22eb1a81b
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-008dcd30fab4ab54d
GUID: 6f7652f821ac
ap-south-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-08e789bb5ca3b9bfd
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0bfcf5aa671f35822
GUID: 6f7652f821ac
ap-southeast-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-05ab00911168ec7af
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0253cac8b82dc7263
GUID: 6f7652f821ac
ap-southeast-2:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-042710e2a62ecec92
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0e00766c034642337
GUID: 6f7652f821ac
ap-northeast-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-0a9fb4802d08e965a
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-00238cb37d54b2a4c
GUID: 6f7652f821ac
ap-northeast-2:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-01ea3038c7b18e526
GUID: fd3054b03123
us-east-1:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-001efa431f19d816f
GUID: fd3054b03123
us-east-2:
# Name: amzn-ami-hvm-2018.03.0.20190826-x86_64-ebs
AMI: ami-02950d3d85d31b6f9
GUID: fd3054b03123
# Name: amzn-ami-hvm-2018.03.0.20200904.0-x86_64-ebs
AMI: ami-0ddea77382fd34b61
GUID: 6f7652f821ac
DesignPatterns:
options:
UserDataURL: "https://amazon-dynamodb-labs.com/assets/UserData.sh"
Expand Down
4 changes: 2 additions & 2 deletions design-patterns/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
boto3==1.10.48
awscli==1.16.310
boto3==1.14.62
awscli==1.18.139