Skip to content

Latest commit

 

History

History
105 lines (54 loc) · 3.93 KB

API.md

File metadata and controls

105 lines (54 loc) · 3.93 KB

API Reference

Classes

Name Description
URLShortener Represents a URL shortener.

Structs

Name Description
CustomDomainOptions Properties to configure a domain name.
URLShortenerProps Properties to configure a URL shortener.

class URLShortener 🔹

Represents a URL shortener.

Use addDomainName to configure a custom domain.

By default, this construct will deploy:

  • An API Gateway API that can be accessed from a public endpoint.
  • A DynamoDB table for storing links.
  • A Lambda Function for shortening the link and storing it to DynamoDB table.

Implements: IConstruct, IConstruct, IConstruct, IDependable Extends: Construct

Initializer

new URLShortener(scope: Construct, id: string, props?: URLShortenerProps)
  • scope (Construct) No description
  • id (string) No description
  • props (URLShortenerProps) No description
    • dynamoTable (Table) The DynamoDB table used for storing links. Default: A new DynamoDB Table is created.

Properties

Name Type Description
static defaultDynamoTableProps🔹 TableProps Default table props with partition key set to id, you can use it to extend your TableProps.

Methods

addDomainName(options)🔹

addDomainName(options: CustomDomainOptions): URLShortener
  • options (CustomDomainOptions) No description
    • domainName (string) Domain name to be associated with URL shortener service, supports apex domain and subdomain.
    • zone (IHostedZone) Hosted zone of the domain which will be used to create alias record(s) from domain name in the hosted zone to URL shortener API endpoint.
    • certificate (ICertificate) The AWS Certificate Manager (ACM) certificate that will be associated with the URL shortener that will be created. Default: A new DNS validated certificate is created in the same region.

Returns:

struct CustomDomainOptions 🔹

Properties to configure a domain name.

Name Type Description
domainName🔹 string Domain name to be associated with URL shortener service, supports apex domain and subdomain.
zone🔹 IHostedZone Hosted zone of the domain which will be used to create alias record(s) from domain name in the hosted zone to URL shortener API endpoint.
certificate?🔹 ICertificate The AWS Certificate Manager (ACM) certificate that will be associated with the URL shortener that will be created.
Default: A new DNS validated certificate is created in the same region.

struct URLShortenerProps 🔹

Properties to configure a URL shortener.

Name Type Description
dynamoTable?🔹 Table The DynamoDB table used for storing links.
Default: A new DynamoDB Table is created.