Skip to content

Instantly share code, notes, and snippets.

View jcdan3's full-sized avatar
💭
I may be slow to respond.

JC Dansereau jcdan3

💭
I may be slow to respond.
  • Hortau
  • Quebec, QC
  • 02:30 (UTC -04:00)
View GitHub Profile
@jcdan3
jcdan3 / sqs.tf
Last active November 27, 2021 04:21
A simple SQS with Terraform
resource "aws_sqs_queue" "terraform_queue" {
name = "terraform-example-queue"
delay_seconds = 90
max_message_size = 2048
message_retention_seconds = 86400
receive_wait_time_seconds = 10
tags = {
Environment = "production"
}
@jcdan3
jcdan3 / main.go
Last active November 27, 2021 04:28
tags := map[string]string{
"Environment": "production",
}
mySQS := sqs.NewSqsQueue("testStack", jsii.String("terraform_queue"), &sqs.SqsQueueConfig{
Name: jsii.String("terraform-example-queue"),
DelaySeconds: jsii.Number(90),
MaxMessageSize: jsii.Number(2048),
MessageRetentionSeconds: jsii.Number(86400),
ReceiveWaitTimeSeconds: jsii.Number(10),
@jcdan3
jcdan3 / commands
Last active November 28, 2021 00:55
mkdir cdktf-medium
cd cdktf-medium
cdktf init  -- template="go"  --local
cdktf get
{
"language": "go",
"app": "go run main.go",
"codeMakerOutput": "generated",
"projectId": "07cdbf37-68b1-400a-9b93-ee9a84616fca",
"terraformProviders": [
"hashicorp/aws@~> 3.64.2"
],
"terraformModules": [],
"context": {
@jcdan3
jcdan3 / main.go
Last active November 27, 2021 13:31
AWS infrastructure sample with cdktf
package main
import (
"encoding/json"
"github.com/aws/constructs-go/constructs/v10"
"github.com/aws/jsii-runtime-go"
"github.com/hashicorp/terraform-cdk-go/cdktf"
"github.com/jcdan3/cdktf-provider-aws-go"
"github.com/jcdan3/cdktf-provider-aws-go/iam"
"github.com/jcdan3/cdktf-provider-aws-go/lambdafunction"
#to deploy:
cdktf deploy test
#to destroy:
cdktf destroy
@jcdan3
jcdan3 / CLI
Created November 27, 2021 12:36
aws configure
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
git commit main.py --amend
# Notes: This will prompt you to edit the commit message. If you want to keep the same message, simply do:
git commit main.py --amend --no-edit
git commit main.py --amend