Skip to content

Commit

Permalink
Updates 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gernot Glawe committed Jul 24, 2019
1 parent ff62d39 commit 590d638
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -21,3 +21,7 @@ lambda-simple/lib/cdk-lambda-simple-stack.js
lambda-simple/lib/cdk-lambda-simple-stack.js
lambda-simple/bin/cdk-lambda-simple.js
OpsCenterRole/templates/opscenterrole.template
alb-update/package-lock.json
lambda-simple/bin/cdk-lambda-simple.js
lambda-simple/lambda/package-lock.json
lambda-simple/package-lock.json
41 changes: 41 additions & 0 deletions Makefile
@@ -0,0 +1,41 @@
PHONY: test help
.DEFAULT_GOAL := help


lambdastack=LambdaStack
albstack=LoadBalancerStack

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

init: ## Install after node is installed
npm install -g aws-cdk
npm install -g tsc

initcdk: init ## init all
cdk init

build: ## Build tsc cdk
npm run build

##
# Lambda

buildlambda: ## Build lambda
cd lambda && npm run build

testlambda: buildlambda ## Test Lambda
cd lambda && npm run test

samlocalprep: build ## Create stack for samlocal
cdk synth LambdaStack> template.yaml

samlocalshow: ## Show Lambda function
grep AWS::Lambda::Function template.yaml -B 1 | head -n 1 | cut -d ":" -f 1
echo "sam local invoke MyFunction12345678 -e lambda/test/event.json"

deploy: build buildlambda ## deploy lambda
cdk deploy $(lambdastack)

deploy-alb: ## Deploy testing application load balancer
cdk deploy $(albstack)
8 changes: 4 additions & 4 deletions OpsCenterRole/package.json
Expand Up @@ -10,13 +10,13 @@
"cdk": "cdk"
},
"devDependencies": {
"@types/node": "12.6.0",
"typescript": "^3.5.2",
"@types/node": "12.6.2",
"typescript": "^3.5.3",
"ts-node": "^8.3.0"
},
"dependencies": {
"@aws-cdk/aws-iam": "0.38.x",
"@aws-cdk/core": "0.38.x",
"@aws-cdk/aws-iam": "1.0.x",
"@aws-cdk/core": "1.0.x",
"source-map-support": "^0.5.12"
}
}
4 changes: 2 additions & 2 deletions OpsCenterRole/templates/opscenterrole.template
Expand Up @@ -22,7 +22,7 @@ Resources:
Statement:
- Action: ssm:CreateOpsItem
Effect: Allow
Resource: "*"
Principal: "*"
Version: "2012-10-17"
PolicyName: opsCenterPolicy
Roles:
Expand All @@ -32,5 +32,5 @@ Resources:
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Modules: aws-cdk=0.34.0,@aws-cdk/aws-iam=0.34.0,@aws-cdk/cdk=0.34.0,@aws-cdk/cx-api=0.34.0,@aws-cdk/region-info=0.34.0,jsii-runtime=node.js/v8.10.0
Modules: aws-cdk=0.37.0,@aws-cdk/aws-iam=0.37.0,@aws-cdk/core=0.37.0,@aws-cdk/cx-api=0.37.0,@aws-cdk/region-info=0.37.0,jsii-runtime=node.js/v8.10.0

14 changes: 7 additions & 7 deletions alb-update/package.json
Expand Up @@ -15,14 +15,14 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/node": "^12.6.0",
"typescript": "^3.5.2"
"@types/node": "^12.6.2",
"typescript": "^3.5.3"
},
"dependencies": {
"@aws-cdk/aws-autoscaling": "0.38.x",
"@aws-cdk/aws-ec2": "0.38.x",
"@aws-cdk/aws-elasticloadbalancingv2": "0.38.x",
"@aws-cdk/aws-iam": "^0.38.0",
"@aws-cdk/core": "0.38.x"
"@aws-cdk/aws-autoscaling": "1.0.x",
"@aws-cdk/aws-ec2": "1.0.x",
"@aws-cdk/aws-elasticloadbalancingv2": "1.0.x",
"@aws-cdk/aws-iam": "^1.0.x",
"@aws-cdk/core": "1.0.x"
}
}
1 change: 0 additions & 1 deletion lambda-simple/lambda/hello.js
@@ -1,4 +1,3 @@

exports.handler = async function(event) {
console.log('request:', JSON.stringify(event, undefined, 2));
return {
Expand Down
12 changes: 6 additions & 6 deletions lambda-simple/package.json
Expand Up @@ -10,14 +10,14 @@
"cdk": "cdk"
},
"devDependencies": {
"@types/node": "8.10.45",
"typescript": "^3.3.3333"
"@types/node": "12.6.2",
"typescript": "^3.5.3"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.37.x",
"@aws-cdk/core": "0.37.x",
"install": "^0.12.2",
"@aws-cdk/aws-lambda": "1.0.x",
"@aws-cdk/core": "1.0.x",
"install": "^0.13.0",
"path": "^0.12.7",
"source-map-support": "^0.5.9"
"source-map-support": "^0.5.12"
}
}
2 changes: 1 addition & 1 deletion vpc-bastion/index.ts
Expand Up @@ -8,7 +8,7 @@ class VPCBastionStack extends cdk.Stack {
constructor(app: cdk.App, id: string) {
super(app, id);
new ec2.Vpc(this, 'TheVPC',{
maxAZs: 2,
maxAzs: 2,
});

const instanceRole = new iam.Role(this,'ssminstancerole',
Expand Down
10 changes: 5 additions & 5 deletions vpc-bastion/package.json
Expand Up @@ -15,12 +15,12 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/node": "^8.10.50",
"typescript": "^3.5.2"
"@types/node": "^12.6.2",
"typescript": "^3.5.3"
},
"dependencies": {
"@aws-cdk/aws-ec2": "0.37.x",
"@aws-cdk/aws-iam": "0.37.x",
"@aws-cdk/core": "0.37.x"
"@aws-cdk/aws-ec2": "1.0.x",
"@aws-cdk/aws-iam": "1.0.x",
"@aws-cdk/core": "1.0.x"
}
}

0 comments on commit 590d638

Please sign in to comment.