Class CloudAssembly
- All Implemented Interfaces:
ICloudAssembly,software.amazon.jsii.JsiiSerializable
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cxapi.*;
CloudAssembly cloudAssembly = CloudAssembly.Builder.create("directory")
.skipEnumCheck(false)
.skipVersionCheck(false)
.topoSort(false)
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.cloud_assembly_schema.ICloudAssembly
ICloudAssembly.Jsii$Default, ICloudAssembly.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionCloudAssembly(String directory) Reads a cloud assembly from the specified directory.CloudAssembly(String directory, LoadManifestOptions loadOptions) Reads a cloud assembly from the specified directory.protectedCloudAssembly(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCloudAssembly(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCleans up any temporary assembly directories that got created in this process.All artifacts included in this assembly.The root directory of the cloud assembly.The raw assembly manifest.The nested assembly artifacts in this assembly.getNestedAssembly(String artifactId) Returns a nested assembly.getNestedAssemblyArtifact(String artifactId) Returns a nested assembly artifact.Runtime information such as module versions used to synthesize this assembly.getStackArtifact(String artifactId) Returns a CloudFormation stack artifact from this assembly.getStackByName(String stackName) Returns a CloudFormation stack artifact from this assembly.Returns all the stacks, including the ones in nested assemblies.The schema version of the assembly manifest.static BooleanReturn whether the given object is a CloudAssembly.tree()Returns the tree metadata artifact from this assembly.tryGetArtifact(String id) Attempts to find an artifact with a specific identity.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CloudAssembly
protected CloudAssembly(software.amazon.jsii.JsiiObjectRef objRef) -
CloudAssembly
protected CloudAssembly(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CloudAssembly
@Stability(Stable) public CloudAssembly(@NotNull String directory, @Nullable LoadManifestOptions loadOptions) Reads a cloud assembly from the specified directory.- Parameters:
directory- The root directory of the assembly. This parameter is required.loadOptions-
-
CloudAssembly
Reads a cloud assembly from the specified directory.- Parameters:
directory- The root directory of the assembly. This parameter is required.
-
-
Method Details
-
cleanupTemporaryDirectories
@Stability(Stable) public static void cleanupTemporaryDirectories()Cleans up any temporary assembly directories that got created in this process.If a Cloud Assembly is emitted to a temporary directory, its directory gets added to a list. This function iterates over that list and deletes each directory in it, to free up disk space.
This function will normally be called automatically during Node process exit and so you don't need to call this. However, some test environments do not properly trigger Node's
exitevent. Notably: Jest does not trigger theexitevent (https://github.com/jestjs/jest/issues/10927).Cleaning up temporary directories in jest
For Jest, you have to make sure this function is called at the end of the test suite instead:
import { CloudAssembly } from 'aws-cdk-lib/cx-api'; afterAll(CloudAssembly.cleanupTemporaryDirectories);Alternatively, you can use the
setupFilesAfterEnvfeature and use a provided helper script to automatically inject the above into every test file, so you don't have to do it by hand.$ npx jest --setupFilesAfterEnv aws-cdk-lib/testhelpers/jest-autoclean
Or put the following into
jest.config.js:module.exports = { // ... setupFilesAfterEnv: ['aws-cdk-lib/testhelpers/jest-cleanup'], }; -
isCloudAssembly
Return whether the given object is a CloudAssembly.We do attribute detection since we can't reliably use 'instanceof'.
- Parameters:
x- This parameter is required.
-
getNestedAssembly
Returns a nested assembly.- Parameters:
artifactId- The artifact ID of the nested assembly. This parameter is required.
-
getNestedAssemblyArtifact
@Stability(Stable) @NotNull public NestedCloudAssemblyArtifact getNestedAssemblyArtifact(@NotNull String artifactId) Returns a nested assembly artifact.- Parameters:
artifactId- The artifact ID of the nested assembly. This parameter is required.
-
getStackArtifact
@Stability(Stable) @NotNull public CloudFormationStackArtifact getStackArtifact(@NotNull String artifactId) Returns a CloudFormation stack artifact from this assembly.- Parameters:
artifactId- the artifact id of the stack (can be obtained throughstack.artifactId). This parameter is required.- Returns:
- a
CloudFormationStackArtifactobject.
-
getStackByName
@Stability(Stable) @NotNull public CloudFormationStackArtifact getStackByName(@NotNull String stackName) Returns a CloudFormation stack artifact from this assembly.Will only search the current assembly.
- Parameters:
stackName- the name of the CloudFormation stack. This parameter is required.- Returns:
- a
CloudFormationStackArtifactobject.
-
tree
Returns the tree metadata artifact from this assembly.- Returns:
- a
TreeCloudArtifactobject if there is one defined in the manifest,undefinedotherwise.
-
tryGetArtifact
Attempts to find an artifact with a specific identity.- Parameters:
id- The artifact ID. This parameter is required.- Returns:
- A
CloudArtifactobject orundefinedif the artifact does not exist in this assembly.
-
getArtifacts
All artifacts included in this assembly. -
getDirectory
The root directory of the cloud assembly.- Specified by:
getDirectoryin interfaceICloudAssembly
-
getManifest
The raw assembly manifest. -
getNestedAssemblies
The nested assembly artifacts in this assembly. -
getRuntime
Runtime information such as module versions used to synthesize this assembly. -
getStacks
- Returns:
- all the CloudFormation stack artifacts that are included in this assembly.
-
getStacksRecursively
Returns all the stacks, including the ones in nested assemblies. -
getVersion
The schema version of the assembly manifest.
-