Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arc-cdk

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc-cdk

This package contains cdktf constructs for easily creating AWS infrastructure.

  • 0.0.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-72%
Maintainers
2
Weekly downloads
 
Created
Source

arc-cdk

This package contains cdktf constructs for easily creating AWS infrastructure.

Installation

npm install arc-cdk

Available Constructs

  • apiGatewayCustomDomainName
  • createAcmCertificate
  • createEcrImage
  • createEcrRepository
  • createLambdaRole
  • dbModule
  • elastiCache
  • lambda
  • lambdaWithApiGateway
  • lambdaWithCloudWatchEvent
  • lambdaWithSns
  • lambdaWithSqs

Refer API.md file for API reference.

Example

import * as aws from "@cdktf/provider-aws";
import * as random from "@cdktf/provider-random";
import { App, TerraformStack } from "cdktf";
import { Construct } from "constructs";
import * as dotenv from "dotenv";
import { resolve } from "path";
import { ILambda, Lambda } from "arc-cdk";

dotenv.config();
export class LambdaStack extends TerraformStack {
  constructor(
    scope: Construct,
    id: string,
    config: Omit<ILambda, "name">
  ) {
    super(scope, id);

    new aws.provider.AwsProvider(this, "aws", {
      region: process.env.AWS_REGION,
      accessKey: process.env.AWS_ACCESS_KEY_ID,
      secretKey: process.env.AWS_SECRET_ACCESS_KEY,
      profile: process.env.AWS_PROFILE,
      assumeRole: [
        {
          roleArn: process.env.AWS_ROLE_ARN,
        },
      ],
    });
    new random.provider.RandomProvider(this, "random");

    const pet = new random.pet.Pet(this, "random-name", {
      length: 2,
    });

    new Lambda(this, "lambda", {
      ...config,
      name: pet.id,
    });
  }
}

const app = new App();
new LambdaStack(app, "example", {
  codePath: resolve(__dirname, "../dist"),
  layerPath: resolve(__dirname, "../layers"),
  handler: "cron.handler",
  runtime: "nodejs16.x",
  namespace: process.env.NAMESPACE || "arc",
  environment: process.env.ENV || "dev",
});
app.synth();

Keywords

FAQs

Package last updated on 04 Mar 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc