Tag - Python

As mentioned in this post I needed to download a private GitHub repo as a ZIP file. The GitHub repo containing this blog is now set to private (mainly to protect my backlog of drafts), which broke my AWS Lambda function (see here and here).
Minimal changes were required from the functioning code, but there was a lot of testing. Some key changes were:
Setting the GitHub Personal Access Token as a Lambda variable Modify the file download function to use custom headers Consuming the token from within Lambda to access and download the file The new function to download the repo:

As you may know from one of my recent blog posts, the blog you’re reading is a collection of Markdown and Hugo artifacts that, when ‘compiled’ with Hugo, creates a wonderfully lightweight website hosted out of AWS S3. My biggest gripe with my documented deployment from GitHub to S3 was the dependency on the GitHub repo being public. Anyone could see my published and unpublished content. As I’ve been spending quite a bit of time writing new posts, I wanted to protect the repo but still deploy the site automatically as I do now in AWS Lambda.

Avid readers, I bring to you a nice little update to one of my more popular posts on how to deploy a Hugo website from GitHub to S3 using GitHub Webhooks, API Gateway and Lambda.
Since that post, AWS has stated that they will deprecate support for Python 2.7 starting 31st December 2020. Not only that, the requests module has been removed from the AWS SDK for Python so the file downloads that happen in my Lambda function stopped working.

If you followed my previous posts on auto deploying a Hugo site from GitHub to S3 (Part 1, Part 2) you may have noticed that GitHub is deprecating the GitHub Services Integration mechanism. This is critical to the auto deployment function so we’ll need an alternative. To add to my woes, I’ve found that the Node deployment package and all of its dependencies involves more maintenance than it deserves. I also noticed that the original Node package was only adding to the target S3 bucket, not performing a sync or equivalent.
Latest Posts
- VCSA 7.0 File-based restore failing at 80%
- Create an Azure Virtual Network Gateway IPSec VPN to PFSense
- Convert a video file to a GIF using a MacOS Automator task
- Homelab - Routing and VLANs with a PFSense VM on a single host
- How to install vRealize Operations Telegraf agent using vRealize Automation and SaltStack Config
Advertisement
Popular Tags
vmware52
vrealize-suite19
how-to17
vsphere16
vcloud-director12
professional-development9
aws8
certificates8
vrealize-orchestrator7
github6
hugo6
lambda6
vcenter6
blog5
s35
homelab4
python4
vrealize-automation4
vrealize-suite-lifecycle-manager4
api3
api-gateway3
automation3
esxi3
javascript3
pfsense3
powercli3
psc3
vcsa3
vrealize-operations-manager3
vrealize-saltstack-config3
azure2
cassandradb2
certification2
dns2
hardware2
microsoft2
packer2
rest2
saltstack2
storage2
swagger2
telegraf2
vcloud-availability2
vcp2
vrealize-log-insight2
vrealize-operations2
active-directory1
adfs1
automator1
blueprints1
bmc1
certificate-authority1
cisco-aci1
clarityui1
cloud-init1
converter1
cpu1
custom-resource1
dell1
docker1
draas1
federation1
firmware1
freebsd1
freenas1
gcp1
ipmi1
ipsec1
json1
macos1
network1
nodejs1
nsx1
opensource1
ova1
postman1
quanta1
route531
saml1
self-hosted1
ubuntu1
upgrade1
utilities1
vcenter-server1
vcloud1
vexpert1
vidm1
virtual-network-gateway1
vmware-identity-manager1
vpn1
vro1
vsan1
vvols1
windows-server1