Skip to content

Commit

Permalink
Merge pull request #65 from pkandasamy91/master
Browse files Browse the repository at this point in the history
Update ecs typescript examples to v0.36.1
  • Loading branch information
SoManyHs authored Jul 3, 2019
2 parents 1bbbe03 + 9800781 commit 35ab76d
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 1,576 deletions.
4 changes: 2 additions & 2 deletions typescript/ecs/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import autoscaling = require('@aws-cdk/aws-autoscaling');
import ec2 = require('@aws-cdk/aws-ec2');
import { InstanceType } from '@aws-cdk/aws-ec2';
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
import cdk = require('@aws-cdk/core');

class ECSCluster extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
Expand All @@ -13,7 +13,7 @@ class ECSCluster extends cdk.Stack {
const asg = new autoscaling.AutoScalingGroup(this, 'MyFleet', {
instanceType: new InstanceType("t2.xlarge"),
machineImage: new ecs.EcsOptimizedAmi(),
updateType: autoscaling.UpdateType.ReplacingUpdate,
updateType: autoscaling.UpdateType.REPLACING_UPDATE,
desiredCapacity: 3,
vpc
});
Expand Down
2 changes: 1 addition & 1 deletion typescript/ecs/cluster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"dependencies": {
"@aws-cdk/aws-ec2": "*",
"@aws-cdk/aws-ecs": "*",
"@aws-cdk/cdk": "*"
"@aws-cdk/core": "*"
}
}
2 changes: 1 addition & 1 deletion typescript/ecs/ecs-load-balanced-service/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import ecs_patterns = require('@aws-cdk/aws-ecs-patterns');
import cdk = require('@aws-cdk/cdk');
import cdk = require('@aws-cdk/core');

class BonjourECS extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
Expand Down
2 changes: 1 addition & 1 deletion typescript/ecs/ecs-load-balanced-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@aws-cdk/aws-ec2": "*",
"@aws-cdk/aws-ecs": "*",
"@aws-cdk/aws-ecs-patterns": "*",
"@aws-cdk/cdk": "*"
"@aws-cdk/core": "*"
}
}
8 changes: 4 additions & 4 deletions typescript/ecs/ecs-service-with-advanced-alb-config/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ecs = require('@aws-cdk/aws-ecs');
import ec2 = require('@aws-cdk/aws-ec2');
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');
import cdk = require('@aws-cdk/cdk');
import cdk = require('@aws-cdk/core');

const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-ecs-integ-ecs');
Expand All @@ -24,7 +24,7 @@ const container = taskDefinition.addContainer('web', {
container.addPortMappings({
containerPort: 80,
hostPort: 8080,
protocol: ecs.Protocol.Tcp
protocol: ecs.Protocol.TCP
});

// Create Service
Expand All @@ -46,9 +46,9 @@ listener.addTargets('ECS', {
targets: [service],
// include health check (default is none)
healthCheck: {
intervalSecs: 60,
interval: cdk.Duration.seconds(60),
path: "/health",
timeoutSeconds: 5,
timeout: cdk.Duration.seconds(5),
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@aws-cdk/aws-ec2": "*",
"@aws-cdk/aws-ecs": "*",
"@aws-cdk/aws-elasticloadbalancingv2": "*",
"@aws-cdk/cdk": "*"
"@aws-cdk/core": "*"
}
}
6 changes: 2 additions & 4 deletions typescript/ecs/ecs-service-with-logging/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import cdk = require('@aws-cdk/cdk');
import cdk = require('@aws-cdk/core');

class WillkommenECS extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
Expand All @@ -13,9 +13,7 @@ class WillkommenECS extends cdk.Stack {
});

// create a task definition with CloudWatch Logs
const logging = new ecs.AwsLogDriver(this, "AppLogging", {
streamPrefix: "myapp",
})
const logging = new ecs.AwsLogDriver({ streamPrefix: "myapp" })

const taskDef = new ecs.Ec2TaskDefinition(this, "MyTaskDefinition");
taskDef.addContainer("AppContainer", {
Expand Down
Loading

0 comments on commit 35ab76d

Please sign in to comment.