Accelerator

class aws_cdk.aws_globalaccelerator.Accelerator(scope, id, *, accelerator_name=None, enabled=None)

Bases: aws_cdk.core.Resource

The Accelerator construct.

Parameters
  • scope (Construct) –

  • id (str) –

  • accelerator_name (Optional[str]) – The name of the accelerator. Default: - resource ID

  • enabled (Optional[bool]) – Indicates whether the accelerator is enabled. Default: true

Methods

add_listener(id, *, port_ranges, client_affinity=None, listener_name=None, protocol=None)

Add a listener to the accelerator.

Parameters
  • id (str) –

  • port_ranges (Sequence[PortRange]) – The list of port ranges for the connections from clients to the accelerator.

  • client_affinity (Optional[ClientAffinity]) – Client affinity to direct all requests from a user to the same endpoint. If you have stateful applications, client affinity lets you direct all requests from a user to the same endpoint. By default, each connection from each client is routed to seperate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint. Default: ClientAffinity.NONE

  • listener_name (Optional[str]) – Name of the listener. Default: - logical ID of the resource

  • protocol (Optional[ConnectionProtocol]) – The protocol for the connections from clients to the accelerator. Default: ConnectionProtocol.TCP

Return type

Listener

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DELETE), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters

policy (RemovalPolicy) –

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

accelerator_arn

The ARN of the accelerator.

Return type

str

dns_name

The Domain Name System (DNS) name that Global Accelerator creates that points to your accelerator’s static IP addresses.

Return type

str

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_accelerator_attributes(scope, id, *, accelerator_arn, dns_name)

import from attributes.

Parameters
  • scope (Construct) –

  • id (str) –

  • accelerator_arn (str) – The ARN of the accelerator.

  • dns_name (str) – The DNS name of the accelerator.

Return type

IAccelerator

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters

construct (IConstruct) –

Return type

bool