awssolutionsconstructsawsroute53alb

package module
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

aws-route53-alb module


All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Reference Documentation: https://docs.aws.amazon.com/solutions/latest/constructs/
Language Package
Python Logo Python aws_solutions_constructs.aws_route53_alb
Typescript Logo Typescript @aws-solutions-constructs/aws-route53-alb
Java Logo Java software.amazon.awsconstructs.services.route53alb

This AWS Solutions Construct implements an Amazon Route53 Hosted Zone routing to an Application Load Balancer

Here is a minimal deployable pattern definition in Typescript:

import { Route53ToAlb } from '@aws-solutions-constructs/aws-route53-alb';

new Route53ToAlb(this, 'Route53ToAlbPattern', {
  privateHostedZoneProps: {
    zoneName: 'www.example.com',
  }
  publicApi: false,
});

Initializer

new Route53ToAlb(scope: Construct, id: string, props: Route53ToAlbProps);

Parameters

Pattern Construct Props

This construct cannot create a new Public Hosted Zone, if you are creating a public API you must supply an existing Public Hosted Zone that will be reconfigured with a new Alias record. Public Hosted Zones are configured with public domain names and are not well suited to be launched and torn down dynamically, so this construct will only reconfigure existing Public Hosted Zones.

This construct can create Private Hosted Zones. If you want a Private Hosted Zone, then you can either provide an existing Private Hosted Zone or a privateHostedZoneProps value with at least the Domain Name defined.

Name Type Description
privateHostedZoneProps? route53.PrivateHostedZoneProps Optional custom properties for a new Private Hosted Zone. Cannot be specified for a public API. Cannot specify a VPC, it will use the VPC in existingVpc or the VPC created by the construct. Providing both this and existingHostedZoneInterfaceis an error.
existingHostedZoneInterface? route53.IHostedZone Existing Public or Private Hosted Zone (type must match publicApi setting). Specifying both this and privateHostedZoneProps is an error. If this is a Private Hosted Zone, the associated VPC must be provided as the existingVpc property
loadBalancerProps? elasticloadbalancingv2.ApplicationLoadBalancerProps Optional custom properties for a new loadBalancer. Providing both this and existingLoadBalancer is an error. This cannot specify a VPC, it will use the VPC in existingVpc or the VPC created by the construct.
existingLoadBalancerObj? elasticloadbalancingv2.ApplicationLoadBalancer Existing Application Load Balancer to incorporate into the construct architecture. Providing both this and loadBalancerProps is an error. The VPC containing this loadBalancer must match the VPC provided in existingVpc.
vpcProps? ec2.VpcProps Optional custom properties for a VPC the construct will create. This VPC will be used by the new ALB and any Private Hosted Zone the construct creates (that's why loadBalancerProps and privateHostedZoneProps can't include a VPC). Providing both this and existingVpc is an error.
existingVpc? ec2.IVpc An existing VPC in which to deploy the construct. Providing both this and vpcProps is an error. If the client provides an existing load balancer and/or existing Private Hosted Zone, those constructs must exist in this VPC.
logAlbAccessLogs? boolean Whether to turn on Access Logs for the Application Load Balancer. Uses an S3 bucket with associated storage costs.Enabling Access Logging is a best practice. default - true
albLoggingBucketProps? s3.BucketProps Optional properties to customize the bucket used to store the ALB Access Logs. Supplying this and setting logAccessLogs to false is an error. @default - none

| publicApi | boolean | Whether the construct is deploying a private or public API. This has implications for the Hosted Zone, VPC and ALB. |

Pattern Properties

Name Type Description
hostedZone route53.IHostedZone The hosted zone used by the construct (whether created by the construct or providedb by the client)
vpc ec2.IVpc The VPC used by the construct (whether created by the construct or providedb by the client)
loadBalancer elasticloadbalancingv2.ApplicationLoadBalancer The Load Balancer used by the construct (whether created by the construct or providedb by the client)

Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

Amazon Route53
  • Adds an ALIAS record to the new or provided Hosted Zone that routes to the construct's ALB
Application Load Balancer
  • Creates an Application Load Balancer with no Listener or target. The consruct can incorporate an existing, fully configured ALB if provided.

Architecture

Architecture Diagram


© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Documentation

Overview

CDK constructs for defining an interaction between an Amazon Route53 domain and an Application Load Balancer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoute53ToAlb_Override

func NewRoute53ToAlb_Override(r Route53ToAlb, scope constructs.Construct, id *string, props *Route53ToAlbProps)

func Route53ToAlb_IsConstruct

func Route53ToAlb_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

Types

type Route53ToAlb

type Route53ToAlb interface {
	constructs.Construct
	HostedZone() awsroute53.IHostedZone
	LoadBalancer() awselasticloadbalancingv2.ApplicationLoadBalancer
	Node() constructs.Node
	Vpc() awsec2.IVpc
	ToString() *string
}

func NewRoute53ToAlb

func NewRoute53ToAlb(scope constructs.Construct, id *string, props *Route53ToAlbProps) Route53ToAlb

type Route53ToAlbProps

type Route53ToAlbProps struct {
	// Whether to create a public or private API.
	//
	// This value has implications
	// for the VPC, the type of Hosted Zone and the Application Load Balancer
	PublicApi *bool `json:"publicApi"`
	// Optional properties to customize the bucket used to store the ALB Access Logs.
	//
	// Supplying this and setting logAccessLogs to false is an error.
	AlbLoggingBucketProps *awss3.BucketProps `json:"albLoggingBucketProps"`
	// Existing Public or Private Hosted Zone.
	//
	// If a Private Hosted Zone, must
	// exist in the same VPC specified in existingVpc
	ExistingHostedZoneInterface awsroute53.IHostedZone `json:"existingHostedZoneInterface"`
	// An existing Application Load Balancer.
	//
	// Providing both this and loadBalancerProps
	// is an error. This ALB must exist in the same VPC specified in existingVPC
	ExistingLoadBalancerObj awselasticloadbalancingv2.ApplicationLoadBalancer `json:"existingLoadBalancerObj"`
	// An existing VPC.
	//
	// Providing both this and vpcProps is an error. If an existingAlb or existing
	// Private Hosted Zone is provided, this value must be the VPC associated with those resources.
	ExistingVpc awsec2.IVpc `json:"existingVpc"`
	// Custom properties for a new ALB.
	//
	// Providing both this and existingLoadBalancerObj
	// is an error. These properties cannot include a VPC.
	LoadBalancerProps interface{} `json:"loadBalancerProps"`
	// Whether to turn on Access Logs for the Application Load Balancer.
	//
	// Uses an S3 bucket
	// with associated storage costs. Enabling Access Logging is a best practice.
	LogAlbAccessLogs *bool `json:"logAlbAccessLogs"`
	// Custom properties for a new Private Hosted Zone.
	//
	// Cannot be specified for a
	// public API. Cannot specify a VPC
	PrivateHostedZoneProps interface{} `json:"privateHostedZoneProps"`
	// Custom properties for a new VPC.
	//
	// Providing both this and existingVpc is
	// an error. If an existingAlb or existing Private Hosted Zone is provided, those
	// already exist in a VPC so this value cannot be provided.
	VpcProps *awsec2.VpcProps `json:"vpcProps"`
}

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL