This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require("aws-sdk"); | |
const crypto = require("crypto"); | |
// Generate unique id with no external dependencies | |
const generateUUID = () => crypto.randomBytes(16).toString("hex"); | |
// Initialising the DynamoDB SDK | |
const documentClient = new AWS.DynamoDB.DocumentClient(); | |
exports.handler = async event => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_ecs_task_definition" "my_first_task" { | |
family = "my-first-task" # Naming our first task | |
container_definitions = <<DEFINITION | |
[ | |
{ | |
"name": "my-first-task", | |
"image": "${aws_ecr_repository.my_first_ecr_repo.repository_url}", | |
"essential": true, | |
"portMappings": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
import * as cloudfront from '@aws-cdk/aws-cloudfront'; | |
import * as route53 from '@aws-cdk/aws-route53'; | |
import * as certificateManager from '@aws-cdk/aws-certificatemanager'; | |
import * as targets from '@aws-cdk/aws-route53-targets'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
import * as cloudfront from '@aws-cdk/aws-cloudfront'; | |
import * as route53 from '@aws-cdk/aws-route53'; | |
import * as certificateManager from '@aws-cdk/aws-certificatemanager'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
import * as cloudfront from '@aws-cdk/aws-cloudfront'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const bucket = new s3.Bucket(this, 'WebsiteBucket', { | |
bucketName: 'andrew-bestbier-cdk-blog', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
import * as cloudfront from '@aws-cdk/aws-cloudfront'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const bucket = new s3.Bucket(this, 'WebsiteBucket', { | |
bucketName: 'andrew-bestbier-cdk-blog', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
import * as iam from '@aws-cdk/aws-iam'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const bucket = new s3.Bucket(this, 'WebsiteBucket', { | |
bucketName: 'andrew-bestbier-cdk-blog', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as cdk from '@aws-cdk/core'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const bucket = new s3.Bucket(this, 'WebsiteBucket', { | |
bucketName: 'andrew-bestbier-cdk-blog' // Choose your own bucket name here | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class InfrastructureStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const bucket = new s3.Bucket(this, 'MyFirstBucket', { | |
bucketName: 'andrew-bestbier-cdk-blog' | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
version = "~> 2.0" | |
region = "eu-west-2" | |
} | |
# Providing a reference to our default VPC | |
resource "aws_default_vpc" "default_vpc" { | |
} | |
# Providing a reference to our default subnets |
NewerOlder