aws-cdk-lib 2.167.2__py3-none-any.whl → 2.169.0__py3-none-any.whl

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.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

Files changed (60) hide show
  1. aws_cdk/__init__.py +2083 -0
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.167.2.jsii.tgz → aws-cdk-lib@2.169.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_accessanalyzer/__init__.py +244 -13
  5. aws_cdk/aws_applicationautoscaling/__init__.py +1691 -95
  6. aws_cdk/aws_applicationinsights/__init__.py +41 -0
  7. aws_cdk/aws_applicationsignals/__init__.py +124 -0
  8. aws_cdk/aws_autoscaling/__init__.py +743 -7
  9. aws_cdk/aws_batch/__init__.py +202 -5
  10. aws_cdk/aws_bedrock/__init__.py +12 -12
  11. aws_cdk/aws_cleanrooms/__init__.py +17 -8
  12. aws_cdk/aws_cloudformation/__init__.py +2571 -492
  13. aws_cdk/aws_cloudfront/__init__.py +281 -0
  14. aws_cdk/aws_cloudfront/experimental/__init__.py +5 -0
  15. aws_cdk/aws_cloudfront_origins/__init__.py +714 -132
  16. aws_cdk/aws_cloudtrail/__init__.py +52 -14
  17. aws_cdk/aws_codebuild/__init__.py +670 -4
  18. aws_cdk/aws_connect/__init__.py +378 -0
  19. aws_cdk/aws_connectcampaignsv2/__init__.py +3376 -0
  20. aws_cdk/aws_customerprofiles/__init__.py +44 -0
  21. aws_cdk/aws_deadline/__init__.py +299 -6
  22. aws_cdk/aws_dynamodb/__init__.py +359 -16
  23. aws_cdk/aws_ec2/__init__.py +19 -6
  24. aws_cdk/aws_ecs/__init__.py +231 -12
  25. aws_cdk/aws_efs/__init__.py +61 -4
  26. aws_cdk/aws_eks/__init__.py +116 -0
  27. aws_cdk/aws_elasticloadbalancingv2/__init__.py +160 -11
  28. aws_cdk/aws_fis/__init__.py +495 -0
  29. aws_cdk/aws_gamelift/__init__.py +3204 -1104
  30. aws_cdk/aws_iot/__init__.py +209 -0
  31. aws_cdk/aws_iotfleetwise/__init__.py +550 -0
  32. aws_cdk/aws_iotsitewise/__init__.py +6 -3
  33. aws_cdk/aws_ivs/__init__.py +458 -0
  34. aws_cdk/aws_kinesisfirehose/__init__.py +756 -8
  35. aws_cdk/aws_lambda/__init__.py +634 -259
  36. aws_cdk/aws_lambda_destinations/__init__.py +73 -0
  37. aws_cdk/aws_lambda_event_sources/__init__.py +102 -2
  38. aws_cdk/aws_location/__init__.py +18 -18
  39. aws_cdk/aws_mediastore/__init__.py +22 -10
  40. aws_cdk/aws_opensearchservice/__init__.py +6 -0
  41. aws_cdk/aws_quicksight/__init__.py +35 -19
  42. aws_cdk/aws_rbin/__init__.py +902 -0
  43. aws_cdk/aws_rds/__init__.py +166 -3
  44. aws_cdk/aws_route53resolver/__init__.py +76 -19
  45. aws_cdk/aws_sagemaker/__init__.py +32 -0
  46. aws_cdk/aws_securityhub/__init__.py +11 -14
  47. aws_cdk/aws_ses/__init__.py +58 -5
  48. aws_cdk/aws_sns/__init__.py +593 -8
  49. aws_cdk/aws_sns_subscriptions/__init__.py +68 -22
  50. aws_cdk/aws_stepfunctions_tasks/__init__.py +1601 -8
  51. aws_cdk/aws_synthetics/__init__.py +46 -0
  52. aws_cdk/aws_transfer/__init__.py +0 -8
  53. aws_cdk/aws_vpclattice/__init__.py +157 -2
  54. aws_cdk/aws_wisdom/__init__.py +113 -69
  55. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/METADATA +1 -1
  56. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/RECORD +60 -58
  57. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/LICENSE +0 -0
  58. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/NOTICE +0 -0
  59. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/WHEEL +0 -0
  60. {aws_cdk_lib-2.167.2.dist-info → aws_cdk_lib-2.169.0.dist-info}/top_level.txt +0 -0
@@ -633,138 +633,651 @@ cloudfront.Distribution(self, "Distribution",
633
633
  default_behavior=cloudfront.BehaviorOptions(origin=origins.FunctionUrlOrigin(fn_url))
634
634
  )
