Basiclly, it's a playground for IaC, Serverless, Cloud Native, DevOps, CI/CD, etc.
Then, it's the backend infrastructure for OpenAHU's projects
IaC:
https://spacelift.io/blog/infrastructure-as-code
More:
- https://spacelift.io/blog
- https://developer.hashicorp.com/terraform/docs
- https://terragrunt.gruntwork.io/docs/
npm install -g esbuild
cd terraform
terraform inithttps://cloud.tencent.com/document/product/583/67790
Sync:
exportconsthandler=(event,context,callback)=>{// first argument is error, second is responsecallback(null,{statusCode: 200,body: JSON.stringify({message: "Hello World",}),});};Async:
exportconsthandler=async(event,context)=>{returnnewPromise((resolve,reject)=>{resolve({statusCode: 200,body: JSON.stringify({message: "Hello World",}),});// error by throw instead of reject// throw new Error("Something went wrong");});};go to terraform/
create terraform/variables.tfvars, add host and domain inside
run terraform apply -var-file=variables.tfvars
Error: the domain name is not configured with CNAME to the default domain name, or the resolution is not effective.
wait for 10 minutes, then try again, cause the domain name resolution takes time