aws-cdk-lib 2.115.0__py3-none-any.whl → 2.116.1__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 (66) hide show
  1. aws_cdk/__init__.py +801 -356
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.115.0.jsii.tgz → aws-cdk-lib@2.116.1.jsii.tgz} +0 -0
  4. aws_cdk/aws_apigateway/__init__.py +3 -1
  5. aws_cdk/aws_apigatewayv2/__init__.py +595 -222
  6. aws_cdk/aws_apigatewayv2_integrations/__init__.py +4 -5
  7. aws_cdk/aws_applicationautoscaling/__init__.py +51 -15
  8. aws_cdk/aws_appsync/__init__.py +14 -3
  9. aws_cdk/aws_autoscaling/__init__.py +6 -0
  10. aws_cdk/aws_b2bi/__init__.py +2445 -0
  11. aws_cdk/aws_cloud9/__init__.py +63 -63
  12. aws_cdk/aws_cloudfront/__init__.py +394 -0
  13. aws_cdk/aws_cloudfront/experimental/__init__.py +5 -2
  14. aws_cdk/aws_cloudtrail/__init__.py +90 -11
  15. aws_cdk/aws_cloudwatch/__init__.py +6 -6
  16. aws_cdk/aws_codedeploy/__init__.py +88 -15
  17. aws_cdk/aws_codepipeline/__init__.py +645 -0
  18. aws_cdk/aws_cognito/__init__.py +13 -26
  19. aws_cdk/aws_config/__init__.py +315 -1
  20. aws_cdk/aws_connect/__init__.py +532 -37
  21. aws_cdk/aws_controltower/__init__.py +4 -4
  22. aws_cdk/aws_datasync/__init__.py +6 -4
  23. aws_cdk/aws_dms/__init__.py +241 -131
  24. aws_cdk/aws_dynamodb/__init__.py +8 -0
  25. aws_cdk/aws_ec2/__init__.py +1030 -45
  26. aws_cdk/aws_ecr/__init__.py +78 -10
  27. aws_cdk/aws_ecs/__init__.py +210 -2
  28. aws_cdk/aws_ecs_patterns/__init__.py +77 -62
  29. aws_cdk/aws_eks/__init__.py +8 -1
  30. aws_cdk/aws_elasticache/__init__.py +136 -10
  31. aws_cdk/aws_elasticloadbalancingv2/__init__.py +10 -13
  32. aws_cdk/aws_emr/__init__.py +234 -17
  33. aws_cdk/aws_eventschemas/__init__.py +15 -13
  34. aws_cdk/aws_fis/__init__.py +33 -13
  35. aws_cdk/aws_gamelift/__init__.py +47 -0
  36. aws_cdk/aws_imagebuilder/__init__.py +922 -84
  37. aws_cdk/aws_internetmonitor/__init__.py +12 -10
  38. aws_cdk/aws_iot/__init__.py +26 -46
  39. aws_cdk/aws_iottwinmaker/__init__.py +36 -34
  40. aws_cdk/aws_lambda/__init__.py +19 -15
  41. aws_cdk/aws_lambda_nodejs/__init__.py +5 -2
  42. aws_cdk/aws_logs/__init__.py +6 -6
  43. aws_cdk/aws_opensearchservice/__init__.py +5 -3
  44. aws_cdk/aws_organizations/__init__.py +3 -3
  45. aws_cdk/aws_osis/__init__.py +17 -13
  46. aws_cdk/aws_rds/__init__.py +6 -0
  47. aws_cdk/aws_s3/__init__.py +4 -2
  48. aws_cdk/aws_s3outposts/__init__.py +8 -8
  49. aws_cdk/aws_sagemaker/__init__.py +17 -94
  50. aws_cdk/aws_secretsmanager/__init__.py +9 -7
  51. aws_cdk/aws_securityhub/__init__.py +18 -0
  52. aws_cdk/aws_servicecatalogappregistry/__init__.py +31 -0
  53. aws_cdk/aws_ses/__init__.py +58 -11
  54. aws_cdk/aws_sns/__init__.py +309 -10
  55. aws_cdk/aws_ssm/__init__.py +3 -5
  56. aws_cdk/aws_stepfunctions/__init__.py +335 -19
  57. aws_cdk/aws_stepfunctions_tasks/__init__.py +388 -38
  58. aws_cdk/aws_transfer/__init__.py +37 -10
  59. aws_cdk/custom_resources/__init__.py +443 -1
  60. aws_cdk/triggers/__init__.py +5 -2
  61. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/METADATA +1 -1
  62. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/RECORD +66 -65
  63. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/LICENSE +0 -0
  64. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/NOTICE +0 -0
  65. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/WHEEL +0 -0
  66. {aws_cdk_lib-2.115.0.dist-info → aws_cdk_lib-2.116.1.dist-info}/top_level.txt +0 -0
aws_cdk/__init__.py CHANGED
@@ -9971,48 +9971,12 @@ class CustomResourceProps:
9971
9971
  )
9972
9972
 
9973
9973
 