635
635
  ```
636
+
637
+ ### Lambda Function URL with Origin Access Control (OAC)
638
+
639
+ You can configure the Lambda Function URL with Origin Access Control (OAC) for enhanced security. When using OAC with Signing SIGV4_ALWAYS, it is recommended to set the Lambda Function URL authType to AWS_IAM to ensure proper authorization.
640
+
641
+ ```python
642
+ import aws_cdk.aws_lambda as lambda_
643
+ # fn: lambda.Function
644
+
645
+
646
+ fn_url = fn.add_function_url(
647
+ auth_type=lambda_.FunctionUrlAuthType.AWS_IAM
648
+ )
649
+
650
+ cloudfront.Distribution(self, "MyDistribution",
651
+ default_behavior=cloudfront.BehaviorOptions(
652
+ origin=origins.FunctionUrlOrigin.with_origin_access_control(fn_url)
653
+ )
654
+ )
655
+ ```
656
+
657
+ If you want to explicitly add OAC for more customized access control, you can use the originAccessControl option as shown below.
658
+
659
+ ```python
660
+ import aws_cdk.aws_lambda as lambda_
661
+ # fn: lambda.Function
662
+
663
+
664
+ fn_url = fn.add_function_url(
665
+ auth_type=lambda_.FunctionUrlAuthType.AWS_IAM
666
+ )
667
+
668
+ # Define a custom OAC
669
+ oac = cloudfront.FunctionUrlOriginAccessControl(self, "MyOAC",
670
+ origin_access_control_name="CustomLambdaOAC",
671
+ signing=cloudfront.Signing.SIGV4_ALWAYS
672
+ )
673
+
674
+ # Set up Lambda Function URL with OAC in CloudFront Distribution
675
+ cloudfront.Distribution(self, "MyDistribution",
676
+ default_behavior=cloudfront.BehaviorOptions(
677
+ origin=origins.FunctionUrlOrigin.with_origin_access_control(fn_url,
678
+ origin_access_control=oac
679
+ )
680
+ )
681
+ )
682
+ ```
636
683
  '''
637
684
  from pkgutil import extend_path
638
685
  __path__ = extend_path(__path__, __name__)
639
686
 
640
- import abc
641
- import builtins
642
- import datetime
643
- import enum
644
- import typing
687
+ import abc
688
+ import builtins
689
+ import datetime
690
+ import enum
691
+ import typing
692
+
693
+ import jsii
694
+ import publication
695
+ import typing_extensions
696
+
697
+ import typeguard
698
+ from importlib.metadata import version as _metadata_package_version
699
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
700
+
701
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
702
+ if TYPEGUARD_MAJOR_VERSION <= 2:
703
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
704
+ else:
705
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
706
+ pass
707
+ else:
708
+ if TYPEGUARD_MAJOR_VERSION == 3:
709
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
710
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
711
+ else:
712
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
713
+
714
+ from .._jsii import *
715
+
716
+ import constructs as _constructs_77d1e7e8
717
+ from .. import Duration as _Duration_4839e8c3
718
+ from ..aws_apigateway import RestApiBase as _RestApiBase_0431da32
719
+ from ..aws_cloudfront import (
720
+ AccessLevel as _AccessLevel_315d9a76,
721
+ CfnDistribution as _CfnDistribution_d9ad3595,
722
+ IOrigin as _IOrigin_83d4c1fa,
723
+ IOriginAccessControl as _IOriginAccessControl_82a6fe5a,
724
+ IOriginAccessIdentity as _IOriginAccessIdentity_a922494c,
725
+ OriginBase as _OriginBase_b8fe5bcc,
726
+ OriginBindConfig as _OriginBindConfig_25a57096,
727
+ OriginBindOptions as _OriginBindOptions_088c2b51,
728
+ OriginProps as _OriginProps_0675928d,
729
+ OriginProtocolPolicy as _OriginProtocolPolicy_967ed73c,
730
+ OriginSslPolicy as _OriginSslPolicy_d65cede2,
731
+ )
732
+ from ..aws_elasticloadbalancingv2 import ILoadBalancerV2 as _ILoadBalancerV2_4c5c0fbb
733
+ from ..aws_lambda import IFunctionUrl as _IFunctionUrl_1a74cd94
734
+ from ..aws_s3 import IBucket as _IBucket_42e086fd
735
+
736
+
737
+ class FunctionUrlOrigin(
738
+ _OriginBase_b8fe5bcc,
739
+ metaclass=jsii.JSIIMeta,
740
+ jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOrigin",
741
+ ):
742
+ '''An Origin for a Lambda Function URL.
743
+
744
+ :exampleMetadata: infused
745
+
746
+ Example::
747
+
748
+ import aws_cdk.aws_lambda as lambda_
749
+ # fn: lambda.Function
750
+
751
+
752
+ fn_url = fn.add_function_url(
753
+ auth_type=lambda_.FunctionUrlAuthType.AWS_IAM
754
+ )
755
+
756
+ cloudfront.Distribution(self, "MyDistribution",
757
+ default_behavior=cloudfront.BehaviorOptions(
758
+ origin=origins.FunctionUrlOrigin.with_origin_access_control(fn_url)
759
+ )
760
+ )
761
+ '''
762
+
763
+ def __init__(
764
+ self,
765
+ lambda_function_url: _IFunctionUrl_1a74cd94,
766
+ *,
767
+ keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
768
+ read_timeout: typing.Optional[_Duration_4839e8c3] = None,
769
+ origin_path: typing.Optional[builtins.str] = None,
770
+ connection_attempts: typing.Optional[jsii.Number] = None,
771
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
772
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
773
+ origin_access_control_id: typing.Optional[builtins.str] = None,
774
+ origin_id: typing.Optional[builtins.str] = None,
775
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
776
+ origin_shield_region: typing.Optional[builtins.str] = None,
777
+ ) -> None:
778
+ '''
779
+ :param lambda_function_url: -
780
+ :param keepalive_timeout: 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)
781
+ :param read_timeout: Specifies how long, in seconds, CloudFront waits for a response from 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(30)
782
+ :param origin_path: 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: '/'
783
+ :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
784
+ :param connection_timeout: 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)
785
+ :param custom_headers: A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
786
+ :param origin_access_control_id: The unique identifier of an origin access control for this origin. Default: - no origin access control
787
+ :param origin_id: A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
788
+ :param origin_shield_enabled: 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
789
+ :param origin_shield_region: 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
790
+ '''
791
+ if __debug__:
792
+ type_hints = typing.get_type_hints(_typecheckingstub__fcda903697b26acfe2149a285d5a64619682b675affb52f4ae2d1aca46c8f1c3)
793
+ check_type(argname="argument lambda_function_url", value=lambda_function_url, expected_type=type_hints["lambda_function_url"])
794
+ props = FunctionUrlOriginProps(
795
+ keepalive_timeout=keepalive_timeout,
796
+ read_timeout=read_timeout,
797
+ origin_path=origin_path,
798
+ connection_attempts=connection_attempts,
799
+ connection_timeout=connection_timeout,
800
+ custom_headers=custom_headers,
801
+ origin_access_control_id=origin_access_control_id,
802
+ origin_id=origin_id,
803
+ origin_shield_enabled=origin_shield_enabled,
804
+ origin_shield_region=origin_shield_region,
805
+ )
806
+
807
+ jsii.create(self.__class__, self, [lambda_function_url, props])
808
+
809
+ @jsii.member(jsii_name="withOriginAccessControl")
810
+ @builtins.classmethod
811
+ def with_origin_access_control(
812
+ cls,
813
+ lambda_function_url: _IFunctionUrl_1a74cd94,
814
+ *,
815
+ origin_access_control: typing.Optional[_IOriginAccessControl_82a6fe5a] = None,
816
+ keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
817
+ read_timeout: typing.Optional[_Duration_4839e8c3] = None,
818
+ origin_path: typing.Optional[builtins.str] = None,
819
+ connection_attempts: typing.Optional[jsii.Number] = None,
820
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
821
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
822
+ origin_access_control_id: typing.Optional[builtins.str] = None,
823
+ origin_id: typing.Optional[builtins.str] = None,
824
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
825
+ origin_shield_region: typing.Optional[builtins.str] = None,
826
+ ) -> _IOrigin_83d4c1fa:
827
+ '''Create a Lambda Function URL Origin with Origin Access Control (OAC) configured.
828
+
829
+ :param lambda_function_url: -
830
+ :param origin_access_control: An optional Origin Access Control. Default: - an Origin Access Control will be created.
831
+ :param keepalive_timeout: 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)
832
+ :param read_timeout: Specifies how long, in seconds, CloudFront waits for a response from 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(30)
833
+ :param origin_path: 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: '/'
834
+ :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
835
+ :param connection_timeout: 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)
836
+ :param custom_headers: A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
837
+ :param origin_access_control_id: The unique identifier of an origin access control for this origin. Default: - no origin access control
838
+ :param origin_id: A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
839
+ :param origin_shield_enabled: 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
840
+ :param origin_shield_region: 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
841
+ '''
842
+ if __debug__:
843
+ type_hints = typing.get_type_hints(_typecheckingstub__b4d59b7721f41be7903dbcffeddd34d596392d2c8d2a4110f31a4dacdb532727)
844
+ check_type(argname="argument lambda_function_url", value=lambda_function_url, expected_type=type_hints["lambda_function_url"])
845
+ props = FunctionUrlOriginWithOACProps(
846
+ origin_access_control=origin_access_control,
847
+ keepalive_timeout=keepalive_timeout,
848
+ read_timeout=read_timeout,
849
+ origin_path=origin_path,
850
+ connection_attempts=connection_attempts,
851
+ connection_timeout=connection_timeout,
852
+ custom_headers=custom_headers,
853
+ origin_access_control_id=origin_access_control_id,
854
+ origin_id=origin_id,
855
+ origin_shield_enabled=origin_shield_enabled,
856
+ origin_shield_region=origin_shield_region,
857
+ )
858
+
859
+ return typing.cast(_IOrigin_83d4c1fa, jsii.sinvoke(cls, "withOriginAccessControl", [lambda_function_url, props]))
860
+
861
+ @jsii.member(jsii_name="renderCustomOriginConfig")
862
+ def _render_custom_origin_config(
863
+ self,
864
+ ) -> typing.Optional[_CfnDistribution_d9ad3595.CustomOriginConfigProperty]:
865
+ return typing.cast(typing.Optional[_CfnDistribution_d9ad3595.CustomOriginConfigProperty], jsii.invoke(self, "renderCustomOriginConfig", []))
866
+
867
+
868
+ @jsii.data_type(
869
+ jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginBaseProps",
870
+ jsii_struct_bases=[_OriginProps_0675928d],
871
+ name_mapping={
872
+ "connection_attempts": "connectionAttempts",
873
+ "connection_timeout": "connectionTimeout",
874
+ "custom_headers": "customHeaders",
875
+ "origin_access_control_id": "originAccessControlId",
876
+ "origin_id": "originId",
877
+ "origin_shield_enabled": "originShieldEnabled",
878
+ "origin_shield_region": "originShieldRegion",
879
+ "origin_path": "originPath",
880
+ },
881
+ )
882
+ class FunctionUrlOriginBaseProps(_OriginProps_0675928d):
883
+ def __init__(
884
+ self,
885
+ *,
886
+ connection_attempts: typing.Optional[jsii.Number] = None,
887
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
888
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
889
+ origin_access_control_id: typing.Optional[builtins.str] = None,
890
+ origin_id: typing.Optional[builtins.str] = None,
891
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
892
+ origin_shield_region: typing.Optional[builtins.str] = None,
893
+ origin_path: typing.Optional[builtins.str] = None,
894
+ ) -> None:
895
+ '''Properties for configuring a origin using a standard Lambda Functions URLs.
896
+
897
+ :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
898
+ :param connection_timeout: 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)
899
+ :param custom_headers: A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
900
+ :param origin_access_control_id: The unique identifier of an origin access control for this origin. Default: - no origin access control
901
+ :param origin_id: A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
902
+ :param origin_shield_enabled: 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
903
+ :param origin_shield_region: 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
904
+ :param origin_path: 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: '/'
905
+
906
+ :exampleMetadata: fixture=_generated
907
+
908
+ Example::
909
+
910
+ # The code below shows an example of how to instantiate this type.
911
+ # The values are placeholders you should change.
912
+ import aws_cdk as cdk
913
+ from aws_cdk import aws_cloudfront_origins as cloudfront_origins
914
+
915
+ function_url_origin_base_props = cloudfront_origins.FunctionUrlOriginBaseProps(
916
+ connection_attempts=123,
917
+ connection_timeout=cdk.Duration.minutes(30),
918
+ custom_headers={
919
+ "custom_headers_key": "customHeaders"
920
+ },
921
+ origin_access_control_id="originAccessControlId",
922
+ origin_id="originId",
923
+ origin_path="originPath",
924
+ origin_shield_enabled=False,
925
+ origin_shield_region="originShieldRegion"
926
+ )
927
+ '''
928
+ if __debug__:
929
+ type_hints = typing.get_type_hints(_typecheckingstub__610b4764a440619f38a9adeb3e13225e58180ee2ee316abd994579fdcdb84c12)
930
+ check_type(argname="argument connection_attempts", value=connection_attempts, expected_type=type_hints["connection_attempts"])
931
+ check_type(argname="argument connection_timeout", value=connection_timeout, expected_type=type_hints["connection_timeout"])
932
+ check_type(argname="argument custom_headers", value=custom_headers, expected_type=type_hints["custom_headers"])
933
+ check_type(argname="argument origin_access_control_id", value=origin_access_control_id, expected_type=type_hints["origin_access_control_id"])
934
+ check_type(argname="argument origin_id", value=origin_id, expected_type=type_hints["origin_id"])
935
+ check_type(argname="argument origin_shield_enabled", value=origin_shield_enabled, expected_type=type_hints["origin_shield_enabled"])
936
+ check_type(argname="argument origin_shield_region", value=origin_shield_region, expected_type=type_hints["origin_shield_region"])
937
+ check_type(argname="argument origin_path", value=origin_path, expected_type=type_hints["origin_path"])
938
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
939
+ if connection_attempts is not None:
940
+ self._values["connection_attempts"] = connection_attempts
941
+ if connection_timeout is not None:
942
+ self._values["connection_timeout"] = connection_timeout
943
+ if custom_headers is not None:
944
+ self._values["custom_headers"] = custom_headers
945
+ if origin_access_control_id is not None:
946
+ self._values["origin_access_control_id"] = origin_access_control_id
947
+ if origin_id is not None:
948
+ self._values["origin_id"] = origin_id
949
+ if origin_shield_enabled is not None:
950
+ self._values["origin_shield_enabled"] = origin_shield_enabled
951
+ if origin_shield_region is not None:
952
+ self._values["origin_shield_region"] = origin_shield_region
953
+ if origin_path is not None:
954
+ self._values["origin_path"] = origin_path
955
+
956
+ @builtins.property
957
+ def connection_attempts(self) -> typing.Optional[jsii.Number]:
958
+ '''The number of times that CloudFront attempts to connect to the origin;
959
+
960
+ valid values are 1, 2, or 3 attempts.
961
+
962
+ :default: 3
963
+ '''
964
+ result = self._values.get("connection_attempts")
965
+ return typing.cast(typing.Optional[jsii.Number], result)
966
+
967
+ @builtins.property
968
+ def connection_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
969
+ '''The number of seconds that CloudFront waits when trying to establish a connection to the origin.
970
+
971
+ Valid values are 1-10 seconds, inclusive.
972
+
973
+ :default: Duration.seconds(10)
974
+ '''
975
+ result = self._values.get("connection_timeout")
976
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
977
+
978
+ @builtins.property
979
+ def custom_headers(
980
+ self,
981
+ ) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
982
+ '''A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
983
+
984
+ :default: {}
985
+ '''
986
+ result = self._values.get("custom_headers")
987
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
988
+
989
+ @builtins.property
990
+ def origin_access_control_id(self) -> typing.Optional[builtins.str]:
991
+ '''The unique identifier of an origin access control for this origin.
992
+
993
+ :default: - no origin access control
994
+ '''
995
+ result = self._values.get("origin_access_control_id")
996
+ return typing.cast(typing.Optional[builtins.str], result)
997
+
998
+ @builtins.property
999
+ def origin_id(self) -> typing.Optional[builtins.str]:
1000
+ '''A unique identifier for the origin.
1001
+
1002
+ This value must be unique within the distribution.
1003
+
1004
+ :default: - an originid will be generated for you
1005
+ '''
1006
+ result = self._values.get("origin_id")
1007
+ return typing.cast(typing.Optional[builtins.str], result)
1008
+
1009
+ @builtins.property
1010
+ def origin_shield_enabled(self) -> typing.Optional[builtins.bool]:
1011
+ '''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.
1012
+
1013
+ :default: - true
1014
+ '''
1015
+ result = self._values.get("origin_shield_enabled")
1016
+ return typing.cast(typing.Optional[builtins.bool], result)
1017
+
1018
+ @builtins.property
1019
+ def origin_shield_region(self) -> typing.Optional[builtins.str]:
1020
+ '''When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
1021
+
1022
+ :default: - origin shield not enabled
1023
+
1024
+ :see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
1025
+ '''
1026
+ result = self._values.get("origin_shield_region")
1027
+ return typing.cast(typing.Optional[builtins.str], result)
1028
+
1029
+ @builtins.property
1030
+ def origin_path(self) -> typing.Optional[builtins.str]:
1031
+ '''An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
1032
+
1033
+ Must begin, but not end, with '/' (e.g., '/production/images').
1034
+
1035
+ :default: '/'
1036
+ '''
1037
+ result = self._values.get("origin_path")
1038
+ return typing.cast(typing.Optional[builtins.str], result)
1039
+
1040
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1041
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1042
+
1043
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1044
+ return not (rhs == self)
1045
+
1046
+ def __repr__(self) -> str:
1047
+ return "FunctionUrlOriginBaseProps(%s)" % ", ".join(
1048
+ k + "=" + repr(v) for k, v in self._values.items()
1049
+ )
1050
+
1051
+
1052
+ @jsii.data_type(
1053
+ jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginProps",
1054
+ jsii_struct_bases=[_OriginProps_0675928d],
1055
+ name_mapping={
1056
+ "connection_attempts": "connectionAttempts",
1057
+ "connection_timeout": "connectionTimeout",
1058
+ "custom_headers": "customHeaders",
1059
+ "origin_access_control_id": "originAccessControlId",
1060
+ "origin_id": "originId",
1061
+ "origin_shield_enabled": "originShieldEnabled",
1062
+ "origin_shield_region": "originShieldRegion",
1063
+ "origin_path": "originPath",
1064
+ "keepalive_timeout": "keepaliveTimeout",
1065
+ "read_timeout": "readTimeout",
1066
+ },
1067
+ )
1068
+ class FunctionUrlOriginProps(_OriginProps_0675928d):
1069
+ def __init__(
1070
+ self,
1071
+ *,
1072
+ connection_attempts: typing.Optional[jsii.Number] = None,
1073
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
1074
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
1075
+ origin_access_control_id: typing.Optional[builtins.str] = None,
1076
+ origin_id: typing.Optional[builtins.str] = None,
1077
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
1078
+ origin_shield_region: typing.Optional[builtins.str] = None,
1079
+ origin_path: typing.Optional[builtins.str] = None,
1080
+ keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
1081
+ read_timeout: typing.Optional[_Duration_4839e8c3] = None,
1082
+ ) -> None:
1083
+ '''Properties for a Lambda Function URL Origin.
1084
+
1085
+ :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
1086
+ :param connection_timeout: 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)
1087
+ :param custom_headers: A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
1088
+ :param origin_access_control_id: The unique identifier of an origin access control for this origin. Default: - no origin access control
1089
+ :param origin_id: A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
1090
+ :param origin_shield_enabled: 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
1091
+ :param origin_shield_region: 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
1092
+ :param origin_path: 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: '/'
1093
+ :param keepalive_timeout: 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)
1094
+ :param read_timeout: Specifies how long, in seconds, CloudFront waits for a response from 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(30)
1095
+
1096
+ :exampleMetadata: fixture=_generated
1097
+
1098
+ Example::
1099
+
1100
+ # The code below shows an example of how to instantiate this type.
1101
+ # The values are placeholders you should change.
1102
+ import aws_cdk as cdk
1103
+ from aws_cdk import aws_cloudfront_origins as cloudfront_origins
1104
+
1105
+ function_url_origin_props = cloudfront_origins.FunctionUrlOriginProps(
1106
+ connection_attempts=123,
1107
+ connection_timeout=cdk.Duration.minutes(30),
1108
+ custom_headers={
1109
+ "custom_headers_key": "customHeaders"
1110
+ },
1111
+ keepalive_timeout=cdk.Duration.minutes(30),
1112
+ origin_access_control_id="originAccessControlId",
1113
+ origin_id="originId",
1114
+ origin_path="originPath",
1115
+ origin_shield_enabled=False,
1116
+ origin_shield_region="originShieldRegion",
1117
+ read_timeout=cdk.Duration.minutes(30)
1118
+ )
1119
+ '''
1120
+ if __debug__:
1121
+ type_hints = typing.get_type_hints(_typecheckingstub__56d340a9ac5dd93c6aa22cb98bcbc860fb23f8d247b53c2cd1a51ecd8406909a)
1122
+ check_type(argname="argument connection_attempts", value=connection_attempts, expected_type=type_hints["connection_attempts"])
1123
+ check_type(argname="argument connection_timeout", value=connection_timeout, expected_type=type_hints["connection_timeout"])
1124
+ check_type(argname="argument custom_headers", value=custom_headers, expected_type=type_hints["custom_headers"])
1125
+ check_type(argname="argument origin_access_control_id", value=origin_access_control_id, expected_type=type_hints["origin_access_control_id"])
1126
+ check_type(argname="argument origin_id", value=origin_id, expected_type=type_hints["origin_id"])
1127
+ check_type(argname="argument origin_shield_enabled", value=origin_shield_enabled, expected_type=type_hints["origin_shield_enabled"])
1128
+ check_type(argname="argument origin_shield_region", value=origin_shield_region, expected_type=type_hints["origin_shield_region"])
1129
+ check_type(argname="argument origin_path", value=origin_path, expected_type=type_hints["origin_path"])
1130
+ check_type(argname="argument keepalive_timeout", value=keepalive_timeout, expected_type=type_hints["keepalive_timeout"])
1131
+ check_type(argname="argument read_timeout", value=read_timeout, expected_type=type_hints["read_timeout"])
1132
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1133
+ if connection_attempts is not None:
1134
+ self._values["connection_attempts"] = connection_attempts
1135
+ if connection_timeout is not None:
1136
+ self._values["connection_timeout"] = connection_timeout
1137
+ if custom_headers is not None:
1138
+ self._values["custom_headers"] = custom_headers
1139
+ if origin_access_control_id is not None:
1140
+ self._values["origin_access_control_id"] = origin_access_control_id
1141
+ if origin_id is not None:
1142
+ self._values["origin_id"] = origin_id
1143
+ if origin_shield_enabled is not None:
1144
+ self._values["origin_shield_enabled"] = origin_shield_enabled
1145
+ if origin_shield_region is not None:
1146
+ self._values["origin_shield_region"] = origin_shield_region
1147
+ if origin_path is not None:
1148
+ self._values["origin_path"] = origin_path
1149
+ if keepalive_timeout is not None:
1150
+ self._values["keepalive_timeout"] = keepalive_timeout
1151
+ if read_timeout is not None:
1152
+ self._values["read_timeout"] = read_timeout
1153
+
1154
+ @builtins.property
1155
+ def connection_attempts(self) -> typing.Optional[jsii.Number]:
1156
+ '''The number of times that CloudFront attempts to connect to the origin;
1157
+
1158
+ valid values are 1, 2, or 3 attempts.
1159
+
1160
+ :default: 3
1161
+ '''
1162
+ result = self._values.get("connection_attempts")
1163
+ return typing.cast(typing.Optional[jsii.Number], result)
1164
+
1165
+ @builtins.property
1166
+ def connection_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
1167
+ '''The number of seconds that CloudFront waits when trying to establish a connection to the origin.
1168
+
1169
+ Valid values are 1-10 seconds, inclusive.
1170
+
1171
+ :default: Duration.seconds(10)
1172
+ '''
1173
+ result = self._values.get("connection_timeout")
1174
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
1175
+
1176
+ @builtins.property
1177
+ def custom_headers(
1178
+ self,
1179
+ ) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
1180
+ '''A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
1181
+
1182
+ :default: {}
1183
+ '''
1184
+ result = self._values.get("custom_headers")
1185
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
1186
+
1187
+ @builtins.property
1188
+ def origin_access_control_id(self) -> typing.Optional[builtins.str]:
1189
+ '''The unique identifier of an origin access control for this origin.
1190
+
1191
+ :default: - no origin access control
1192
+ '''
1193
+ result = self._values.get("origin_access_control_id")
1194
+ return typing.cast(typing.Optional[builtins.str], result)
1195
+
1196
+ @builtins.property
1197
+ def origin_id(self) -> typing.Optional[builtins.str]:
1198
+ '''A unique identifier for the origin.
1199
+
1200
+ This value must be unique within the distribution.
1201
+
1202
+ :default: - an originid will be generated for you
1203
+ '''
1204
+ result = self._values.get("origin_id")
1205
+ return typing.cast(typing.Optional[builtins.str], result)
1206
+
1207
+ @builtins.property
1208
+ def origin_shield_enabled(self) -> typing.Optional[builtins.bool]:
1209
+ '''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.
645
1210
 
646
- import jsii
647
- import publication
648
- import typing_extensions
1211
+ :default: - true
1212
+ '''
1213
+ result = self._values.get("origin_shield_enabled")
1214
+ return typing.cast(typing.Optional[builtins.bool], result)
649
1215
 
650
- import typeguard
651
- from importlib.metadata import version as _metadata_package_version
652
- TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
1216
+ @builtins.property
1217
+ def origin_shield_region(self) -> typing.Optional[builtins.str]:
1218
+ '''When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
653
1219
 
654
- def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
655
- if TYPEGUARD_MAJOR_VERSION <= 2:
656
- return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
657
- else:
658
- if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
659
- pass
660
- else:
661
- if TYPEGUARD_MAJOR_VERSION == 3:
662
- typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
663
- typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
664
- else:
665
- typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
1220
+ :default: - origin shield not enabled
666
1221
 
667
- from .._jsii import *
1222
+ :see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
1223
+ '''
1224
+ result = self._values.get("origin_shield_region")
1225
+ return typing.cast(typing.Optional[builtins.str], result)
668
1226
 
669
- import constructs as _constructs_77d1e7e8
670
- from .. import Duration as _Duration_4839e8c3
671
- from ..aws_apigateway import RestApiBase as _RestApiBase_0431da32
672
- from ..aws_cloudfront import (
673
- AccessLevel as _AccessLevel_315d9a76,
674
- CfnDistribution as _CfnDistribution_d9ad3595,
675
- IOrigin as _IOrigin_83d4c1fa,
676
- IOriginAccessControl as _IOriginAccessControl_82a6fe5a,
677
- IOriginAccessIdentity as _IOriginAccessIdentity_a922494c,
678
- OriginBase as _OriginBase_b8fe5bcc,
679
- OriginBindConfig as _OriginBindConfig_25a57096,
680
- OriginBindOptions as _OriginBindOptions_088c2b51,
681
- OriginProps as _OriginProps_0675928d,
682
- OriginProtocolPolicy as _OriginProtocolPolicy_967ed73c,
683
- OriginSslPolicy as _OriginSslPolicy_d65cede2,
684
- )
685
- from ..aws_elasticloadbalancingv2 import ILoadBalancerV2 as _ILoadBalancerV2_4c5c0fbb
686
- from ..aws_lambda import IFunctionUrl as _IFunctionUrl_1a74cd94
687
- from ..aws_s3 import IBucket as _IBucket_42e086fd
1227
+ @builtins.property
1228
+ def origin_path(self) -> typing.Optional[builtins.str]:
1229
+ '''An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
688
1230
 
1231
+ Must begin, but not end, with '/' (e.g., '/production/images').
689
1232
 
690
- class FunctionUrlOrigin(
691
- _OriginBase_b8fe5bcc,
692
- metaclass=jsii.JSIIMeta,
693
- jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOrigin",
694
- ):
695
- '''An Origin for a Lambda Function URL.
1233
+ :default: '/'
1234
+ '''
1235
+ result = self._values.get("origin_path")
1236
+ return typing.cast(typing.Optional[builtins.str], result)
696
1237
 
697
- :exampleMetadata: infused
1238
+ @builtins.property
1239
+ def keepalive_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
1240
+ '''Specifies how long, in seconds, CloudFront persists its connection to the origin.
698
1241
 
699
- Example::
1242
+ The valid range is from 1 to 180 seconds, inclusive.
700
1243
 
701
- import aws_cdk.aws_lambda as lambda_
702
-
703
- # fn: lambda.Function
704
-
705
- fn_url = fn.add_function_url(auth_type=lambda_.FunctionUrlAuthType.NONE)
706
-
707
- cloudfront.Distribution(self, "Distribution",
708
- default_behavior=cloudfront.BehaviorOptions(origin=origins.FunctionUrlOrigin(fn_url))
709
- )
710
- '''
1244
+ Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota
1245
+ has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.
711
1246
 
712
- def __init__(
713
- self,
714
- lambda_function_url: _IFunctionUrl_1a74cd94,
715
- *,
716
- keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
717
- read_timeout: typing.Optional[_Duration_4839e8c3] = None,
718
- origin_path: typing.Optional[builtins.str] = None,
719
- connection_attempts: typing.Optional[jsii.Number] = None,
720
- connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
721
- custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
722
- origin_access_control_id: typing.Optional[builtins.str] = None,
723
- origin_id: typing.Optional[builtins.str] = None,
724
- origin_shield_enabled: typing.Optional[builtins.bool] = None,
725
- origin_shield_region: typing.Optional[builtins.str] = None,
726
- ) -> None:
1247
+ :default: Duration.seconds(5)
727
1248
  '''
728
- :param lambda_function_url: -
729
- :param keepalive_timeout: 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)
730
- :param read_timeout: Specifies how long, in seconds, CloudFront waits for a response from 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(30)
731
- :param origin_path: 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: '/'
732
- :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
733
- :param connection_timeout: 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)
734
- :param custom_headers: A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. Default: {}
735
- :param origin_access_control_id: The unique identifier of an origin access control for this origin. Default: - no origin access control
736
- :param origin_id: A unique identifier for the origin. This value must be unique within the distribution. Default: - an originid will be generated for you
737
- :param origin_shield_enabled: 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
738
- :param origin_shield_region: 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
1249
+ result = self._values.get("keepalive_timeout")
1250
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
1251
+
1252
+ @builtins.property
1253
+ def read_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
1254
+ '''Specifies how long, in seconds, CloudFront waits for a response from the origin.
1255
+
1256
+ The valid range is from 1 to 180 seconds, inclusive.
1257
+
1258
+ Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota
1259
+ has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.
1260
+
1261
+ :default: Duration.seconds(30)
739
1262
  '''
740
- if __debug__:
741
- type_hints = typing.get_type_hints(_typecheckingstub__fcda903697b26acfe2149a285d5a64619682b675affb52f4ae2d1aca46c8f1c3)
742
- check_type(argname="argument lambda_function_url", value=lambda_function_url, expected_type=type_hints["lambda_function_url"])
743
- props = FunctionUrlOriginProps(
744
- keepalive_timeout=keepalive_timeout,
745
- read_timeout=read_timeout,
746
- origin_path=origin_path,
747
- connection_attempts=connection_attempts,
748
- connection_timeout=connection_timeout,
749
- custom_headers=custom_headers,
750
- origin_access_control_id=origin_access_control_id,
751
- origin_id=origin_id,
752
- origin_shield_enabled=origin_shield_enabled,
753
- origin_shield_region=origin_shield_region,
754
- )
1263
+ result = self._values.get("read_timeout")
1264
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
755
1265
 
756
- jsii.create(self.__class__, self, [lambda_function_url, props])
1266
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1267
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
757
1268
 
758
- @jsii.member(jsii_name="renderCustomOriginConfig")
759
- def _render_custom_origin_config(
760
- self,
761
- ) -> typing.Optional[_CfnDistribution_d9ad3595.CustomOriginConfigProperty]:
762
- return typing.cast(typing.Optional[_CfnDistribution_d9ad3595.CustomOriginConfigProperty], jsii.invoke(self, "renderCustomOriginConfig", []))
1269
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1270
+ return not (rhs == self)
1271
+
1272
+ def __repr__(self) -> str:
1273
+ return "FunctionUrlOriginProps(%s)" % ", ".join(
1274
+ k + "=" + repr(v) for k, v in self._values.items()
1275
+ )
763
1276
 
764
1277
 
765
1278
  @jsii.data_type(
766
- jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginProps",
767
- jsii_struct_bases=[_OriginProps_0675928d],
1279
+ jsii_type="aws-cdk-lib.aws_cloudfront_origins.FunctionUrlOriginWithOACProps",
1280
+ jsii_struct_bases=[FunctionUrlOriginProps],
768
1281
  name_mapping={
769
1282
  "connection_attempts": "connectionAttempts",
770
1283
  "connection_timeout": "connectionTimeout",
@@ -776,9 +1289,10 @@ class FunctionUrlOrigin(
776
1289
  "origin_path": "originPath",
777
1290
  "keepalive_timeout": "keepaliveTimeout",
778
1291
  "read_timeout": "readTimeout",
1292
+ "origin_access_control": "originAccessControl",
779
1293
  },
780
1294
  )
781
- class FunctionUrlOriginProps(_OriginProps_0675928d):
1295
+ class FunctionUrlOriginWithOACProps(FunctionUrlOriginProps):
782
1296
  def __init__(
783
1297
  self,
784
1298
  *,
@@ -792,8 +1306,9 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
792
1306
  origin_path: typing.Optional[builtins.str] = None,
793
1307
  keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
794
1308
  read_timeout: typing.Optional[_Duration_4839e8c3] = None,
1309
+ origin_access_control: typing.Optional[_IOriginAccessControl_82a6fe5a] = None,
795
1310
  ) -> None:
796
- '''Properties for a Lambda Function URL Origin.
1311
+ '''Properties for configuring a Lambda Functions URLs with OAC.
797
1312
 
798
1313
  :param connection_attempts: The number of times that CloudFront attempts to connect to the origin; valid values are 1, 2, or 3 attempts. Default: 3
799
1314
  :param connection_timeout: 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)
@@ -805,33 +1320,37 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
805
1320
  :param origin_path: 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: '/'
806
1321
  :param keepalive_timeout: 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)
807
1322
  :param read_timeout: Specifies how long, in seconds, CloudFront waits for a response from 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(30)
1323
+ :param origin_access_control: An optional Origin Access Control. Default: - an Origin Access Control will be created.
808
1324
 
809
- :exampleMetadata: fixture=_generated
1325
+ :exampleMetadata: infused
810
1326
 
811
1327
  Example::
812
1328
 
813
- # The code below shows an example of how to instantiate this type.
814
- # The values are placeholders you should change.
815
- import aws_cdk as cdk
816
- from aws_cdk import aws_cloudfront_origins as cloudfront_origins
1329
+ import aws_cdk.aws_lambda as lambda_
1330
+ # fn: lambda.Function
817
1331
 
818
- function_url_origin_props = cloudfront_origins.FunctionUrlOriginProps(
819
- connection_attempts=123,
820
- connection_timeout=cdk.Duration.minutes(30),
821
- custom_headers={
822
- "custom_headers_key": "customHeaders"
823
- },
824
- keepalive_timeout=cdk.Duration.minutes(30),
825
- origin_access_control_id="originAccessControlId",
826
- origin_id="originId",
827
- origin_path="originPath",
828
- origin_shield_enabled=False,
829
- origin_shield_region="originShieldRegion",
830
- read_timeout=cdk.Duration.minutes(30)
1332
+
1333
+ fn_url = fn.add_function_url(
1334
+ auth_type=lambda_.FunctionUrlAuthType.AWS_IAM
1335
+ )
1336
+
1337
+ # Define a custom OAC
1338
+ oac = cloudfront.FunctionUrlOriginAccessControl(self, "MyOAC",
1339
+ origin_access_control_name="CustomLambdaOAC",
1340
+ signing=cloudfront.Signing.SIGV4_ALWAYS
1341
+ )
1342
+
1343
+ # Set up Lambda Function URL with OAC in CloudFront Distribution
1344
+ cloudfront.Distribution(self, "MyDistribution",
1345
+ default_behavior=cloudfront.BehaviorOptions(
1346
+ origin=origins.FunctionUrlOrigin.with_origin_access_control(fn_url,
1347
+ origin_access_control=oac
1348
+ )
1349
+ )
831
1350
  )
832
1351
  '''
833
1352
  if __debug__:
834
- type_hints = typing.get_type_hints(_typecheckingstub__56d340a9ac5dd93c6aa22cb98bcbc860fb23f8d247b53c2cd1a51ecd8406909a)
1353
+ type_hints = typing.get_type_hints(_typecheckingstub__56968af993436ccfcac0aa6a57169f1a033078c10740d435d086816ad0336a75)
835
1354
  check_type(argname="argument connection_attempts", value=connection_attempts, expected_type=type_hints["connection_attempts"])
836
1355
  check_type(argname="argument connection_timeout", value=connection_timeout, expected_type=type_hints["connection_timeout"])
837
1356
  check_type(argname="argument custom_headers", value=custom_headers, expected_type=type_hints["custom_headers"])
@@ -842,6 +1361,7 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
842
1361
  check_type(argname="argument origin_path", value=origin_path, expected_type=type_hints["origin_path"])
843
1362
  check_type(argname="argument keepalive_timeout", value=keepalive_timeout, expected_type=type_hints["keepalive_timeout"])
844
1363
  check_type(argname="argument read_timeout", value=read_timeout, expected_type=type_hints["read_timeout"])
1364
+ check_type(argname="argument origin_access_control", value=origin_access_control, expected_type=type_hints["origin_access_control"])
845
1365
  self._values: typing.Dict[builtins.str, typing.Any] = {}
846
1366
  if connection_attempts is not None:
847
1367
  self._values["connection_attempts"] = connection_attempts
@@ -863,6 +1383,8 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
863
1383
  self._values["keepalive_timeout"] = keepalive_timeout
864
1384
  if read_timeout is not None:
865
1385
  self._values["read_timeout"] = read_timeout
1386
+ if origin_access_control is not None:
1387
+ self._values["origin_access_control"] = origin_access_control
866
1388
 
867
1389
  @builtins.property
868
1390
  def connection_attempts(self) -> typing.Optional[jsii.Number]:
@@ -976,6 +1498,15 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
976
1498
  result = self._values.get("read_timeout")
977
1499
  return typing.cast(typing.Optional[_Duration_4839e8c3], result)
978
1500
 
1501
+ @builtins.property
1502
+ def origin_access_control(self) -> typing.Optional[_IOriginAccessControl_82a6fe5a]:
1503
+ '''An optional Origin Access Control.
1504
+
1505
+ :default: - an Origin Access Control will be created.
1506
+ '''
1507
+ result = self._values.get("origin_access_control")
1508
+ return typing.cast(typing.Optional[_IOriginAccessControl_82a6fe5a], result)
1509
+
979
1510
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
980
1511
  return isinstance(rhs, self.__class__) and rhs._values == self._values
981
1512
 
@@ -983,7 +1514,7 @@ class FunctionUrlOriginProps(_OriginProps_0675928d):
983
1514
  return not (rhs == self)
984
1515
 
985
1516
  def __repr__(self) -> str:
986
- return "FunctionUrlOriginProps(%s)" % ", ".join(
1517
+ return "FunctionUrlOriginWithOACProps(%s)" % ", ".join(
987
1518
  k + "=" + repr(v) for k, v in self._values.items()
988
1519
  )
989
1520
 
@@ -3672,7 +4203,9 @@ class S3StaticWebsiteOriginProps(HttpOriginProps):
3672
4203
 
3673
4204
  __all__ = [
3674
4205
  "FunctionUrlOrigin",
4206
+ "FunctionUrlOriginBaseProps",
3675
4207
  "FunctionUrlOriginProps",
4208
+ "FunctionUrlOriginWithOACProps",
3676
4209
  "HttpOrigin",
3677
4210
  "HttpOriginProps",
3678
4211
  "LoadBalancerV2Origin",
@@ -3710,6 +4243,38 @@ def _typecheckingstub__fcda903697b26acfe2149a285d5a64619682b675affb52f4ae2d1aca4
3710
4243
  """Type checking stubs"""
3711
4244
  pass
3712
4245
 
4246
+ def _typecheckingstub__b4d59b7721f41be7903dbcffeddd34d596392d2c8d2a4110f31a4dacdb532727(
4247
+ lambda_function_url: _IFunctionUrl_1a74cd94,
4248
+ *,
4249
+ origin_access_control: typing.Optional[_IOriginAccessControl_82a6fe5a] = None,
4250
+ keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
4251
+ read_timeout: typing.Optional[_Duration_4839e8c3] = None,
4252
+ origin_path: typing.Optional[builtins.str] = None,
4253
+ connection_attempts: typing.Optional[jsii.Number] = None,
4254
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
4255
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
4256
+ origin_access_control_id: typing.Optional[builtins.str] = None,
4257
+ origin_id: typing.Optional[builtins.str] = None,
4258
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
4259
+ origin_shield_region: typing.Optional[builtins.str] = None,
4260
+ ) -> None:
4261
+ """Type checking stubs"""
4262
+ pass
4263
+
4264
+ def _typecheckingstub__610b4764a440619f38a9adeb3e13225e58180ee2ee316abd994579fdcdb84c12(
4265
+ *,
4266
+ connection_attempts: typing.Optional[jsii.Number] = None,
4267
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
4268
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
4269
+ origin_access_control_id: typing.Optional[builtins.str] = None,
4270
+ origin_id: typing.Optional[builtins.str] = None,
4271
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
4272
+ origin_shield_region: typing.Optional[builtins.str] = None,
4273
+ origin_path: typing.Optional[builtins.str] = None,
4274
+ ) -> None:
4275
+ """Type checking stubs"""
4276
+ pass
4277
+
3713
4278
  def _typecheckingstub__56d340a9ac5dd93c6aa22cb98bcbc860fb23f8d247b53c2cd1a51ecd8406909a(
3714
4279
  *,
3715
4280
  connection_attempts: typing.Optional[jsii.Number] = None,
@@ -3726,6 +4291,23 @@ def _typecheckingstub__56d340a9ac5dd93c6aa22cb98bcbc860fb23f8d247b53c2cd1a51ecd8
3726
4291
  """Type checking stubs"""
3727
4292
  pass
3728
4293
 
4294
+ def _typecheckingstub__56968af993436ccfcac0aa6a57169f1a033078c10740d435d086816ad0336a75(
4295
+ *,
4296
+ connection_attempts: typing.Optional[jsii.Number] = None,
4297
+ connection_timeout: typing.Optional[_Duration_4839e8c3] = None,
4298
+ custom_headers: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
4299
+ origin_access_control_id: typing.Optional[builtins.str] = None,
4300
+ origin_id: typing.Optional[builtins.str] = None,
4301
+ origin_shield_enabled: typing.Optional[builtins.bool] = None,
4302
+ origin_shield_region: typing.Optional[builtins.str] = None,
4303
+ origin_path: typing.Optional[builtins.str] = None,
4304
+ keepalive_timeout: typing.Optional[_Duration_4839e8c3] = None,
4305
+ read_timeout: typing.Optional[_Duration_4839e8c3] = None,
4306
+ origin_access_control: typing.Optional[_IOriginAccessControl_82a6fe5a] = None,
4307
+ ) -> None:
4308
+ """Type checking stubs"""
4309
+ pass
4310
+
3729
4311
  def _typecheckingstub__57d13f69f251622e0723aa73c3eb93e482e0deb7a7b1e8439c7d7ad35cfc0cc5(
3730
4312
  domain_name: builtins.str,
3731
4313
  *,