Skip to content

Instantly share code, notes, and snippets.

View cagingulsen's full-sized avatar
🌩️
Focusing

Kemal Cagin Gulsen cagingulsen

🌩️
Focusing
View GitHub Profile
import * as cdk from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import { LambdaStack } from '../src/main';
test('Lambda created', () => {
const app = new cdk.App();
const stack = new LambdaStack(app, 'LambdaStack');
const template = Template.fromStack(stack);
template.resourceCountIs('AWS::Lambda::Function', 1);
const { awscdk } = require('projen');
const project = new awscdk.AwsCdkTypeScriptApp({
authorAddress: 'cagingulsen@gmail.com',
authorName: 'Kemal Cagin Gulsen',
cdkVersion: '2.8.0',
defaultReleaseBranch: 'main',
name: 'prod-ready-cdk',
description: 'A CDK project for my blog posts',
repositoryUrl: 'https://github.com/cagingulsen/prod-ready-cdk.git',
keywords: [
const { AwsCdkTypeScriptApp } = require('projen');
const project = new AwsCdkTypeScriptApp({
cdkVersion: '1.95.2',
defaultReleaseBranch: 'main',
name: 'prod-ready-cdk',
// cdkDependencies: undefined, /* Which AWS CDK modules (those that start with "@aws-cdk/") this app uses. */
// deps: [], /* Runtime dependencies of this module. */
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
// devDeps: [], /* Build dependencies for this module. */
@cagingulsen
cagingulsen / main.ts
Created January 23, 2022 22:19
AWS CDK App
import { App, Stack, StackProps } from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import { Construct } from 'constructs';
export class LambdaStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps = {}) {
super(scope, id, props);
new lambda.Function(this, 'ExampleFunction', {
functionName: 'example-lambda',
@cagingulsen
cagingulsen / hello.js
Last active January 23, 2022 21:56
Hello World Lambda Function
exports.handler = function(event, context) {
console.log('Hello, Cloudwatch!');
context.succeed('Hello, World!');
};
@cagingulsen
cagingulsen / 0_reuse_code.js
Created December 21, 2016 12:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console