https://github.com/sourcefuse/arc-cdk
https://github.com/sourcefuse/arc-cdk
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sourcefuse/arc-cdk
- Owner: sourcefuse
- License: apache-2.0
- Created: 2023-01-15T16:53:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-21T22:50:52.000Z (about 1 year ago)
- Last Synced: 2025-08-01T05:55:57.019Z (6 months ago)
- Language: TypeScript
- Size: 359 KB
- Stars: 2
- Watchers: 7
- Forks: 3
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arc-cdk
This package contains cdktf constructs for easily creating AWS infrastructure.
### Installation
```bash
npm install arc-cdk
```
## Available Constructs
- apiGatewayCustomDomainName
- createAcmCertificate
- createEcrImage
- createEcrRepository
- createLambdaRole
- dbModule
- elastiCache
- lambda
- lambdaWithApiGateway
- lambdaWithCloudWatchEvent
- lambdaWithSns
- lambdaWithSqs
Refer [API.md](https://github.com/sourcefuse/arc-cdk/blob/main/API.md) file for API reference.
### Example
```ts
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
) {
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();
```