Releases: infamousjoeg/aws-ec2-cloudflare-lambda
Releases · infamousjoeg/aws-ec2-cloudflare-lambda
AWS EC2 Cloudflare Lambda
You can use the exported AWS SAM template AWSEC2CloudflareLambda.yaml
to orchestrate setting up your AWS Lambda function using the same Python script. Just don't forget to populate values into your Environment Variables before enabling the CloudWatch Event trigger!
- Install Python and pip.
sudo apt install python python-pip -y
orsudo yum install python python-pip -y
You deal with theepel-release
repo enablement on your own if you're on RHEL or CentOS. - Install AWS CLI.
pip install awscli
- Install AWS SAM CLI.
pip install aws-sam-cli
aws s3 mb s3://<bucket name> --region <region>
<bucket name>
=cdemoUpdateCloudflare
<region>
=us-east-1
orus-central-1
- Upload SAM Package to AWS S3 Bucket created in Step 3. This will output a CloudFormation Template for us to use based on the package uploaded.
sam package --template-file AWSEC2CloudflareLambda.yaml --output-template-file AWSEC2CloudflareLambda-output.yaml --s3-bucket <bucket name>
- Deploy SAM template-based generated CloudFormation template in CloudFormation.
sam deploy --template-file AWSEC2CloudflareLambda-output.yaml --stack-name <CloudFormation Stack Name>