Class Accelerator
The Accelerator construct.
Inherited Members
Namespace: Amazon.CDK.AWS.GlobalAccelerator
Assembly: Amazon.CDK.AWS.GlobalAccelerator.dll
Syntax (csharp)
public class Accelerator : Resource, IAccelerator, IResource, IConstruct, IDependable
Syntax (vb)
Public Class Accelerator
Inherits Resource
Implements IAccelerator, IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
// Create an Accelerator
var accelerator = new Accelerator(this, "Accelerator");
// Create a Listener
var listener = accelerator.AddListener("Listener", new ListenerOptions {
PortRanges = new [] { new PortRange { FromPort = 80 }, new PortRange { FromPort = 443 } }
});
// Import the Load Balancers
var nlb1 = NetworkLoadBalancer.FromNetworkLoadBalancerAttributes(this, "NLB1", new NetworkLoadBalancerAttributes {
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b"
});
var nlb2 = NetworkLoadBalancer.FromNetworkLoadBalancerAttributes(this, "NLB2", new NetworkLoadBalancerAttributes {
LoadBalancerArn = "arn:aws:elasticloadbalancing:ap-south-1:111111111111:loadbalancer/app/my-load-balancer2/5513dc2ea8a1"
});
// Add one EndpointGroup for each Region we are targeting
listener.AddEndpointGroup("Group1", new EndpointGroupOptions {
Endpoints = new [] { new NetworkLoadBalancerEndpoint(nlb1) }
});
listener.AddEndpointGroup("Group2", new 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 = new [] { new NetworkLoadBalancerEndpoint(nlb2) }
});
Synopsis
Constructors
Accelerator(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Accelerator(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Accelerator(Construct, String, IAcceleratorProps) |
Properties
AcceleratorArn | The ARN of the accelerator. |
DnsName | The Domain Name System (DNS) name that Global Accelerator creates that points to your accelerator's static IP addresses. |
Methods
AddListener(String, IListenerOptions) | Add a listener to the accelerator. |
FromAcceleratorAttributes(Construct, String, IAcceleratorAttributes) | import from attributes. |
Constructors
Accelerator(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Accelerator(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Accelerator(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Accelerator(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Accelerator(Construct, String, IAcceleratorProps)
public Accelerator(Construct scope, string id, IAcceleratorProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IAcceleratorProps
Properties
AcceleratorArn
The ARN of the accelerator.
public virtual string AcceleratorArn { get; }
Property Value
System.String
DnsName
The Domain Name System (DNS) name that Global Accelerator creates that points to your accelerator's static IP addresses.
public virtual string DnsName { get; }
Property Value
System.String
Methods
AddListener(String, IListenerOptions)
Add a listener to the accelerator.
public virtual Listener AddListener(string id, IListenerOptions options)
Parameters
- id System.String
- options IListenerOptions
Returns
FromAcceleratorAttributes(Construct, String, IAcceleratorAttributes)
import from attributes.
public static IAccelerator FromAcceleratorAttributes(Construct scope, string id, IAcceleratorAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IAcceleratorAttributes
Returns