class BaseLoadBalancer
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.BaseLoadBalancer |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.BaseLoadBalancer |
Python | aws_cdk.aws_elasticloadbalancingv2.BaseLoadBalancer |
TypeScript (source) | @aws-cdk/aws-elasticloadbalancingv2 » BaseLoadBalancer |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
Extends
Resource
Implemented by
Application
, Network
Base class for both Application and Network Load Balancers.
Initializer
new BaseLoadBalancer(scope: Construct, id: string, baseProps: BaseLoadBalancerProps, additionalProps: any)
Parameters
- scope
Construct
- id
string
- baseProps
Base
Load Balancer Props - additionalProps
any
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
load | string | The ARN of this load balancer. |
load | string | The canonical hosted zone ID of this load balancer. |
load | string | The DNS name of this load balancer. |
load | string | The full name of this load balancer. |
load | string | The name of this load balancer. |
load | string[] | |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
vpc? | IVpc | The VPC this load balancer has been created in. |
env
Type:
Resource
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.
loadBalancerArn
Type:
string
The ARN of this load balancer.
Example value: arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-internal-load-balancer/50dc6c495c0c9188
loadBalancerCanonicalHostedZoneId
Type:
string
The canonical hosted zone ID of this load balancer.
Example value: Z2P70J7EXAMPLE
loadBalancerDnsName
Type:
string
The DNS name of this load balancer.
Example value: my-load-balancer-424835706.us-west-2.elb.amazonaws.com
loadBalancerFullName
Type:
string
The full name of this load balancer.
Example value: app/my-load-balancer/50dc6c495c0c9188
loadBalancerName
Type:
string
The name of this load balancer.
Example value: my-load-balancer
loadBalancerSecurityGroups
Type:
string[]
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
vpc?
Type:
IVpc
(optional)
The VPC this load balancer has been created in.
This property is always defined (not null
or undefined
) for sub-classes of BaseLoadBalancer
.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
log | Enable access logging for this load balancer. |
remove | Remove an attribute from the load balancer. |
set | Set a non-standard attribute on the load balancer. |
to | Returns a string representation of this construct. |
protected validate() | Validate the current construct. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
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.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
AccessLogs(bucket, prefix?)
logpublic logAccessLogs(bucket: IBucket, prefix?: string): void
Parameters
- bucket
IBucket
- prefix
string
Enable access logging for this load balancer.
A region must be specified on the stack containing the load balancer; you cannot enable logging on environment-agnostic stacks. See https://docs.aws.amazon.com/cdk/latest/guide/environments.html
Attribute(key)
removepublic removeAttribute(key: string): void
Parameters
- key
string
Remove an attribute from the load balancer.
Attribute(key, value?)
setpublic setAttribute(key: string, value?: string): void
Parameters
- key
string
- value
string
Set a non-standard attribute on the load balancer.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
protected validate()
protected validate(): string[]
Returns
string[]
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.