awsglobalacceleratorendpoints

package
v2.138.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Endpoints for AWS Global Accelerator

This library contains integration classes to reference endpoints in AWS Global Accelerator. Instances of these classes should be passed to the endpointGroup.addEndpoint() method.

See the README of the aws-cdk-lib/aws-globalaccelerator library for more information on AWS Global Accelerator, and examples of all the integration classes available in this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCfnEipEndpoint_Override

func NewCfnEipEndpoint_Override(c CfnEipEndpoint, eip awsec2.CfnEIP, options *CfnEipEndpointProps)

func NewInstanceEndpoint_Override

func NewInstanceEndpoint_Override(i InstanceEndpoint, instance awsec2.IInstance, options *InstanceEndpointProps)

Types

type ApplicationLoadBalancerEndpoint

type ApplicationLoadBalancerEndpoint interface {
	awsglobalaccelerator.IEndpoint
	// The region where the endpoint is located.
	//
	// If the region cannot be determined, `undefined` is returned.
	Region() *string
	// Render the endpoint to an endpoint configuration.
	RenderEndpointConfiguration() interface{}
}

Use an Application Load Balancer as a Global Accelerator Endpoint.

Example:

var alb applicationLoadBalancer
var listener listener

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewApplicationLoadBalancerEndpoint(alb, &ApplicationLoadBalancerEndpointOptions{
			Weight: jsii.Number(128),
			PreserveClientIp: jsii.Boolean(true),
		}),
	},
})

type ApplicationLoadBalancerEndpointOptions

type ApplicationLoadBalancerEndpointOptions struct {
	// Forward the client IP address in an `X-Forwarded-For` header.
	//
	// GlobalAccelerator will create Network Interfaces in your VPC in order
	// to preserve the client IP address.
	//
	// Client IP address preservation is supported only in specific AWS Regions.
	// See the GlobalAccelerator Developer Guide for a list.
	// Default: true if available.
	//
	PreserveClientIp *bool `field:"optional" json:"preserveClientIp" yaml:"preserveClientIp"`
	// Endpoint weight across all endpoints in the group.
	//
	// Must be a value between 0 and 255.
	// Default: 128.
	//
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

Properties for a ApplicationLoadBalancerEndpoint.

Example:

var alb applicationLoadBalancer
var listener listener

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewApplicationLoadBalancerEndpoint(alb, &ApplicationLoadBalancerEndpointOptions{
			Weight: jsii.Number(128),
			PreserveClientIp: jsii.Boolean(true),
		}),
	},
})

type CfnEipEndpoint

type CfnEipEndpoint interface {
	awsglobalaccelerator.IEndpoint
	// The region where the endpoint is located.
	//
	// If the region cannot be determined, `undefined` is returned.
	Region() *string
	// Render the endpoint to an endpoint configuration.
	RenderEndpointConfiguration() interface{}
}

Use an EC2 Instance as a Global Accelerator Endpoint.

Example:

var listener listener
var eip cfnEIP

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewCfnEipEndpoint(eip, &CfnEipEndpointProps{
			Weight: jsii.Number(128),
		}),
	},
})

func NewCfnEipEndpoint

func NewCfnEipEndpoint(eip awsec2.CfnEIP, options *CfnEipEndpointProps) CfnEipEndpoint

type CfnEipEndpointProps

type CfnEipEndpointProps struct {
	// Endpoint weight across all endpoints in the group.
	//
	// Must be a value between 0 and 255.
	// Default: 128.
	//
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

Properties for a NetworkLoadBalancerEndpoint.

Example:

var listener listener
var eip cfnEIP

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewCfnEipEndpoint(eip, &CfnEipEndpointProps{
			Weight: jsii.Number(128),
		}),
	},
})

type InstanceEndpoint

type InstanceEndpoint interface {
	awsglobalaccelerator.IEndpoint
	// The region where the endpoint is located.
	//
	// If the region cannot be determined, `undefined` is returned.
	Region() *string
	// Render the endpoint to an endpoint configuration.
	RenderEndpointConfiguration() interface{}
}

