Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@nrfcloud/benthos-cdk
Advanced tools
A compatibility layer for using the CDK for Terraform with AWS CDK constructs
The CDK for Terraform is a great tool for managing infrastructure, but it lacks the ecosystem of constructs that the AWS CDK has. This tool allows you to use the excellent aws-cdk-lib construct library, while also getting access to the benefits of terraform. Think of provisioning a CockroachDB cloud cluster and connecting it to a lambda using the high level nodejs function construct in the same stack.
Yes, but it's in technical preview and missing many essential features. It also doesn't seem to be actively maintained.
Essentially, just use the provided AwsTerraformAdaptorStack
class as your base stack class instead of TerraformStack
import {AwsTerraformAdaptorStack} from "./cdk-adaptor-stack";
import {Bucket} from "aws-cdk-lib";
import {S3Bucket} from "@cdktf/provider-aws/lib/s3-bucket/index.js";
import {S3BucketObject} from "@cdktf/provider-aws/lib/s3-bucket-object";
class MyStack extends AwsTerraformAdaptorStack {
constructor(scope: Construct, id: string, region: string) {
super(scope, id, region);
// You can instantiate AWS CDK constructs as normal
const bucket = new Bucket(this, 'MyBucket', {
bucket: 'my-bucket',
});
// You can also instantiate CDK for Terraform constructs
// Bidirectional references between the two are automatically created
const tfBucket = new S3BucketObject(this, 'MyTfBucket', {
bucket: bucket.bucketName,
key: 'my-tf-bucket',
source: 'my-tf-bucket',
});
}
}
Internally, the adaptor tries to use the CloudControl api for 1-1 compatibility with Cloudformation. In some cases this is enough, but in many others explicit resource mappings are required. The adaptor ships with a good variety of these mappings, but it is not exhaustive.
If you encounter an error like No resource mapping found for <resource type>
, you can add a mapping for it like so:
// Map between a L1 Cloudformation construct and a CDK for Terraform construct
registerMappingTyped(CfnBucketPolicy, S3BucketPolicy, {
resource(scope, id, props) {
return new S3BucketPolicy(
scope,
id,
deleteUndefinedKeys({
// ALL keys of the provided construct must be mapped
policy: Fn.jsonencode(props.PolicyDocument),
bucket: props.Bucket,
}),
);
},
attributes: {
// ALL attributes of the provided construct must be mapped
Ref: (resource) => resource.id,
},
});
The Cloudcontrol api is theoretically a stable crud API 1-1 with cloudformation, but it in practice it has some quirks. Update operations in particular seems to break with alarming regularity, so explicit mappings are preferred, especially for complex resources.
0.2.0
FAQs
AWS CDK constructs for serverless Benthos
The npm package @nrfcloud/benthos-cdk receives a total of 40 weekly downloads. As such, @nrfcloud/benthos-cdk popularity was classified as not popular.
We found that @nrfcloud/benthos-cdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.