(aws cdk lib): CloudFormationDeployments missing in aws-cdk-lib
See original GitHub issueGeneral Issue
Unable to find CloudFormationDeployments
from v1 (exported in 'aws-cdk/lib/api/cloudformation-deployments'
) in aws-cdk-lib
(v2)
The Question
While writing some e2e tests for a library we are using CDK to provision different stacks for each suite to test the behaviour of our library in an actual Lambda execution environment. We are already able to do so using CDK v1 using something along the lines of:
import { App, Stack } from '@aws-cdk/core';
import { SdkProvider } from 'aws-cdk/lib/api/aws-auth';
import { CloudFormationDeployments } from 'aws-cdk/lib/api/cloudformation-deployments';
const integTestApp = new App();
const stack = new Stack(integTestApp, 'ExampleIntegTest');
// Add Constructs
const stackArtifact = integTestApp.synth().getStackByName(stack.stackName);
const sdkProvider = await SdkProvider.withAwsCliCompatibleDefaults({
profile: process.env.AWS_PROFILE,
});
const cloudFormation = new CloudFormationDeployments({ sdkProvider });
await cloudFormation.deployStack({
stack: stackArtifact,
});
We would like to migrate this to aws-cdk-lib
(v2) to get the benefits of the newer version but we are unable to find SdkProvider
and CloudFormationDeployments
in the new version, could you confirm their presence and/or provide an alternative for v2?
CDK CLI Version
N/A
Framework Version
2.3.0
Node.js Version
N/A
OS
N/A
Language
Typescript
Language Version
N/A
Other information
Alternatively we have considered using the CloudFormation client from aws-sdk
to deploy the synthesised template but in doing so we would lose the hotswap
feature which we are using while writing the tests to iterate faster.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:8 (6 by maintainers)
Top GitHub Comments
@rix0rrr @peterwoodworth any chance we could get an answer on whether this is in the plans or not?
Not asking for any kind of ETA, just would like to know if this is something that might become exposed again or if we should just stick with v1 / find an alternative.
We are using this in awslabs/aws-lambda-powertools-typescript to run our end to end tests and being able to migrate to
aws-cdk-lib
would allow us to manage only one dependency instead of having to bump all the@aws-cdk/aws-*
ones from v1.I’ve been using
SdkProvider
andCloudFormationDeployments
to wrap a service around CDK to deploy templated infrastructure on demand. My usage pattern is to useCloudFormationDeployments
to upload assets and prepare a CloudFormation change-set, and then use the standard CloudFormation API to execute and monitor that change-set using SNS notifications.Was aware from the start that these are not in the official API and might be changed without warning - but they are useful nonetheless as without it I would need to replicate all the CDK-specific business logic.
The high-level requirement would be something like: Provide a way to get from
.synth()
- which produces aCloudAssembly
- to one or more CloudFormation change-sets that can be invoked as normal.I can live without all the monitoring functionality, as that’s really more geared to the CLI.