Use an EC2 Instance as a Global Accelerator Endpoint.

Example:

var listener listener
var instance instance

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewInstanceEndpoint(instance, &InstanceEndpointProps{
			Weight: jsii.Number(128),
			PreserveClientIp: jsii.Boolean(true),
		}),
	},
})

func NewInstanceEndpoint

func NewInstanceEndpoint(instance awsec2.IInstance, options *InstanceEndpointProps) InstanceEndpoint

type InstanceEndpointProps

type InstanceEndpointProps struct {
	// Forward the client IP address.
	//
	// GlobalAccelerator will create Network Interfaces in your VPC in order
	// to preserve the client IP address.
	//
	// Client IP address preservation is supported only in specific AWS Regions.
	// See the GlobalAccelerator Developer Guide for a list.
	// Default: true if available.
	//
	PreserveClientIp *bool `field:"optional" json:"preserveClientIp" yaml:"preserveClientIp"`
	// Endpoint weight across all endpoints in the group.
	//
	// Must be a value between 0 and 255.
	// Default: 128.
	//
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

Properties for a NetworkLoadBalancerEndpoint.

Example:

var listener listener
var instance instance

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewInstanceEndpoint(instance, &InstanceEndpointProps{
			Weight: jsii.Number(128),
			PreserveClientIp: jsii.Boolean(true),
		}),
	},
})

type NetworkLoadBalancerEndpoint

type NetworkLoadBalancerEndpoint interface {
	awsglobalaccelerator.IEndpoint
	// The region where the endpoint is located.
	//
	// If the region cannot be determined, `undefined` is returned.
	Region() *string
	// Render the endpoint to an endpoint configuration.
	RenderEndpointConfiguration() interface{}
}

Use a Network Load Balancer as a Global Accelerator Endpoint.

Example:

// Create an Accelerator
accelerator := globalaccelerator.NewAccelerator(this, jsii.String("Accelerator"))

// Create a Listener
listener := accelerator.AddListener(jsii.String("Listener"), &ListenerOptions{
	PortRanges: []portRange{
		&portRange{
			FromPort: jsii.Number(80),
		},
		&portRange{
			FromPort: jsii.Number(443),
		},
	},
})

// Import the Load Balancers
nlb1 := elbv2.NetworkLoadBalancer_FromNetworkLoadBalancerAttributes(this, jsii.String("NLB1"), &NetworkLoadBalancerAttributes{
	LoadBalancerArn: jsii.String("arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b"),
})
nlb2 := elbv2.NetworkLoadBalancer_FromNetworkLoadBalancerAttributes(this, jsii.String("NLB2"), &NetworkLoadBalancerAttributes{
	LoadBalancerArn: jsii.String("arn:aws:elasticloadbalancing:ap-south-1:111111111111:loadbalancer/app/my-load-balancer2/5513dc2ea8a1"),
})

// Add one EndpointGroup for each Region we are targeting
listener.AddEndpointGroup(jsii.String("Group1"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewNetworkLoadBalancerEndpoint(nlb1),
	},
})
listener.AddEndpointGroup(jsii.String("Group2"), &EndpointGroupOptions{
	// Imported load balancers automatically calculate their Region from the ARN.
	// If you are load balancing to other resources, you must also pass a `region`
	// parameter here.
	Endpoints: []*iEndpoint{
		ga_endpoints.NewNetworkLoadBalancerEndpoint(nlb2),
	},
})

type NetworkLoadBalancerEndpointProps

type NetworkLoadBalancerEndpointProps struct {
	// Endpoint weight across all endpoints in the group.
	//
	// Must be a value between 0 and 255.
	// Default: 128.
	//
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

Properties for a NetworkLoadBalancerEndpoint.

Example:

var nlb networkLoadBalancer
var listener listener

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []iEndpoint{
		ga_endpoints.NewNetworkLoadBalancerEndpoint(nlb, &NetworkLoadBalancerEndpointProps{
			Weight: jsii.Number(128),
		}),
	},
})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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