Registry / aws / aws-cdk-aws-globalaccelerator

aws-cdk-aws-globalaccelerator

JSON →
library1.204.0pypypiunverified

The AWS Cloud Development Kit (CDK) Construct Library for AWS Global Accelerator. This library allows developers to define and provision Global Accelerator resources using familiar programming languages. It is part of the AWS CDK v1 ecosystem, with version 1.204.0 being released as part of the broader CDK v1 maintenance cycle. AWS CDK has a regular release cadence, often weekly for minor updates and bug fixes.

pip install aws-cdk-aws-globalaccelerator aws-cdk.core
INSTALL
IMPORT
SIG · AWS-CDK-AWS-GLOBAL
A
aws-cdk-aws-globalaccelerator
awspythonv1.204.0
Install
7.1s avg
Import
Disk
59MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 57MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.1s · import 0.000s · 57MB
59MB installed
● package 59MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Accelerator
from aws_cdk import aws_globalaccelerator as ga
from aws_cdk.aws_globalaccelerator import Accelerator
While direct import works, aliasing to 'ga' is the community standard for brevity and consistency in CDK v1.
PortRange
from aws_cdk import aws_globalaccelerator as ga
ApplicationLoadBalancerEndpoint
from aws_cdk import aws_globalaccelerator_endpoints as ga_endpoints
from aws_cdk.aws_globalaccelerator import ApplicationLoadBalancerEndpoint
Endpoint-specific constructs are often in `aws_globalaccelerator_endpoints` for clarity, not directly in `aws_globalaccelerator`.

This quickstart demonstrates how to create a basic Global Accelerator with a listener and an empty endpoint group. It's runnable and will synthesize a CloudFormation template. To make it functional, you would typically add actual application endpoints (like Application Load Balancers or EC2 instances) to the `endpoint_group`.

import os from aws_cdk import ( core as cdk, aws_globalaccelerator as ga ) class GlobalAcceleratorStack(cdk.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, construct_id, **kwargs) # Create a Global Accelerator accelerator = ga.Accelerator(self, "MyGlobalAccelerator", accelerator_name="MyWebAppAccelerator" ) # Add a Listener for HTTP traffic on port 80 # GA listeners are always TCP or UDP. HTTP/S is handled by the endpoints. listener = ga.Listener(self, "HttpListener", accelerator=accelerator, port_ranges=[ga.PortRange(from_port=80, to_port=80)], protocol=ga.ConnectionProtocol.TCP ) # Add an Endpoint Group for a specific region # This group is initially empty; you would add actual endpoints to it. endpoint_group = ga.EndpointGroup(self, "UsEast1EndpointGroup", listener=listener, endpoint_group_region="us-east-1" # The region where your application endpoints reside ) # To add actual endpoints (e.g., an Application Load Balancer): # from aws_cdk import aws_globalaccelerator_endpoints as ga_endpoints # from aws_cdk import aws_elasticloadbalancingv2 as elbv2 # alb = elbv2.ApplicationLoadBalancer.from_lookup(...) # endpoint_group.add_endpoint(ga_endpoints.ApplicationLoadBalancerEndpoint(alb)) app = cdk.App() GlobalAcceleratorStack(app, "GlobalAcceleratorQuickstartStack", env=cdk.Environment( account=os.environ.get("CDK_DEFAULT_ACCOUNT"), region=os.environ.get("CDK_DEFAULT_REGION", "us-east-1") # GA itself is global, but stack needs a region for deployment ) ) app.synth()
cdk --version
Debug
Known issues
breakingThis library is for AWS CDK v1 (version 1.x.x). AWS CDK v2 has significant breaking changes, including module names (e.g., `aws_cdk.aws_globalaccelerator` vs `aws_cdk.aws_globalaccelerator` in v2 but with different class properties/methods) and construct patterns. Do not mix v1 and v2 libraries.
fix
Ensure all CDK libraries in your project are either v1.x.x or v2.x.x. If migrating to v2, consult the official CDK v2 upgrade guide for `aws-globalaccelerator` changes.
affects: CDK v1.x.x when attempting to use v2 constructs/patterns
gotchaGlobal Accelerator endpoint groups require a specified `endpoint_group_region`. While Global Accelerator itself is a global service, its endpoint groups must be associated with a specific AWS region where your application endpoints (e.g., ALBs, EC2 instances) reside.
fix
Always specify the `endpoint_group_region` property when creating an `EndpointGroup`. Ensure this region matches the region where the actual endpoints are deployed.
affects: All versions of `aws-cdk-aws-globalaccelerator`
gotchaGlobal Accelerator listeners require a list of `PortRange` objects, not just integers or tuples. Forgetting to wrap port numbers in `ga.PortRange()` is a common mistake.
fix
When defining `port_ranges` for a `Listener`, always use `[ga.PortRange(from_port=X, to_port=Y)]`.
affects: All versions of `aws-cdk-aws-globalaccelerator`
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk.corerequiredThis package is a CDK construct library and depends on aws-cdk.core for foundational CDK constructs and functionalities. This version specifically requires `aws-cdk.core (>=1.204.0,<2.0.0)`.
Agent activity
15 hits · last 30 days
node
14
Resources
aws-cdk-aws-globalaccelerator — pip install aws-cdk-aws-globalaccelerator · libregistry