@ashishpandeyone/cdk-lambda-web-function 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md CHANGED
@@ -1856,6 +1856,7 @@ Endpoints are created only through `WebFunction`, which owns their log groups in
1856
1856
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.metricRequestThrottles">metricRequestThrottles</a></code> | Requests rejected with 429 because the endpoint reached its `rateLimit` (`EndpointRequestThrottles`). |
1857
1857
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.metricServerErrorRate">metricServerErrorRate</a></code> | The percentage of requests answered with a 5XX status (math expression; |
1858
1858
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.metricServerErrors">metricServerErrors</a></code> | Requests answered with a 5XX status (`HTTPResponseStatusClass5XX`). |
1859
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalDomainName">regionalDomainName</a></code> | The domain name of this endpoint in one region. |
1859
1860
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalUrl">regionalUrl</a></code> | The URL of this endpoint in one region. |
1860
1861
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.routeTraffic">routeTraffic</a></code> | Routes the endpoint to `revision` instead of the function's current revision, optionally sharing traffic with one more revision (`additionalRevisions`, which gets its weight; |
1861
1862
 
@@ -2053,6 +2054,24 @@ scales up for a sudden burst, not only your application's errors. The metric onl
2053
2054
 
2054
2055
  ---
2055
2056
 
2057
+ ##### `regionalDomainName` <a name="regionalDomainName" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalDomainName"></a>
2058
+
2059
+ ```typescript
2060
+ public regionalDomainName(region: string): string
2061
+ ```
2062
+
2063
+ The domain name of this endpoint in one region.
2064
+
2065
+ Only for `PER_REGION` endpoints.
2066
+
2067
+ ###### `region`<sup>Required</sup> <a name="region" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalDomainName.parameter.region"></a>
2068
+
2069
+ - *Type:* string
2070
+
2071
+ one of `regions`.
2072
+
2073
+ ---
2074
+
2056
2075
  ##### `regionalUrl` <a name="regionalUrl" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalUrl"></a>
2057
2076
 
2058
2077
  ```typescript
@@ -2152,6 +2171,7 @@ Any object.
2152
2171
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.property.regions">regions</a></code> | <code>string[]</code> | Every region the endpoint serves from: the home region first, then the others in alphabetical order. |
2153
2172
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.property.rollbackAlarms">rollbackAlarms</a></code> | <code>aws-cdk-lib.aws_cloudwatch.IAlarm[]</code> | The alarms this endpoint created for its deployment's `rollbackOn`, one per threshold in every region it serves from (the home region's first). |
2154
2173
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.property.url">url</a></code> | <code>string</code> | The endpoint's URL: the global URL for `MULTI_REGION`, otherwise the home region's. |
2174
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.property.webFunction">webFunction</a></code> | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.IWebFunction">IWebFunction</a></code> | The function this endpoint belongs to. |
2155
2175
 
2156
2176
  ---
2157
2177
 
@@ -2277,6 +2297,18 @@ The endpoint's URL: the global URL for `MULTI_REGION`, otherwise the home region
2277
2297
 
2278
2298
  ---
2279
2299
 
2300
+ ##### `webFunction`<sup>Required</sup> <a name="webFunction" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.property.webFunction"></a>
2301
+
2302
+ ```typescript
2303
+ public readonly webFunction: IWebFunction;
2304
+ ```
2305
+
2306
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.IWebFunction">IWebFunction</a>
2307
+
2308
+ The function this endpoint belongs to.
2309
+
2310
+ ---
2311
+
2280
2312
 
2281
2313
  ### WebFunctionRevision <a name="WebFunctionRevision" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision"></a>
2282
2314
 
@@ -3738,6 +3770,469 @@ Renaming a function replaces it, and its endpoint gets a new URL.
3738
3770
 
3739
3771
  ---
3740
3772
 
3773
+ ### WebFunctionOriginProps <a name="WebFunctionOriginProps" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps"></a>
3774
+
3775
+ Properties for a Web Function endpoint origin.
3776
+
3777
+ #### Initializer <a name="Initializer" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.Initializer"></a>
3778
+
3779
+ ```typescript
3780
+ import { WebFunctionOriginProps } from '@ashishpandeyone/cdk-lambda-web-function'
3781
+
3782
+ const webFunctionOriginProps: WebFunctionOriginProps = { ... }
3783
+ ```
3784
+
3785
+ #### Properties <a name="Properties" id="Properties"></a>
3786
+
3787
+ | **Name** | **Type** | **Description** |
3788
+ | --- | --- | --- |
3789
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.connectionAttempts">connectionAttempts</a></code> | <code>number</code> | The number of times that CloudFront attempts to connect to the origin; |
3790
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.connectionTimeout">connectionTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | The number of seconds that CloudFront waits when trying to establish a connection to the origin. |
3791
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.customHeaders">customHeaders</a></code> | <code>{[ key: string ]: string}</code> | A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. |
3792
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originAccessControlId">originAccessControlId</a></code> | <code>string</code> | The unique identifier of an origin access control for this origin. |
3793
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originId">originId</a></code> | <code>string</code> | A unique identifier for the origin. |
3794
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originShieldEnabled">originShieldEnabled</a></code> | <code>boolean</code> | 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. |
3795
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originShieldRegion">originShieldRegion</a></code> | <code>string</code> | When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance. |
3796
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.responseCompletionTimeout">responseCompletionTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | The time that a request from CloudFront to the origin can stay open and wait for a response. |
3797
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originPath">originPath</a></code> | <code>string</code> | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
3798
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.ipAddressType">ipAddressType</a></code> | <code>aws-cdk-lib.aws_cloudfront.OriginIpAddressType</code> | Which IP protocol CloudFront uses to connect to the origin. |
3799
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.keepaliveTimeout">keepaliveTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | How long CloudFront keeps its connection to the origin open. |
3800
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.readTimeout">readTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | How long CloudFront waits for a response from the origin. |
3801
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.region">region</a></code> | <code>string</code> | For a `PER_REGION` endpoint: the region whose URL CloudFront calls. |
3802
+
3803
+ ---
3804
+
3805
+ ##### `connectionAttempts`<sup>Optional</sup> <a name="connectionAttempts" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.connectionAttempts"></a>
3806
+
3807
+ ```typescript
3808
+ public readonly connectionAttempts: number;
3809
+ ```
3810
+
3811
+ - *Type:* number
3812
+ - *Default:* 3
3813
+
3814
+ The number of times that CloudFront attempts to connect to the origin;
3815
+
3816
+ valid values are 1, 2, or 3 attempts.
3817
+
3818
+ ---
3819
+
3820
+ ##### `connectionTimeout`<sup>Optional</sup> <a name="connectionTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.connectionTimeout"></a>
3821
+
3822
+ ```typescript
3823
+ public readonly connectionTimeout: Duration;
3824
+ ```
3825
+
3826
+ - *Type:* aws-cdk-lib.Duration
3827
+ - *Default:* Duration.seconds(10)
3828
+
3829
+ The number of seconds that CloudFront waits when trying to establish a connection to the origin.
3830
+
3831
+ Valid values are 1-10 seconds, inclusive.
3832
+
3833
+ ---
3834
+
3835
+ ##### `customHeaders`<sup>Optional</sup> <a name="customHeaders" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.customHeaders"></a>
3836
+
3837
+ ```typescript
3838
+ public readonly customHeaders: {[ key: string ]: string};
3839
+ ```
3840
+
3841
+ - *Type:* {[ key: string ]: string}
3842
+ - *Default:* {}
3843
+
3844
+ A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
3845
+
3846
+ ---
3847
+
3848
+ ##### `originAccessControlId`<sup>Optional</sup> <a name="originAccessControlId" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originAccessControlId"></a>
3849
+
3850
+ ```typescript
3851
+ public readonly originAccessControlId: string;
3852
+ ```
3853
+
3854
+ - *Type:* string
3855
+ - *Default:* no origin access control
3856
+
3857
+ The unique identifier of an origin access control for this origin.
3858
+
3859
+ ---
3860
+
3861
+ ##### `originId`<sup>Optional</sup> <a name="originId" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originId"></a>
3862
+
3863
+ ```typescript
3864
+ public readonly originId: string;
3865
+ ```
3866
+
3867
+ - *Type:* string
3868
+ - *Default:* an originid will be generated for you
3869
+
3870
+ A unique identifier for the origin.
3871
+
3872
+ This value must be unique within the distribution.
3873
+
3874
+ ---
3875
+
3876
+ ##### `originShieldEnabled`<sup>Optional</sup> <a name="originShieldEnabled" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originShieldEnabled"></a>
3877
+
3878
+ ```typescript
3879
+ public readonly originShieldEnabled: boolean;
3880
+ ```
3881
+
3882
+ - *Type:* boolean
3883
+ - *Default:* true
3884
+
3885
+ 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.
3886
+
3887
+ ---
3888
+
3889
+ ##### `originShieldRegion`<sup>Optional</sup> <a name="originShieldRegion" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originShieldRegion"></a>
3890
+
3891
+ ```typescript
3892
+ public readonly originShieldRegion: string;
3893
+ ```
3894
+
3895
+ - *Type:* string
3896
+ - *Default:* origin shield not enabled
3897
+
3898
+ When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
3899
+
3900
+ > [https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html)
3901
+
3902
+ ---
3903
+
3904
+ ##### `responseCompletionTimeout`<sup>Optional</sup> <a name="responseCompletionTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.responseCompletionTimeout"></a>
3905
+
3906
+ ```typescript
3907
+ public readonly responseCompletionTimeout: Duration;
3908
+ ```
3909
+
3910
+ - *Type:* aws-cdk-lib.Duration
3911
+ - *Default:* undefined - AWS CloudFront default is not enforcing a maximum value
3912
+
3913
+ The time that a request from CloudFront to the origin can stay open and wait for a response.
3914
+
3915
+ If the complete response isn't received from the origin by this time, CloudFront ends the connection.
3916
+
3917
+ Valid values are 1-3600 seconds, inclusive.
3918
+
3919
+ > [https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesOrigin.html#response-completion-timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesOrigin.html#response-completion-timeout)
3920
+
3921
+ ---
3922
+
3923
+ ##### `originPath`<sup>Optional</sup> <a name="originPath" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.originPath"></a>
3924
+
3925
+ ```typescript
3926
+ public readonly originPath: string;
3927
+ ```
3928
+
3929
+ - *Type:* string
3930
+ - *Default:* '/'
3931
+
3932
+ An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
3933
+
3934
+ Must begin, but not end, with '/' (e.g., '/production/images').
3935
+
3936
+ ---
3937
+
3938
+ ##### `ipAddressType`<sup>Optional</sup> <a name="ipAddressType" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.ipAddressType"></a>
3939
+
3940
+ ```typescript
3941
+ public readonly ipAddressType: OriginIpAddressType;
3942
+ ```
3943
+
3944
+ - *Type:* aws-cdk-lib.aws_cloudfront.OriginIpAddressType
3945
+ - *Default:* OriginIpAddressType.IPV4
3946
+
3947
+ Which IP protocol CloudFront uses to connect to the origin.
3948
+
3949
+ ---
3950
+
3951
+ ##### `keepaliveTimeout`<sup>Optional</sup> <a name="keepaliveTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.keepaliveTimeout"></a>
3952
+
3953
+ ```typescript
3954
+ public readonly keepaliveTimeout: Duration;
3955
+ ```
3956
+
3957
+ - *Type:* aws-cdk-lib.Duration
3958
+ - *Default:* Duration.seconds(5)
3959
+
3960
+ How long CloudFront keeps its connection to the origin open.
3961
+
3962
+ ---
3963
+
3964
+ ##### `readTimeout`<sup>Optional</sup> <a name="readTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.readTimeout"></a>
3965
+
3966
+ ```typescript
3967
+ public readonly readTimeout: Duration;
3968
+ ```
3969
+
3970
+ - *Type:* aws-cdk-lib.Duration
3971
+ - *Default:* Duration.seconds(30)
3972
+
3973
+ How long CloudFront waits for a response from the origin.
3974
+
3975
+ Above 120 seconds needs a CloudFront quota increase.
3976
+
3977
+ ---
3978
+
3979
+ ##### `region`<sup>Optional</sup> <a name="region" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps.property.region"></a>
3980
+
3981
+ ```typescript
3982
+ public readonly region: string;
3983
+ ```
3984
+
3985
+ - *Type:* string
3986
+ - *Default:* the endpoint's home region
3987
+
3988
+ For a `PER_REGION` endpoint: the region whose URL CloudFront calls.
3989
+
3990
+ Only one region per origin; use an origin
3991
+ group or one origin per behavior for more.
3992
+
3993
+ ---
3994
+
3995
+ ### WebFunctionOriginWithOacProps <a name="WebFunctionOriginWithOacProps" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps"></a>
3996
+
3997
+ Properties for a Web Function endpoint origin with origin access control.
3998
+
3999
+ #### Initializer <a name="Initializer" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.Initializer"></a>
4000
+
4001
+ ```typescript
4002
+ import { WebFunctionOriginWithOacProps } from '@ashishpandeyone/cdk-lambda-web-function'
4003
+
4004
+ const webFunctionOriginWithOacProps: WebFunctionOriginWithOacProps = { ... }
4005
+ ```
4006
+
4007
+ #### Properties <a name="Properties" id="Properties"></a>
4008
+
4009
+ | **Name** | **Type** | **Description** |
4010
+ | --- | --- | --- |
4011
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.connectionAttempts">connectionAttempts</a></code> | <code>number</code> | The number of times that CloudFront attempts to connect to the origin; |
4012
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.connectionTimeout">connectionTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | The number of seconds that CloudFront waits when trying to establish a connection to the origin. |
4013
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.customHeaders">customHeaders</a></code> | <code>{[ key: string ]: string}</code> | A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. |
4014
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originAccessControlId">originAccessControlId</a></code> | <code>string</code> | The unique identifier of an origin access control for this origin. |
4015
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originId">originId</a></code> | <code>string</code> | A unique identifier for the origin. |
4016
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originShieldEnabled">originShieldEnabled</a></code> | <code>boolean</code> | 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. |
4017
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originShieldRegion">originShieldRegion</a></code> | <code>string</code> | When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance. |
4018
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.responseCompletionTimeout">responseCompletionTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | The time that a request from CloudFront to the origin can stay open and wait for a response. |
4019
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originPath">originPath</a></code> | <code>string</code> | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
4020
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.ipAddressType">ipAddressType</a></code> | <code>aws-cdk-lib.aws_cloudfront.OriginIpAddressType</code> | Which IP protocol CloudFront uses to connect to the origin. |
4021
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.keepaliveTimeout">keepaliveTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | How long CloudFront keeps its connection to the origin open. |
4022
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.readTimeout">readTimeout</a></code> | <code>aws-cdk-lib.Duration</code> | How long CloudFront waits for a response from the origin. |
4023
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.region">region</a></code> | <code>string</code> | For a `PER_REGION` endpoint: the region whose URL CloudFront calls. |
4024
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originAccessControl">originAccessControl</a></code> | <code>aws-cdk-lib.interfaces.aws_cloudfront.IOriginAccessControlRef</code> | The origin access control. |
4025
+
4026
+ ---
4027
+
4028
+ ##### `connectionAttempts`<sup>Optional</sup> <a name="connectionAttempts" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.connectionAttempts"></a>
4029
+
4030
+ ```typescript
4031
+ public readonly connectionAttempts: number;
4032
+ ```
4033
+
4034
+ - *Type:* number
4035
+ - *Default:* 3
4036
+
4037
+ The number of times that CloudFront attempts to connect to the origin;
4038
+
4039
+ valid values are 1, 2, or 3 attempts.
4040
+
4041
+ ---
4042
+
4043
+ ##### `connectionTimeout`<sup>Optional</sup> <a name="connectionTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.connectionTimeout"></a>
4044
+
4045
+ ```typescript
4046
+ public readonly connectionTimeout: Duration;
4047
+ ```
4048
+
4049
+ - *Type:* aws-cdk-lib.Duration
4050
+ - *Default:* Duration.seconds(10)
4051
+
4052
+ The number of seconds that CloudFront waits when trying to establish a connection to the origin.
4053
+
4054
+ Valid values are 1-10 seconds, inclusive.
4055
+
4056
+ ---
4057
+
4058
+ ##### `customHeaders`<sup>Optional</sup> <a name="customHeaders" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.customHeaders"></a>
4059
+
4060
+ ```typescript
4061
+ public readonly customHeaders: {[ key: string ]: string};
4062
+ ```
4063
+
4064
+ - *Type:* {[ key: string ]: string}
4065
+ - *Default:* {}
4066
+
4067
+ A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
4068
+
4069
+ ---
4070
+
4071
+ ##### `originAccessControlId`<sup>Optional</sup> <a name="originAccessControlId" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originAccessControlId"></a>
4072
+
4073
+ ```typescript
4074
+ public readonly originAccessControlId: string;
4075
+ ```
4076
+
4077
+ - *Type:* string
4078
+ - *Default:* no origin access control
4079
+
4080
+ The unique identifier of an origin access control for this origin.
4081
+
4082
+ ---
4083
+
4084
+ ##### `originId`<sup>Optional</sup> <a name="originId" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originId"></a>
4085
+
4086
+ ```typescript
4087
+ public readonly originId: string;
4088
+ ```
4089
+
4090
+ - *Type:* string
4091
+ - *Default:* an originid will be generated for you
4092
+
4093
+ A unique identifier for the origin.
4094
+
4095
+ This value must be unique within the distribution.
4096
+
4097
+ ---
4098
+
4099
+ ##### `originShieldEnabled`<sup>Optional</sup> <a name="originShieldEnabled" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originShieldEnabled"></a>
4100
+
4101
+ ```typescript
4102
+ public readonly originShieldEnabled: boolean;
4103
+ ```
4104
+
4105
+ - *Type:* boolean
4106
+ - *Default:* true
4107
+
4108
+ 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.
4109
+
4110
+ ---
4111
+
4112
+ ##### `originShieldRegion`<sup>Optional</sup> <a name="originShieldRegion" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originShieldRegion"></a>
4113
+
4114
+ ```typescript
4115
+ public readonly originShieldRegion: string;
4116
+ ```
4117
+
4118
+ - *Type:* string
4119
+ - *Default:* origin shield not enabled
4120
+
4121
+ When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
4122
+
4123
+ > [https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html)
4124
+
4125
+ ---
4126
+
4127
+ ##### `responseCompletionTimeout`<sup>Optional</sup> <a name="responseCompletionTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.responseCompletionTimeout"></a>
4128
+
4129
+ ```typescript
4130
+ public readonly responseCompletionTimeout: Duration;
4131
+ ```
4132
+
4133
+ - *Type:* aws-cdk-lib.Duration
4134
+ - *Default:* undefined - AWS CloudFront default is not enforcing a maximum value
4135
+
4136
+ The time that a request from CloudFront to the origin can stay open and wait for a response.
4137
+
4138
+ If the complete response isn't received from the origin by this time, CloudFront ends the connection.
4139
+
4140
+ Valid values are 1-3600 seconds, inclusive.
4141
+
4142
+ > [https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesOrigin.html#response-completion-timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesOrigin.html#response-completion-timeout)
4143
+
4144
+ ---
4145
+
4146
+ ##### `originPath`<sup>Optional</sup> <a name="originPath" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originPath"></a>
4147
+
4148
+ ```typescript
4149
+ public readonly originPath: string;
4150
+ ```
4151
+
4152
+ - *Type:* string
4153
+ - *Default:* '/'
4154
+
4155
+ An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
4156
+
4157
+ Must begin, but not end, with '/' (e.g., '/production/images').
4158
+
4159
+ ---
4160
+
4161
+ ##### `ipAddressType`<sup>Optional</sup> <a name="ipAddressType" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.ipAddressType"></a>
4162
+
4163
+ ```typescript
4164
+ public readonly ipAddressType: OriginIpAddressType;
4165
+ ```
4166
+
4167
+ - *Type:* aws-cdk-lib.aws_cloudfront.OriginIpAddressType
4168
+ - *Default:* OriginIpAddressType.IPV4
4169
+
4170
+ Which IP protocol CloudFront uses to connect to the origin.
4171
+
4172
+ ---
4173
+
4174
+ ##### `keepaliveTimeout`<sup>Optional</sup> <a name="keepaliveTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.keepaliveTimeout"></a>
4175
+
4176
+ ```typescript
4177
+ public readonly keepaliveTimeout: Duration;
4178
+ ```
4179
+
4180
+ - *Type:* aws-cdk-lib.Duration
4181
+ - *Default:* Duration.seconds(5)
4182
+
4183
+ How long CloudFront keeps its connection to the origin open.
4184
+
4185
+ ---
4186
+
4187
+ ##### `readTimeout`<sup>Optional</sup> <a name="readTimeout" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.readTimeout"></a>
4188
+
4189
+ ```typescript
4190
+ public readonly readTimeout: Duration;
4191
+ ```
4192
+
4193
+ - *Type:* aws-cdk-lib.Duration
4194
+ - *Default:* Duration.seconds(30)
4195
+
4196
+ How long CloudFront waits for a response from the origin.
4197
+
4198
+ Above 120 seconds needs a CloudFront quota increase.
4199
+
4200
+ ---
4201
+
4202
+ ##### `region`<sup>Optional</sup> <a name="region" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.region"></a>
4203
+
4204
+ ```typescript
4205
+ public readonly region: string;
4206
+ ```
4207
+
4208
+ - *Type:* string
4209
+ - *Default:* the endpoint's home region
4210
+
4211
+ For a `PER_REGION` endpoint: the region whose URL CloudFront calls.
4212
+
4213
+ Only one region per origin; use an origin
4214
+ group or one origin per behavior for more.
4215
+
4216
+ ---
4217
+
4218
+ ##### `originAccessControl`<sup>Optional</sup> <a name="originAccessControl" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps.property.originAccessControl"></a>
4219
+
4220
+ ```typescript
4221
+ public readonly originAccessControl: IOriginAccessControlRef;
4222
+ ```
4223
+
4224
+ - *Type:* aws-cdk-lib.interfaces.aws_cloudfront.IOriginAccessControlRef
4225
+ - *Default:* one is created per stack and signing protocol
4226
+
4227
+ The origin access control.
4228
+
4229
+ It must have origin type `lambda`, signing behavior `always-amz-auth`, and signing
4230
+ protocol `sigv4` (a regional endpoint) or `sigv4a` (a `MULTI_REGION` endpoint's global domain). Checked at
4231
+ synthesis when it's defined in this app (CDK's `FunctionUrlOriginAccessControl` signs with `always`, which
4232
+ CloudFront rejects for Web Function origins).
4233
+
4234
+ ---
4235
+
3741
4236
  ### WebFunctionPermission <a name="WebFunctionPermission" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission"></a>
3742
4237
 
3743
4238
  Permission for a principal outside this account, an AWS service or an organization to call a function's endpoints.
@@ -4362,6 +4857,104 @@ a statement in the function's resource policy (not for an imported function's en
4362
4857
 
4363
4858
 
4364
4859
 
4860
+ ### WebFunctionOrigin <a name="WebFunctionOrigin" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin"></a>
4861
+
4862
+ A CloudFront origin for a Web Function endpoint.
4863
+
4864
+ Use `WebFunctionOrigin.withOriginAccessControl(endpoint)` for an `AWS_IAM` endpoint: CloudFront signs every request,
4865
+ and only your distribution may call the endpoint. `new WebFunctionOrigin(endpoint)` is for a public (`NONE`) endpoint.
4866
+
4867
+ #### Initializers <a name="Initializers" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.Initializer"></a>
4868
+
4869
+ ```typescript
4870
+ import { WebFunctionOrigin } from '@ashishpandeyone/cdk-lambda-web-function'
4871
+
4872
+ new WebFunctionOrigin(endpoint: WebFunctionEndpoint, props?: WebFunctionOriginProps)
4873
+ ```
4874
+
4875
+ | **Name** | **Type** | **Description** |
4876
+ | --- | --- | --- |
4877
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.Initializer.parameter.endpoint">endpoint</a></code> | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint">WebFunctionEndpoint</a></code> | *No description.* |
4878
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.Initializer.parameter.props">props</a></code> | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps">WebFunctionOriginProps</a></code> | *No description.* |
4879
+
4880
+ ---
4881
+
4882
+ ##### `endpoint`<sup>Required</sup> <a name="endpoint" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.Initializer.parameter.endpoint"></a>
4883
+
4884
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint">WebFunctionEndpoint</a>
4885
+
4886
+ ---
4887
+
4888
+ ##### `props`<sup>Optional</sup> <a name="props" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.Initializer.parameter.props"></a>
4889
+
4890
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginProps">WebFunctionOriginProps</a>
4891
+
4892
+ ---
4893
+
4894
+ #### Methods <a name="Methods" id="Methods"></a>
4895
+
4896
+ | **Name** | **Description** |
4897
+ | --- | --- |
4898
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.bind">bind</a></code> | Binds the origin to the associated Distribution. |
4899
+
4900
+ ---
4901
+
4902
+ ##### `bind` <a name="bind" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.bind"></a>
4903
+
4904
+ ```typescript
4905
+ public bind(scope: Construct, options: OriginBindOptions): OriginBindConfig
4906
+ ```
4907
+
4908
+ Binds the origin to the associated Distribution.
4909
+
4910
+ Can be used to grant permissions, create dependent resources, etc.
4911
+
4912
+ ###### `scope`<sup>Required</sup> <a name="scope" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.bind.parameter.scope"></a>
4913
+
4914
+ - *Type:* constructs.Construct
4915
+
4916
+ ---
4917
+
4918
+ ###### `options`<sup>Required</sup> <a name="options" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.bind.parameter.options"></a>
4919
+
4920
+ - *Type:* aws-cdk-lib.aws_cloudfront.OriginBindOptions
4921
+
4922
+ ---
4923
+
4924
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
4925
+
4926
+ | **Name** | **Description** |
4927
+ | --- | --- |
4928
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.withOriginAccessControl">withOriginAccessControl</a></code> | An origin for an `AWS_IAM` endpoint, with origin access control: CloudFront signs every request to the endpoint (`always-amz-auth`, which keeps the viewer's `Authorization` header for your application), and the function's resource policy allows `cloudfront.amazonaws.com` to call this endpoint on behalf of this distribution only. |
4929
+
4930
+ ---
4931
+
4932
+ ##### `withOriginAccessControl` <a name="withOriginAccessControl" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.withOriginAccessControl"></a>
4933
+
4934
+ ```typescript
4935
+ import { WebFunctionOrigin } from '@ashishpandeyone/cdk-lambda-web-function'
4936
+
4937
+ WebFunctionOrigin.withOriginAccessControl(endpoint: WebFunctionEndpoint, props?: WebFunctionOriginWithOacProps)
4938
+ ```
4939
+
4940
+ An origin for an `AWS_IAM` endpoint, with origin access control: CloudFront signs every request to the endpoint (`always-amz-auth`, which keeps the viewer's `Authorization` header for your application), and the function's resource policy allows `cloudfront.amazonaws.com` to call this endpoint on behalf of this distribution only.
4941
+
4942
+ The distribution must be in the function's stack.
4943
+
4944
+ ###### `endpoint`<sup>Required</sup> <a name="endpoint" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.withOriginAccessControl.parameter.endpoint"></a>
4945
+
4946
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint">WebFunctionEndpoint</a>
4947
+
4948
+ ---
4949
+
4950
+ ###### `props`<sup>Optional</sup> <a name="props" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin.withOriginAccessControl.parameter.props"></a>
4951
+
4952
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionOriginWithOacProps">WebFunctionOriginWithOacProps</a>
4953
+
4954
+ ---
4955
+
4956
+
4957
+
4365
4958
  ## Protocols <a name="Protocols" id="Protocols"></a>
4366
4959
 
4367
4960
  ### IWebFunction <a name="IWebFunction" id="@ashishpandeyone/cdk-lambda-web-function.IWebFunction"></a>