Terraform module for a AWS URL shortener
Creates a url shortener using only ApiGateway and Dynamodb
provider "aws" {
region = "us-east1"
secretkey = ""
accesskey = ""
}
module "url-shortener" {
source = "../.."
tags = {
application = "test"
}
stack_name = "url-shortener"
api_stage_name = "test"
}
curl -X POST https://{awsinvokedURL} --header 'content-type:application/json' --data '{ "id": "tweets", "url": "https://twitter.com" }'
Now, open Invoke URL: https://46yw59620f.execute-api.us-east-1.amazonaws.com/test/{idyoucreated}
You should see your below url shortener ID and the URL inside DynamoDB