Skip to content

suhajda3/serverless-business-card

Repository files navigation

Serverless business card

Create your digital business card by using only AWS Free Tier resources.
Example: misi.is-a.dev

iPhone screenshot

Easy Installation

Create AWS Resources

Launch CloudFormation in the us-east-1 region and create a stack with the following S3 template URL:
https://serverless-business-card.s3.amazonaws.com/template.yaml

Specify a unique name for your S3 bucket.

CloudFormation

Be sure to check the CloudFormation warning at the bottom of the page. These permissions are required so that Lambda can access your S3 bucket (where your photo is stored) and we can include the Lambda Function URL in the vCard.

IAM warning

When your business card is ready, CloudFormation displays the CREATE_COMPLETE message. You may get an error if your S3 name is not unique. Simply delete the stack and restart the process by choosing a different S3 bucket name.

IAM warning

Now head over to the Lambda console and fill in your personal information in the Code source then click Deploy.
Your business card URL is your Function URL. You can use this address to program an NFC sticker or link it to your personal domain.

Attach your Photo

You can add a photo to your business card. Upload your photo to the S3 bucket you specified earlier. Be sure to name your photo avatar.jpeg.

Program an NFC chip with your Function URL

Purchase an NFC sticker for a few bucks and program your Lambda Function URL to it, then stick it on any of your current cards. You can program the NFC sticker with NFC Tools.

Advanced Installation

If you want to deploy the CloudFormaton template other than the us-east-1 region, you can use the template-with-code.yaml instead with the following S3 template URL:
https://serverless-business-card.s3.amazonaws.com/template-with-code.yaml

This does not download the zipped Lambda code from S3, it contains the code itself. Be sure to select the region before deploying the template.

The issue with this method is that CloudFormation automatically creates an index.js file and doesn't look for the specified Node.js version. Since Node.js 18.x index.js is no longer default. You will need to rename index.js to index.mjs. Everything else is the same.

CloudFormation template

Use a custom Domain

For a more friendly URL, you can use your own subdomain instead of the Lambda Function URL. Don't forget that Lambda Function URL's are HTTPS only. You will need a redirect or if you prefer to use DNS (CNAME) you will need a valid HTTPS certificate for that domain. You can use one of the Free For Life domains for this purpose.

Files

  • template.yaml: CloudFormation template that downloads the source code (serverless-business-card.zip) from an S3 bucket located in us-east-1
  • template-with-code.yaml: CloudFormation template that contains the source code. (There is currently an issue with CloudFormation and Node.js 18.x)
  • serverless-business-card.zip: Lambda source code in a zipped archive

Donate

Buy Me A Coffee

Please consider donating. 🙏

License

All content is Apache-2.0.