Documentation ¶
Index ¶
- func CfnLoadBalancer_CFN_RESOURCE_TYPE_NAME() *string
- func CfnLoadBalancer_IsCfnElement(x interface{}) *bool
- func CfnLoadBalancer_IsCfnResource(x interface{}) *bool
- func CfnLoadBalancer_IsConstruct(x interface{}) *bool
- func LoadBalancer_IsConstruct(x interface{}) *bool
- func LoadBalancer_IsOwnedResource(construct constructs.IConstruct) *bool
- func LoadBalancer_IsResource(construct constructs.IConstruct) *bool
- func NewCfnLoadBalancer_Override(c CfnLoadBalancer, scope constructs.Construct, id *string, ...)
- func NewInstanceTarget_Override(i InstanceTarget, instance awsec2.Instance)
- func NewListenerPort_Override(l ListenerPort, securityGroup awsec2.ISecurityGroup, defaultPort awsec2.Port)
- func NewLoadBalancer_Override(l LoadBalancer, scope constructs.Construct, id *string, ...)
- type CfnLoadBalancer
- type CfnLoadBalancerProps
- type CfnLoadBalancer_AccessLoggingPolicyProperty
- type CfnLoadBalancer_AppCookieStickinessPolicyProperty
- type CfnLoadBalancer_ConnectionDrainingPolicyProperty
- type CfnLoadBalancer_ConnectionSettingsProperty
- type CfnLoadBalancer_HealthCheckProperty
- type CfnLoadBalancer_LBCookieStickinessPolicyProperty
- type CfnLoadBalancer_ListenersProperty
- type CfnLoadBalancer_PoliciesProperty
- type HealthCheck
- type ILoadBalancerTarget
- type InstanceTarget
- type ListenerPort
- type LoadBalancer
- type LoadBalancerListener
- type LoadBalancerProps
- type LoadBalancingProtocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnLoadBalancer_CFN_RESOURCE_TYPE_NAME ¶
func CfnLoadBalancer_CFN_RESOURCE_TYPE_NAME() *string
func CfnLoadBalancer_IsCfnElement ¶
func CfnLoadBalancer_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnLoadBalancer_IsCfnResource ¶
func CfnLoadBalancer_IsCfnResource(x interface{}) *bool
Check whether the given object is a CfnResource.
func CfnLoadBalancer_IsConstruct ¶
func CfnLoadBalancer_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func LoadBalancer_IsConstruct ¶
func LoadBalancer_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func LoadBalancer_IsOwnedResource ¶ added in v2.32.0
func LoadBalancer_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func LoadBalancer_IsResource ¶
func LoadBalancer_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
func NewCfnLoadBalancer_Override ¶
func NewCfnLoadBalancer_Override(c CfnLoadBalancer, scope constructs.Construct, id *string, props *CfnLoadBalancerProps)
func NewInstanceTarget_Override ¶ added in v2.70.0
func NewInstanceTarget_Override(i InstanceTarget, instance awsec2.Instance)
Create a new Instance target.
func NewListenerPort_Override ¶
func NewListenerPort_Override(l ListenerPort, securityGroup awsec2.ISecurityGroup, defaultPort awsec2.Port)
func NewLoadBalancer_Override ¶
func NewLoadBalancer_Override(l LoadBalancer, scope constructs.Construct, id *string, props *LoadBalancerProps)
Types ¶
type CfnLoadBalancer ¶
type CfnLoadBalancer interface { awscdk.CfnResource awscdk.IInspectable awscdk.ITaggable // Information about where and how access logs are stored for the load balancer. AccessLoggingPolicy() interface{} SetAccessLoggingPolicy(val interface{}) // Information about a policy for application-controlled session stickiness. AppCookieStickinessPolicy() interface{} SetAppCookieStickinessPolicy(val interface{}) // The name of the Route 53 hosted zone that is associated with the load balancer. // // Internal-facing load balancers don't use this value, use `DNSName` instead. AttrCanonicalHostedZoneName() *string // The ID of the Route 53 hosted zone name that is associated with the load balancer. AttrCanonicalHostedZoneNameId() *string // The DNS name for the load balancer. AttrDnsName() *string AttrId() *string // The name of the security group that you can use as part of your inbound rules for your load balancer's back-end instances. AttrSourceSecurityGroupGroupName() *string // The owner of the source security group. AttrSourceSecurityGroupOwnerAlias() *string // The Availability Zones for the load balancer. // // For load balancers in a VPC, specify `Subnets` instead. AvailabilityZones() *[]*string SetAvailabilityZones(val *[]*string) // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance. ConnectionDrainingPolicy() interface{} SetConnectionDrainingPolicy(val interface{}) // If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration. ConnectionSettings() interface{} SetConnectionSettings(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones. CrossZone() interface{} SetCrossZone(val interface{}) // The health check settings to use when evaluating the health of your EC2 instances. HealthCheck() interface{} SetHealthCheck(val interface{}) // The IDs of the instances for the load balancer. Instances() *[]*string SetInstances(val *[]*string) // Information about a policy for duration-based session stickiness. LbCookieStickinessPolicy() interface{} SetLbCookieStickinessPolicy(val interface{}) // The listeners for the load balancer. // // You can specify at most one listener per port. Listeners() interface{} SetListeners(val interface{}) // The name of the load balancer. LoadBalancerName() *string SetLoadBalancerName(val *string) // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // The policies defined for your Classic Load Balancer. Policies() interface{} SetPolicies(val interface{}) // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // The type of load balancer. // // Valid only for load balancers in a VPC. Scheme() *string SetScheme(val *string) // The security groups for the load balancer. SecurityGroups() *[]*string SetSecurityGroups(val *[]*string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // The IDs of the subnets for the load balancer. // // You can specify at most one subnet per Availability Zone. Subnets() *[]*string SetSubnets(val *[]*string) // Tag Manager which manages the tags for this resource. Tags() awscdk.TagManager // The tags associated with a load balancer. TagsRaw() *[]*awscdk.CfnTag SetTagsRaw(val *[]*awscdk.CfnTag) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // 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`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
Specifies a Classic Load Balancer.
You can specify the `AvailabilityZones` or `Subnets` property, but not both.
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the [DependsOn attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) to declare a dependency on the VPC-gateway attachment.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var attributes interface{} cfnLoadBalancer := awscdk.Aws_elasticloadbalancing.NewCfnLoadBalancer(this, jsii.String("MyCfnLoadBalancer"), &CfnLoadBalancerProps{ Listeners: []interface{}{ &ListenersProperty{ InstancePort: jsii.String("instancePort"), LoadBalancerPort: jsii.String("loadBalancerPort"), Protocol: jsii.String("protocol"), // the properties below are optional InstanceProtocol: jsii.String("instanceProtocol"), PolicyNames: []*string{ jsii.String("policyNames"), }, SslCertificateId: jsii.String("sslCertificateId"), }, }, // the properties below are optional AccessLoggingPolicy: &AccessLoggingPolicyProperty{ Enabled: jsii.Boolean(false), S3BucketName: jsii.String("s3BucketName"), // the properties below are optional EmitInterval: jsii.Number(123), S3BucketPrefix: jsii.String("s3BucketPrefix"), }, AppCookieStickinessPolicy: []interface{}{ &AppCookieStickinessPolicyProperty{ CookieName: jsii.String("cookieName"), PolicyName: jsii.String("policyName"), }, }, AvailabilityZones: []*string{ jsii.String("availabilityZones"), }, ConnectionDrainingPolicy: &ConnectionDrainingPolicyProperty{ Enabled: jsii.Boolean(false), // the properties below are optional Timeout: jsii.Number(123), }, ConnectionSettings: &ConnectionSettingsProperty{ IdleTimeout: jsii.Number(123), }, CrossZone: jsii.Boolean(false), HealthCheck: &HealthCheckProperty{ HealthyThreshold: jsii.String("healthyThreshold"), Interval: jsii.String("interval"), Target: jsii.String("target"), Timeout: jsii.String("timeout"), UnhealthyThreshold: jsii.String("unhealthyThreshold"), }, Instances: []*string{ jsii.String("instances"), }, LbCookieStickinessPolicy: []interface{}{ &LBCookieStickinessPolicyProperty{ CookieExpirationPeriod: jsii.String("cookieExpirationPeriod"), PolicyName: jsii.String("policyName"), }, }, LoadBalancerName: jsii.String("loadBalancerName"), Policies: []interface{}{ &PoliciesProperty{ Attributes: []interface{}{ attributes, }, PolicyName: jsii.String("policyName"), PolicyType: jsii.String("policyType"), // the properties below are optional InstancePorts: []*string{ jsii.String("instancePorts"), }, LoadBalancerPorts: []*string{ jsii.String("loadBalancerPorts"), }, }, }, Scheme: jsii.String("scheme"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, })
func NewCfnLoadBalancer ¶
func NewCfnLoadBalancer(scope constructs.Construct, id *string, props *CfnLoadBalancerProps) CfnLoadBalancer
type CfnLoadBalancerProps ¶
type CfnLoadBalancerProps struct { // The listeners for the load balancer. You can specify at most one listener per port. // // If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-listeners // Listeners interface{} `field:"required" json:"listeners" yaml:"listeners"` // Information about where and how access logs are stored for the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-accessloggingpolicy // AccessLoggingPolicy interface{} `field:"optional" json:"accessLoggingPolicy" yaml:"accessLoggingPolicy"` // Information about a policy for application-controlled session stickiness. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-appcookiestickinesspolicy // AppCookieStickinessPolicy interface{} `field:"optional" json:"appCookieStickinessPolicy" yaml:"appCookieStickinessPolicy"` // The Availability Zones for the load balancer. For load balancers in a VPC, specify `Subnets` instead. // // Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-availabilityzones // AvailabilityZones *[]*string `field:"optional" json:"availabilityZones" yaml:"availabilityZones"` // If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance. // // For more information, see [Configure connection draining](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-conn-drain.html) in the *User Guide for Classic Load Balancers* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-connectiondrainingpolicy // ConnectionDrainingPolicy interface{} `field:"optional" json:"connectionDrainingPolicy" yaml:"connectionDrainingPolicy"` // If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration. // // By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see [Configure idle connection timeout](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/config-idle-timeout.html) in the *User Guide for Classic Load Balancers* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-connectionsettings // ConnectionSettings interface{} `field:"optional" json:"connectionSettings" yaml:"connectionSettings"` // If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones. // // For more information, see [Configure cross-zone load balancing](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-crosszone-lb.html) in the *User Guide for Classic Load Balancers* . // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-crosszone // CrossZone interface{} `field:"optional" json:"crossZone" yaml:"crossZone"` // The health check settings to use when evaluating the health of your EC2 instances. // // Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-healthcheck // HealthCheck interface{} `field:"optional" json:"healthCheck" yaml:"healthCheck"` // The IDs of the instances for the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-instances // Instances *[]*string `field:"optional" json:"instances" yaml:"instances"` // Information about a policy for duration-based session stickiness. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-lbcookiestickinesspolicy // LbCookieStickinessPolicy interface{} `field:"optional" json:"lbCookieStickinessPolicy" yaml:"lbCookieStickinessPolicy"` // The name of the load balancer. // // This name must be unique within your set of load balancers for the region. // // If you don't specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-loadbalancername // LoadBalancerName *string `field:"optional" json:"loadBalancerName" yaml:"loadBalancerName"` // The policies defined for your Classic Load Balancer. // // Specify only back-end server policies. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-policies // Policies interface{} `field:"optional" json:"policies" yaml:"policies"` // The type of load balancer. Valid only for load balancers in a VPC. // // If `Scheme` is `internet-facing` , the load balancer has a public DNS name that resolves to a public IP address. // // If `Scheme` is `internal` , the load balancer has a public DNS name that resolves to a private IP address. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-scheme // Scheme *string `field:"optional" json:"scheme" yaml:"scheme"` // The security groups for the load balancer. // // Valid only for load balancers in a VPC. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-securitygroups // SecurityGroups *[]*string `field:"optional" json:"securityGroups" yaml:"securityGroups"` // The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone. // // Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-subnets // Subnets *[]*string `field:"optional" json:"subnets" yaml:"subnets"` // The tags associated with a load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancing-loadbalancer.html#cfn-elasticloadbalancing-loadbalancer-tags // Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` }
Properties for defining a `CfnLoadBalancer`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var attributes interface{} cfnLoadBalancerProps := &CfnLoadBalancerProps{ Listeners: []interface{}{ &ListenersProperty{ InstancePort: jsii.String("instancePort"), LoadBalancerPort: jsii.String("loadBalancerPort"), Protocol: jsii.String("protocol"), // the properties below are optional InstanceProtocol: jsii.String("instanceProtocol"), PolicyNames: []*string{ jsii.String("policyNames"), }, SslCertificateId: jsii.String("sslCertificateId"), }, }, // the properties below are optional AccessLoggingPolicy: &AccessLoggingPolicyProperty{ Enabled: jsii.Boolean(false), S3BucketName: jsii.String("s3BucketName"), // the properties below are optional EmitInterval: jsii.Number(123), S3BucketPrefix: jsii.String("s3BucketPrefix"), }, AppCookieStickinessPolicy: []interface{}{ &AppCookieStickinessPolicyProperty{ CookieName: jsii.String("cookieName"), PolicyName: jsii.String("policyName"), }, }, AvailabilityZones: []*string{ jsii.String("availabilityZones"), }, ConnectionDrainingPolicy: &ConnectionDrainingPolicyProperty{ Enabled: jsii.Boolean(false), // the properties below are optional Timeout: jsii.Number(123), }, ConnectionSettings: &ConnectionSettingsProperty{ IdleTimeout: jsii.Number(123), }, CrossZone: jsii.Boolean(false), HealthCheck: &HealthCheckProperty{ HealthyThreshold: jsii.String("healthyThreshold"), Interval: jsii.String("interval"), Target: jsii.String("target"), Timeout: jsii.String("timeout"), UnhealthyThreshold: jsii.String("unhealthyThreshold"), }, Instances: []*string{ jsii.String("instances"), }, LbCookieStickinessPolicy: []interface{}{ &LBCookieStickinessPolicyProperty{ CookieExpirationPeriod: jsii.String("cookieExpirationPeriod"), PolicyName: jsii.String("policyName"), }, }, LoadBalancerName: jsii.String("loadBalancerName"), Policies: []interface{}{ &PoliciesProperty{ Attributes: []interface{}{ attributes, }, PolicyName: jsii.String("policyName"), PolicyType: jsii.String("policyType"), // the properties below are optional InstancePorts: []*string{ jsii.String("instancePorts"), }, LoadBalancerPorts: []*string{ jsii.String("loadBalancerPorts"), }, }, }, Scheme: jsii.String("scheme"), SecurityGroups: []*string{ jsii.String("securityGroups"), }, Subnets: []*string{ jsii.String("subnets"), }, Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, }
type CfnLoadBalancer_AccessLoggingPolicyProperty ¶
type CfnLoadBalancer_AccessLoggingPolicyProperty struct { // Specifies whether access logs are enabled for the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-accessloggingpolicy.html#cfn-elasticloadbalancing-loadbalancer-accessloggingpolicy-enabled // Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"` // The name of the Amazon S3 bucket where the access logs are stored. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-accessloggingpolicy.html#cfn-elasticloadbalancing-loadbalancer-accessloggingpolicy-s3bucketname // S3BucketName *string `field:"required" json:"s3BucketName" yaml:"s3BucketName"` // The interval for publishing the access logs. You can specify an interval of either 5 minutes or 60 minutes. // // Default: 60 minutes. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-accessloggingpolicy.html#cfn-elasticloadbalancing-loadbalancer-accessloggingpolicy-emitinterval // EmitInterval *float64 `field:"optional" json:"emitInterval" yaml:"emitInterval"` // The logical hierarchy you created for your Amazon S3 bucket, for example `my-bucket-prefix/prod` . // // If the prefix is not provided, the log is placed at the root level of the bucket. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-accessloggingpolicy.html#cfn-elasticloadbalancing-loadbalancer-accessloggingpolicy-s3bucketprefix // S3BucketPrefix *string `field:"optional" json:"s3BucketPrefix" yaml:"s3BucketPrefix"` }
Specifies where and how access logs are stored for your Classic Load Balancer.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" accessLoggingPolicyProperty := &AccessLoggingPolicyProperty{ Enabled: jsii.Boolean(false), S3BucketName: jsii.String("s3BucketName"), // the properties below are optional EmitInterval: jsii.Number(123), S3BucketPrefix: jsii.String("s3BucketPrefix"), }
type CfnLoadBalancer_AppCookieStickinessPolicyProperty ¶
type CfnLoadBalancer_AppCookieStickinessPolicyProperty struct { // The name of the application cookie used for stickiness. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-appcookiestickinesspolicy.html#cfn-elasticloadbalancing-loadbalancer-appcookiestickinesspolicy-cookiename // CookieName *string `field:"required" json:"cookieName" yaml:"cookieName"` // The mnemonic name for the policy being created. // // The name must be unique within a set of policies for this load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-appcookiestickinesspolicy.html#cfn-elasticloadbalancing-loadbalancer-appcookiestickinesspolicy-policyname // PolicyName *string `field:"required" json:"policyName" yaml:"policyName"` }
Specifies a policy for application-controlled session stickiness for your Classic Load Balancer.
To associate a policy with a listener, use the [PolicyNames](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-policynames) property for the listener.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" appCookieStickinessPolicyProperty := &AppCookieStickinessPolicyProperty{ CookieName: jsii.String("cookieName"), PolicyName: jsii.String("policyName"), }
type CfnLoadBalancer_ConnectionDrainingPolicyProperty ¶
type CfnLoadBalancer_ConnectionDrainingPolicyProperty struct { // Specifies whether connection draining is enabled for the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-connectiondrainingpolicy.html#cfn-elasticloadbalancing-loadbalancer-connectiondrainingpolicy-enabled // Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"` // The maximum time, in seconds, to keep the existing connections open before deregistering the instances. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-connectiondrainingpolicy.html#cfn-elasticloadbalancing-loadbalancer-connectiondrainingpolicy-timeout // Timeout *float64 `field:"optional" json:"timeout" yaml:"timeout"` }
Specifies the connection draining settings for your Classic Load Balancer.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" connectionDrainingPolicyProperty := &ConnectionDrainingPolicyProperty{ Enabled: jsii.Boolean(false), // the properties below are optional Timeout: jsii.Number(123), }
type CfnLoadBalancer_ConnectionSettingsProperty ¶
type CfnLoadBalancer_ConnectionSettingsProperty struct { // The time, in seconds, that the connection is allowed to be idle (no data has been sent over the connection) before it is closed by the load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-connectionsettings.html#cfn-elasticloadbalancing-loadbalancer-connectionsettings-idletimeout // IdleTimeout *float64 `field:"required" json:"idleTimeout" yaml:"idleTimeout"` }
Specifies the idle timeout value for your Classic Load Balancer.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" connectionSettingsProperty := &ConnectionSettingsProperty{ IdleTimeout: jsii.Number(123), }
type CfnLoadBalancer_HealthCheckProperty ¶
type CfnLoadBalancer_HealthCheckProperty struct { // The number of consecutive health checks successes required before moving the instance to the `Healthy` state. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-healthcheck.html#cfn-elasticloadbalancing-loadbalancer-healthcheck-healthythreshold // HealthyThreshold *string `field:"required" json:"healthyThreshold" yaml:"healthyThreshold"` // The approximate interval, in seconds, between health checks of an individual instance. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-healthcheck.html#cfn-elasticloadbalancing-loadbalancer-healthcheck-interval // Interval *string `field:"required" json:"interval" yaml:"interval"` // The instance being checked. // // The protocol is either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1) through 65535. // // TCP is the default, specified as a TCP: port pair, for example "TCP:5000". In this case, a health check simply attempts to open a TCP connection to the instance on the specified port. Failure to connect within the configured timeout is considered unhealthy. // // SSL is also specified as SSL: port pair, for example, SSL:5000. // // For HTTP/HTTPS, you must include a ping path in the string. HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to the instance on the given port and path. Any answer other than "200 OK" within the timeout period is considered unhealthy. // // The total length of the HTTP ping target must be 1024 16-bit Unicode characters or less. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-healthcheck.html#cfn-elasticloadbalancing-loadbalancer-healthcheck-target // Target *string `field:"required" json:"target" yaml:"target"` // The amount of time, in seconds, during which no response means a failed health check. // // This value must be less than the `Interval` value. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-healthcheck.html#cfn-elasticloadbalancing-loadbalancer-healthcheck-timeout // Timeout *string `field:"required" json:"timeout" yaml:"timeout"` // The number of consecutive health check failures required before moving the instance to the `Unhealthy` state. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-healthcheck.html#cfn-elasticloadbalancing-loadbalancer-healthcheck-unhealthythreshold // UnhealthyThreshold *string `field:"required" json:"unhealthyThreshold" yaml:"unhealthyThreshold"` }
Specifies health check settings for your Classic Load Balancer.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" healthCheckProperty := &HealthCheckProperty{ HealthyThreshold: jsii.String("healthyThreshold"), Interval: jsii.String("interval"), Target: jsii.String("target"), Timeout: jsii.String("timeout"), UnhealthyThreshold: jsii.String("unhealthyThreshold"), }
type CfnLoadBalancer_LBCookieStickinessPolicyProperty ¶
type CfnLoadBalancer_LBCookieStickinessPolicyProperty struct { // The time period, in seconds, after which the cookie should be considered stale. // // If this parameter is not specified, the stickiness session lasts for the duration of the browser session. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-lbcookiestickinesspolicy.html#cfn-elasticloadbalancing-loadbalancer-lbcookiestickinesspolicy-cookieexpirationperiod // CookieExpirationPeriod *string `field:"optional" json:"cookieExpirationPeriod" yaml:"cookieExpirationPeriod"` // The name of the policy. // // This name must be unique within the set of policies for this load balancer. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-lbcookiestickinesspolicy.html#cfn-elasticloadbalancing-loadbalancer-lbcookiestickinesspolicy-policyname // PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"` }
Specifies a policy for duration-based session stickiness for your Classic Load Balancer.
To associate a policy with a listener, use the [PolicyNames](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-policynames) property for the listener.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" lBCookieStickinessPolicyProperty := &LBCookieStickinessPolicyProperty{ CookieExpirationPeriod: jsii.String("cookieExpirationPeriod"), PolicyName: jsii.String("policyName"), }
type CfnLoadBalancer_ListenersProperty ¶
type CfnLoadBalancer_ListenersProperty struct { // The port on which the instance is listening. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-instanceport // InstancePort *string `field:"required" json:"instancePort" yaml:"instancePort"` // The port on which the load balancer is listening. // // On EC2-VPC, you can specify any port from the range 1-65535. On EC2-Classic, you can specify any port from the following list: 25, 80, 443, 465, 587, 1024-65535. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-loadbalancerport // LoadBalancerPort *string `field:"required" json:"loadBalancerPort" yaml:"loadBalancerPort"` // The load balancer transport protocol to use for routing: HTTP, HTTPS, TCP, or SSL. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-protocol // Protocol *string `field:"required" json:"protocol" yaml:"protocol"` // The protocol to use for routing traffic to instances: HTTP, HTTPS, TCP, or SSL. // // If the front-end protocol is TCP or SSL, the back-end protocol must be TCP or SSL. If the front-end protocol is HTTP or HTTPS, the back-end protocol must be HTTP or HTTPS. // // If there is another listener with the same `InstancePort` whose `InstanceProtocol` is secure, (HTTPS or SSL), the listener's `InstanceProtocol` must also be secure. // // If there is another listener with the same `InstancePort` whose `InstanceProtocol` is HTTP or TCP, the listener's `InstanceProtocol` must be HTTP or TCP. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-instanceprotocol // InstanceProtocol *string `field:"optional" json:"instanceProtocol" yaml:"instanceProtocol"` // The names of the policies to associate with the listener. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-policynames // PolicyNames *[]*string `field:"optional" json:"policyNames" yaml:"policyNames"` // The Amazon Resource Name (ARN) of the server certificate. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-listeners.html#cfn-elasticloadbalancing-loadbalancer-listeners-sslcertificateid // SslCertificateId *string `field:"optional" json:"sslCertificateId" yaml:"sslCertificateId"` }
Specifies a listener for your Classic Load Balancer.
Modifying any property replaces the listener.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" listenersProperty := &ListenersProperty{ InstancePort: jsii.String("instancePort"), LoadBalancerPort: jsii.String("loadBalancerPort"), Protocol: jsii.String("protocol"), // the properties below are optional InstanceProtocol: jsii.String("instanceProtocol"), PolicyNames: []*string{ jsii.String("policyNames"), }, SslCertificateId: jsii.String("sslCertificateId"), }
type CfnLoadBalancer_PoliciesProperty ¶
type CfnLoadBalancer_PoliciesProperty struct { // The policy attributes. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-policies.html#cfn-elasticloadbalancing-loadbalancer-policies-attributes // Attributes interface{} `field:"required" json:"attributes" yaml:"attributes"` // The name of the policy. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-policies.html#cfn-elasticloadbalancing-loadbalancer-policies-policyname // PolicyName *string `field:"required" json:"policyName" yaml:"policyName"` // The name of the policy type. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-policies.html#cfn-elasticloadbalancing-loadbalancer-policies-policytype // PolicyType *string `field:"required" json:"policyType" yaml:"policyType"` // The instance ports for the policy. // // Required only for some policy types. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-policies.html#cfn-elasticloadbalancing-loadbalancer-policies-instanceports // InstancePorts *[]*string `field:"optional" json:"instancePorts" yaml:"instancePorts"` // The load balancer ports for the policy. // // Required only for some policy types. // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancing-loadbalancer-policies.html#cfn-elasticloadbalancing-loadbalancer-policies-loadbalancerports // LoadBalancerPorts *[]*string `field:"optional" json:"loadBalancerPorts" yaml:"loadBalancerPorts"` }
Specifies policies for your Classic Load Balancer.
To associate policies with a listener, use the [PolicyNames](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb-listener.html#cfn-ec2-elb-listener-policynames) property for the listener.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" var attributes interface{} policiesProperty := &PoliciesProperty{ Attributes: []interface{}{ attributes, }, PolicyName: jsii.String("policyName"), PolicyType: jsii.String("policyType"), // the properties below are optional InstancePorts: []*string{ jsii.String("instancePorts"), }, LoadBalancerPorts: []*string{ jsii.String("loadBalancerPorts"), }, }
type HealthCheck ¶
type HealthCheck struct { // What port number to health check on. Port *float64 `field:"required" json:"port" yaml:"port"` // After how many successful checks is an instance considered healthy. // Default: 2. // HealthyThreshold *float64 `field:"optional" json:"healthyThreshold" yaml:"healthyThreshold"` // Number of seconds between health checks. // Default: Duration.seconds(30) // Interval awscdk.Duration `field:"optional" json:"interval" yaml:"interval"` // What path to use for HTTP or HTTPS health check (must return 200). // // For SSL and TCP health checks, accepting connections is enough to be considered // healthy. // Default: "/". // Path *string `field:"optional" json:"path" yaml:"path"` // What protocol to use for health checking. // // The protocol is automatically determined from the port if it's not supplied. // Default: Automatic. // Protocol LoadBalancingProtocol `field:"optional" json:"protocol" yaml:"protocol"` // Health check timeout. // Default: Duration.seconds(5) // Timeout awscdk.Duration `field:"optional" json:"timeout" yaml:"timeout"` // After how many unsuccessful checks is an instance considered unhealthy. // Default: 5. // UnhealthyThreshold *float64 `field:"optional" json:"unhealthyThreshold" yaml:"unhealthyThreshold"` }
Describe the health check to a load balancer.
Example:
var vpc iVpc var myAutoScalingGroup autoScalingGroup lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), HealthCheck: &HealthCheck{ Port: jsii.Number(80), }, }) lb.AddTarget(myAutoScalingGroup) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), })
type ILoadBalancerTarget ¶
type ILoadBalancerTarget interface { awsec2.IConnectable // Attach load-balanced target to a classic ELB. AttachToClassicLB(loadBalancer LoadBalancer) }
Interface that is going to be implemented by constructs that you can load balance to.
type InstanceTarget ¶ added in v2.70.0
type InstanceTarget interface { ILoadBalancerTarget // The network connections associated with this resource. Connections() awsec2.Connections // Instance to register to. Instance() awsec2.Instance // Attach load-balanced target to a classic ELB. AttachToClassicLB(loadBalancer LoadBalancer) }
An EC2 instance that is the target for load balancing.
Example:
var vpc iVpc lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), }) // instance to add as the target for load balancer. instance := ec2.NewInstance(this, jsii.String("targetInstance"), &InstanceProps{ Vpc: vpc, InstanceType: ec2.InstanceType_Of(ec2.InstanceClass_BURSTABLE2, ec2.InstanceSize_MICRO), MachineImage: ec2.NewAmazonLinuxImage(&AmazonLinuxImageProps{ Generation: ec2.AmazonLinuxGeneration_AMAZON_LINUX_2, }), }) lb.AddTarget(elb.NewInstanceTarget(instance))
func NewInstanceTarget ¶ added in v2.70.0
func NewInstanceTarget(instance awsec2.Instance) InstanceTarget
Create a new Instance target.
type ListenerPort ¶
type ListenerPort interface { awsec2.IConnectable // The network connections associated with this resource. Connections() awsec2.Connections }
Reference to a listener's port just created.
This implements IConnectable with a default port (the port that an ELB listener was just created on) for a given security group so that it can be conveniently used just like any Connectable. E.g:
const listener = elb.addListener(...); listener.connections.allowDefaultPortFromAnyIPv4(); // or instance.connections.allowToDefaultPort(listener);
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" var port port var securityGroup securityGroup listenerPort := awscdk.Aws_elasticloadbalancing.NewListenerPort(securityGroup, port)
func NewListenerPort ¶
func NewListenerPort(securityGroup awsec2.ISecurityGroup, defaultPort awsec2.Port) ListenerPort
type LoadBalancer ¶
type LoadBalancer interface { awscdk.Resource awsec2.IConnectable // Control all connections from and to this load balancer. Connections() awsec2.Connections // 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. Env() *awscdk.ResourceEnvironment // An object controlling specifically the connections for each listener added to this load balancer. ListenerPorts() *[]ListenerPort LoadBalancerCanonicalHostedZoneName() *string LoadBalancerCanonicalHostedZoneNameId() *string LoadBalancerDnsName() *string LoadBalancerName() *string LoadBalancerSourceSecurityGroupGroupName() *string LoadBalancerSourceSecurityGroupOwnerAlias() *string // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Add a backend to the load balancer. // // Returns: A ListenerPort object that controls connections to the listener port. AddListener(listener *LoadBalancerListener) ListenerPort AddTarget(target ILoadBalancerTarget) // 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`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Returns a string representation of this construct. ToString() *string }
A load balancer with a single listener.
Routes to a fleet of of instances in a VPC.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, }) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), }) lb.AddTarget(service.LoadBalancerTarget(&LoadBalancerTargetOptions{ ContainerName: jsii.String("MyContainer"), ContainerPort: jsii.Number(80), }))
func NewLoadBalancer ¶
func NewLoadBalancer(scope constructs.Construct, id *string, props *LoadBalancerProps) LoadBalancer
type LoadBalancerListener ¶
type LoadBalancerListener struct { // External listening port. ExternalPort *float64 `field:"required" json:"externalPort" yaml:"externalPort"` // Allow connections to the load balancer from the given set of connection peers. // // By default, connections will be allowed from anywhere. Set this to an empty list // to deny connections, or supply a custom list of peers to allow connections from // (IP ranges or security groups). // Default: Anywhere. // AllowConnectionsFrom *[]awsec2.IConnectable `field:"optional" json:"allowConnectionsFrom" yaml:"allowConnectionsFrom"` // What public protocol to use for load balancing. // // Either 'tcp', 'ssl', 'http' or 'https'. // // May be omitted if the external port is either 80 or 443. ExternalProtocol LoadBalancingProtocol `field:"optional" json:"externalProtocol" yaml:"externalProtocol"` // Instance listening port. // // Same as the externalPort if not specified. // Default: externalPort. // InternalPort *float64 `field:"optional" json:"internalPort" yaml:"internalPort"` // What public protocol to use for load balancing. // // Either 'tcp', 'ssl', 'http' or 'https'. // // May be omitted if the internal port is either 80 or 443. // // The instance protocol is 'tcp' if the front-end protocol // is 'tcp' or 'ssl', the instance protocol is 'http' if the // front-end protocol is 'https'. InternalProtocol LoadBalancingProtocol `field:"optional" json:"internalProtocol" yaml:"internalProtocol"` // SSL policy names. PolicyNames *[]*string `field:"optional" json:"policyNames" yaml:"policyNames"` // the ARN of the SSL certificate. // Default: - none. // SslCertificateArn *string `field:"optional" json:"sslCertificateArn" yaml:"sslCertificateArn"` }
Add a backend to the load balancer.
Example:
var vpc iVpc var myAutoScalingGroup autoScalingGroup lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, InternetFacing: jsii.Boolean(true), HealthCheck: &HealthCheck{ Port: jsii.Number(80), }, }) lb.AddTarget(myAutoScalingGroup) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), })
type LoadBalancerProps ¶
type LoadBalancerProps struct { // VPC network of the fleet instances. Vpc awsec2.IVpc `field:"required" json:"vpc" yaml:"vpc"` // Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket. // Default: - disabled. // AccessLoggingPolicy *CfnLoadBalancer_AccessLoggingPolicyProperty `field:"optional" json:"accessLoggingPolicy" yaml:"accessLoggingPolicy"` // Whether cross zone load balancing is enabled. // // This controls whether the load balancer evenly distributes requests // across each availability zone. // Default: true. // CrossZone *bool `field:"optional" json:"crossZone" yaml:"crossZone"` // Health check settings for the load balancing targets. // // Not required but recommended. // Default: - None. // HealthCheck *HealthCheck `field:"optional" json:"healthCheck" yaml:"healthCheck"` // Whether this is an internet-facing Load Balancer. // // This controls whether the LB has a public IP address assigned. It does // not open up the Load Balancer's security groups to public internet access. // Default: false. // InternetFacing *bool `field:"optional" json:"internetFacing" yaml:"internetFacing"` // What listeners to set up for the load balancer. // // Can also be added by .addListener() // Default: -. // Listeners *[]*LoadBalancerListener `field:"optional" json:"listeners" yaml:"listeners"` // Which subnets to deploy the load balancer. // // Can be used to define a specific set of subnets to deploy the load balancer to. // Useful multiple public or private subnets are covering the same availability zone. // Default: - Public subnets if internetFacing, Private subnets otherwise. // SubnetSelection *awsec2.SubnetSelection `field:"optional" json:"subnetSelection" yaml:"subnetSelection"` // What targets to load balance to. // // Can also be added by .addTarget() // Default: - None. // Targets *[]ILoadBalancerTarget `field:"optional" json:"targets" yaml:"targets"` }
Construction properties for a LoadBalancer.
Example:
var cluster cluster var taskDefinition taskDefinition var vpc vpc service := ecs.NewEc2Service(this, jsii.String("Service"), &Ec2ServiceProps{ Cluster: Cluster, TaskDefinition: TaskDefinition, }) lb := elb.NewLoadBalancer(this, jsii.String("LB"), &LoadBalancerProps{ Vpc: Vpc, }) lb.AddListener(&LoadBalancerListener{ ExternalPort: jsii.Number(80), }) lb.AddTarget(service.LoadBalancerTarget(&LoadBalancerTargetOptions{ ContainerName: jsii.String("MyContainer"), ContainerPort: jsii.Number(80), }))
type LoadBalancingProtocol ¶
type LoadBalancingProtocol string
const ( LoadBalancingProtocol_TCP LoadBalancingProtocol = "TCP" LoadBalancingProtocol_SSL LoadBalancingProtocol = "SSL" LoadBalancingProtocol_HTTP LoadBalancingProtocol = "HTTP" LoadBalancingProtocol_HTTPS LoadBalancingProtocol = "HTTPS" )
Source Files ¶
- CfnLoadBalancer.go
- CfnLoadBalancerProps.go
- CfnLoadBalancer_AccessLoggingPolicyProperty.go
- CfnLoadBalancer_AppCookieStickinessPolicyProperty.go
- CfnLoadBalancer_ConnectionDrainingPolicyProperty.go
- CfnLoadBalancer_ConnectionSettingsProperty.go
- CfnLoadBalancer_HealthCheckProperty.go
- CfnLoadBalancer_LBCookieStickinessPolicyProperty.go
- CfnLoadBalancer_ListenersProperty.go
- CfnLoadBalancer_PoliciesProperty.go
- CfnLoadBalancer__checks.go
- HealthCheck.go
- ILoadBalancerTarget.go
- ILoadBalancerTarget__checks.go
- InstanceTarget.go
- InstanceTarget__checks.go
- ListenerPort.go
- ListenerPort__checks.go
- LoadBalancer.go
- LoadBalancerListener.go
- LoadBalancerProps.go
- LoadBalancer__checks.go
- LoadBalancingProtocol.go
- main.go