Skip to content

Instantly share code, notes, and snippets.

const lambdaFunctionOne = new nodejs_lambda.NodejsFunction(this, "LambdaFunctionOne", {
runtime: lambda.Runtime.NODEJS_14_X,
entry: path.join(__dirname, `/../lambda/FunctionOne/index.ts`),
handler: "handler",
timeout: Duration.minutes(10),
});
const waitForXMinutes = new sfn.Wait(this, 'Wait', {
time: sfn.WaitTime.duration(Duration.minutes(3)),
const lambdaFunctionOne = new nodejs_lambda.NodejsFunction(this, "LambdaFunctionOne", {
runtime: lambda.Runtime.NODEJS_14_X,
entry: path.join(__dirname, `/../lambda/FunctionOne/index.ts`),
handler: "handler",
timeout: Duration.minutes(10),
});
const waitForXMinutes = new sfn.Wait(this, 'Wait', {
time: sfn.WaitTime.duration(Duration.minutes(3)),
@pubudusj
pubudusj / delete-cloudwatch-logs-streams.sh
Last active August 18, 2020 21:13
AWS Cloudwatch delete all the log streams within a group without deleting the group
#!/bin/bash
# This is to delete all the log streams within a AWS Cloudwatch Log Group without deleting the group.
# Pass the log group name as first paramter to the script.
# jq utility required.
logGroupName=$1
for i in `aws logs describe-log-streams --log-group-name $logGroupName | jq -r '.[] | .[] | .logStreamName'`
do
echo "Deleting log stream $i"
@pubudusj
pubudusj / terraform_attach_manged_role.tf
Last active January 9, 2023 16:31
Terraform attaching existing managed policy to a new role
### New role creation
### Here assume_role_policy MUST be defined for the trust relationship
resource "aws_iam_role" "codedeploy_service_role" {
name = "CodeDeployServiceRole"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{