cdktn 0.25.0.dev38__tar.gz → 0.25.0.dev40__tar.gz
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.
- {cdktn-0.25.0.dev38/src/cdktn.egg-info → cdktn-0.25.0.dev40}/PKG-INFO +1 -1
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/setup.py +2 -2
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn/__init__.py +738 -71
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn/_jsii/__init__.py +1 -1
- cdktn-0.25.0.dev40/src/cdktn/_jsii/cdktn@0.25.0-pre.40.jsii.tgz +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40/src/cdktn.egg-info}/PKG-INFO +1 -1
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn.egg-info/SOURCES.txt +1 -1
- cdktn-0.25.0.dev38/src/cdktn/_jsii/cdktn@0.25.0-pre.38.jsii.tgz +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/LICENSE +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/MANIFEST.in +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/README.md +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/pyproject.toml +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/setup.cfg +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn/py.typed +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn/testing_matchers/__init__.py +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn.egg-info/dependency_links.txt +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn.egg-info/requires.txt +0 -0
- {cdktn-0.25.0.dev38 → cdktn-0.25.0.dev40}/src/cdktn.egg-info/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@ kwargs = json.loads(
|
|
|
5
5
|
"""
|
|
6
6
|
{
|
|
7
7
|
"name": "cdktn",
|
|
8
|
-
"version": "0.25.0.
|
|
8
|
+
"version": "0.25.0.dev40",
|
|
9
9
|
"description": "Cloud Development Kit for Terraform",
|
|
10
10
|
"license": "MPL-2.0",
|
|
11
11
|
"url": "https://github.com/open-constructs/cdk-terrain",
|
|
@@ -27,7 +27,7 @@ kwargs = json.loads(
|
|
|
27
27
|
],
|
|
28
28
|
"package_data": {
|
|
29
29
|
"cdktn._jsii": [
|
|
30
|
-
"cdktn@0.25.0-pre.
|
|
30
|
+
"cdktn@0.25.0-pre.40.jsii.tgz"
|
|
31
31
|
],
|
|
32
32
|
"cdktn": [
|
|
33
33
|
"py.typed"
|
|
@@ -635,9 +635,8 @@ class AssetHashOptions:
|
|
|
635
635
|
class AssetHashType(enum.Enum):
|
|
636
636
|
'''(experimental) The type of asset hash.
|
|
637
637
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
packaging, uploading to cloud storage, etc.
|
|
638
|
+
The hash identifies a specific revision of the asset and caches deployment
|
|
639
|
+
work such as packaging and uploading.
|
|
641
640
|
|
|
642
641
|
:stability: experimental
|
|
643
642
|
'''
|
|
@@ -645,16 +644,15 @@ class AssetHashType(enum.Enum):
|
|
|
645
644
|
SOURCE = "SOURCE"
|
|
646
645
|
'''(experimental) Based on the content of the source path.
|
|
647
646
|
|
|
648
|
-
Use ``SOURCE``
|
|
649
|
-
you want to track changes to the source files directly.
|
|
647
|
+
Use ``SOURCE`` to track changes to the source files directly.
|
|
650
648
|
|
|
651
649
|
:stability: experimental
|
|
652
650
|
'''
|
|
653
651
|
OUTPUT = "OUTPUT"
|
|
654
652
|
'''(experimental) Based on the content of the bundling output.
|
|
655
653
|
|
|
656
|
-
Use ``OUTPUT`` when the source
|
|
657
|
-
|
|
654
|
+
Use ``OUTPUT`` when the source is a top-level folder holding code and/or
|
|
655
|
+
dependencies not directly linked to the asset.
|
|
658
656
|
|
|
659
657
|
:stability: experimental
|
|
660
658
|
'''
|
|
@@ -677,9 +675,9 @@ class AssetOptions:
|
|
|
677
675
|
asset_hash: typing.Optional[builtins.str] = None,
|
|
678
676
|
asset_hash_type: typing.Optional["AssetHashType"] = None,
|
|
679
677
|
) -> None:
|
|
680
|
-
'''(experimental)
|
|
678
|
+
'''(experimental) Options controlling how an asset's hash is derived.
|
|
681
679
|
|
|
682
|
-
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``.
|
|
680
|
+
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``. The hash identifies a specific revision of the asset and caches deployment work (packaging, uploading). A custom hash must be updated whenever the asset changes, or some deployments will not be invalidated. Default: - based on ``assetHashType``
|
|
683
681
|
:param asset_hash_type: (experimental) Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
|
|
684
682
|
|
|
685
683
|
:stability: experimental
|
|
@@ -703,11 +701,9 @@ class AssetOptions:
|
|
|
703
701
|
hash, and because it names the staged asset file it may only contain
|
|
704
702
|
letters, digits, ``_``, ``.`` and ``-``.
|
|
705
703
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
need to make sure it is updated every time the asset changes, or otherwise it is
|
|
710
|
-
possible that some deployments will not be invalidated.
|
|
704
|
+
The hash identifies a specific revision of the asset and caches deployment
|
|
705
|
+
work (packaging, uploading). A custom hash must be updated whenever the
|
|
706
|
+
asset changes, or some deployments will not be invalidated.
|
|
711
707
|
|
|
712
708
|
:default: - based on ``assetHashType``
|
|
713
709
|
|
|
@@ -790,6 +786,8 @@ class AssetPackaging(metaclass=jsii.JSIIMeta, jsii_type="cdktn.AssetPackaging"):
|
|
|
790
786
|
"asset_hash_type": "assetHashType",
|
|
791
787
|
"packaging": "packaging",
|
|
792
788
|
"source_path": "sourcePath",
|
|
789
|
+
"bundler": "bundler",
|
|
790
|
+
"display_name": "displayName",
|
|
793
791
|
"exclude": "exclude",
|
|
794
792
|
"extra_hash": "extraHash",
|
|
795
793
|
"ignore_strategy": "ignoreStrategy",
|
|
@@ -803,16 +801,20 @@ class AssetStagingOptions(AssetOptions):
|
|
|
803
801
|
asset_hash_type: typing.Optional["AssetHashType"] = None,
|
|
804
802
|
packaging: "IAssetPackaging",
|
|
805
803
|
source_path: builtins.str,
|
|
804
|
+
bundler: typing.Optional["IAssetBundler"] = None,
|
|
805
|
+
display_name: typing.Optional[builtins.str] = None,
|
|
806
806
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
807
807
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
808
808
|
ignore_strategy: typing.Optional["IIgnoreStrategy"] = None,
|
|
809
809
|
) -> None:
|
|
810
810
|
'''(experimental) Options for {@link AssetStaging}.
|
|
811
811
|
|
|
812
|
-
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``.
|
|
812
|
+
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``. The hash identifies a specific revision of the asset and caches deployment work (packaging, uploading). A custom hash must be updated whenever the asset changes, or some deployments will not be invalidated. Default: - based on ``assetHashType``
|
|
813
813
|
:param asset_hash_type: (experimental) Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
|
|
814
814
|
:param packaging: (experimental) How the staged result is produced and shaped. The caller decides this (e.g. from its own ``AssetType``) — ``AssetStaging`` never infers or changes it based on ``exclude``/``extraHash``.
|
|
815
815
|
:param source_path: (experimental) Absolute path to the source file or directory. Resolving a relative path against ``cdktf.json`` is the caller's responsibility.
|
|
816
|
+
:param bundler: (experimental) A bundler that builds the source into an artifact before staging. Under the default ``SOURCE`` hashing the build is deferred to ``stage()`` and stays skippable; ``OUTPUT`` hashing builds eagerly at construction time to hash the artifact, forgoing skippability. The bundler's declared output shape must match the packaging: a ``BundleResult.directory`` needs a directory-accepting packaging, a ``BundleResult.file`` a single-file one (``AssetType.FILE``). The mismatch is caught once the build runs. Default: - the source is staged verbatim, with no build step
|
|
817
|
+
:param display_name: (experimental) Identifier used in error messages, so they name the user-facing construct (e.g. the ``TerraformAsset``) rather than this internal staging child. Default: - the staging construct's own id
|
|
816
818
|
:param exclude: (experimental) Paths to exclude, relative to ``sourcePath``. Cannot be combined with ``ignoreStrategy``, which replaces this matcher rather than layering on top of it. Default: - nothing is excluded
|
|
817
819
|
:param extra_hash: (experimental) Extra information to fold into the hash (e.g. build instructions and other inputs). Default: - no extra hash
|
|
818
820
|
:param ignore_strategy: (experimental) Exclusion matching, for callers that need ``.gitignore`` / ``.dockerignore`` parity rather than the built-in exact-path / suffix / directory matcher. Default: - ``exclude`` is used with the built-in matcher
|
|
@@ -825,6 +827,8 @@ class AssetStagingOptions(AssetOptions):
|
|
|
825
827
|
check_type(argname="argument asset_hash_type", value=asset_hash_type, expected_type=type_hints["asset_hash_type"])
|
|
826
828
|
check_type(argname="argument packaging", value=packaging, expected_type=type_hints["packaging"])
|
|
827
829
|
check_type(argname="argument source_path", value=source_path, expected_type=type_hints["source_path"])
|
|
830
|
+
check_type(argname="argument bundler", value=bundler, expected_type=type_hints["bundler"])
|
|
831
|
+
check_type(argname="argument display_name", value=display_name, expected_type=type_hints["display_name"])
|
|
828
832
|
check_type(argname="argument exclude", value=exclude, expected_type=type_hints["exclude"])
|
|
829
833
|
check_type(argname="argument extra_hash", value=extra_hash, expected_type=type_hints["extra_hash"])
|
|
830
834
|
check_type(argname="argument ignore_strategy", value=ignore_strategy, expected_type=type_hints["ignore_strategy"])
|
|
@@ -836,6 +840,10 @@ class AssetStagingOptions(AssetOptions):
|
|
|
836
840
|
self._values["asset_hash"] = asset_hash
|
|
837
841
|
if asset_hash_type is not None:
|
|
838
842
|
self._values["asset_hash_type"] = asset_hash_type
|
|
843
|
+
if bundler is not None:
|
|
844
|
+
self._values["bundler"] = bundler
|
|
845
|
+
if display_name is not None:
|
|
846
|
+
self._values["display_name"] = display_name
|
|
839
847
|
if exclude is not None:
|
|
840
848
|
self._values["exclude"] = exclude
|
|
841
849
|
if extra_hash is not None:
|
|
@@ -852,11 +860,9 @@ class AssetStagingOptions(AssetOptions):
|
|
|
852
860
|
hash, and because it names the staged asset file it may only contain
|
|
853
861
|
letters, digits, ``_``, ``.`` and ``-``.
|
|
854
862
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
need to make sure it is updated every time the asset changes, or otherwise it is
|
|
859
|
-
possible that some deployments will not be invalidated.
|
|
863
|
+
The hash identifies a specific revision of the asset and caches deployment
|
|
864
|
+
work (packaging, uploading). A custom hash must be updated whenever the
|
|
865
|
+
asset changes, or some deployments will not be invalidated.
|
|
860
866
|
|
|
861
867
|
:default: - based on ``assetHashType``
|
|
862
868
|
|
|
@@ -909,6 +915,35 @@ class AssetStagingOptions(AssetOptions):
|
|
|
909
915
|
assert result is not None, "Required property 'source_path' is missing"
|
|
910
916
|
return typing.cast(builtins.str, result)
|
|
911
917
|
|
|
918
|
+
@builtins.property
|
|
919
|
+
def bundler(self) -> typing.Optional["IAssetBundler"]:
|
|
920
|
+
'''(experimental) A bundler that builds the source into an artifact before staging.
|
|
921
|
+
|
|
922
|
+
Under the default ``SOURCE`` hashing the build is deferred to ``stage()`` and
|
|
923
|
+
stays skippable; ``OUTPUT`` hashing builds eagerly at construction time to
|
|
924
|
+
hash the artifact, forgoing skippability. The bundler's declared output
|
|
925
|
+
shape must match the packaging: a ``BundleResult.directory`` needs a
|
|
926
|
+
directory-accepting packaging, a ``BundleResult.file`` a single-file one
|
|
927
|
+
(``AssetType.FILE``). The mismatch is caught once the build runs.
|
|
928
|
+
|
|
929
|
+
:default: - the source is staged verbatim, with no build step
|
|
930
|
+
|
|
931
|
+
:stability: experimental
|
|
932
|
+
'''
|
|
933
|
+
result = self._values.get("bundler")
|
|
934
|
+
return typing.cast(typing.Optional["IAssetBundler"], result)
|
|
935
|
+
|
|
936
|
+
@builtins.property
|
|
937
|
+
def display_name(self) -> typing.Optional[builtins.str]:
|
|
938
|
+
'''(experimental) Identifier used in error messages, so they name the user-facing construct (e.g. the ``TerraformAsset``) rather than this internal staging child.
|
|
939
|
+
|
|
940
|
+
:default: - the staging construct's own id
|
|
941
|
+
|
|
942
|
+
:stability: experimental
|
|
943
|
+
'''
|
|
944
|
+
result = self._values.get("display_name")
|
|
945
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
946
|
+
|
|
912
947
|
@builtins.property
|
|
913
948
|
def exclude(self) -> typing.Optional[typing.List[builtins.str]]:
|
|
914
949
|
'''(experimental) Paths to exclude, relative to ``sourcePath``.
|
|
@@ -1455,6 +1490,246 @@ class AzurermBackendConfig:
|
|
|
1455
1490
|
)
|
|
1456
1491
|
|
|
1457
1492
|
|
|
1493
|
+
@jsii.data_type(
|
|
1494
|
+
jsii_type="cdktn.BundleOptions",
|
|
1495
|
+
jsii_struct_bases=[],
|
|
1496
|
+
name_mapping={"output_dir": "outputDir", "source": "source"},
|
|
1497
|
+
)
|
|
1498
|
+
class BundleOptions:
|
|
1499
|
+
def __init__(self, *, output_dir: builtins.str, source: builtins.str) -> None:
|
|
1500
|
+
'''(experimental) Options handed to an {@link IAssetBundler} when it runs.
|
|
1501
|
+
|
|
1502
|
+
A struct rather than positional parameters: adding a field is additive,
|
|
1503
|
+
adding a method parameter is not, and ``bundle`` is called through JSII where
|
|
1504
|
+
that distinction is a breaking-change boundary.
|
|
1505
|
+
|
|
1506
|
+
:param output_dir: (experimental) A scratch directory the bundler may write into, owned and created by the caller. The bundler produces its output here (or in a subdirectory) and returns a {@link BundleResult} pointing at the finished artifact — see {@link IAssetBundler.bundle}.
|
|
1507
|
+
:param source: (experimental) Absolute path to the asset's source file or directory. The bundler reads from here and must not modify it. Exclusions (``exclude`` / ``ignoreStrategy``) are already applied: when any are configured this points at a filtered copy, not the original tree, so the bundler reads exactly the file set the asset hash was taken over.
|
|
1508
|
+
|
|
1509
|
+
:stability: experimental
|
|
1510
|
+
'''
|
|
1511
|
+
if __debug__:
|
|
1512
|
+
type_hints = cached_type_hints(_typecheckingstub__e4984c7b158b6fd9f304d19bf1be6b525991aa5c57db01aa1dd6d282c3369f9e)
|
|
1513
|
+
check_type(argname="argument output_dir", value=output_dir, expected_type=type_hints["output_dir"])
|
|
1514
|
+
check_type(argname="argument source", value=source, expected_type=type_hints["source"])
|
|
1515
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
1516
|
+
"output_dir": output_dir,
|
|
1517
|
+
"source": source,
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
@builtins.property
|
|
1521
|
+
def output_dir(self) -> builtins.str:
|
|
1522
|
+
'''(experimental) A scratch directory the bundler may write into, owned and created by the caller.
|
|
1523
|
+
|
|
1524
|
+
The bundler produces its output here (or in a subdirectory) and
|
|
1525
|
+
returns a {@link BundleResult} pointing at the finished artifact — see
|
|
1526
|
+
{@link IAssetBundler.bundle}.
|
|
1527
|
+
|
|
1528
|
+
:stability: experimental
|
|
1529
|
+
'''
|
|
1530
|
+
result = self._values.get("output_dir")
|
|
1531
|
+
assert result is not None, "Required property 'output_dir' is missing"
|
|
1532
|
+
return typing.cast(builtins.str, result)
|
|
1533
|
+
|
|
1534
|
+
@builtins.property
|
|
1535
|
+
def source(self) -> builtins.str:
|
|
1536
|
+
'''(experimental) Absolute path to the asset's source file or directory. The bundler reads from here and must not modify it.
|
|
1537
|
+
|
|
1538
|
+
Exclusions (``exclude`` / ``ignoreStrategy``) are already applied: when any
|
|
1539
|
+
are configured this points at a filtered copy, not the original tree, so
|
|
1540
|
+
the bundler reads exactly the file set the asset hash was taken over.
|
|
1541
|
+
|
|
1542
|
+
:stability: experimental
|
|
1543
|
+
'''
|
|
1544
|
+
result = self._values.get("source")
|
|
1545
|
+
assert result is not None, "Required property 'source' is missing"
|
|
1546
|
+
return typing.cast(builtins.str, result)
|
|
1547
|
+
|
|
1548
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
1549
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
1550
|
+
|
|
1551
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
1552
|
+
return not (rhs == self)
|
|
1553
|
+
|
|
1554
|
+
def __repr__(self) -> str:
|
|
1555
|
+
return "BundleOptions(%s)" % ", ".join(
|
|
1556
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
1557
|
+
)
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
@jsii.enum(jsii_type="cdktn.BundleOutputType")
|
|
1561
|
+
class BundleOutputType(enum.Enum):
|
|
1562
|
+
'''(experimental) The shape of a bundler's output, so staging and packaging can treat a single-file artifact (a tarball, a ``.zip``) differently from a directory tree without inferring it from the path.
|
|
1563
|
+
|
|
1564
|
+
:stability: experimental
|
|
1565
|
+
'''
|
|
1566
|
+
|
|
1567
|
+
DIRECTORY = "DIRECTORY"
|
|
1568
|
+
'''(experimental) The output is a directory tree.
|
|
1569
|
+
|
|
1570
|
+
Packaged like an unbundled source directory. The default, and the only
|
|
1571
|
+
shape that predates archive support.
|
|
1572
|
+
|
|
1573
|
+
:stability: experimental
|
|
1574
|
+
'''
|
|
1575
|
+
FILE = "FILE"
|
|
1576
|
+
'''(experimental) The output is a single file the bundler already produced in its final form.
|
|
1577
|
+
|
|
1578
|
+
A tarball or a deterministic ``.zip``. Staged verbatim rather than
|
|
1579
|
+
re-archived, so ``AssetType.FILE`` no longer has to reject a bundler.
|
|
1580
|
+
|
|
1581
|
+
:stability: experimental
|
|
1582
|
+
'''
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
class BundleResult(metaclass=jsii.JSIIMeta, jsii_type="cdktn.BundleResult"):
|
|
1586
|
+
'''(experimental) What a bundler produced, returned from {@link IAssetBundler.bundle}.
|
|
1587
|
+
|
|
1588
|
+
Carries the artifact path and its shape, or a declined state signalling the
|
|
1589
|
+
caller should fall back. See {@link declined} for the decline protocol.
|
|
1590
|
+
|
|
1591
|
+
:stability: experimental
|
|
1592
|
+
'''
|
|
1593
|
+
|
|
1594
|
+
@jsii.member(jsii_name="declined")
|
|
1595
|
+
@builtins.classmethod
|
|
1596
|
+
def declined(cls) -> "BundleResult":
|
|
1597
|
+
'''(experimental) The bundler declined to run here; the caller should fall back.
|
|
1598
|
+
|
|
1599
|
+
Distinct from a thrown error, which is a hard failure.
|
|
1600
|
+
|
|
1601
|
+
:stability: experimental
|
|
1602
|
+
'''
|
|
1603
|
+
return typing.cast("BundleResult", jsii.sinvoke(cls, "declined", []))
|
|
1604
|
+
|
|
1605
|
+
@jsii.member(jsii_name="directory")
|
|
1606
|
+
@builtins.classmethod
|
|
1607
|
+
def directory(cls, path: builtins.str) -> "BundleResult":
|
|
1608
|
+
'''(experimental) A directory-tree artifact at ``path``.
|
|
1609
|
+
|
|
1610
|
+
:param path: -
|
|
1611
|
+
|
|
1612
|
+
:stability: experimental
|
|
1613
|
+
'''
|
|
1614
|
+
if __debug__:
|
|
1615
|
+
type_hints = cached_type_hints(_typecheckingstub__cb448e5d937b8e66717fe97ab740ea1924edd313428fa2e65c41a3f2d7c1a24c)
|
|
1616
|
+
check_type(argname="argument path", value=path, expected_type=type_hints["path"])
|
|
1617
|
+
return typing.cast("BundleResult", jsii.sinvoke(cls, "directory", [path]))
|
|
1618
|
+
|
|
1619
|
+
@jsii.member(jsii_name="file")
|
|
1620
|
+
@builtins.classmethod
|
|
1621
|
+
def file(cls, path: builtins.str) -> "BundleResult":
|
|
1622
|
+
'''(experimental) A single-file artifact at ``path`` (a tarball, a ``.zip``), staged verbatim.
|
|
1623
|
+
|
|
1624
|
+
:param path: -
|
|
1625
|
+
|
|
1626
|
+
:stability: experimental
|
|
1627
|
+
'''
|
|
1628
|
+
if __debug__:
|
|
1629
|
+
type_hints = cached_type_hints(_typecheckingstub__e6adf0d1d61dee6269a50f7bde47aef784df796b53286fb04ab6c071a75d6975)
|
|
1630
|
+
check_type(argname="argument path", value=path, expected_type=type_hints["path"])
|
|
1631
|
+
return typing.cast("BundleResult", jsii.sinvoke(cls, "file", [path]))
|
|
1632
|
+
|
|
1633
|
+
@builtins.property
|
|
1634
|
+
@jsii.member(jsii_name="isDeclined")
|
|
1635
|
+
def is_declined(self) -> builtins.bool:
|
|
1636
|
+
'''(experimental) Whether the bundler declined to run, signalling the caller to fall back.
|
|
1637
|
+
|
|
1638
|
+
:stability: experimental
|
|
1639
|
+
'''
|
|
1640
|
+
return typing.cast(builtins.bool, jsii.get(self, "isDeclined"))
|
|
1641
|
+
|
|
1642
|
+
@builtins.property
|
|
1643
|
+
@jsii.member(jsii_name="outputType")
|
|
1644
|
+
def output_type(self) -> typing.Optional["BundleOutputType"]:
|
|
1645
|
+
'''(experimental) The artifact's shape, or undefined when {@link isDeclined}.
|
|
1646
|
+
|
|
1647
|
+
:stability: experimental
|
|
1648
|
+
'''
|
|
1649
|
+
return typing.cast(typing.Optional["BundleOutputType"], jsii.get(self, "outputType"))
|
|
1650
|
+
|
|
1651
|
+
@builtins.property
|
|
1652
|
+
@jsii.member(jsii_name="path")
|
|
1653
|
+
def path(self) -> typing.Optional[builtins.str]:
|
|
1654
|
+
'''(experimental) The artifact path, or undefined when {@link isDeclined}.
|
|
1655
|
+
|
|
1656
|
+
:stability: experimental
|
|
1657
|
+
'''
|
|
1658
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "path"))
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
class BundlerKey(metaclass=jsii.JSIIMeta, jsii_type="cdktn.BundlerKey"):
|
|
1662
|
+
'''(experimental) Builds an {@link IAssetBundler.bundlerKey} from an ordered set of parts.
|
|
1663
|
+
|
|
1664
|
+
A ``bundlerKey`` has to serialize everything that can move a build's output;
|
|
1665
|
+
done ad hoc, every bundler invents its own delimiter and forgets an input
|
|
1666
|
+
differently. This gives the convention one implementation: parts are joined
|
|
1667
|
+
with a separator that is escaped inside values, so distinct inputs cannot
|
|
1668
|
+
collide into the same key.
|
|
1669
|
+
|
|
1670
|
+
:stability: experimental
|
|
1671
|
+
|
|
1672
|
+
Example::
|
|
1673
|
+
|
|
1674
|
+
const key = BundlerKey.of("docker", image, command)
|
|
1675
|
+
.withEnv({ NODE_ENV: nodeEnv })
|
|
1676
|
+
.toString();
|
|
1677
|
+
'''
|
|
1678
|
+
|
|
1679
|
+
@jsii.member(jsii_name="of")
|
|
1680
|
+
@builtins.classmethod
|
|
1681
|
+
def of(cls, *parts: builtins.str) -> "BundlerKey":
|
|
1682
|
+
'''(experimental) Start a key from an ordered list of parts.
|
|
1683
|
+
|
|
1684
|
+
Order is significant: it is part of what the key identifies.
|
|
1685
|
+
|
|
1686
|
+
:param parts: -
|
|
1687
|
+
|
|
1688
|
+
:stability: experimental
|
|
1689
|
+
'''
|
|
1690
|
+
if __debug__:
|
|
1691
|
+
type_hints = cached_type_hints(_typecheckingstub__76b2ba8d3e61fcbea83025fd36866ed49e2970a52cbe09f43be16a01cf5a6858)
|
|
1692
|
+
check_type(argname="argument parts", value=parts, expected_type=typing.Tuple[type_hints["parts"], ...]) # pyright: ignore [reportGeneralTypeIssues]
|
|
1693
|
+
return typing.cast("BundlerKey", jsii.sinvoke(cls, "of", [*parts]))
|
|
1694
|
+
|
|
1695
|
+
@jsii.member(jsii_name="add")
|
|
1696
|
+
def add(self, *parts: builtins.str) -> "BundlerKey":
|
|
1697
|
+
'''(experimental) Append parts, returning a new key.
|
|
1698
|
+
|
|
1699
|
+
:param parts: -
|
|
1700
|
+
|
|
1701
|
+
:stability: experimental
|
|
1702
|
+
'''
|
|
1703
|
+
if __debug__:
|
|
1704
|
+
type_hints = cached_type_hints(_typecheckingstub__5542e2e8a7f529585fff07dcaf5ca7a0425baa3a9af1286723c0b3fb21d976c6)
|
|
1705
|
+
check_type(argname="argument parts", value=parts, expected_type=typing.Tuple[type_hints["parts"], ...]) # pyright: ignore [reportGeneralTypeIssues]
|
|
1706
|
+
return typing.cast("BundlerKey", jsii.invoke(self, "add", [*parts]))
|
|
1707
|
+
|
|
1708
|
+
@jsii.member(jsii_name="toString")
|
|
1709
|
+
def to_string(self) -> builtins.str:
|
|
1710
|
+
'''(experimental) Render the collected parts to the string passed as ``bundlerKey``.
|
|
1711
|
+
|
|
1712
|
+
:stability: experimental
|
|
1713
|
+
'''
|
|
1714
|
+
return typing.cast(builtins.str, jsii.invoke(self, "toString", []))
|
|
1715
|
+
|
|
1716
|
+
@jsii.member(jsii_name="withEnv")
|
|
1717
|
+
def with_env(
|
|
1718
|
+
self,
|
|
1719
|
+
entries: typing.Mapping[builtins.str, builtins.str],
|
|
1720
|
+
) -> "BundlerKey":
|
|
1721
|
+
'''(experimental) Append ``key=value`` parts for a record, sorted by key so the result does not depend on property order.
|
|
1722
|
+
|
|
1723
|
+
:param entries: -
|
|
1724
|
+
|
|
1725
|
+
:stability: experimental
|
|
1726
|
+
'''
|
|
1727
|
+
if __debug__:
|
|
1728
|
+
type_hints = cached_type_hints(_typecheckingstub__89d2ee0220c33c5357157d502001eb29e4d7acc5dd0985be2aeb7f269d3ef50b)
|
|
1729
|
+
check_type(argname="argument entries", value=entries, expected_type=type_hints["entries"])
|
|
1730
|
+
return typing.cast("BundlerKey", jsii.invoke(self, "withEnv", [entries]))
|
|
1731
|
+
|
|
1732
|
+
|
|
1458
1733
|
@jsii.data_type(
|
|
1459
1734
|
jsii_type="cdktn.CloudBackendConfig",
|
|
1460
1735
|
jsii_struct_bases=[],
|
|
@@ -5335,11 +5610,10 @@ class IAsset(typing_extensions.Protocol):
|
|
|
5335
5610
|
@builtins.property
|
|
5336
5611
|
@jsii.member(jsii_name="assetHash")
|
|
5337
5612
|
def asset_hash(self) -> builtins.str:
|
|
5338
|
-
'''(experimental) A hash of this asset,
|
|
5613
|
+
'''(experimental) A hash of this asset, available at construction time.
|
|
5339
5614
|
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
hash has changed.
|
|
5615
|
+
Being a plain string, it can be used in construct IDs to force a new
|
|
5616
|
+
resource when the content hash changes.
|
|
5343
5617
|
|
|
5344
5618
|
:stability: experimental
|
|
5345
5619
|
'''
|
|
@@ -5357,11 +5631,10 @@ class _IAssetProxy:
|
|
|
5357
5631
|
@builtins.property
|
|
5358
5632
|
@jsii.member(jsii_name="assetHash")
|
|
5359
5633
|
def asset_hash(self) -> builtins.str:
|
|
5360
|
-
'''(experimental) A hash of this asset,
|
|
5634
|
+
'''(experimental) A hash of this asset, available at construction time.
|
|
5361
5635
|
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
hash has changed.
|
|
5636
|
+
Being a plain string, it can be used in construct IDs to force a new
|
|
5637
|
+
resource when the content hash changes.
|
|
5365
5638
|
|
|
5366
5639
|
:stability: experimental
|
|
5367
5640
|
'''
|
|
@@ -5371,6 +5644,192 @@ class _IAssetProxy:
|
|
|
5371
5644
|
typing.cast(typing.Any, IAsset).__jsii_proxy_class__ = lambda : _IAssetProxy
|
|
5372
5645
|
|
|
5373
5646
|
|
|
5647
|
+
@jsii.interface(jsii_type="cdktn.IAssetBundler")
|
|
5648
|
+
class IAssetBundler(typing_extensions.Protocol):
|
|
5649
|
+
'''(experimental) Transforms a source tree into a built artifact. Runs at synth, before the output is packaged and staged.
|
|
5650
|
+
|
|
5651
|
+
This is the extension point for asset bundling: core ships no bundler.
|
|
5652
|
+
Docker, esbuild, pip, ``go build``, and similar are an open-ended, non
|
|
5653
|
+
cloud-specific set, so each lives in its own package and implements this
|
|
5654
|
+
one interface — the same way {@link IIgnoreStrategy} lets richer exclusion
|
|
5655
|
+
live outside core. Users pass an instance via the consuming construct's
|
|
5656
|
+
``bundler`` option.
|
|
5657
|
+
|
|
5658
|
+
``bundle`` runs during the owning construct's ``onSynthesize`` hook and may
|
|
5659
|
+
touch the filesystem. Deferring it there keeps it skippable when the asset's
|
|
5660
|
+
stack is not being synthesized, which holds as long as the hash is taken
|
|
5661
|
+
over the source rather than the built output.
|
|
5662
|
+
|
|
5663
|
+
Bundlers compose through {@link ChainBundler} rather than a hierarchy: a
|
|
5664
|
+
bundler declines (see {@link BundleResult.declined}) instead of failing when
|
|
5665
|
+
it cannot run, and the chain falls through to the next.
|
|
5666
|
+
|
|
5667
|
+
:stability: experimental
|
|
5668
|
+
'''
|
|
5669
|
+
|
|
5670
|
+
@builtins.property
|
|
5671
|
+
@jsii.member(jsii_name="bundlerKey")
|
|
5672
|
+
def bundler_key(self) -> typing.Optional[builtins.str]:
|
|
5673
|
+
'''(experimental) A value identifying the build, folded into the asset hash.
|
|
5674
|
+
|
|
5675
|
+
The source tree alone cannot see the build, so swapping a ``node:18`` base
|
|
5676
|
+
image for ``node:20`` would otherwise leave identity unchanged. Under
|
|
5677
|
+
``SOURCE`` hashing this is the only channel by which the build reaches
|
|
5678
|
+
identity, so it must serialize every input that can move the output, or a
|
|
5679
|
+
changed build silently reuses a stale artifact. {@link BundlerKey} builds
|
|
5680
|
+
one from an ordered set of parts.
|
|
5681
|
+
|
|
5682
|
+
Mirrors {@link IIgnoreStrategy.cacheKey}: omit it when the build cannot be
|
|
5683
|
+
summarized as a string, and fall back to ``extraHash``.
|
|
5684
|
+
|
|
5685
|
+
:default: - the build does not contribute to the hash
|
|
5686
|
+
|
|
5687
|
+
:stability: experimental
|
|
5688
|
+
'''
|
|
5689
|
+
...
|
|
5690
|
+
|
|
5691
|
+
@builtins.property
|
|
5692
|
+
@jsii.member(jsii_name="outputFileName")
|
|
5693
|
+
def output_file_name(self) -> typing.Optional[builtins.str]:
|
|
5694
|
+
'''(experimental) The name a single-file artifact is staged under (e.g. ``archive.zip``).
|
|
5695
|
+
|
|
5696
|
+
A file-producing bundler (``BundleResult.file``) staged with
|
|
5697
|
+
``AssetType.FILE`` would otherwise take the source path's basename, which is
|
|
5698
|
+
a directory name when the source is a directory. Declaring the name here
|
|
5699
|
+
lets the artifact reflect what the bundler produces. It is static
|
|
5700
|
+
configuration, needed at construction before a deferred ``SOURCE`` build
|
|
5701
|
+
runs, not the file's runtime name.
|
|
5702
|
+
|
|
5703
|
+
Valid only for a file-producing bundler: setting it with a directory
|
|
5704
|
+
packaging (anything but ``AssetType.FILE``) is rejected at construction.
|
|
5705
|
+
|
|
5706
|
+
:default: - the source path's basename
|
|
5707
|
+
|
|
5708
|
+
:stability: experimental
|
|
5709
|
+
'''
|
|
5710
|
+
...
|
|
5711
|
+
|
|
5712
|
+
@jsii.member(jsii_name="bundle")
|
|
5713
|
+
def bundle(
|
|
5714
|
+
self,
|
|
5715
|
+
*,
|
|
5716
|
+
output_dir: builtins.str,
|
|
5717
|
+
source: builtins.str,
|
|
5718
|
+
) -> "BundleResult":
|
|
5719
|
+
'''(experimental) Produce the artifact and return a {@link BundleResult} describing it.
|
|
5720
|
+
|
|
5721
|
+
Implementations write into ``options.outputDir`` and never write back to
|
|
5722
|
+
``options.source``. The returned path must exist and match its declared
|
|
5723
|
+
shape, or staging rejects it.
|
|
5724
|
+
|
|
5725
|
+
A bundler that cannot run in this environment returns
|
|
5726
|
+
``BundleResult.declined()`` so a {@link ChainBundler} can fall through to
|
|
5727
|
+
the next; a thrown error is a hard failure, not a decline.
|
|
5728
|
+
|
|
5729
|
+
:param output_dir: (experimental) A scratch directory the bundler may write into, owned and created by the caller. The bundler produces its output here (or in a subdirectory) and returns a {@link BundleResult} pointing at the finished artifact — see {@link IAssetBundler.bundle}.
|
|
5730
|
+
:param source: (experimental) Absolute path to the asset's source file or directory. The bundler reads from here and must not modify it. Exclusions (``exclude`` / ``ignoreStrategy``) are already applied: when any are configured this points at a filtered copy, not the original tree, so the bundler reads exactly the file set the asset hash was taken over.
|
|
5731
|
+
|
|
5732
|
+
:stability: experimental
|
|
5733
|
+
'''
|
|
5734
|
+
...
|
|
5735
|
+
|
|
5736
|
+
|
|
5737
|
+
class _IAssetBundlerProxy:
|
|
5738
|
+
'''(experimental) Transforms a source tree into a built artifact. Runs at synth, before the output is packaged and staged.
|
|
5739
|
+
|
|
5740
|
+
This is the extension point for asset bundling: core ships no bundler.
|
|
5741
|
+
Docker, esbuild, pip, ``go build``, and similar are an open-ended, non
|
|
5742
|
+
cloud-specific set, so each lives in its own package and implements this
|
|
5743
|
+
one interface — the same way {@link IIgnoreStrategy} lets richer exclusion
|
|
5744
|
+
live outside core. Users pass an instance via the consuming construct's
|
|
5745
|
+
``bundler`` option.
|
|
5746
|
+
|
|
5747
|
+
``bundle`` runs during the owning construct's ``onSynthesize`` hook and may
|
|
5748
|
+
touch the filesystem. Deferring it there keeps it skippable when the asset's
|
|
5749
|
+
stack is not being synthesized, which holds as long as the hash is taken
|
|
5750
|
+
over the source rather than the built output.
|
|
5751
|
+
|
|
5752
|
+
Bundlers compose through {@link ChainBundler} rather than a hierarchy: a
|
|
5753
|
+
bundler declines (see {@link BundleResult.declined}) instead of failing when
|
|
5754
|
+
it cannot run, and the chain falls through to the next.
|
|
5755
|
+
|
|
5756
|
+
:stability: experimental
|
|
5757
|
+
'''
|
|
5758
|
+
|
|
5759
|
+
__jsii_type__: typing.ClassVar[str] = "cdktn.IAssetBundler"
|
|
5760
|
+
|
|
5761
|
+
@builtins.property
|
|
5762
|
+
@jsii.member(jsii_name="bundlerKey")
|
|
5763
|
+
def bundler_key(self) -> typing.Optional[builtins.str]:
|
|
5764
|
+
'''(experimental) A value identifying the build, folded into the asset hash.
|
|
5765
|
+
|
|
5766
|
+
The source tree alone cannot see the build, so swapping a ``node:18`` base
|
|
5767
|
+
image for ``node:20`` would otherwise leave identity unchanged. Under
|
|
5768
|
+
``SOURCE`` hashing this is the only channel by which the build reaches
|
|
5769
|
+
identity, so it must serialize every input that can move the output, or a
|
|
5770
|
+
changed build silently reuses a stale artifact. {@link BundlerKey} builds
|
|
5771
|
+
one from an ordered set of parts.
|
|
5772
|
+
|
|
5773
|
+
Mirrors {@link IIgnoreStrategy.cacheKey}: omit it when the build cannot be
|
|
5774
|
+
summarized as a string, and fall back to ``extraHash``.
|
|
5775
|
+
|
|
5776
|
+
:default: - the build does not contribute to the hash
|
|
5777
|
+
|
|
5778
|
+
:stability: experimental
|
|
5779
|
+
'''
|
|
5780
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "bundlerKey"))
|
|
5781
|
+
|
|
5782
|
+
@builtins.property
|
|
5783
|
+
@jsii.member(jsii_name="outputFileName")
|
|
5784
|
+
def output_file_name(self) -> typing.Optional[builtins.str]:
|
|
5785
|
+
'''(experimental) The name a single-file artifact is staged under (e.g. ``archive.zip``).
|
|
5786
|
+
|
|
5787
|
+
A file-producing bundler (``BundleResult.file``) staged with
|
|
5788
|
+
``AssetType.FILE`` would otherwise take the source path's basename, which is
|
|
5789
|
+
a directory name when the source is a directory. Declaring the name here
|
|
5790
|
+
lets the artifact reflect what the bundler produces. It is static
|
|
5791
|
+
configuration, needed at construction before a deferred ``SOURCE`` build
|
|
5792
|
+
runs, not the file's runtime name.
|
|
5793
|
+
|
|
5794
|
+
Valid only for a file-producing bundler: setting it with a directory
|
|
5795
|
+
packaging (anything but ``AssetType.FILE``) is rejected at construction.
|
|
5796
|
+
|
|
5797
|
+
:default: - the source path's basename
|
|
5798
|
+
|
|
5799
|
+
:stability: experimental
|
|
5800
|
+
'''
|
|
5801
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "outputFileName"))
|
|
5802
|
+
|
|
5803
|
+
@jsii.member(jsii_name="bundle")
|
|
5804
|
+
def bundle(
|
|
5805
|
+
self,
|
|
5806
|
+
*,
|
|
5807
|
+
output_dir: builtins.str,
|
|
5808
|
+
source: builtins.str,
|
|
5809
|
+
) -> "BundleResult":
|
|
5810
|
+
'''(experimental) Produce the artifact and return a {@link BundleResult} describing it.
|
|
5811
|
+
|
|
5812
|
+
Implementations write into ``options.outputDir`` and never write back to
|
|
5813
|
+
``options.source``. The returned path must exist and match its declared
|
|
5814
|
+
shape, or staging rejects it.
|
|
5815
|
+
|
|
5816
|
+
A bundler that cannot run in this environment returns
|
|
5817
|
+
``BundleResult.declined()`` so a {@link ChainBundler} can fall through to
|
|
5818
|
+
the next; a thrown error is a hard failure, not a decline.
|
|
5819
|
+
|
|
5820
|
+
:param output_dir: (experimental) A scratch directory the bundler may write into, owned and created by the caller. The bundler produces its output here (or in a subdirectory) and returns a {@link BundleResult} pointing at the finished artifact — see {@link IAssetBundler.bundle}.
|
|
5821
|
+
:param source: (experimental) Absolute path to the asset's source file or directory. The bundler reads from here and must not modify it. Exclusions (``exclude`` / ``ignoreStrategy``) are already applied: when any are configured this points at a filtered copy, not the original tree, so the bundler reads exactly the file set the asset hash was taken over.
|
|
5822
|
+
|
|
5823
|
+
:stability: experimental
|
|
5824
|
+
'''
|
|
5825
|
+
options = BundleOptions(output_dir=output_dir, source=source)
|
|
5826
|
+
|
|
5827
|
+
return typing.cast("BundleResult", jsii.invoke(self, "bundle", [options]))
|
|
5828
|
+
|
|
5829
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
5830
|
+
typing.cast(typing.Any, IAssetBundler).__jsii_proxy_class__ = lambda : _IAssetBundlerProxy
|
|
5831
|
+
|
|
5832
|
+
|
|
5374
5833
|
@jsii.interface(jsii_type="cdktn.IAssetPackaging")
|
|
5375
5834
|
class IAssetPackaging(typing_extensions.Protocol):
|
|
5376
5835
|
'''(experimental) How a staged asset is produced and what shape it takes on disk.
|
|
@@ -5384,6 +5843,20 @@ class IAssetPackaging(typing_extensions.Protocol):
|
|
|
5384
5843
|
:stability: experimental
|
|
5385
5844
|
'''
|
|
5386
5845
|
|
|
5846
|
+
@builtins.property
|
|
5847
|
+
@jsii.member(jsii_name="acceptsDirectorySource")
|
|
5848
|
+
def accepts_directory_source(self) -> builtins.bool:
|
|
5849
|
+
'''(experimental) Whether ``pack`` accepts a directory as its ``source``.
|
|
5850
|
+
|
|
5851
|
+
Independent of ``producesDirectory`` and ``omitsDirectoryEntries``, both of
|
|
5852
|
+
which describe the output: a ``tar.gz`` packaging takes a directory source
|
|
5853
|
+
yet emits a single file. Bundler output is always a directory, so a
|
|
5854
|
+
packaging that is ``false`` here cannot stage it.
|
|
5855
|
+
|
|
5856
|
+
:stability: experimental
|
|
5857
|
+
'''
|
|
5858
|
+
...
|
|
5859
|
+
|
|
5387
5860
|
@builtins.property
|
|
5388
5861
|
@jsii.member(jsii_name="extension")
|
|
5389
5862
|
def extension(self) -> builtins.str:
|
|
@@ -5431,7 +5904,7 @@ class IAssetPackaging(typing_extensions.Protocol):
|
|
|
5431
5904
|
target: builtins.str,
|
|
5432
5905
|
ignore_strategy: typing.Optional["IIgnoreStrategy"] = None,
|
|
5433
5906
|
) -> None:
|
|
5434
|
-
'''(experimental)
|
|
5907
|
+
'''(experimental) Write the packaged result to ``options.target``.
|
|
5435
5908
|
|
|
5436
5909
|
:param source: (experimental) Path to the resolved (already bundled, if applicable) source.
|
|
5437
5910
|
:param target: (experimental) Path the packaged result should be written to.
|
|
@@ -5456,6 +5929,20 @@ class _IAssetPackagingProxy:
|
|
|
5456
5929
|
|
|
5457
5930
|
__jsii_type__: typing.ClassVar[str] = "cdktn.IAssetPackaging"
|
|
5458
5931
|
|
|
5932
|
+
@builtins.property
|
|
5933
|
+
@jsii.member(jsii_name="acceptsDirectorySource")
|
|
5934
|
+
def accepts_directory_source(self) -> builtins.bool:
|
|
5935
|
+
'''(experimental) Whether ``pack`` accepts a directory as its ``source``.
|
|
5936
|
+
|
|
5937
|
+
Independent of ``producesDirectory`` and ``omitsDirectoryEntries``, both of
|
|
5938
|
+
which describe the output: a ``tar.gz`` packaging takes a directory source
|
|
5939
|
+
yet emits a single file. Bundler output is always a directory, so a
|
|
5940
|
+
packaging that is ``false`` here cannot stage it.
|
|
5941
|
+
|
|
5942
|
+
:stability: experimental
|
|
5943
|
+
'''
|
|
5944
|
+
return typing.cast(builtins.bool, jsii.get(self, "acceptsDirectorySource"))
|
|
5945
|
+
|
|
5459
5946
|
@builtins.property
|
|
5460
5947
|
@jsii.member(jsii_name="extension")
|
|
5461
5948
|
def extension(self) -> builtins.str:
|
|
@@ -5503,7 +5990,7 @@ class _IAssetPackagingProxy:
|
|
|
5503
5990
|
target: builtins.str,
|
|
5504
5991
|
ignore_strategy: typing.Optional["IIgnoreStrategy"] = None,
|
|
5505
5992
|
) -> None:
|
|
5506
|
-
'''(experimental)
|
|
5993
|
+
'''(experimental) Write the packaged result to ``options.target``.
|
|
5507
5994
|
|
|
5508
5995
|
:param source: (experimental) Path to the resolved (already bundled, if applicable) source.
|
|
5509
5996
|
:param target: (experimental) Path the packaged result should be written to.
|
|
@@ -12231,7 +12718,7 @@ class StagedAsset:
|
|
|
12231
12718
|
asset ends up — a bucket name, an object key, a URL — is resolved at
|
|
12232
12719
|
apply time and belongs on the publisher's own reference type instead.
|
|
12233
12720
|
|
|
12234
|
-
:param asset_hash: (experimental) A hash on the content source
|
|
12721
|
+
:param asset_hash: (experimental) A hash on the content source, uniquely identifying this asset. The asset is not rebuilt or republished while this value is unchanged.
|
|
12235
12722
|
:param is_directory: (experimental) Whether the staged artifact is a directory rather than a single file. Publishers branch on this to decide whether they upload one object or sync a tree; see ``IAssetPackaging.producesDirectory``.
|
|
12236
12723
|
:param path: (experimental) The path to the staged artifact, relative to the stack directory.
|
|
12237
12724
|
|
|
@@ -12250,11 +12737,9 @@ class StagedAsset:
|
|
|
12250
12737
|
|
|
12251
12738
|
@builtins.property
|
|
12252
12739
|
def asset_hash(self) -> builtins.str:
|
|
12253
|
-
'''(experimental) A hash on the content source.
|
|
12740
|
+
'''(experimental) A hash on the content source, uniquely identifying this asset.
|
|
12254
12741
|
|
|
12255
|
-
|
|
12256
|
-
asset throughout the system. If this value doesn't change, the asset will
|
|
12257
|
-
not be rebuilt or republished.
|
|
12742
|
+
The asset is not rebuilt or republished while this value is unchanged.
|
|
12258
12743
|
|
|
12259
12744
|
:stability: experimental
|
|
12260
12745
|
'''
|
|
@@ -13145,6 +13630,7 @@ class TerraformAsset(
|
|
|
13145
13630
|
path: builtins.str,
|
|
13146
13631
|
asset_hash: typing.Optional[builtins.str] = None,
|
|
13147
13632
|
asset_hash_type: typing.Optional["AssetHashType"] = None,
|
|
13633
|
+
bundler: typing.Optional["IAssetBundler"] = None,
|
|
13148
13634
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
13149
13635
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
13150
13636
|
type: typing.Optional["AssetType"] = None,
|
|
@@ -13157,7 +13643,8 @@ class TerraformAsset(
|
|
|
13157
13643
|
:param id: -
|
|
13158
13644
|
:param path:
|
|
13159
13645
|
:param asset_hash:
|
|
13160
|
-
:param asset_hash_type: (experimental) How the ``assetHash`` is derived. ``SOURCE`` (the default) hashes the source path. ``CUSTOM`` uses the ``assetHash`` value verbatim and requires it to be set. ``OUTPUT``
|
|
13646
|
+
:param asset_hash_type: (experimental) How the ``assetHash`` is derived. ``SOURCE`` (the default) hashes the source path. ``CUSTOM`` uses the ``assetHash`` value verbatim and requires it to be set. ``OUTPUT`` hashes the source too, unless a ``bundler`` is set — then it hashes the bundler's built output, which forces an eager build (see ``bundler``). If ``assetHash`` is set, this must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: AssetHashType.SOURCE
|
|
13647
|
+
:param bundler: (experimental) A bundler that builds the source into an artifact before staging. Core ships no bundler; implement ``IAssetBundler`` or use one from a bundler package. Under the default ``SOURCE`` hashing the build is deferred to synth and stays skippable; ``OUTPUT`` hashing builds eagerly to hash the artifact. The bundler's output shape must match ``type``. See ``AssetStagingOptions.bundler``. Default: - the source is staged verbatim, with no build step
|
|
13161
13648
|
:param exclude: (experimental) Paths to exclude from the asset, relative to ``path``. See ``AssetStagingOptions.exclude`` for the accepted forms. Both the computed hash and the staged/packed content honor the exclusion. Default: - nothing is excluded
|
|
13162
13649
|
:param extra_hash: (experimental) Extra information to fold into the hash (e.g. build instructions and other inputs). Default: - no extra hash
|
|
13163
13650
|
:param type:
|
|
@@ -13172,6 +13659,7 @@ class TerraformAsset(
|
|
|
13172
13659
|
path=path,
|
|
13173
13660
|
asset_hash=asset_hash,
|
|
13174
13661
|
asset_hash_type=asset_hash_type,
|
|
13662
|
+
bundler=bundler,
|
|
13175
13663
|
exclude=exclude,
|
|
13176
13664
|
extra_hash=extra_hash,
|
|
13177
13665
|
type=type,
|
|
@@ -13182,11 +13670,10 @@ class TerraformAsset(
|
|
|
13182
13670
|
@builtins.property
|
|
13183
13671
|
@jsii.member(jsii_name="assetHash")
|
|
13184
13672
|
def asset_hash(self) -> builtins.str:
|
|
13185
|
-
'''(experimental) A hash of this asset,
|
|
13673
|
+
'''(experimental) A hash of this asset, available at construction time.
|
|
13186
13674
|
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
hash has changed.
|
|
13675
|
+
Being a plain string, it can be used in construct IDs to force a new
|
|
13676
|
+
resource when the content hash changes.
|
|
13190
13677
|
|
|
13191
13678
|
:stability: experimental
|
|
13192
13679
|
'''
|
|
@@ -13233,6 +13720,7 @@ class TerraformAsset(
|
|
|
13233
13720
|
"path": "path",
|
|
13234
13721
|
"asset_hash": "assetHash",
|
|
13235
13722
|
"asset_hash_type": "assetHashType",
|
|
13723
|
+
"bundler": "bundler",
|
|
13236
13724
|
"exclude": "exclude",
|
|
13237
13725
|
"extra_hash": "extraHash",
|
|
13238
13726
|
"type": "type",
|
|
@@ -13245,6 +13733,7 @@ class TerraformAssetConfig:
|
|
|
13245
13733
|
path: builtins.str,
|
|
13246
13734
|
asset_hash: typing.Optional[builtins.str] = None,
|
|
13247
13735
|
asset_hash_type: typing.Optional["AssetHashType"] = None,
|
|
13736
|
+
bundler: typing.Optional["IAssetBundler"] = None,
|
|
13248
13737
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
13249
13738
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
13250
13739
|
type: typing.Optional["AssetType"] = None,
|
|
@@ -13252,7 +13741,8 @@ class TerraformAssetConfig:
|
|
|
13252
13741
|
'''
|
|
13253
13742
|
:param path:
|
|
13254
13743
|
:param asset_hash:
|
|
13255
|
-
:param asset_hash_type: (experimental) How the ``assetHash`` is derived. ``SOURCE`` (the default) hashes the source path. ``CUSTOM`` uses the ``assetHash`` value verbatim and requires it to be set. ``OUTPUT``
|
|
13744
|
+
:param asset_hash_type: (experimental) How the ``assetHash`` is derived. ``SOURCE`` (the default) hashes the source path. ``CUSTOM`` uses the ``assetHash`` value verbatim and requires it to be set. ``OUTPUT`` hashes the source too, unless a ``bundler`` is set — then it hashes the bundler's built output, which forces an eager build (see ``bundler``). If ``assetHash`` is set, this must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: AssetHashType.SOURCE
|
|
13745
|
+
:param bundler: (experimental) A bundler that builds the source into an artifact before staging. Core ships no bundler; implement ``IAssetBundler`` or use one from a bundler package. Under the default ``SOURCE`` hashing the build is deferred to synth and stays skippable; ``OUTPUT`` hashing builds eagerly to hash the artifact. The bundler's output shape must match ``type``. See ``AssetStagingOptions.bundler``. Default: - the source is staged verbatim, with no build step
|
|
13256
13746
|
:param exclude: (experimental) Paths to exclude from the asset, relative to ``path``. See ``AssetStagingOptions.exclude`` for the accepted forms. Both the computed hash and the staged/packed content honor the exclusion. Default: - nothing is excluded
|
|
13257
13747
|
:param extra_hash: (experimental) Extra information to fold into the hash (e.g. build instructions and other inputs). Default: - no extra hash
|
|
13258
13748
|
:param type:
|
|
@@ -13264,6 +13754,7 @@ class TerraformAssetConfig:
|
|
|
13264
13754
|
check_type(argname="argument path", value=path, expected_type=type_hints["path"])
|
|
13265
13755
|
check_type(argname="argument asset_hash", value=asset_hash, expected_type=type_hints["asset_hash"])
|
|
13266
13756
|
check_type(argname="argument asset_hash_type", value=asset_hash_type, expected_type=type_hints["asset_hash_type"])
|
|
13757
|
+
check_type(argname="argument bundler", value=bundler, expected_type=type_hints["bundler"])
|
|
13267
13758
|
check_type(argname="argument exclude", value=exclude, expected_type=type_hints["exclude"])
|
|
13268
13759
|
check_type(argname="argument extra_hash", value=extra_hash, expected_type=type_hints["extra_hash"])
|
|
13269
13760
|
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
@@ -13274,6 +13765,8 @@ class TerraformAssetConfig:
|
|
|
13274
13765
|
self._values["asset_hash"] = asset_hash
|
|
13275
13766
|
if asset_hash_type is not None:
|
|
13276
13767
|
self._values["asset_hash_type"] = asset_hash_type
|
|
13768
|
+
if bundler is not None:
|
|
13769
|
+
self._values["bundler"] = bundler
|
|
13277
13770
|
if exclude is not None:
|
|
13278
13771
|
self._values["exclude"] = exclude
|
|
13279
13772
|
if extra_hash is not None:
|
|
@@ -13303,10 +13796,9 @@ class TerraformAssetConfig:
|
|
|
13303
13796
|
'''(experimental) How the ``assetHash`` is derived.
|
|
13304
13797
|
|
|
13305
13798
|
``SOURCE`` (the default) hashes the source path. ``CUSTOM`` uses the
|
|
13306
|
-
``assetHash`` value verbatim and requires it to be set. ``OUTPUT``
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
bundler's output once bundling is introduced.
|
|
13799
|
+
``assetHash`` value verbatim and requires it to be set. ``OUTPUT`` hashes the
|
|
13800
|
+
source too, unless a ``bundler`` is set — then it hashes the bundler's
|
|
13801
|
+
built output, which forces an eager build (see ``bundler``).
|
|
13310
13802
|
|
|
13311
13803
|
If ``assetHash`` is set, this must be ``undefined`` or ``AssetHashType.CUSTOM``.
|
|
13312
13804
|
|
|
@@ -13317,6 +13809,23 @@ class TerraformAssetConfig:
|
|
|
13317
13809
|
result = self._values.get("asset_hash_type")
|
|
13318
13810
|
return typing.cast(typing.Optional["AssetHashType"], result)
|
|
13319
13811
|
|
|
13812
|
+
@builtins.property
|
|
13813
|
+
def bundler(self) -> typing.Optional["IAssetBundler"]:
|
|
13814
|
+
'''(experimental) A bundler that builds the source into an artifact before staging.
|
|
13815
|
+
|
|
13816
|
+
Core ships no bundler; implement ``IAssetBundler`` or use one from a bundler
|
|
13817
|
+
package. Under the default ``SOURCE`` hashing the build is deferred to synth
|
|
13818
|
+
and stays skippable; ``OUTPUT`` hashing builds eagerly to hash the artifact.
|
|
13819
|
+
The bundler's output shape must match ``type``. See
|
|
13820
|
+
``AssetStagingOptions.bundler``.
|
|
13821
|
+
|
|
13822
|
+
:default: - the source is staged verbatim, with no build step
|
|
13823
|
+
|
|
13824
|
+
:stability: experimental
|
|
13825
|
+
'''
|
|
13826
|
+
result = self._values.get("bundler")
|
|
13827
|
+
return typing.cast(typing.Optional["IAssetBundler"], result)
|
|
13828
|
+
|
|
13320
13829
|
@builtins.property
|
|
13321
13830
|
def exclude(self) -> typing.Optional[typing.List[builtins.str]]:
|
|
13322
13831
|
'''(experimental) Paths to exclude from the asset, relative to ``path``.
|
|
@@ -19831,23 +20340,14 @@ class AssetStaging(
|
|
|
19831
20340
|
metaclass=jsii.JSIIMeta,
|
|
19832
20341
|
jsii_type="cdktn.AssetStaging",
|
|
19833
20342
|
):
|
|
19834
|
-
'''(experimental) Resolves an asset's identity
|
|
20343
|
+
'''(experimental) Resolves an asset's identity and stages its content to disk.
|
|
19835
20344
|
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
``SOURCE`` and ``OUTPUT`` compute identically here: without a bundler, the
|
|
19843
|
-
"output" of an asset is its source verbatim. A future bundler changes what
|
|
19844
|
-
``OUTPUT`` hashes, not this class.
|
|
19845
|
-
|
|
19846
|
-
The source-tree walk behind ``SOURCE``/``OUTPUT`` is cached per synth (see
|
|
19847
|
-
{@link hashCachesByRoot}), so referencing the same asset from more than one
|
|
19848
|
-
resource or stack hashes it once. ``ASSET_HASH_SALT_CONTEXT_KEY`` folds an
|
|
19849
|
-
app-wide value into every computed hash, for bulk cache-busting across an
|
|
19850
|
-
entire tree rather than one asset's ``extraHash``.
|
|
20345
|
+
The hash is available immediately after construction; the filesystem write
|
|
20346
|
+
is deferred to ``stage()``, the one window where it is safe. Hashing is
|
|
20347
|
+
cached per synth (see {@link hashCachesByRoot}) so an asset referenced from
|
|
20348
|
+
several places is walked once. Without a bundler, ``SOURCE`` and ``OUTPUT`` both
|
|
20349
|
+
hash the source; with one they diverge, as ``AssetStagingOptions.bundler``
|
|
20350
|
+
describes.
|
|
19851
20351
|
|
|
19852
20352
|
:stability: experimental
|
|
19853
20353
|
'''
|
|
@@ -19859,6 +20359,8 @@ class AssetStaging(
|
|
|
19859
20359
|
*,
|
|
19860
20360
|
packaging: "IAssetPackaging",
|
|
19861
20361
|
source_path: builtins.str,
|
|
20362
|
+
bundler: typing.Optional["IAssetBundler"] = None,
|
|
20363
|
+
display_name: typing.Optional[builtins.str] = None,
|
|
19862
20364
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
19863
20365
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
19864
20366
|
ignore_strategy: typing.Optional["IIgnoreStrategy"] = None,
|
|
@@ -19870,10 +20372,12 @@ class AssetStaging(
|
|
|
19870
20372
|
:param id: -
|
|
19871
20373
|
:param packaging: (experimental) How the staged result is produced and shaped. The caller decides this (e.g. from its own ``AssetType``) — ``AssetStaging`` never infers or changes it based on ``exclude``/``extraHash``.
|
|
19872
20374
|
:param source_path: (experimental) Absolute path to the source file or directory. Resolving a relative path against ``cdktf.json`` is the caller's responsibility.
|
|
20375
|
+
:param bundler: (experimental) A bundler that builds the source into an artifact before staging. Under the default ``SOURCE`` hashing the build is deferred to ``stage()`` and stays skippable; ``OUTPUT`` hashing builds eagerly at construction time to hash the artifact, forgoing skippability. The bundler's declared output shape must match the packaging: a ``BundleResult.directory`` needs a directory-accepting packaging, a ``BundleResult.file`` a single-file one (``AssetType.FILE``). The mismatch is caught once the build runs. Default: - the source is staged verbatim, with no build step
|
|
20376
|
+
:param display_name: (experimental) Identifier used in error messages, so they name the user-facing construct (e.g. the ``TerraformAsset``) rather than this internal staging child. Default: - the staging construct's own id
|
|
19873
20377
|
:param exclude: (experimental) Paths to exclude, relative to ``sourcePath``. Cannot be combined with ``ignoreStrategy``, which replaces this matcher rather than layering on top of it. Default: - nothing is excluded
|
|
19874
20378
|
:param extra_hash: (experimental) Extra information to fold into the hash (e.g. build instructions and other inputs). Default: - no extra hash
|
|
19875
20379
|
:param ignore_strategy: (experimental) Exclusion matching, for callers that need ``.gitignore`` / ``.dockerignore`` parity rather than the built-in exact-path / suffix / directory matcher. Default: - ``exclude`` is used with the built-in matcher
|
|
19876
|
-
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``.
|
|
20380
|
+
:param asset_hash: (experimental) Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. The value is used verbatim as the asset hash, and because it names the staged asset file it may only contain letters, digits, ``_``, ``.`` and ``-``. The hash identifies a specific revision of the asset and caches deployment work (packaging, uploading). A custom hash must be updated whenever the asset changes, or some deployments will not be invalidated. Default: - based on ``assetHashType``
|
|
19877
20381
|
:param asset_hash_type: (experimental) Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
|
|
19878
20382
|
|
|
19879
20383
|
:stability: experimental
|
|
@@ -19885,6 +20389,8 @@ class AssetStaging(
|
|
|
19885
20389
|
props = AssetStagingOptions(
|
|
19886
20390
|
packaging=packaging,
|
|
19887
20391
|
source_path=source_path,
|
|
20392
|
+
bundler=bundler,
|
|
20393
|
+
display_name=display_name,
|
|
19888
20394
|
exclude=exclude,
|
|
19889
20395
|
extra_hash=extra_hash,
|
|
19890
20396
|
ignore_strategy=ignore_strategy,
|
|
@@ -19896,12 +20402,13 @@ class AssetStaging(
|
|
|
19896
20402
|
|
|
19897
20403
|
@jsii.member(jsii_name="stage")
|
|
19898
20404
|
def stage(self, target_path: builtins.str) -> None:
|
|
19899
|
-
'''(experimental)
|
|
20405
|
+
'''(experimental) Stage the asset's content to ``targetPath``.
|
|
19900
20406
|
|
|
19901
|
-
Called from the owning
|
|
19902
|
-
|
|
20407
|
+
Called from the owning construct's ``onSynthesize`` hook. Without a bundler
|
|
20408
|
+
the source is packaged verbatim; with one, the bundler's output is, built
|
|
20409
|
+
eagerly for ``OUTPUT`` hashing or deferred to here for ``SOURCE``.
|
|
19903
20410
|
|
|
19904
|
-
:param target_path: -
|
|
20411
|
+
:param target_path: -
|
|
19905
20412
|
|
|
19906
20413
|
:stability: experimental
|
|
19907
20414
|
'''
|
|
@@ -19913,11 +20420,10 @@ class AssetStaging(
|
|
|
19913
20420
|
@builtins.property
|
|
19914
20421
|
@jsii.member(jsii_name="assetHash")
|
|
19915
20422
|
def asset_hash(self) -> builtins.str:
|
|
19916
|
-
'''(experimental) A hash of this asset,
|
|
20423
|
+
'''(experimental) A hash of this asset, available at construction time.
|
|
19917
20424
|
|
|
19918
|
-
|
|
19919
|
-
|
|
19920
|
-
hash has changed.
|
|
20425
|
+
Being a plain string, it can be used in construct IDs to force a new
|
|
20426
|
+
resource when the content hash changes.
|
|
19921
20427
|
|
|
19922
20428
|
:stability: experimental
|
|
19923
20429
|
'''
|
|
@@ -20257,6 +20763,111 @@ class BooleanMapMap(metaclass=jsii.JSIIMeta, jsii_type="cdktn.BooleanMapMap"):
|
|
|
20257
20763
|
jsii.set(self, "terraformResource", value) # pyright: ignore[reportArgumentType]
|
|
20258
20764
|
|
|
20259
20765
|
|
|
20766
|
+
@jsii.implements(IAssetBundler)
|
|
20767
|
+
class ChainBundler(metaclass=jsii.JSIIMeta, jsii_type="cdktn.ChainBundler"):
|
|
20768
|
+
'''(experimental) Composes bundlers into a "try each in order until one runs" chain.
|
|
20769
|
+
|
|
20770
|
+
This is how a local bundler and a Docker bundler compose without being
|
|
20771
|
+
rewritten as one: each leg declines (``BundleResult.declined()``) when it
|
|
20772
|
+
cannot run here, and the chain moves to the next. The first non-declining
|
|
20773
|
+
result wins; if all decline, ``bundle`` throws, since staging has nothing to
|
|
20774
|
+
fall back to. Each leg builds into its own output directory, so a leg that
|
|
20775
|
+
writes before declining cannot leak partial files into the leg that wins.
|
|
20776
|
+
|
|
20777
|
+
The chain's ``bundlerKey`` folds in *every* leg's key, so identity is the same
|
|
20778
|
+
regardless of which leg ends up running — a build that could have gone local
|
|
20779
|
+
or Docker is one asset, not two.
|
|
20780
|
+
|
|
20781
|
+
This makes the legs interchangeable only if they produce equivalent output.
|
|
20782
|
+
Under ``SOURCE`` hashing they must: a machine with a host tool and one without
|
|
20783
|
+
run different legs, and non-equivalent legs would stage different bytes under
|
|
20784
|
+
the same hash. Use ``OUTPUT`` hashing when legs may diverge, so identity tracks
|
|
20785
|
+
the artifact each leg actually produced.
|
|
20786
|
+
|
|
20787
|
+
:stability: experimental
|
|
20788
|
+
'''
|
|
20789
|
+
|
|
20790
|
+
@jsii.member(jsii_name="of")
|
|
20791
|
+
@builtins.classmethod
|
|
20792
|
+
def of(cls, *bundlers: "IAssetBundler") -> "ChainBundler":
|
|
20793
|
+
'''(experimental) Chain bundlers in the order given;
|
|
20794
|
+
|
|
20795
|
+
earlier bundlers are preferred.
|
|
20796
|
+
|
|
20797
|
+
:param bundlers: -
|
|
20798
|
+
|
|
20799
|
+
:stability: experimental
|
|
20800
|
+
'''
|
|
20801
|
+
if __debug__:
|
|
20802
|
+
type_hints = cached_type_hints(_typecheckingstub__f90bbf7276852d6eae454e98f7945b00bbfa6b5451b7f6bda28e77371cec3e96)
|
|
20803
|
+
check_type(argname="argument bundlers", value=bundlers, expected_type=typing.Tuple[type_hints["bundlers"], ...]) # pyright: ignore [reportGeneralTypeIssues]
|
|
20804
|
+
return typing.cast("ChainBundler", jsii.sinvoke(cls, "of", [*bundlers]))
|
|
20805
|
+
|
|
20806
|
+
@jsii.member(jsii_name="bundle")
|
|
20807
|
+
def bundle(
|
|
20808
|
+
self,
|
|
20809
|
+
*,
|
|
20810
|
+
output_dir: builtins.str,
|
|
20811
|
+
source: builtins.str,
|
|
20812
|
+
) -> "BundleResult":
|
|
20813
|
+
'''(experimental) Produce the artifact and return a {@link BundleResult} describing it.
|
|
20814
|
+
|
|
20815
|
+
Implementations write into ``options.outputDir`` and never write back to
|
|
20816
|
+
``options.source``. The returned path must exist and match its declared
|
|
20817
|
+
shape, or staging rejects it.
|
|
20818
|
+
|
|
20819
|
+
A bundler that cannot run in this environment returns
|
|
20820
|
+
``BundleResult.declined()`` so a {@link ChainBundler} can fall through to
|
|
20821
|
+
the next; a thrown error is a hard failure, not a decline.
|
|
20822
|
+
|
|
20823
|
+
:param output_dir: (experimental) A scratch directory the bundler may write into, owned and created by the caller. The bundler produces its output here (or in a subdirectory) and returns a {@link BundleResult} pointing at the finished artifact — see {@link IAssetBundler.bundle}.
|
|
20824
|
+
:param source: (experimental) Absolute path to the asset's source file or directory. The bundler reads from here and must not modify it. Exclusions (``exclude`` / ``ignoreStrategy``) are already applied: when any are configured this points at a filtered copy, not the original tree, so the bundler reads exactly the file set the asset hash was taken over.
|
|
20825
|
+
|
|
20826
|
+
:stability: experimental
|
|
20827
|
+
'''
|
|
20828
|
+
options = BundleOptions(output_dir=output_dir, source=source)
|
|
20829
|
+
|
|
20830
|
+
return typing.cast("BundleResult", jsii.invoke(self, "bundle", [options]))
|
|
20831
|
+
|
|
20832
|
+
@builtins.property
|
|
20833
|
+
@jsii.member(jsii_name="bundlerKey")
|
|
20834
|
+
def bundler_key(self) -> typing.Optional[builtins.str]:
|
|
20835
|
+
'''(experimental) A value identifying the build, folded into the asset hash.
|
|
20836
|
+
|
|
20837
|
+
The source tree alone cannot see the build, so swapping a ``node:18`` base
|
|
20838
|
+
image for ``node:20`` would otherwise leave identity unchanged. Under
|
|
20839
|
+
``SOURCE`` hashing this is the only channel by which the build reaches
|
|
20840
|
+
identity, so it must serialize every input that can move the output, or a
|
|
20841
|
+
changed build silently reuses a stale artifact. {@link BundlerKey} builds
|
|
20842
|
+
one from an ordered set of parts.
|
|
20843
|
+
|
|
20844
|
+
Mirrors {@link IIgnoreStrategy.cacheKey}: omit it when the build cannot be
|
|
20845
|
+
summarized as a string, and fall back to ``extraHash``.
|
|
20846
|
+
|
|
20847
|
+
:stability: experimental
|
|
20848
|
+
'''
|
|
20849
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "bundlerKey"))
|
|
20850
|
+
|
|
20851
|
+
@builtins.property
|
|
20852
|
+
@jsii.member(jsii_name="outputFileName")
|
|
20853
|
+
def output_file_name(self) -> typing.Optional[builtins.str]:
|
|
20854
|
+
'''(experimental) The name a single-file artifact is staged under (e.g. ``archive.zip``).
|
|
20855
|
+
|
|
20856
|
+
A file-producing bundler (``BundleResult.file``) staged with
|
|
20857
|
+
``AssetType.FILE`` would otherwise take the source path's basename, which is
|
|
20858
|
+
a directory name when the source is a directory. Declaring the name here
|
|
20859
|
+
lets the artifact reflect what the bundler produces. It is static
|
|
20860
|
+
configuration, needed at construction before a deferred ``SOURCE`` build
|
|
20861
|
+
runs, not the file's runtime name.
|
|
20862
|
+
|
|
20863
|
+
Valid only for a file-producing bundler: setting it with a directory
|
|
20864
|
+
packaging (anything but ``AssetType.FILE``) is rejected at construction.
|
|
20865
|
+
|
|
20866
|
+
:stability: experimental
|
|
20867
|
+
'''
|
|
20868
|
+
return typing.cast(typing.Optional[builtins.str], jsii.get(self, "outputFileName"))
|
|
20869
|
+
|
|
20870
|
+
|
|
20260
20871
|
@jsii.implements(IInterpolatingParent, IResolvable, ITerraformAddressable)
|
|
20261
20872
|
class ComplexComputedList(
|
|
20262
20873
|
metaclass=jsii.JSIIMeta,
|
|
@@ -29244,6 +29855,11 @@ __all__ = [
|
|
|
29244
29855
|
"BooleanMap",
|
|
29245
29856
|
"BooleanMapList",
|
|
29246
29857
|
"BooleanMapMap",
|
|
29858
|
+
"BundleOptions",
|
|
29859
|
+
"BundleOutputType",
|
|
29860
|
+
"BundleResult",
|
|
29861
|
+
"BundlerKey",
|
|
29862
|
+
"ChainBundler",
|
|
29247
29863
|
"CloudBackend",
|
|
29248
29864
|
"CloudBackendConfig",
|
|
29249
29865
|
"CloudWorkspace",
|
|
@@ -29295,6 +29911,7 @@ __all__ = [
|
|
|
29295
29911
|
"IAnyProducer",
|
|
29296
29912
|
"IAspect",
|
|
29297
29913
|
"IAsset",
|
|
29914
|
+
"IAssetBundler",
|
|
29298
29915
|
"IAssetPackaging",
|
|
29299
29916
|
"IFragmentConcatenator",
|
|
29300
29917
|
"IIgnoreStrategy",
|
|
@@ -29555,6 +30172,8 @@ def _typecheckingstub__5026244ff290924dad88f65421d8025b8bcb105d693dec43cd93a0c7d
|
|
|
29555
30172
|
asset_hash_type: typing.Optional[AssetHashType] = None,
|
|
29556
30173
|
packaging: IAssetPackaging,
|
|
29557
30174
|
source_path: builtins.str,
|
|
30175
|
+
bundler: typing.Optional[IAssetBundler] = None,
|
|
30176
|
+
display_name: typing.Optional[builtins.str] = None,
|
|
29558
30177
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
29559
30178
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
29560
30179
|
ignore_strategy: typing.Optional[IIgnoreStrategy] = None,
|
|
@@ -29593,6 +30212,44 @@ def _typecheckingstub__912173407c419eae209032e0ac104680f082bb5aad4825d0e858e8efc
|
|
|
29593
30212
|
"""Type checking stubs"""
|
|
29594
30213
|
pass
|
|
29595
30214
|
|
|
30215
|
+
def _typecheckingstub__e4984c7b158b6fd9f304d19bf1be6b525991aa5c57db01aa1dd6d282c3369f9e(
|
|
30216
|
+
*,
|
|
30217
|
+
output_dir: builtins.str,
|
|
30218
|
+
source: builtins.str,
|
|
30219
|
+
) -> None:
|
|
30220
|
+
"""Type checking stubs"""
|
|
30221
|
+
pass
|
|
30222
|
+
|
|
30223
|
+
def _typecheckingstub__cb448e5d937b8e66717fe97ab740ea1924edd313428fa2e65c41a3f2d7c1a24c(
|
|
30224
|
+
path: builtins.str,
|
|
30225
|
+
) -> None:
|
|
30226
|
+
"""Type checking stubs"""
|
|
30227
|
+
pass
|
|
30228
|
+
|
|
30229
|
+
def _typecheckingstub__e6adf0d1d61dee6269a50f7bde47aef784df796b53286fb04ab6c071a75d6975(
|
|
30230
|
+
path: builtins.str,
|
|
30231
|
+
) -> None:
|
|
30232
|
+
"""Type checking stubs"""
|
|
30233
|
+
pass
|
|
30234
|
+
|
|
30235
|
+
def _typecheckingstub__76b2ba8d3e61fcbea83025fd36866ed49e2970a52cbe09f43be16a01cf5a6858(
|
|
30236
|
+
*parts: builtins.str,
|
|
30237
|
+
) -> None:
|
|
30238
|
+
"""Type checking stubs"""
|
|
30239
|
+
pass
|
|
30240
|
+
|
|
30241
|
+
def _typecheckingstub__5542e2e8a7f529585fff07dcaf5ca7a0425baa3a9af1286723c0b3fb21d976c6(
|
|
30242
|
+
*parts: builtins.str,
|
|
30243
|
+
) -> None:
|
|
30244
|
+
"""Type checking stubs"""
|
|
30245
|
+
pass
|
|
30246
|
+
|
|
30247
|
+
def _typecheckingstub__89d2ee0220c33c5357157d502001eb29e4d7acc5dd0985be2aeb7f269d3ef50b(
|
|
30248
|
+
entries: typing.Mapping[builtins.str, builtins.str],
|
|
30249
|
+
) -> None:
|
|
30250
|
+
"""Type checking stubs"""
|
|
30251
|
+
pass
|
|
30252
|
+
|
|
29596
30253
|
def _typecheckingstub__4c43a277c741c97005cffe2a27390aad01d95fded1b13c16a35f07ccaec84f7a(
|
|
29597
30254
|
*,
|
|
29598
30255
|
organization: builtins.str,
|
|
@@ -31530,6 +32187,7 @@ def _typecheckingstub__6f29998a5dacee0da3977e8d51379662670eb6942990ac7e6e052ab5e
|
|
|
31530
32187
|
path: builtins.str,
|
|
31531
32188
|
asset_hash: typing.Optional[builtins.str] = None,
|
|
31532
32189
|
asset_hash_type: typing.Optional[AssetHashType] = None,
|
|
32190
|
+
bundler: typing.Optional[IAssetBundler] = None,
|
|
31533
32191
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
31534
32192
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
31535
32193
|
type: typing.Optional[AssetType] = None,
|
|
@@ -31548,6 +32206,7 @@ def _typecheckingstub__e7a613b39a707470fb3fa76a5d5d750aa8285bec8b92786190d69d5b7
|
|
|
31548
32206
|
path: builtins.str,
|
|
31549
32207
|
asset_hash: typing.Optional[builtins.str] = None,
|
|
31550
32208
|
asset_hash_type: typing.Optional[AssetHashType] = None,
|
|
32209
|
+
bundler: typing.Optional[IAssetBundler] = None,
|
|
31551
32210
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
31552
32211
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
31553
32212
|
type: typing.Optional[AssetType] = None,
|
|
@@ -32940,6 +33599,8 @@ def _typecheckingstub__a694062800c2f527dfda0d5a21ceaa0607085c2bef7277ea0a3217058
|
|
|
32940
33599
|
*,
|
|
32941
33600
|
packaging: IAssetPackaging,
|
|
32942
33601
|
source_path: builtins.str,
|
|
33602
|
+
bundler: typing.Optional[IAssetBundler] = None,
|
|
33603
|
+
display_name: typing.Optional[builtins.str] = None,
|
|
32943
33604
|
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
32944
33605
|
extra_hash: typing.Optional[builtins.str] = None,
|
|
32945
33606
|
ignore_strategy: typing.Optional[IIgnoreStrategy] = None,
|
|
@@ -33049,6 +33710,12 @@ def _typecheckingstub__fc66bb069d4f417396a421b3c709177b54ebf2b757f3965e92709f83a
|
|
|
33049
33710
|
"""Type checking stubs"""
|
|
33050
33711
|
pass
|
|
33051
33712
|
|
|
33713
|
+
def _typecheckingstub__f90bbf7276852d6eae454e98f7945b00bbfa6b5451b7f6bda28e77371cec3e96(
|
|
33714
|
+
*bundlers: IAssetBundler,
|
|
33715
|
+
) -> None:
|
|
33716
|
+
"""Type checking stubs"""
|
|
33717
|
+
pass
|
|
33718
|
+
|
|
33052
33719
|
def _typecheckingstub__383f75d3115cefe50368b79b9cef65b6997c768310bb192c74f470cf288d8b78(
|
|
33053
33720
|
terraform_resource: IInterpolatingParent,
|
|
33054
33721
|
terraform_attribute: builtins.str,
|
|
@@ -34874,5 +35541,5 @@ def _typecheckingstub__0930e68f78776f6767a34b896806a2c7f0841f069ff5f5b3f5b121add
|
|
|
34874
35541
|
"""Type checking stubs"""
|
|
34875
35542
|
pass
|
|
34876
35543
|
|
|
34877
|
-
for cls in [IAnyProducer, IAspect, IAsset, IAssetPackaging, IFragmentConcatenator, IIgnoreStrategy, IImportableConfig, IInterpolatingParent, IListProducer, IManifest, INumberProducer, IPostProcessor, IRemoteWorkspace, IResolvable, IResolveContext, IResource, IResourceConstructor, IScopeCallback, IStackSynthesizer, IStringProducer, ISynthesisSession, ITerraformAddressable, ITerraformDependable, ITerraformEphemeralResource, ITerraformIterator, ITerraformResource, ITokenMapper, ITokenResolver]:
|
|
35544
|
+
for cls in [IAnyProducer, IAspect, IAsset, IAssetBundler, IAssetPackaging, IFragmentConcatenator, IIgnoreStrategy, IImportableConfig, IInterpolatingParent, IListProducer, IManifest, INumberProducer, IPostProcessor, IRemoteWorkspace, IResolvable, IResolveContext, IResource, IResourceConstructor, IScopeCallback, IStackSynthesizer, IStringProducer, ISynthesisSession, ITerraformAddressable, ITerraformDependable, ITerraformEphemeralResource, ITerraformIterator, ITerraformResource, ITokenMapper, ITokenResolver]:
|
|
34878
35545
|
typing.cast(typing.Any, cls).__protocol_attrs__ = typing.cast(typing.Any, cls).__protocol_attrs__ - set(['__jsii_proxy_class__', '__jsii_type__'])
|
|
Binary file
|
|
@@ -11,5 +11,5 @@ src/cdktn.egg-info/dependency_links.txt
|
|
|
11
11
|
src/cdktn.egg-info/requires.txt
|
|
12
12
|
src/cdktn.egg-info/top_level.txt
|
|
13
13
|
src/cdktn/_jsii/__init__.py
|
|
14
|
-
src/cdktn/_jsii/cdktn@0.25.0-pre.
|
|
14
|
+
src/cdktn/_jsii/cdktn@0.25.0-pre.40.jsii.tgz
|
|
15
15
|
src/cdktn/testing_matchers/__init__.py
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|