Skip to content

(aws cdk lib): CloudFormationDeployments missing in aws-cdk-lib #18211

@dreamorosi

Description

@dreamorosi

General 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-cdk-libRelated to the aws-cdk-lib packageeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions