LoadBalancerV2Origin
- class aws_cdk.aws_cloudfront_origins.LoadBalancerV2Origin(load_balancer, *, http_port=None, https_port=None, ip_address_type=None, keepalive_timeout=None, origin_ssl_protocols=None, protocol_policy=None, read_timeout=None, origin_path=None, connection_attempts=None, connection_timeout=None, custom_headers=None, origin_access_control_id=None, origin_id=None, origin_shield_enabled=None, origin_shield_region=None, response_completion_timeout=None)
- Bases: - HttpOrigin- An Origin for a v2 load balancer. - ExampleMetadata:
- infused 
 - Example: - # Creates a distribution from an ELBv2 load balancer # vpc: ec2.Vpc # Create an application load balancer in a VPC. 'internetFacing' must be 'true' # for CloudFront to access the load balancer and use it as an origin. lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True ) cloudfront.Distribution(self, "myDist", default_behavior=cloudfront.BehaviorOptions(origin=origins.LoadBalancerV2Origin(lb)) ) - Parameters:
- load_balancer ( - ILoadBalancerV2)
- http_port ( - Union[- int,- float,- None]) – The HTTP port that CloudFront uses to connect to the origin. Default: 80
- https_port ( - Union[- int,- float,- None]) – The HTTPS port that CloudFront uses to connect to the origin. Default: 443
- ip_address_type ( - Optional[- OriginIpAddressType]) – Specifies which IP protocol CloudFront uses when connecting to your origin. If your origin uses both IPv4 and IPv6 protocols, you can choose dualstack to help optimize reliability. Default: undefined - AWS Cloudfront default is IPv4
- keepalive_timeout ( - Optional[- Duration]) – Specifies how long, in seconds, CloudFront persists its connection to the origin. The valid range is from 1 to 180 seconds, inclusive. Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time. Default: Duration.seconds(5)
- origin_ssl_protocols ( - Optional[- Sequence[- OriginSslPolicy]]) – The SSL versions to use when interacting with the origin. Default: OriginSslPolicy.TLS_V1_2
- protocol_policy ( - Optional[- OriginProtocolPolicy]) – Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. Default: OriginProtocolPolicy.HTTPS_ONLY
- read_timeout ( - Optional[- Duration]) – Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout. The valid range is from 1 to 180 seconds, inclusive. Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time. Default: Duration.seconds(30)
- origin_path ( - Optional[- str]) – An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. Must begin, but not end, with ‘/’ (e.g., ‘/production/images’). Default: ‘/’
- connection_attempts ( - Union[- int,- float,- None]) – The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
- connection_timeout ( - Optional[- Duration]) – The number of seconds that CloudFront waits when trying to establish a connection to the origin. Valid values are 1-10 seconds, inclusive. Default: Duration.seconds(10)
- custom_headers ( - Optional[- Mapping[- str,- str]]) – A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
- origin_access_control_id ( - Optional[- str]) – The unique identifier of an origin access control for this origin. Default: - no origin access control
- origin_id ( - Optional[- str]) – A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
- origin_shield_enabled ( - Optional[- bool]) – Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false. Default: - true
- origin_shield_region ( - Optional[- str]) – When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance. Default: - origin shield not enabled
- response_completion_timeout ( - Optional[- Duration]) – The time that a request from CloudFront to the origin can stay open and wait for a response. If the complete response isn’t received from the origin by this time, CloudFront ends the connection. Valid values are 1-3600 seconds, inclusive. Default: undefined - AWS CloudFront default is not enforcing a maximum value
 
 - Methods - bind(scope, *, origin_id, distribution_id=None)
- Binds the origin to the associated Distribution. - Can be used to grant permissions, create dependent resources, etc. - Parameters:
- scope ( - Construct)
- origin_id ( - str) – The identifier of this Origin, as assigned by the Distribution this Origin has been used added to.
- distribution_id ( - Optional[- str]) – The identifier of the Distribution this Origin is used for. This is used to grant origin access permissions to the distribution for origin access control. Default: - no distribution id
 
- Return type: