@ashishpandeyone/cdk-lambda-web-function 0.1.4 → 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
@@ -51,6 +51,7 @@ new NodejsWebFunction(scope: Construct, id: string, props: NodejsWebFunctionProp
51
51
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.with">with</a></code> | Applies one or more mixins to this construct. |
52
52
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.applyCrossStackReferenceStrength">applyCrossStackReferenceStrength</a></code> | Override the cross-stack reference strength for this resource. |
53
53
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
54
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addToResourcePolicy">addToResourcePolicy</a></code> | Adds a statement to the function's resource policy, e.g. to let another account manage the function. For invoking, prefer `addPermission` or `grantInvoke`. |
54
55
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.grantInvoke">grantInvoke</a></code> | Allows `grantee` to call the endpoint. |
55
56
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.metric">metric</a></code> | A metric of this function's execution environments in `AWS/Lambda/Web` (dimension `FunctionName`), across all endpoints. |
56
57
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.metricActiveTime">metricActiveTime</a></code> | Time the execution environments were active (`EnvironmentActiveTime`). |
@@ -60,6 +61,7 @@ new NodejsWebFunction(scope: Construct, id: string, props: NodejsWebFunctionProp
60
61
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.metricResponseBytes">metricResponseBytes</a></code> | Bytes sent in responses (`ResponseBytes`). |
61
62
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addEndpoint">addEndpoint</a></code> | Adds an endpoint (up to 10 per function), e.g. a public one next to an IAM-only one, or one pinned to an earlier revision. Each endpoint has its own URL, authentication, regions and limits. |
62
63
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addEnvironment">addEnvironment</a></code> | Adds an environment variable. |
64
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addPermission">addPermission</a></code> | Allows a principal in another account, an AWS service or an organization to call the function's endpoints, through the function's resource policy. |
63
65
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addToRolePolicy">addToRolePolicy</a></code> | Adds a statement to the execution role's policy. |
64
66
 
65
67
  ---
@@ -135,6 +137,24 @@ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
135
137
 
136
138
  ---
137
139
 
140
+ ##### `addToResourcePolicy` <a name="addToResourcePolicy" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addToResourcePolicy"></a>
141
+
142
+ ```typescript
143
+ public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
144
+ ```
145
+
146
+ Adds a statement to the function's resource policy, e.g. to let another account manage the function. For invoking, prefer `addPermission` or `grantInvoke`.
147
+
148
+ The function has one resource policy (`AWS::Lambda::ResourcePolicy`), created on the first statement. This stack
149
+ is its only writer: another stack or template can't also attach one, and changes made outside CloudFormation
150
+ are overwritten by the next update of the policy.
151
+
152
+ ###### `statement`<sup>Required</sup> <a name="statement" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addToResourcePolicy.parameter.statement"></a>
153
+
154
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
155
+
156
+ ---
157
+
138
158
  ##### `grantInvoke` <a name="grantInvoke" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.grantInvoke"></a>
139
159
 
140
160
  ```typescript
@@ -293,6 +313,30 @@ Names starting with `AWS_` are reserved.
293
313
 
294
314
  ---
295
315
 
316
+ ##### `addPermission` <a name="addPermission" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addPermission"></a>
317
+
318
+ ```typescript
319
+ public addPermission(id: string, permission: WebFunctionPermission): void
320
+ ```
321
+
322
+ Allows a principal in another account, an AWS service or an organization to call the function's endpoints, through the function's resource policy.
323
+
324
+ For a role in this account, use `grantInvoke`.
325
+
326
+ ###### `id`<sup>Required</sup> <a name="id" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addPermission.parameter.id"></a>
327
+
328
+ - *Type:* string
329
+
330
+ the statement ID (`Sid`): letters and digits, unique within the function.
331
+
332
+ ---
333
+
334
+ ###### `permission`<sup>Required</sup> <a name="permission" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addPermission.parameter.permission"></a>
335
+
336
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission">WebFunctionPermission</a>
337
+
338
+ ---
339
+
296
340
  ##### `addToRolePolicy` <a name="addToRolePolicy" id="@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction.addToRolePolicy"></a>
297
341
 
298
342
  ```typescript
@@ -713,6 +757,7 @@ new WebFunction(scope: Construct, id: string, props: WebFunctionProps)
713
757
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.with">with</a></code> | Applies one or more mixins to this construct. |
714
758
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.applyCrossStackReferenceStrength">applyCrossStackReferenceStrength</a></code> | Override the cross-stack reference strength for this resource. |
715
759
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
760
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.addToResourcePolicy">addToResourcePolicy</a></code> | Adds a statement to the function's resource policy, e.g. to let another account manage the function. For invoking, prefer `addPermission` or `grantInvoke`. |
716
761
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.grantInvoke">grantInvoke</a></code> | Allows `grantee` to call the endpoint. |
717
762
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.metric">metric</a></code> | A metric of this function's execution environments in `AWS/Lambda/Web` (dimension `FunctionName`), across all endpoints. |
718
763
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.metricActiveTime">metricActiveTime</a></code> | Time the execution environments were active (`EnvironmentActiveTime`). |
@@ -722,6 +767,7 @@ new WebFunction(scope: Construct, id: string, props: WebFunctionProps)
722
767
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.metricResponseBytes">metricResponseBytes</a></code> | Bytes sent in responses (`ResponseBytes`). |
723
768
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.addEndpoint">addEndpoint</a></code> | Adds an endpoint (up to 10 per function), e.g. a public one next to an IAM-only one, or one pinned to an earlier revision. Each endpoint has its own URL, authentication, regions and limits. |
724
769
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.addEnvironment">addEnvironment</a></code> | Adds an environment variable. |
770
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.addPermission">addPermission</a></code> | Allows a principal in another account, an AWS service or an organization to call the function's endpoints, through the function's resource policy. |
725
771
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction.addToRolePolicy">addToRolePolicy</a></code> | Adds a statement to the execution role's policy. |
726
772
 
727
773
  ---
@@ -797,6 +843,24 @@ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
797
843
 
798
844
  ---
799
845
 
846
+ ##### `addToResourcePolicy` <a name="addToResourcePolicy" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addToResourcePolicy"></a>
847
+
848
+ ```typescript
849
+ public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
850
+ ```
851
+
852
+ Adds a statement to the function's resource policy, e.g. to let another account manage the function. For invoking, prefer `addPermission` or `grantInvoke`.
853
+
854
+ The function has one resource policy (`AWS::Lambda::ResourcePolicy`), created on the first statement. This stack
855
+ is its only writer: another stack or template can't also attach one, and changes made outside CloudFormation
856
+ are overwritten by the next update of the policy.
857
+
858
+ ###### `statement`<sup>Required</sup> <a name="statement" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addToResourcePolicy.parameter.statement"></a>
859
+
860
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
861
+
862
+ ---
863
+
800
864
  ##### `grantInvoke` <a name="grantInvoke" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.grantInvoke"></a>
801
865
 
802
866
  ```typescript
@@ -955,6 +1019,30 @@ Names starting with `AWS_` are reserved.
955
1019
 
956
1020
  ---
957
1021
 
1022
+ ##### `addPermission` <a name="addPermission" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addPermission"></a>
1023
+
1024
+ ```typescript
1025
+ public addPermission(id: string, permission: WebFunctionPermission): void
1026
+ ```
1027
+
1028
+ Allows a principal in another account, an AWS service or an organization to call the function's endpoints, through the function's resource policy.
1029
+
1030
+ For a role in this account, use `grantInvoke`.
1031
+
1032
+ ###### `id`<sup>Required</sup> <a name="id" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addPermission.parameter.id"></a>
1033
+
1034
+ - *Type:* string
1035
+
1036
+ the statement ID (`Sid`): letters and digits, unique within the function.
1037
+
1038
+ ---
1039
+
1040
+ ###### `permission`<sup>Required</sup> <a name="permission" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addPermission.parameter.permission"></a>
1041
+
1042
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission">WebFunctionPermission</a>
1043
+
1044
+ ---
1045
+
958
1046
  ##### `addToRolePolicy` <a name="addToRolePolicy" id="@ashishpandeyone/cdk-lambda-web-function.WebFunction.addToRolePolicy"></a>
959
1047
 
960
1048
  ```typescript
@@ -1369,6 +1457,7 @@ new WebFunctionBase(scope: Construct, id: string, props?: ResourceProps)
1369
1457
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.with">with</a></code> | Applies one or more mixins to this construct. |
1370
1458
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.applyCrossStackReferenceStrength">applyCrossStackReferenceStrength</a></code> | Override the cross-stack reference strength for this resource. |
1371
1459
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
1460
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.addToResourcePolicy">addToResourcePolicy</a></code> | Adds a statement to the function's resource policy (not added for an imported function). |
1372
1461
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.grantInvoke">grantInvoke</a></code> | Allows `grantee` to call the function's endpoint. |
1373
1462
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.metric">metric</a></code> | A metric of this function's execution environments in `AWS/Lambda/Web` (dimension `FunctionName`), across all endpoints. |
1374
1463
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.metricActiveTime">metricActiveTime</a></code> | Time the execution environments were active (`EnvironmentActiveTime`). |
@@ -1450,6 +1539,20 @@ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
1450
1539
 
1451
1540
  ---
1452
1541
 
1542
+ ##### `addToResourcePolicy` <a name="addToResourcePolicy" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.addToResourcePolicy"></a>
1543
+
1544
+ ```typescript
1545
+ public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
1546
+ ```
1547
+
1548
+ Adds a statement to the function's resource policy (not added for an imported function).
1549
+
1550
+ ###### `statement`<sup>Required</sup> <a name="statement" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.addToResourcePolicy.parameter.statement"></a>
1551
+
1552
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
1553
+
1554
+ ---
1555
+
1453
1556
  ##### `grantInvoke` <a name="grantInvoke" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase.grantInvoke"></a>
1454
1557
 
1455
1558
  ```typescript
@@ -1753,6 +1856,7 @@ Endpoints are created only through `WebFunction`, which owns their log groups in
1753
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`). |
1754
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; |
1755
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. |
1756
1860
  | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalUrl">regionalUrl</a></code> | The URL of this endpoint in one region. |
1757
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; |
1758
1862
 
@@ -1950,6 +2054,24 @@ scales up for a sudden burst, not only your application's errors. The metric onl
1950
2054
 
1951
2055
  ---
1952
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
+
1953
2075
  ##### `regionalUrl` <a name="regionalUrl" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint.regionalUrl"></a>
1954
2076
 
1955
2077
  ```typescript
@@ -2049,6 +2171,7 @@ Any object.
2049
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. |
2050
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). |
2051
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. |
2052
2175
 
2053
2176
  ---
2054
2177
 
@@ -2174,6 +2297,18 @@ The endpoint's URL: the global URL for `MULTI_REGION`, otherwise the home region
2174
2297
 
2175
2298
  ---
2176
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
+
2177
2312
 
2178
2313
  ### WebFunctionRevision <a name="WebFunctionRevision" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision"></a>
2179
2314
 
@@ -3635,6 +3770,547 @@ Renaming a function replaces it, and its endpoint gets a new URL.
3635
3770
 
3636
3771
  ---
3637
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
+
4236
+ ### WebFunctionPermission <a name="WebFunctionPermission" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission"></a>
4237
+
4238
+ Permission for a principal outside this account, an AWS service or an organization to call a function's endpoints.
4239
+
4240
+ #### Initializer <a name="Initializer" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.Initializer"></a>
4241
+
4242
+ ```typescript
4243
+ import { WebFunctionPermission } from '@ashishpandeyone/cdk-lambda-web-function'
4244
+
4245
+ const webFunctionPermission: WebFunctionPermission = { ... }
4246
+ ```
4247
+
4248
+ #### Properties <a name="Properties" id="Properties"></a>
4249
+
4250
+ | **Name** | **Type** | **Description** |
4251
+ | --- | --- | --- |
4252
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.principal">principal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | Who may call: an account (`iam.AccountPrincipal`), a role or user (`iam.ArnPrincipal`), an AWS service (`iam.ServicePrincipal`, with `sourceArn` or `sourceAccount`) or an organization (`iam.OrganizationPrincipal`). |
4253
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.endpoint">endpoint</a></code> | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint">WebFunctionEndpoint</a></code> | The endpoint the principal may call. |
4254
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.sourceAccount">sourceAccount</a></code> | <code>string</code> | For an AWS service: the account that owns the resource calling on its behalf (condition `aws:SourceAccount`). |
4255
+ | <code><a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.sourceArn">sourceArn</a></code> | <code>string</code> | For an AWS service: the ARN of the resource calling on its behalf (condition `aws:SourceArn`, `ArnLike`), e.g. a CloudFront distribution. Without it or `sourceAccount`, any account's use of the service could call the endpoint. |
4256
+
4257
+ ---
4258
+
4259
+ ##### `principal`<sup>Required</sup> <a name="principal" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.principal"></a>
4260
+
4261
+ ```typescript
4262
+ public readonly principal: IPrincipal;
4263
+ ```
4264
+
4265
+ - *Type:* aws-cdk-lib.aws_iam.IPrincipal
4266
+
4267
+ Who may call: an account (`iam.AccountPrincipal`), a role or user (`iam.ArnPrincipal`), an AWS service (`iam.ServicePrincipal`, with `sourceArn` or `sourceAccount`) or an organization (`iam.OrganizationPrincipal`).
4268
+
4269
+ A principal in another account also needs `lambda:InvokeWebFunctionEndpoint` in its own IAM policy.
4270
+
4271
+ ---
4272
+
4273
+ ##### `endpoint`<sup>Optional</sup> <a name="endpoint" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.endpoint"></a>
4274
+
4275
+ ```typescript
4276
+ public readonly endpoint: WebFunctionEndpoint;
4277
+ ```
4278
+
4279
+ - *Type:* <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint">WebFunctionEndpoint</a>
4280
+ - *Default:* every endpoint of the function, including ones added later
4281
+
4282
+ The endpoint the principal may call.
4283
+
4284
+ It must belong to this function.
4285
+
4286
+ ---
4287
+
4288
+ ##### `sourceAccount`<sup>Optional</sup> <a name="sourceAccount" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.sourceAccount"></a>
4289
+
4290
+ ```typescript
4291
+ public readonly sourceAccount: string;
4292
+ ```
4293
+
4294
+ - *Type:* string
4295
+ - *Default:* no condition
4296
+
4297
+ For an AWS service: the account that owns the resource calling on its behalf (condition `aws:SourceAccount`).
4298
+
4299
+ ---
4300
+
4301
+ ##### `sourceArn`<sup>Optional</sup> <a name="sourceArn" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission.property.sourceArn"></a>
4302
+
4303
+ ```typescript
4304
+ public readonly sourceArn: string;
4305
+ ```
4306
+
4307
+ - *Type:* string
4308
+ - *Default:* no condition
4309
+
4310
+ For an AWS service: the ARN of the resource calling on its behalf (condition `aws:SourceArn`, `ArnLike`), e.g. a CloudFront distribution. Without it or `sourceAccount`, any account's use of the service could call the endpoint.
4311
+
4312
+ ---
4313
+
3638
4314
  ### WebFunctionProps <a name="WebFunctionProps" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps"></a>
3639
4315
 
3640
4316
  Properties for a `WebFunction`.
@@ -4169,6 +4845,9 @@ Allows `grantee` to call the endpoint (`lambda:InvokeWebFunctionEndpoint`).
4169
4845
  The grant is on the endpoint's home-region ARN, which IAM evaluates for every region the
4170
4846
  endpoint serves from, including a MULTI_REGION global URL.
4171
4847
 
4848
+ A grantee in the function's account gets an IAM policy statement. Another account or an AWS service also gets
4849
+ a statement in the function's resource policy (not for an imported function's endpoints).
4850
+
4172
4851
  ###### `grantee`<sup>Required</sup> <a name="grantee" id="@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants.invoke.parameter.grantee"></a>
4173
4852
 
4174
4853
  - *Type:* aws-cdk-lib.aws_iam.IGrantable
@@ -4178,16 +4857,118 @@ endpoint serves from, including a MULTI_REGION global URL.
4178
4857
 
4179
4858
 
4180
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
+
4181
4958
  ## Protocols <a name="Protocols" id="Protocols"></a>
4182
4959
 
4183
4960
  ### IWebFunction <a name="IWebFunction" id="@ashishpandeyone/cdk-lambda-web-function.IWebFunction"></a>
4184
4961
 
4185
- - *Extends:* aws-cdk-lib.IResource, aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef
4962
+ - *Extends:* aws-cdk-lib.IResource, aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef, aws-cdk-lib.aws_iam.IResourceWithPolicy
4186
4963
 
4187
4964
  - *Implemented By:* <a href="#@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction">NodejsWebFunction</a>, <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunction">WebFunction</a>, <a href="#@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase">WebFunctionBase</a>, <a href="#@ashishpandeyone/cdk-lambda-web-function.IWebFunction">IWebFunction</a>
4188
4965
 
4189
4966
  A Lambda Web Function, created in this app (`WebFunction`) or imported (`WebFunction.fromWebFunctionArn`).
4190
4967
 
4968
+ `addToResourcePolicy` adds to the function's resource policy (who else may call or manage it). A `WebFunction` has
4969
+ one, created by its stack on the first statement. An imported function's policy belongs to the stack that created
4970
+ it, so the statement isn't added (`statementAdded: false`).
4971
+
4191
4972
  #### Methods <a name="Methods" id="Methods"></a>
4192
4973
 
4193
4974
  | **Name** | **Description** |
@@ -4212,7 +4993,9 @@ Allows `grantee` to call the function's endpoint (`lambda:InvokeWebFunctionEndpo
4212
4993
 
4213
4994
  for an imported function, the endpoint named in its attributes, or every endpoint.
4214
4995
 
4215
- This adds to the grantee's IAM policy. For a function in another account, its resource policy must also allow the grantee.
4996
+ For a `WebFunction`, a grantee in this account gets an IAM policy statement; another account or an AWS service
4997
+ also gets a statement in the function's resource policy. For an imported function, only the grantee's IAM policy
4998
+ changes: across accounts, the function's own resource policy must also allow the grantee.
4216
4999
  [disable-awslint:no-grants]
4217
5000
 
4218
5001
  ###### `grantee`<sup>Required</sup> <a name="grantee" id="@ashishpandeyone/cdk-lambda-web-function.IWebFunction.grantInvoke.parameter.grantee"></a>