9974
- class CustomResourceProvider(
9974
+ class CustomResourceProviderBase(
9975
9975
  _constructs_77d1e7e8.Construct,
9976
- metaclass=jsii.JSIIMeta,
9977
- jsii_type="aws-cdk-lib.CustomResourceProvider",
9976
+ metaclass=jsii.JSIIAbstractClass,
9977
+ jsii_type="aws-cdk-lib.CustomResourceProviderBase",
9978
9978
  ):
9979
- '''An AWS-Lambda backed custom resource provider, for CDK Construct Library constructs.
9980
-
9981
- This is a provider for ``CustomResource`` constructs, backed by an AWS Lambda
9982
- Function. It only supports NodeJS runtimes.
9983
- .. epigraph::
9984
-
9985
- **Application builders do not need to use this provider type**. This is not
9986
- a generic custom resource provider class. It is specifically
9987
- intended to be used only by constructs in the AWS CDK Construct Library, and
9988
- only exists here because of reverse dependency issues (for example, it cannot
9989
- use ``iam.PolicyStatement`` objects, since the ``iam`` library already depends on
9990
- the CDK ``core`` library and we cannot have cyclic dependencies).
9991
-
9992
- If you are not writing constructs for the AWS Construct Library, you should
9993
- use the ``Provider`` class in the ``custom-resources`` module instead, which has
9994
- a better API and supports all Lambda runtimes, not just Node.
9995
-
9996
- N.B.: When you are writing Custom Resource Providers, there are a number of
9997
- lifecycle events you have to pay attention to. These are documented in the
9998
- README of the ``custom-resources`` module. Be sure to give the documentation
9999
- in that module a read, regardless of whether you end up using the Provider
10000
- class in there or this one.
10001
-
10002
- :exampleMetadata: infused
10003
-
10004
- Example::
10005
-
10006
- provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
10007
- code_directory=f"{__dirname}/my-handler",
10008
- runtime=CustomResourceProviderRuntime.NODEJS_18_X
10009
- )
10010
- provider.add_to_role_policy({
10011
- "Effect": "Allow",
10012
- "Action": "s3:GetObject",
10013
- "Resource": "*"
10014
- })
10015
- '''
9979
+ '''Base class for creating a custom resource provider.'''
10016
9980
 
10017
9981
  def __init__(
10018
9982
  self,
@@ -10020,7 +9984,7 @@ class CustomResourceProvider(
10020
9984
  id: builtins.str,
10021
9985
  *,
10022
9986
  code_directory: builtins.str,
10023
- runtime: "CustomResourceProviderRuntime",
9987
+ runtime_name: builtins.str,
10024
9988
  description: typing.Optional[builtins.str] = None,
10025
9989
  environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10026
9990
  memory_size: typing.Optional["Size"] = None,
@@ -10032,7 +9996,7 @@ class CustomResourceProvider(
10032
9996
  :param scope: -
10033
9997
  :param id: -
10034
9998
  :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
10035
- :param runtime: The AWS Lambda runtime and version to use for the provider.
9999
+ :param runtime_name: The AWS Lambda runtime and version name to use for the provider.
10036
10000
  :param description: A description of the function. Default: - No description.
10037
10001
  :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
10038
10002
  :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
@@ -10041,12 +10005,12 @@ class CustomResourceProvider(
10041
10005
  :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10042
10006
  '''
10043
10007
  if __debug__:
10044
- type_hints = typing.get_type_hints(_typecheckingstub__c9a6802d57ad9b69b2fa5290464f51a2a8623348c365289d64305245e073ef41)
10008
+ type_hints = typing.get_type_hints(_typecheckingstub__b472990efe22be52456a5e812dc6396350b7010d1113310d62ef01f74c1769e1)
10045
10009
  check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
10046
10010
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
10047
- props = CustomResourceProviderProps(
10011
+ props = CustomResourceProviderBaseProps(
10048
10012
  code_directory=code_directory,
10049
- runtime=runtime,
10013
+ runtime_name=runtime_name,
10050
10014
  description=description,
10051
10015
  environment=environment,
10052
10016
  memory_size=memory_size,
@@ -10057,108 +10021,6 @@ class CustomResourceProvider(
10057
10021
 
10058
10022
  jsii.create(self.__class__, self, [scope, id, props])
10059
10023
 
10060
- @jsii.member(jsii_name="getOrCreate")
10061
- @builtins.classmethod
10062
- def get_or_create(
10063
- cls,
10064
- scope: _constructs_77d1e7e8.Construct,
10065
- uniqueid: builtins.str,
10066
- *,
10067
- code_directory: builtins.str,
10068
- runtime: "CustomResourceProviderRuntime",
10069
- description: typing.Optional[builtins.str] = None,
10070
- environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10071
- memory_size: typing.Optional["Size"] = None,
10072
- policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
10073
- timeout: typing.Optional["Duration"] = None,
10074
- use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
10075
- ) -> builtins.str:
10076
- '''Returns a stack-level singleton ARN (service token) for the custom resource provider.
10077
-
10078
- :param scope: Construct scope.
10079
- :param uniqueid: A globally unique id that will be used for the stack-level construct.
10080
- :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
10081
- :param runtime: The AWS Lambda runtime and version to use for the provider.
10082
- :param description: A description of the function. Default: - No description.
10083
- :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
10084
- :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
10085
- :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
10086
- :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
10087
- :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10088
-
10089
- :return:
10090
-
10091
- the service token of the custom resource provider, which should be
10092
- used when defining a ``CustomResource``.
10093
- '''
10094
- if __debug__:
10095
- type_hints = typing.get_type_hints(_typecheckingstub__c1f95fb403ff0b28ac158a1e391fedc73bee20ded09963a1a66fabfcfe99d006)
10096
- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
10097
- check_type(argname="argument uniqueid", value=uniqueid, expected_type=type_hints["uniqueid"])
10098
- props = CustomResourceProviderProps(
10099
- code_directory=code_directory,
10100
- runtime=runtime,
10101
- description=description,
10102
- environment=environment,
10103
- memory_size=memory_size,
10104
- policy_statements=policy_statements,
10105
- timeout=timeout,
10106
- use_cfn_response_wrapper=use_cfn_response_wrapper,
10107
- )
10108
-
10109
- return typing.cast(builtins.str, jsii.sinvoke(cls, "getOrCreate", [scope, uniqueid, props]))
10110
-
10111
- @jsii.member(jsii_name="getOrCreateProvider")
10112
- @builtins.classmethod
10113
- def get_or_create_provider(
10114
- cls,
10115
- scope: _constructs_77d1e7e8.Construct,
10116
- uniqueid: builtins.str,
10117
- *,
10118
- code_directory: builtins.str,
10119
- runtime: "CustomResourceProviderRuntime",
10120
- description: typing.Optional[builtins.str] = None,
10121
- environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10122
- memory_size: typing.Optional["Size"] = None,
10123
- policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
10124
- timeout: typing.Optional["Duration"] = None,
10125
- use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
10126
- ) -> "CustomResourceProvider":
10127
- '''Returns a stack-level singleton for the custom resource provider.
10128
-
10129
- :param scope: Construct scope.
10130
- :param uniqueid: A globally unique id that will be used for the stack-level construct.
10131
- :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
10132
- :param runtime: The AWS Lambda runtime and version to use for the provider.
10133
- :param description: A description of the function. Default: - No description.
10134
- :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
10135
- :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
10136
- :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
10137
- :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
10138
- :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10139
-
10140
- :return:
10141
-
10142
- the service token of the custom resource provider, which should be
10143
- used when defining a ``CustomResource``.
10144
- '''
10145
- if __debug__:
10146
- type_hints = typing.get_type_hints(_typecheckingstub__0ccbce12d9e6f35bd2240da7f5c1900a1ff6b41588e9f31f4b76ecb707a6310f)
10147
- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
10148
- check_type(argname="argument uniqueid", value=uniqueid, expected_type=type_hints["uniqueid"])
10149
- props = CustomResourceProviderProps(
10150
- code_directory=code_directory,
10151
- runtime=runtime,
10152
- description=description,
10153
- environment=environment,
10154
- memory_size=memory_size,
10155
- policy_statements=policy_statements,
10156
- timeout=timeout,
10157
- use_cfn_response_wrapper=use_cfn_response_wrapper,
10158
- )
10159
-
10160
- return typing.cast("CustomResourceProvider", jsii.sinvoke(cls, "getOrCreateProvider", [scope, uniqueid, props]))
10161
-
10162
10024
  @jsii.member(jsii_name="addToRolePolicy")
10163
10025
  def add_to_role_policy(self, statement: typing.Any) -> None:
10164
10026
  '''Add an IAM policy statement to the inline policy of the provider's lambda function's role.
@@ -10180,7 +10042,7 @@ class CustomResourceProvider(
10180
10042
  })
10181
10043
  '''
10182
10044
  if __debug__:
10183
- type_hints = typing.get_type_hints(_typecheckingstub__b6bbb7ac438407b317f797bf320b11f8dee8e0222411b4590c1352b276e7f29c)
10045
+ type_hints = typing.get_type_hints(_typecheckingstub__d7b4da0f6df59a6071a8ead45156197cdf0751659059c019b964df5f5dd58b9a)
10184
10046
  check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
10185
10047
  return typing.cast(None, jsii.invoke(self, "addToRolePolicy", [statement]))
10186
10048
 
@@ -10203,30 +10065,21 @@ class CustomResourceProvider(
10203
10065
  @builtins.property
10204
10066
  @jsii.member(jsii_name="serviceToken")
10205
10067
  def service_token(self) -> builtins.str:
10206
- '''The ARN of the provider's AWS Lambda function which should be used as the ``serviceToken`` when defining a custom resource.
10068
+ '''The ARN of the provider's AWS Lambda function which should be used as the ``serviceToken`` when defining a custom resource.'''
10069
+ return typing.cast(builtins.str, jsii.get(self, "serviceToken"))
10207
10070
 
10208
- Example::
10209
10071
 
10210
- # my_provider: CustomResourceProvider
10211
-
10212
-
10213
- CustomResource(self, "MyCustomResource",
10214
- service_token=my_provider.service_token,
10215
- properties={
10216
- "my_property_one": "one",
10217
- "my_property_two": "two"
10218
- }
10219
- )
10220
- '''
10221
- return typing.cast(builtins.str, jsii.get(self, "serviceToken"))
10072
+ class _CustomResourceProviderBaseProxy(CustomResourceProviderBase):
10073
+ pass
10074
+
10075
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
10076
+ typing.cast(typing.Any, CustomResourceProviderBase).__jsii_proxy_class__ = lambda : _CustomResourceProviderBaseProxy
10222
10077
 
10223
10078
 
10224
10079
  @jsii.data_type(
10225
- jsii_type="aws-cdk-lib.CustomResourceProviderProps",
10080
+ jsii_type="aws-cdk-lib.CustomResourceProviderOptions",
10226
10081
  jsii_struct_bases=[],
10227
10082
  name_mapping={
10228
- "code_directory": "codeDirectory",
10229
- "runtime": "runtime",
10230
10083
  "description": "description",
10231
10084
  "environment": "environment",
10232
10085
  "memory_size": "memorySize",
@@ -10235,12 +10088,10 @@ class CustomResourceProvider(
10235
10088
  "use_cfn_response_wrapper": "useCfnResponseWrapper",
10236
10089
  },
10237
10090
  )
10238
- class CustomResourceProviderProps:
10091
+ class CustomResourceProviderOptions:
10239
10092
  def __init__(
10240
10093
  self,
10241
10094
  *,
10242
- code_directory: builtins.str,
10243
- runtime: "CustomResourceProviderRuntime",
10244
10095
  description: typing.Optional[builtins.str] = None,
10245
10096
  environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10246
10097
  memory_size: typing.Optional["Size"] = None,
@@ -10248,10 +10099,8 @@ class CustomResourceProviderProps:
10248
10099
  timeout: typing.Optional["Duration"] = None,
10249
10100
  use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
10250
10101
  ) -> None:
10251
- '''Initialization properties for ``CustomResourceProvider``.
10102
+ '''Initialization options for custom resource providers.
10252
10103
 
10253
- :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
10254
- :param runtime: The AWS Lambda runtime and version to use for the provider.
10255
10104
  :param description: A description of the function. Default: - No description.
10256
10105
  :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
10257
10106
  :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
@@ -10259,34 +10108,37 @@ class CustomResourceProviderProps:
10259
10108
  :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
10260
10109
  :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10261
10110
 
10262
- :exampleMetadata: infused
10111
+ :exampleMetadata: fixture=_generated
10263
10112
 
10264
10113
  Example::
10265
10114
 
10266
- provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
10267
- code_directory=f"{__dirname}/my-handler",
10268
- runtime=CustomResourceProviderRuntime.NODEJS_18_X
10115
+ # The code below shows an example of how to instantiate this type.
10116
+ # The values are placeholders you should change.
10117
+ import aws_cdk as cdk
10118
+
10119
+ # policy_statements: Any
10120
+ # size: cdk.Size
10121
+
10122
+ custom_resource_provider_options = cdk.CustomResourceProviderOptions(
10123
+ description="description",
10124
+ environment={
10125
+ "environment_key": "environment"
10126
+ },
10127
+ memory_size=size,
10128
+ policy_statements=[policy_statements],
10129
+ timeout=cdk.Duration.minutes(30),
10130
+ use_cfn_response_wrapper=False
10269
10131
  )
10270
- provider.add_to_role_policy({
10271
- "Effect": "Allow",
10272
- "Action": "s3:GetObject",
10273
- "Resource": "*"
10274
- })
10275
10132
  '''
10276
10133
  if __debug__:
10277
- type_hints = typing.get_type_hints(_typecheckingstub__67b3f7332c978ef4e7c7aecd62d50434c044f1fb228ab5cf8711c9ad036743c1)
10278
- check_type(argname="argument code_directory", value=code_directory, expected_type=type_hints["code_directory"])
10279
- check_type(argname="argument runtime", value=runtime, expected_type=type_hints["runtime"])
10134
+ type_hints = typing.get_type_hints(_typecheckingstub__7473e2978820a8ffdbda9b6e4ccae286256e80d7f830b3838e774e0dd9a8605f)
10280
10135
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
10281
10136
  check_type(argname="argument environment", value=environment, expected_type=type_hints["environment"])
10282
10137
  check_type(argname="argument memory_size", value=memory_size, expected_type=type_hints["memory_size"])
10283
10138
  check_type(argname="argument policy_statements", value=policy_statements, expected_type=type_hints["policy_statements"])
10284
10139
  check_type(argname="argument timeout", value=timeout, expected_type=type_hints["timeout"])
10285
10140
  check_type(argname="argument use_cfn_response_wrapper", value=use_cfn_response_wrapper, expected_type=type_hints["use_cfn_response_wrapper"])
10286
- self._values: typing.Dict[builtins.str, typing.Any] = {
10287
- "code_directory": code_directory,
10288
- "runtime": runtime,
10289
- }
10141
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
10290
10142
  if description is not None:
10291
10143
  self._values["description"] = description
10292
10144
  if environment is not None:
@@ -10300,24 +10152,6 @@ class CustomResourceProviderProps:
10300
10152
  if use_cfn_response_wrapper is not None:
10301
10153
  self._values["use_cfn_response_wrapper"] = use_cfn_response_wrapper
10302
10154
 
10303
- @builtins.property
10304
- def code_directory(self) -> builtins.str:
10305
- '''A local file system directory with the provider's code.
10306
-
10307
- The code will be
10308
- bundled into a zip asset and wired to the provider's AWS Lambda function.
10309
- '''
10310
- result = self._values.get("code_directory")
10311
- assert result is not None, "Required property 'code_directory' is missing"
10312
- return typing.cast(builtins.str, result)
10313
-
10314
- @builtins.property
10315
- def runtime(self) -> "CustomResourceProviderRuntime":
10316
- '''The AWS Lambda runtime and version to use for the provider.'''
10317
- result = self._values.get("runtime")
10318
- assert result is not None, "Required property 'runtime' is missing"
10319
- return typing.cast("CustomResourceProviderRuntime", result)
10320
-
10321
10155
  @builtins.property
10322
10156
  def description(self) -> typing.Optional[builtins.str]:
10323
10157
  '''A description of the function.
@@ -10400,19 +10234,203 @@ class CustomResourceProviderProps:
10400
10234
  return not (rhs == self)
10401
10235
 
10402
10236
  def __repr__(self) -> str:
10403
- return "CustomResourceProviderProps(%s)" % ", ".join(
10237
+ return "CustomResourceProviderOptions(%s)" % ", ".join(
10404
10238
  k + "=" + repr(v) for k, v in self._values.items()
10405
10239
  )
10406
10240
 
10407
10241
 
10408
- @jsii.enum(jsii_type="aws-cdk-lib.CustomResourceProviderRuntime")
10409
- class CustomResourceProviderRuntime(enum.Enum):
10410
- '''The lambda runtime to use for the resource provider.
10242
+ @jsii.data_type(
10243
+ jsii_type="aws-cdk-lib.CustomResourceProviderProps",
10244
+ jsii_struct_bases=[CustomResourceProviderOptions],
10245
+ name_mapping={
10246
+ "description": "description",
10247
+ "environment": "environment",
10248
+ "memory_size": "memorySize",
10249
+ "policy_statements": "policyStatements",
10250
+ "timeout": "timeout",
10251
+ "use_cfn_response_wrapper": "useCfnResponseWrapper",
10252
+ "code_directory": "codeDirectory",
10253
+ "runtime": "runtime",
10254
+ },
10255
+ )
10256
+ class CustomResourceProviderProps(CustomResourceProviderOptions):
10257
+ def __init__(
10258
+ self,
10259
+ *,
10260
+ description: typing.Optional[builtins.str] = None,
10261
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
10262
+ memory_size: typing.Optional["Size"] = None,
10263
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
10264
+ timeout: typing.Optional["Duration"] = None,
10265
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
10266
+ code_directory: builtins.str,
10267
+ runtime: "CustomResourceProviderRuntime",
10268
+ ) -> None:
10269
+ '''Initialization properties for ``CustomResourceProvider``.
10411
10270
 
10412
- This also indicates
10413
- which language is used for the handler.
10271
+ :param description: A description of the function. Default: - No description.
10272
+ :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
10273
+ :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
10274
+ :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
10275
+ :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
10276
+ :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10277
+ :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
10278
+ :param runtime: The AWS Lambda runtime and version to use for the provider.
10414
10279
 
10415
- :exampleMetadata: infused
10280
+ :exampleMetadata: infused
10281
+
10282
+ Example::
10283
+
10284
+ provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
10285
+ code_directory=f"{__dirname}/my-handler",
10286
+ runtime=CustomResourceProviderRuntime.NODEJS_18_X
10287
+ )
10288
+ provider.add_to_role_policy({
10289
+ "Effect": "Allow",
10290
+ "Action": "s3:GetObject",
10291
+ "Resource": "*"
10292
+ })
10293
+ '''
10294
+ if __debug__:
10295
+ type_hints = typing.get_type_hints(_typecheckingstub__67b3f7332c978ef4e7c7aecd62d50434c044f1fb228ab5cf8711c9ad036743c1)
10296
+ check_type(argname="argument description", value=description, expected_type=type_hints["description"])
10297
+ check_type(argname="argument environment", value=environment, expected_type=type_hints["environment"])
10298
+ check_type(argname="argument memory_size", value=memory_size, expected_type=type_hints["memory_size"])
10299
+ check_type(argname="argument policy_statements", value=policy_statements, expected_type=type_hints["policy_statements"])
10300
+ check_type(argname="argument timeout", value=timeout, expected_type=type_hints["timeout"])
10301
+ check_type(argname="argument use_cfn_response_wrapper", value=use_cfn_response_wrapper, expected_type=type_hints["use_cfn_response_wrapper"])
10302
+ check_type(argname="argument code_directory", value=code_directory, expected_type=type_hints["code_directory"])
10303
+ check_type(argname="argument runtime", value=runtime, expected_type=type_hints["runtime"])
10304
+ self._values: typing.Dict[builtins.str, typing.Any] = {
10305
+ "code_directory": code_directory,
10306
+ "runtime": runtime,
10307
+ }
10308
+ if description is not None:
10309
+ self._values["description"] = description
10310
+ if environment is not None:
10311
+ self._values["environment"] = environment
10312
+ if memory_size is not None:
10313
+ self._values["memory_size"] = memory_size
10314
+ if policy_statements is not None:
10315
+ self._values["policy_statements"] = policy_statements
10316
+ if timeout is not None:
10317
+ self._values["timeout"] = timeout
10318
+ if use_cfn_response_wrapper is not None:
10319
+ self._values["use_cfn_response_wrapper"] = use_cfn_response_wrapper
10320
+
10321
+ @builtins.property
10322
+ def description(self) -> typing.Optional[builtins.str]:
10323
+ '''A description of the function.
10324
+
10325
+ :default: - No description.
10326
+ '''
10327
+ result = self._values.get("description")
10328
+ return typing.cast(typing.Optional[builtins.str], result)
10329
+
10330
+ @builtins.property
10331
+ def environment(
10332
+ self,
10333
+ ) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
10334
+ '''Key-value pairs that are passed to Lambda as Environment.
10335
+
10336
+ :default: - No environment variables.
10337
+ '''
10338
+ result = self._values.get("environment")
10339
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
10340
+
10341
+ @builtins.property
10342
+ def memory_size(self) -> typing.Optional["Size"]:
10343
+ '''The amount of memory that your function has access to.
10344
+
10345
+ Increasing the
10346
+ function's memory also increases its CPU allocation.
10347
+
10348
+ :default: Size.mebibytes(128)
10349
+ '''
10350
+ result = self._values.get("memory_size")
10351
+ return typing.cast(typing.Optional["Size"], result)
10352
+
10353
+ @builtins.property
10354
+ def policy_statements(self) -> typing.Optional[typing.List[typing.Any]]:
10355
+ '''A set of IAM policy statements to include in the inline policy of the provider's lambda function.
10356
+
10357
+ **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement``
10358
+ objects like you will see in the rest of the CDK.
10359
+
10360
+ :default: - no additional inline policy
10361
+
10362
+ Example::
10363
+
10364
+ provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
10365
+ code_directory=f"{__dirname}/my-handler",
10366
+ runtime=CustomResourceProviderRuntime.NODEJS_18_X,
10367
+ policy_statements=[{
10368
+ "Effect": "Allow",
10369
+ "Action": "s3:PutObject*",
10370
+ "Resource": "*"
10371
+ }
10372
+ ]
10373
+ )
10374
+ '''
10375
+ result = self._values.get("policy_statements")
10376
+ return typing.cast(typing.Optional[typing.List[typing.Any]], result)
10377
+
10378
+ @builtins.property
10379
+ def timeout(self) -> typing.Optional["Duration"]:
10380
+ '''AWS Lambda timeout for the provider.
10381
+
10382
+ :default: Duration.minutes(15)
10383
+ '''
10384
+ result = self._values.get("timeout")
10385
+ return typing.cast(typing.Optional["Duration"], result)
10386
+
10387
+ @builtins.property
10388
+ def use_cfn_response_wrapper(self) -> typing.Optional[builtins.bool]:
10389
+ '''Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint.
10390
+
10391
+ :default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
10392
+ '''
10393
+ result = self._values.get("use_cfn_response_wrapper")
10394
+ return typing.cast(typing.Optional[builtins.bool], result)
10395
+
10396
+ @builtins.property
10397
+ def code_directory(self) -> builtins.str:
10398
+ '''A local file system directory with the provider's code.
10399
+
10400
+ The code will be
10401
+ bundled into a zip asset and wired to the provider's AWS Lambda function.
10402
+ '''
10403
+ result = self._values.get("code_directory")
10404
+ assert result is not None, "Required property 'code_directory' is missing"
10405
+ return typing.cast(builtins.str, result)
10406
+
10407
+ @builtins.property
10408
+ def runtime(self) -> "CustomResourceProviderRuntime":
10409
+ '''The AWS Lambda runtime and version to use for the provider.'''
10410
+ result = self._values.get("runtime")
10411
+ assert result is not None, "Required property 'runtime' is missing"
10412
+ return typing.cast("CustomResourceProviderRuntime", result)
10413
+
10414
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
10415
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
10416
+
10417
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
10418
+ return not (rhs == self)
10419
+
10420
+ def __repr__(self) -> str:
10421
+ return "CustomResourceProviderProps(%s)" % ", ".join(
10422
+ k + "=" + repr(v) for k, v in self._values.items()
10423
+ )
10424
+
10425
+
10426
+ @jsii.enum(jsii_type="aws-cdk-lib.CustomResourceProviderRuntime")
10427
+ class CustomResourceProviderRuntime(enum.Enum):
10428
+ '''The lambda runtime to use for the resource provider.
10429
+
10430
+ This also indicates
10431
+ which language is used for the handler.
10432
+
10433
+ :exampleMetadata: infused
10416
10434
 
10417
10435
  Example::
10418
10436
 
@@ -11973,26 +11991,21 @@ class Duration(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.Duration"):
11973
11991
 
11974
11992
  Example::
11975
11993
 
11976
- import aws_cdk.aws_ecs as ecs
11977
-
11978
- # cluster: ecs.ICluster
11979
- # task_definition: ecs.TaskDefinition
11994
+ # application: appconfig.Application
11995
+ # bucket: s3.Bucket
11980
11996
 
11981
11997
 
11982
- rule = events.Rule(self, "Rule",
11983
- schedule=events.Schedule.rate(cdk.Duration.hours(1))
11998
+ appconfig.SourcedConfiguration(self, "MySourcedConfiguration",
11999
+ application=application,
12000
+ location=appconfig.ConfigurationSource.from_bucket(bucket, "path/to/file.json"),
12001
+ deployment_strategy=appconfig.DeploymentStrategy(self, "MyDeploymentStrategy",
12002
+ rollout_strategy=appconfig.RolloutStrategy.linear(
12003
+ growth_factor=15,
12004
+ deployment_duration=Duration.minutes(30),
12005
+ final_bake_time=Duration.minutes(15)
12006
+ )
12007
+ )
11984
12008
  )
11985
-
11986
- rule.add_target(targets.EcsTask(
11987
- cluster=cluster,
11988
- task_definition=task_definition,
11989
- task_count=1,
11990
- container_overrides=[targets.ContainerOverride(
11991
- container_name="TheContainer",
11992
- command=["echo", events.EventField.from_path("$.detail.event")]
11993
- )],
11994
- enable_execute_command=True
11995
- ))
11996
12009
  '''
11997
12010
 
11998
12011
  @jsii.member(jsii_name="days")
@@ -31005,127 +31018,512 @@ class CfnWaitConditionHandle(
31005
31018
  return typing.cast(builtins.str, jsii.get(self, "attrId"))
31006
31019
 
31007
31020
  @builtins.property
31008
- @jsii.member(jsii_name="cfnProperties")
31009
- def _cfn_properties(self) -> typing.Mapping[builtins.str, typing.Any]:
31010
- return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.get(self, "cfnProperties"))
31011
-
31021
+ @jsii.member(jsii_name="cfnProperties")
31022
+ def _cfn_properties(self) -> typing.Mapping[builtins.str, typing.Any]:
31023
+ return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.get(self, "cfnProperties"))
31024
+
31025
+
31026
+ class CustomResource(
31027
+ Resource,
31028
+ metaclass=jsii.JSIIMeta,
31029
+ jsii_type="aws-cdk-lib.CustomResource",
31030
+ ):
31031
+ '''Instantiation of a custom resource, whose implementation is provided a Provider.
31032
+
31033
+ This class is intended to be used by construct library authors. Application
31034
+ builder should not be able to tell whether or not a construct is backed by
31035
+ a custom resource, and so the use of this class should be invisible.
31036
+
31037
+ Instead, construct library authors declare a custom construct that hides the
31038
+ choice of provider, and accepts a strongly-typed properties object with the
31039
+ properties your provider accepts.
31040
+
31041
+ Your custom resource provider (identified by the ``serviceToken`` property)
31042
+ can be one of 4 constructs:
31043
+
31044
+ - If you are authoring a construct library or application, we recommend you
31045
+ use the ``Provider`` class in the ``custom-resources`` module.
31046
+ - If you are authoring a construct for the CDK's AWS Construct Library,
31047
+ you should use the ``CustomResourceProvider`` construct in this package.
31048
+ - If you want full control over the provider, you can always directly use
31049
+ a Lambda Function or SNS Topic by passing the ARN into ``serviceToken``.
31050
+
31051
+ :resource: AWS::CloudFormation::CustomResource
31052
+ :exampleMetadata: infused
31053
+
31054
+ Example::
31055
+
31056
+ service_token = CustomResourceProvider.get_or_create(self, "Custom::MyCustomResourceType",
31057
+ code_directory=f"{__dirname}/my-handler",
31058
+ runtime=CustomResourceProviderRuntime.NODEJS_18_X,
31059
+ description="Lambda function created by the custom resource provider"
31060
+ )
31061
+
31062
+ CustomResource(self, "MyResource",
31063
+ resource_type="Custom::MyCustomResourceType",
31064
+ service_token=service_token
31065
+ )
31066
+ '''
31067
+
31068
+ def __init__(
31069
+ self,
31070
+ scope: _constructs_77d1e7e8.Construct,
31071
+ id: builtins.str,
31072
+ *,
31073
+ service_token: builtins.str,
31074
+ pascal_case_properties: typing.Optional[builtins.bool] = None,
31075
+ properties: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
31076
+ removal_policy: typing.Optional[RemovalPolicy] = None,
31077
+ resource_type: typing.Optional[builtins.str] = None,
31078
+ ) -> None:
31079
+ '''
31080
+ :param scope: -
31081
+ :param id: -
31082
+ :param service_token: The ARN of the provider which implements this custom resource type. You can implement a provider by listening to raw AWS CloudFormation events and specify the ARN of an SNS topic (``topic.topicArn``) or the ARN of an AWS Lambda function (``lambda.functionArn``) or use the CDK's custom `resource provider framework <https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html>`_ which makes it easier to implement robust providers. Provider framework:: // use the provider framework from aws-cdk/custom-resources: const provider = new customresources.Provider(this, 'ResourceProvider', { onEventHandler, isCompleteHandler, // optional }); new CustomResource(this, 'MyResource', { serviceToken: provider.serviceToken, }); AWS Lambda function (not recommended to use AWS Lambda Functions directly, see the module README):: // invoke an AWS Lambda function when a lifecycle event occurs: new CustomResource(this, 'MyResource', { serviceToken: myFunction.functionArn, }); SNS topic (not recommended to use AWS Lambda Functions directly, see the module README):: // publish lifecycle events to an SNS topic: new CustomResource(this, 'MyResource', { serviceToken: myTopic.topicArn, });
31083
+ :param pascal_case_properties: Convert all property keys to pascal case. Default: false
31084
+ :param properties: Properties to pass to the Lambda. Default: - No properties.
31085
+ :param removal_policy: The policy to apply when this resource is removed from the application. Default: cdk.RemovalPolicy.Destroy
31086
+ :param resource_type: For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. For example, you can use "Custom::MyCustomResourceTypeName". Custom resource type names must begin with "Custom::" and can include alphanumeric characters and the following characters: _@-. You can specify a custom resource type name up to a maximum length of 60 characters. You cannot change the type during an update. Using your own resource type names helps you quickly differentiate the types of custom resources in your stack. For example, if you had two custom resources that conduct two different ping tests, you could name their type as Custom::PingTester to make them easily identifiable as ping testers (instead of using AWS::CloudFormation::CustomResource). Default: - AWS::CloudFormation::CustomResource
31087
+ '''
31088
+ if __debug__:
31089
+ type_hints = typing.get_type_hints(_typecheckingstub__5c89cdcdef1901fae8effe187c732f9fbf4ec5793ae2938cebb924671df2c26f)
31090
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
31091
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
31092
+ props = CustomResourceProps(
31093
+ service_token=service_token,
31094
+ pascal_case_properties=pascal_case_properties,
31095
+ properties=properties,
31096
+ removal_policy=removal_policy,
31097
+ resource_type=resource_type,
31098
+ )
31099
+
31100
+ jsii.create(self.__class__, self, [scope, id, props])
31101
+
31102
+ @jsii.member(jsii_name="getAtt")
31103
+ def get_att(self, attribute_name: builtins.str) -> Reference:
31104
+ '''Returns the value of an attribute of the custom resource of an arbitrary type.
31105
+
31106
+ Attributes are returned from the custom resource provider through the
31107
+ ``Data`` map where the key is the attribute name.
31108
+
31109
+ :param attribute_name: the name of the attribute.
31110
+
31111
+ :return:
31112
+
31113
+ a token for ``Fn::GetAtt``. Use ``Token.asXxx`` to encode the returned ``Reference`` as a specific type or
31114
+ use the convenience ``getAttString`` for string attributes.
31115
+ '''
31116
+ if __debug__:
31117
+ type_hints = typing.get_type_hints(_typecheckingstub__df75eb9fc7a387097b40aeef3aed3b3a82fae9b826d9d79442f6256b53ffab19)
31118
+ check_type(argname="argument attribute_name", value=attribute_name, expected_type=type_hints["attribute_name"])
31119
+ return typing.cast(Reference, jsii.invoke(self, "getAtt", [attribute_name]))
31120
+
31121
+ @jsii.member(jsii_name="getAttString")
31122
+ def get_att_string(self, attribute_name: builtins.str) -> builtins.str:
31123
+ '''Returns the value of an attribute of the custom resource of type string.
31124
+
31125
+ Attributes are returned from the custom resource provider through the
31126
+ ``Data`` map where the key is the attribute name.
31127
+
31128
+ :param attribute_name: the name of the attribute.
31129
+
31130
+ :return: a token for ``Fn::GetAtt`` encoded as a string.
31131
+ '''
31132
+ if __debug__:
31133
+ type_hints = typing.get_type_hints(_typecheckingstub__f9a9f2fc767762d8005e1a5d920d5d4064d4ed7ec492ba4a20eb60182b0e11ba)
31134
+ check_type(argname="argument attribute_name", value=attribute_name, expected_type=type_hints["attribute_name"])
31135
+ return typing.cast(builtins.str, jsii.invoke(self, "getAttString", [attribute_name]))
31136
+
31137
+ @builtins.property
31138
+ @jsii.member(jsii_name="ref")
31139
+ def ref(self) -> builtins.str:
31140
+ '''The physical name of this custom resource.'''
31141
+ return typing.cast(builtins.str, jsii.get(self, "ref"))
31142
+
31143
+
31144
+ class CustomResourceProvider(
31145
+ CustomResourceProviderBase,
31146
+ metaclass=jsii.JSIIMeta,
31147
+ jsii_type="aws-cdk-lib.CustomResourceProvider",
31148
+ ):
31149
+ '''An AWS-Lambda backed custom resource provider, for CDK Construct Library constructs.
31150
+
31151
+ This is a provider for ``CustomResource`` constructs, backed by an AWS Lambda
31152
+ Function. It only supports NodeJS runtimes.
31153
+ .. epigraph::
31154
+
31155
+ **Application builders do not need to use this provider type**. This is not
31156
+ a generic custom resource provider class. It is specifically
31157
+ intended to be used only by constructs in the AWS CDK Construct Library, and
31158
+ only exists here because of reverse dependency issues (for example, it cannot
31159
+ use ``iam.PolicyStatement`` objects, since the ``iam`` library already depends on
31160
+ the CDK ``core`` library and we cannot have cyclic dependencies).
31161
+
31162
+ If you are not writing constructs for the AWS Construct Library, you should
31163
+ use the ``Provider`` class in the ``custom-resources`` module instead, which has
31164
+ a better API and supports all Lambda runtimes, not just Node.
31165
+
31166
+ N.B.: When you are writing Custom Resource Providers, there are a number of
31167
+ lifecycle events you have to pay attention to. These are documented in the
31168
+ README of the ``custom-resources`` module. Be sure to give the documentation
31169
+ in that module a read, regardless of whether you end up using the Provider
31170
+ class in there or this one.
31171
+
31172
+ :exampleMetadata: infused
31173
+
31174
+ Example::
31175
+
31176
+ provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
31177
+ code_directory=f"{__dirname}/my-handler",
31178
+ runtime=CustomResourceProviderRuntime.NODEJS_18_X
31179
+ )
31180
+ provider.add_to_role_policy({
31181
+ "Effect": "Allow",
31182
+ "Action": "s3:GetObject",
31183
+ "Resource": "*"
31184
+ })
31185
+ '''
31186
+
31187
+ def __init__(
31188
+ self,
31189
+ scope: _constructs_77d1e7e8.Construct,
31190
+ id: builtins.str,
31191
+ *,
31192
+ code_directory: builtins.str,
31193
+ runtime: CustomResourceProviderRuntime,
31194
+ description: typing.Optional[builtins.str] = None,
31195
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
31196
+ memory_size: typing.Optional[Size] = None,
31197
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
31198
+ timeout: typing.Optional[Duration] = None,
31199
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
31200
+ ) -> None:
31201
+ '''
31202
+ :param scope: -
31203
+ :param id: -
31204
+ :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
31205
+ :param runtime: The AWS Lambda runtime and version to use for the provider.
31206
+ :param description: A description of the function. Default: - No description.
31207
+ :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
31208
+ :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
31209
+ :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
31210
+ :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
31211
+ :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
31212
+ '''
31213
+ if __debug__:
31214
+ type_hints = typing.get_type_hints(_typecheckingstub__c9a6802d57ad9b69b2fa5290464f51a2a8623348c365289d64305245e073ef41)
31215
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
31216
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
31217
+ props = CustomResourceProviderProps(
31218
+ code_directory=code_directory,
31219
+ runtime=runtime,
31220
+ description=description,
31221
+ environment=environment,
31222
+ memory_size=memory_size,
31223
+ policy_statements=policy_statements,
31224
+ timeout=timeout,
31225
+ use_cfn_response_wrapper=use_cfn_response_wrapper,
31226
+ )
31227
+
31228
+ jsii.create(self.__class__, self, [scope, id, props])
31229
+
31230
+ @jsii.member(jsii_name="getOrCreate")
31231
+ @builtins.classmethod
31232
+ def get_or_create(
31233
+ cls,
31234
+ scope: _constructs_77d1e7e8.Construct,
31235
+ uniqueid: builtins.str,
31236
+ *,
31237
+ code_directory: builtins.str,
31238
+ runtime: CustomResourceProviderRuntime,
31239
+ description: typing.Optional[builtins.str] = None,
31240
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
31241
+ memory_size: typing.Optional[Size] = None,
31242
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
31243
+ timeout: typing.Optional[Duration] = None,
31244
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
31245
+ ) -> builtins.str:
31246
+ '''Returns a stack-level singleton ARN (service token) for the custom resource provider.
31247
+
31248
+ :param scope: Construct scope.
31249
+ :param uniqueid: A globally unique id that will be used for the stack-level construct.
31250
+ :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
31251
+ :param runtime: The AWS Lambda runtime and version to use for the provider.
31252
+ :param description: A description of the function. Default: - No description.
31253
+ :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
31254
+ :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
31255
+ :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
31256
+ :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
31257
+ :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
31258
+
31259
+ :return:
31260
+
31261
+ the service token of the custom resource provider, which should be
31262
+ used when defining a ``CustomResource``.
31263
+ '''
31264
+ if __debug__:
31265
+ type_hints = typing.get_type_hints(_typecheckingstub__c1f95fb403ff0b28ac158a1e391fedc73bee20ded09963a1a66fabfcfe99d006)
31266
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
31267
+ check_type(argname="argument uniqueid", value=uniqueid, expected_type=type_hints["uniqueid"])
31268
+ props = CustomResourceProviderProps(
31269
+ code_directory=code_directory,
31270
+ runtime=runtime,
31271
+ description=description,
31272
+ environment=environment,
31273
+ memory_size=memory_size,
31274
+ policy_statements=policy_statements,
31275
+ timeout=timeout,
31276
+ use_cfn_response_wrapper=use_cfn_response_wrapper,
31277
+ )
31278
+
31279
+ return typing.cast(builtins.str, jsii.sinvoke(cls, "getOrCreate", [scope, uniqueid, props]))
31280
+
31281
+ @jsii.member(jsii_name="getOrCreateProvider")
31282
+ @builtins.classmethod
31283
+ def get_or_create_provider(
31284
+ cls,
31285
+ scope: _constructs_77d1e7e8.Construct,
31286
+ uniqueid: builtins.str,
31287
+ *,
31288
+ code_directory: builtins.str,
31289
+ runtime: CustomResourceProviderRuntime,
31290
+ description: typing.Optional[builtins.str] = None,
31291
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
31292
+ memory_size: typing.Optional[Size] = None,
31293
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
31294
+ timeout: typing.Optional[Duration] = None,
31295
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
31296
+ ) -> "CustomResourceProvider":
31297
+ '''Returns a stack-level singleton for the custom resource provider.
31298
+
31299
+ :param scope: Construct scope.
31300
+ :param uniqueid: A globally unique id that will be used for the stack-level construct.
31301
+ :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
31302
+ :param runtime: The AWS Lambda runtime and version to use for the provider.
31303
+ :param description: A description of the function. Default: - No description.
31304
+ :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
31305
+ :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
31306
+ :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
31307
+ :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
31308
+ :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
31309
+
31310
+ :return:
31311
+
31312
+ the service token of the custom resource provider, which should be
31313
+ used when defining a ``CustomResource``.
31314
+ '''
31315
+ if __debug__:
31316
+ type_hints = typing.get_type_hints(_typecheckingstub__0ccbce12d9e6f35bd2240da7f5c1900a1ff6b41588e9f31f4b76ecb707a6310f)
31317
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
31318
+ check_type(argname="argument uniqueid", value=uniqueid, expected_type=type_hints["uniqueid"])
31319
+ props = CustomResourceProviderProps(
31320
+ code_directory=code_directory,
31321
+ runtime=runtime,
31322
+ description=description,
31323
+ environment=environment,
31324
+ memory_size=memory_size,
31325
+ policy_statements=policy_statements,
31326
+ timeout=timeout,
31327
+ use_cfn_response_wrapper=use_cfn_response_wrapper,
31328
+ )
31329
+
31330
+ return typing.cast("CustomResourceProvider", jsii.sinvoke(cls, "getOrCreateProvider", [scope, uniqueid, props]))
31331
+
31332
+
31333
+ @jsii.data_type(
31334
+ jsii_type="aws-cdk-lib.CustomResourceProviderBaseProps",
31335
+ jsii_struct_bases=[CustomResourceProviderOptions],
31336
+ name_mapping={
31337
+ "description": "description",
31338
+ "environment": "environment",
31339
+ "memory_size": "memorySize",
31340
+ "policy_statements": "policyStatements",
31341
+ "timeout": "timeout",
31342
+ "use_cfn_response_wrapper": "useCfnResponseWrapper",
31343
+ "code_directory": "codeDirectory",
31344
+ "runtime_name": "runtimeName",
31345
+ },
31346
+ )
31347
+ class CustomResourceProviderBaseProps(CustomResourceProviderOptions):
31348
+ def __init__(
31349
+ self,
31350
+ *,
31351
+ description: typing.Optional[builtins.str] = None,
31352
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
31353
+ memory_size: typing.Optional[Size] = None,
31354
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
31355
+ timeout: typing.Optional[Duration] = None,
31356
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
31357
+ code_directory: builtins.str,
31358
+ runtime_name: builtins.str,
31359
+ ) -> None:
31360
+ '''Initialization properties for ``CustomResourceProviderBase``.
31361
+
31362
+ :param description: A description of the function. Default: - No description.
31363
+ :param environment: Key-value pairs that are passed to Lambda as Environment. Default: - No environment variables.
31364
+ :param memory_size: The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. Default: Size.mebibytes(128)
31365
+ :param policy_statements: A set of IAM policy statements to include in the inline policy of the provider's lambda function. **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement`` objects like you will see in the rest of the CDK. Default: - no additional inline policy
31366
+ :param timeout: AWS Lambda timeout for the provider. Default: Duration.minutes(15)
31367
+ :param use_cfn_response_wrapper: Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint. Default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
31368
+ :param code_directory: A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
31369
+ :param runtime_name: The AWS Lambda runtime and version name to use for the provider.
31370
+
31371
+ :exampleMetadata: fixture=_generated
31372
+
31373
+ Example::
31374
+
31375
+ # The code below shows an example of how to instantiate this type.
31376
+ # The values are placeholders you should change.
31377
+ import aws_cdk as cdk
31378
+
31379
+ # policy_statements: Any
31380
+ # size: cdk.Size
31381
+
31382
+ custom_resource_provider_base_props = cdk.CustomResourceProviderBaseProps(
31383
+ code_directory="codeDirectory",
31384
+ runtime_name="runtimeName",
31385
+
31386
+ # the properties below are optional
31387
+ description="description",
31388
+ environment={
31389
+ "environment_key": "environment"
31390
+ },
31391
+ memory_size=size,
31392
+ policy_statements=[policy_statements],
31393
+ timeout=cdk.Duration.minutes(30),
31394
+ use_cfn_response_wrapper=False
31395
+ )
31396
+ '''
31397
+ if __debug__:
31398
+ type_hints = typing.get_type_hints(_typecheckingstub__a1ac82056ff309d22752667288bc14e4df222e4ef5faa80aa686251113655d12)
31399
+ check_type(argname="argument description", value=description, expected_type=type_hints["description"])
31400
+ check_type(argname="argument environment", value=environment, expected_type=type_hints["environment"])
31401
+ check_type(argname="argument memory_size", value=memory_size, expected_type=type_hints["memory_size"])
31402
+ check_type(argname="argument policy_statements", value=policy_statements, expected_type=type_hints["policy_statements"])
31403
+ check_type(argname="argument timeout", value=timeout, expected_type=type_hints["timeout"])
31404
+ check_type(argname="argument use_cfn_response_wrapper", value=use_cfn_response_wrapper, expected_type=type_hints["use_cfn_response_wrapper"])
31405
+ check_type(argname="argument code_directory", value=code_directory, expected_type=type_hints["code_directory"])
31406
+ check_type(argname="argument runtime_name", value=runtime_name, expected_type=type_hints["runtime_name"])
31407
+ self._values: typing.Dict[builtins.str, typing.Any] = {
31408
+ "code_directory": code_directory,
31409
+ "runtime_name": runtime_name,
31410
+ }
31411
+ if description is not None:
31412
+ self._values["description"] = description
31413
+ if environment is not None:
31414
+ self._values["environment"] = environment
31415
+ if memory_size is not None:
31416
+ self._values["memory_size"] = memory_size
31417
+ if policy_statements is not None:
31418
+ self._values["policy_statements"] = policy_statements
31419
+ if timeout is not None:
31420
+ self._values["timeout"] = timeout
31421
+ if use_cfn_response_wrapper is not None:
31422
+ self._values["use_cfn_response_wrapper"] = use_cfn_response_wrapper
31423
+
31424
+ @builtins.property
31425
+ def description(self) -> typing.Optional[builtins.str]:
31426
+ '''A description of the function.
31427
+
31428
+ :default: - No description.
31429
+ '''
31430
+ result = self._values.get("description")
31431
+ return typing.cast(typing.Optional[builtins.str], result)
31432
+
31433
+ @builtins.property
31434
+ def environment(
31435
+ self,
31436
+ ) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
31437
+ '''Key-value pairs that are passed to Lambda as Environment.
31012
31438
 
31013
- class CustomResource(
31014
- Resource,
31015
- metaclass=jsii.JSIIMeta,
31016
- jsii_type="aws-cdk-lib.CustomResource",
31017
- ):
31018
- '''Instantiation of a custom resource, whose implementation is provided a Provider.
31439
+ :default: - No environment variables.
31440
+ '''
31441
+ result = self._values.get("environment")
31442
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
31019
31443
 
31020
- This class is intended to be used by construct library authors. Application
31021
- builder should not be able to tell whether or not a construct is backed by
31022
- a custom resource, and so the use of this class should be invisible.
31444
+ @builtins.property
31445
+ def memory_size(self) -> typing.Optional[Size]:
31446
+ '''The amount of memory that your function has access to.
31023
31447
 
31024
- Instead, construct library authors declare a custom construct that hides the
31025
- choice of provider, and accepts a strongly-typed properties object with the
31026
- properties your provider accepts.
31448
+ Increasing the
31449
+ function's memory also increases its CPU allocation.
31027
31450
 
31028
- Your custom resource provider (identified by the ``serviceToken`` property)
31029
- can be one of 4 constructs:
31451
+ :default: Size.mebibytes(128)
31452
+ '''
31453
+ result = self._values.get("memory_size")
31454
+ return typing.cast(typing.Optional[Size], result)
31030
31455
 
31031
- - If you are authoring a construct library or application, we recommend you
31032
- use the ``Provider`` class in the ``custom-resources`` module.
31033
- - If you are authoring a construct for the CDK's AWS Construct Library,
31034
- you should use the ``CustomResourceProvider`` construct in this package.
31035
- - If you want full control over the provider, you can always directly use
31036
- a Lambda Function or SNS Topic by passing the ARN into ``serviceToken``.
31456
+ @builtins.property
31457
+ def policy_statements(self) -> typing.Optional[typing.List[typing.Any]]:
31458
+ '''A set of IAM policy statements to include in the inline policy of the provider's lambda function.
31037
31459
 
31038
- :resource: AWS::CloudFormation::CustomResource
31039
- :exampleMetadata: infused
31460
+ **Please note**: these are direct IAM JSON policy blobs, *not* ``iam.PolicyStatement``
31461
+ objects like you will see in the rest of the CDK.
31040
31462
 
31041
- Example::
31463
+ :default: - no additional inline policy
31042
31464
 
31043
- service_token = CustomResourceProvider.get_or_create(self, "Custom::MyCustomResourceType",
31044
- code_directory=f"{__dirname}/my-handler",
31045
- runtime=CustomResourceProviderRuntime.NODEJS_18_X,
31046
- description="Lambda function created by the custom resource provider"
31047
- )
31048
-
31049
- CustomResource(self, "MyResource",
31050
- resource_type="Custom::MyCustomResourceType",
31051
- service_token=service_token
31052
- )
31053
- '''
31465
+ Example::
31054
31466
 
31055
- def __init__(
31056
- self,
31057
- scope: _constructs_77d1e7e8.Construct,
31058
- id: builtins.str,
31059
- *,
31060
- service_token: builtins.str,
31061
- pascal_case_properties: typing.Optional[builtins.bool] = None,
31062
- properties: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
31063
- removal_policy: typing.Optional[RemovalPolicy] = None,
31064
- resource_type: typing.Optional[builtins.str] = None,
31065
- ) -> None:
31066
- '''
31067
- :param scope: -
31068
- :param id: -
31069
- :param service_token: The ARN of the provider which implements this custom resource type. You can implement a provider by listening to raw AWS CloudFormation events and specify the ARN of an SNS topic (``topic.topicArn``) or the ARN of an AWS Lambda function (``lambda.functionArn``) or use the CDK's custom `resource provider framework <https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html>`_ which makes it easier to implement robust providers. Provider framework:: // use the provider framework from aws-cdk/custom-resources: const provider = new customresources.Provider(this, 'ResourceProvider', { onEventHandler, isCompleteHandler, // optional }); new CustomResource(this, 'MyResource', { serviceToken: provider.serviceToken, }); AWS Lambda function (not recommended to use AWS Lambda Functions directly, see the module README):: // invoke an AWS Lambda function when a lifecycle event occurs: new CustomResource(this, 'MyResource', { serviceToken: myFunction.functionArn, }); SNS topic (not recommended to use AWS Lambda Functions directly, see the module README):: // publish lifecycle events to an SNS topic: new CustomResource(this, 'MyResource', { serviceToken: myTopic.topicArn, });
31070
- :param pascal_case_properties: Convert all property keys to pascal case. Default: false
31071
- :param properties: Properties to pass to the Lambda. Default: - No properties.
31072
- :param removal_policy: The policy to apply when this resource is removed from the application. Default: cdk.RemovalPolicy.Destroy
31073
- :param resource_type: For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. For example, you can use "Custom::MyCustomResourceTypeName". Custom resource type names must begin with "Custom::" and can include alphanumeric characters and the following characters: _@-. You can specify a custom resource type name up to a maximum length of 60 characters. You cannot change the type during an update. Using your own resource type names helps you quickly differentiate the types of custom resources in your stack. For example, if you had two custom resources that conduct two different ping tests, you could name their type as Custom::PingTester to make them easily identifiable as ping testers (instead of using AWS::CloudFormation::CustomResource). Default: - AWS::CloudFormation::CustomResource
31467
+ provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
31468
+ code_directory=f"{__dirname}/my-handler",
31469
+ runtime=CustomResourceProviderRuntime.NODEJS_18_X,
31470
+ policy_statements=[{
31471
+ "Effect": "Allow",
31472
+ "Action": "s3:PutObject*",
31473
+ "Resource": "*"
31474
+ }
31475
+ ]
31476
+ )
31074
31477
  '''
31075
- if __debug__:
31076
- type_hints = typing.get_type_hints(_typecheckingstub__5c89cdcdef1901fae8effe187c732f9fbf4ec5793ae2938cebb924671df2c26f)
31077
- check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
31078
- check_type(argname="argument id", value=id, expected_type=type_hints["id"])
31079
- props = CustomResourceProps(
31080
- service_token=service_token,
31081
- pascal_case_properties=pascal_case_properties,
31082
- properties=properties,
31083
- removal_policy=removal_policy,
31084
- resource_type=resource_type,
31085
- )
31478
+ result = self._values.get("policy_statements")
31479
+ return typing.cast(typing.Optional[typing.List[typing.Any]], result)
31086
31480
 
31087
- jsii.create(self.__class__, self, [scope, id, props])
31481
+ @builtins.property
31482
+ def timeout(self) -> typing.Optional[Duration]:
31483
+ '''AWS Lambda timeout for the provider.
31088
31484
 
31089
- @jsii.member(jsii_name="getAtt")
31090
- def get_att(self, attribute_name: builtins.str) -> Reference:
31091
- '''Returns the value of an attribute of the custom resource of an arbitrary type.
31485
+ :default: Duration.minutes(15)
31486
+ '''
31487
+ result = self._values.get("timeout")
31488
+ return typing.cast(typing.Optional[Duration], result)
31092
31489
 
31093
- Attributes are returned from the custom resource provider through the
31094
- ``Data`` map where the key is the attribute name.
31490
+ @builtins.property
31491
+ def use_cfn_response_wrapper(self) -> typing.Optional[builtins.bool]:
31492
+ '''Whether or not the cloudformation response wrapper (``nodejs-entrypoint.ts``) is used. If set to ``true``, ``nodejs-entrypoint.js`` is bundled in the same asset as the custom resource and set as the entrypoint. If set to ``false``, the custom resource provided is the entrypoint.
31095
31493
 
31096
- :param attribute_name: the name of the attribute.
31494
+ :default: - ``true`` if ``inlineCode: false`` and ``false`` otherwise.
31495
+ '''
31496
+ result = self._values.get("use_cfn_response_wrapper")
31497
+ return typing.cast(typing.Optional[builtins.bool], result)
31097
31498
 
31098
- :return:
31499
+ @builtins.property
31500
+ def code_directory(self) -> builtins.str:
31501
+ '''A local file system directory with the provider's code.
31099
31502
 
31100
- a token for ``Fn::GetAtt``. Use ``Token.asXxx`` to encode the returned ``Reference`` as a specific type or
31101
- use the convenience ``getAttString`` for string attributes.
31503
+ The code will be
31504
+ bundled into a zip asset and wired to the provider's AWS Lambda function.
31102
31505
  '''
31103
- if __debug__:
31104
- type_hints = typing.get_type_hints(_typecheckingstub__df75eb9fc7a387097b40aeef3aed3b3a82fae9b826d9d79442f6256b53ffab19)
31105
- check_type(argname="argument attribute_name", value=attribute_name, expected_type=type_hints["attribute_name"])
31106
- return typing.cast(Reference, jsii.invoke(self, "getAtt", [attribute_name]))
31107
-
31108
- @jsii.member(jsii_name="getAttString")
31109
- def get_att_string(self, attribute_name: builtins.str) -> builtins.str:
31110
- '''Returns the value of an attribute of the custom resource of type string.
31506
+ result = self._values.get("code_directory")
31507
+ assert result is not None, "Required property 'code_directory' is missing"
31508
+ return typing.cast(builtins.str, result)
31111
31509
 
31112
- Attributes are returned from the custom resource provider through the
31113
- ``Data`` map where the key is the attribute name.
31510
+ @builtins.property
31511
+ def runtime_name(self) -> builtins.str:
31512
+ '''The AWS Lambda runtime and version name to use for the provider.'''
31513
+ result = self._values.get("runtime_name")
31514
+ assert result is not None, "Required property 'runtime_name' is missing"
31515
+ return typing.cast(builtins.str, result)
31114
31516
 
31115
- :param attribute_name: the name of the attribute.
31517
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
31518
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
31116
31519
 
31117
- :return: a token for ``Fn::GetAtt`` encoded as a string.
31118
- '''
31119
- if __debug__:
31120
- type_hints = typing.get_type_hints(_typecheckingstub__f9a9f2fc767762d8005e1a5d920d5d4064d4ed7ec492ba4a20eb60182b0e11ba)
31121
- check_type(argname="argument attribute_name", value=attribute_name, expected_type=type_hints["attribute_name"])
31122
- return typing.cast(builtins.str, jsii.invoke(self, "getAttString", [attribute_name]))
31520
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
31521
+ return not (rhs == self)
31123
31522
 
31124
- @builtins.property
31125
- @jsii.member(jsii_name="ref")
31126
- def ref(self) -> builtins.str:
31127
- '''The physical name of this custom resource.'''
31128
- return typing.cast(builtins.str, jsii.get(self, "ref"))
31523
+ def __repr__(self) -> str:
31524
+ return "CustomResourceProviderBaseProps(%s)" % ", ".join(
31525
+ k + "=" + repr(v) for k, v in self._values.items()
31526
+ )
31129
31527
 
31130
31528
 
31131
31529
  @jsii.implements(ITokenResolver)
@@ -33066,6 +33464,9 @@ __all__ = [
33066
33464
  "CustomResource",
33067
33465
  "CustomResourceProps",
33068
33466
  "CustomResourceProvider",
33467
+ "CustomResourceProviderBase",
33468
+ "CustomResourceProviderBaseProps",
33469
+ "CustomResourceProviderOptions",
33069
33470
  "CustomResourceProviderProps",
33070
33471
  "CustomResourceProviderRuntime",
33071
33472
  "DefaultStackSynthesizer",
@@ -33224,6 +33625,7 @@ __all__ = [
33224
33625
  "aws_autoscaling_common",
33225
33626
  "aws_autoscaling_hooktargets",
33226
33627
  "aws_autoscalingplans",
33628
+ "aws_b2bi",
33227
33629
  "aws_backup",
33228
33630
  "aws_backupgateway",
33229
33631
  "aws_batch",
@@ -33496,6 +33898,7 @@ from . import aws_autoscaling
33496
33898
  from . import aws_autoscaling_common
33497
33899
  from . import aws_autoscaling_hooktargets
33498
33900
  from . import aws_autoscalingplans
33901
+ from . import aws_b2bi
33499
33902
  from . import aws_backup
33500
33903
  from . import aws_backupgateway
33501
33904
  from . import aws_batch
@@ -34750,12 +35153,12 @@ def _typecheckingstub__9dc07c260551c6e828a1b20303b5a44e226e85166f6249c94e31d0271
34750
35153
  """Type checking stubs"""
34751
35154
  pass
34752
35155
 
34753
- def _typecheckingstub__c9a6802d57ad9b69b2fa5290464f51a2a8623348c365289d64305245e073ef41(
35156
+ def _typecheckingstub__b472990efe22be52456a5e812dc6396350b7010d1113310d62ef01f74c1769e1(
34754
35157
  scope: _constructs_77d1e7e8.Construct,
34755
35158
  id: builtins.str,
34756
35159
  *,
34757
35160
  code_directory: builtins.str,
34758
- runtime: CustomResourceProviderRuntime,
35161
+ runtime_name: builtins.str,
34759
35162
  description: typing.Optional[builtins.str] = None,
34760
35163
  environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
34761
35164
  memory_size: typing.Optional[Size] = None,
@@ -34766,28 +35169,14 @@ def _typecheckingstub__c9a6802d57ad9b69b2fa5290464f51a2a8623348c365289d64305245e
34766
35169
  """Type checking stubs"""
34767
35170
  pass
34768
35171
 
34769
- def _typecheckingstub__c1f95fb403ff0b28ac158a1e391fedc73bee20ded09963a1a66fabfcfe99d006(
34770
- scope: _constructs_77d1e7e8.Construct,
34771
- uniqueid: builtins.str,
34772
- *,
34773
- code_directory: builtins.str,
34774
- runtime: CustomResourceProviderRuntime,
34775
- description: typing.Optional[builtins.str] = None,
34776
- environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
34777
- memory_size: typing.Optional[Size] = None,
34778
- policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
34779
- timeout: typing.Optional[Duration] = None,
34780
- use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
35172
+ def _typecheckingstub__d7b4da0f6df59a6071a8ead45156197cdf0751659059c019b964df5f5dd58b9a(
35173
+ statement: typing.Any,
34781
35174
  ) -> None:
34782
35175
  """Type checking stubs"""
34783
35176
  pass
34784
35177
 
34785
- def _typecheckingstub__0ccbce12d9e6f35bd2240da7f5c1900a1ff6b41588e9f31f4b76ecb707a6310f(
34786
- scope: _constructs_77d1e7e8.Construct,
34787
- uniqueid: builtins.str,
35178
+ def _typecheckingstub__7473e2978820a8ffdbda9b6e4ccae286256e80d7f830b3838e774e0dd9a8605f(
34788
35179
  *,
34789
- code_directory: builtins.str,
34790
- runtime: CustomResourceProviderRuntime,
34791
35180
  description: typing.Optional[builtins.str] = None,
34792
35181
  environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
34793
35182
  memory_size: typing.Optional[Size] = None,
@@ -34798,22 +35187,16 @@ def _typecheckingstub__0ccbce12d9e6f35bd2240da7f5c1900a1ff6b41588e9f31f4b76ecb70
34798
35187
  """Type checking stubs"""
34799
35188
  pass
34800
35189
 
34801
- def _typecheckingstub__b6bbb7ac438407b317f797bf320b11f8dee8e0222411b4590c1352b276e7f29c(
34802
- statement: typing.Any,
34803
- ) -> None:
34804
- """Type checking stubs"""
34805
- pass
34806
-
34807
35190
  def _typecheckingstub__67b3f7332c978ef4e7c7aecd62d50434c044f1fb228ab5cf8711c9ad036743c1(
34808
35191
  *,
34809
- code_directory: builtins.str,
34810
- runtime: CustomResourceProviderRuntime,
34811
35192
  description: typing.Optional[builtins.str] = None,
34812
35193
  environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
34813
35194
  memory_size: typing.Optional[Size] = None,
34814
35195
  policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
34815
35196
  timeout: typing.Optional[Duration] = None,
34816
35197
  use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
35198
+ code_directory: builtins.str,
35199
+ runtime: CustomResourceProviderRuntime,
34817
35200
  ) -> None:
34818
35201
  """Type checking stubs"""
34819
35202
  pass
@@ -37755,6 +38138,68 @@ def _typecheckingstub__f9a9f2fc767762d8005e1a5d920d5d4064d4ed7ec492ba4a20eb60182
37755
38138
  """Type checking stubs"""
37756
38139
  pass
37757
38140
 
38141
+ def _typecheckingstub__c9a6802d57ad9b69b2fa5290464f51a2a8623348c365289d64305245e073ef41(
38142
+ scope: _constructs_77d1e7e8.Construct,
38143
+ id: builtins.str,
38144
+ *,
38145
+ code_directory: builtins.str,
38146
+ runtime: CustomResourceProviderRuntime,
38147
+ description: typing.Optional[builtins.str] = None,
38148
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
38149
+ memory_size: typing.Optional[Size] = None,
38150
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
38151
+ timeout: typing.Optional[Duration] = None,
38152
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
38153
+ ) -> None:
38154
+ """Type checking stubs"""
38155
+ pass
38156
+
38157
+ def _typecheckingstub__c1f95fb403ff0b28ac158a1e391fedc73bee20ded09963a1a66fabfcfe99d006(
38158
+ scope: _constructs_77d1e7e8.Construct,
38159
+ uniqueid: builtins.str,
38160
+ *,
38161
+ code_directory: builtins.str,
38162
+ runtime: CustomResourceProviderRuntime,
38163
+ description: typing.Optional[builtins.str] = None,
38164
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
38165
+ memory_size: typing.Optional[Size] = None,
38166
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
38167
+ timeout: typing.Optional[Duration] = None,
38168
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
38169
+ ) -> None:
38170
+ """Type checking stubs"""
38171
+ pass
38172
+
38173
+ def _typecheckingstub__0ccbce12d9e6f35bd2240da7f5c1900a1ff6b41588e9f31f4b76ecb707a6310f(
38174
+ scope: _constructs_77d1e7e8.Construct,
38175
+ uniqueid: builtins.str,
38176
+ *,
38177
+ code_directory: builtins.str,
38178
+ runtime: CustomResourceProviderRuntime,
38179
+ description: typing.Optional[builtins.str] = None,
38180
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
38181
+ memory_size: typing.Optional[Size] = None,
38182
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
38183
+ timeout: typing.Optional[Duration] = None,
38184
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
38185
+ ) -> None:
38186
+ """Type checking stubs"""
38187
+ pass
38188
+
38189
+ def _typecheckingstub__a1ac82056ff309d22752667288bc14e4df222e4ef5faa80aa686251113655d12(
38190
+ *,
38191
+ description: typing.Optional[builtins.str] = None,
38192
+ environment: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
38193
+ memory_size: typing.Optional[Size] = None,
38194
+ policy_statements: typing.Optional[typing.Sequence[typing.Any]] = None,
38195
+ timeout: typing.Optional[Duration] = None,
38196
+ use_cfn_response_wrapper: typing.Optional[builtins.bool] = None,
38197
+ code_directory: builtins.str,
38198
+ runtime_name: builtins.str,
38199
+ ) -> None:
38200
+ """Type checking stubs"""
38201
+ pass
38202
+
37758
38203
  def _typecheckingstub__782d46d699e89fd2df9c165498a60efbd310f2edb56c287f4b79e6ceed5a9ecb(
37759
38204
  concat: IFragmentConcatenator,
37760
38205
  ) -> None: