Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@aws-cdk/integ-tests-alpha
Advanced tools
The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Suppose you have a simple stack, that only encapsulates a Lambda function with a certain handler:
interface StackUnderTestProps extends StackProps {
functionProps?: lambda.FunctionProps;
}
class StackUnderTest extends Stack {
constructor(scope: Construct, id: string, props: StackUnderTestProps) {
super(scope, id, props);
new lambda.Function(this, 'Handler', {
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
...props.functionProps,
});
}
}
You may want to test this stack under different conditions. For example, we want
this stack to be deployed correctly, regardless of the architecture we choose
for the Lambda function. In particular, it should work for both ARM_64
and
X86_64
. So you can create an IntegTestCase
that exercises both scenarios:
interface StackUnderTestProps extends StackProps {
architecture?: lambda.Architecture;
}
class StackUnderTest extends Stack {
constructor(scope: Construct, id: string, props: StackUnderTestProps) {
super(scope, id, props);
new lambda.Function(this, 'Handler', {
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
architecture: props.architecture,
});
}
}
// Beginning of the test suite
const app = new App();
const stack = new Stack(app, 'stack');
new IntegTestCase(stack, 'DifferentArchitectures', {
stacks: [
new StackUnderTest(app, 'Stack1', {
architecture: lambda.Architecture.ARM_64,
}),
new StackUnderTest(app, 'Stack2', {
architecture: lambda.Architecture.X86_64,
}),
],
});
This is all the instruction you need for the integration test runner to know which stacks to synthesize, deploy and destroy. But you may also need to customize the behavior of the runner by changing its parameters. For example:
const app = new App();
const stackUnderTest = new Stack(app, 'StackUnderTest', /* ... */);
const stack = new Stack(app, 'stack');
new IntegTestCase(stack, 'CustomizedDeploymentWorkflow', {
stacks: [stackUnderTest],
diffAssets: true,
stackUpdateWorkflow: true,
cdkCommandOptions: {
deploy: {
args: {
requireApproval: RequireApproval.NEVER,
json: true,
},
},
destroy: {
args: {
force: true,
},
},
},
});
FAQs
CDK Integration Testing Constructs
The npm package @aws-cdk/integ-tests-alpha receives a total of 30,986 weekly downloads. As such, @aws-cdk/integ-tests-alpha popularity was classified as popular.
We found that @aws-cdk/integ-tests-alpha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.