Skip to content

Commit

Permalink
fix(ecs): remove LoadBalancedFargateServiceApplet, no longer supported (
Browse files Browse the repository at this point in the history
  • Loading branch information
piradeepk authored and rix0rrr committed Jun 7, 2019
1 parent 3f7a0ad commit a610017
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 240 deletions.

This file was deleted.

1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-ecs-patterns/lib/index.ts
Expand Up @@ -4,7 +4,6 @@ export * from './base/queue-worker-service-base';

export * from './ecs/load-balanced-ecs-service';
export * from './fargate/load-balanced-fargate-service';
export * from './fargate/load-balanced-fargate-service-applet';
export * from './base/load-balanced-service-base';

export * from './ecs/scheduled-ecs-task';
91 changes: 0 additions & 91 deletions packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s.ts
Expand Up @@ -249,95 +249,4 @@ export = {

test.done();
},

'test Fargateloadbalanced applet'(test: Test) {
// WHEN
const app = new cdk.App();
const stack = new ecsPatterns.LoadBalancedFargateServiceApplet(app, 'Service', {
image: 'test',
desiredCount: 2,
environment: {
TEST_ENVIRONMENT_VARIABLE1: "test environment variable 1 value",
TEST_ENVIRONMENT_VARIABLE2: "test environment variable 2 value"
}
});

// THEN - stack contains a load balancer and a service
expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer'));

expect(stack).to(haveResource("AWS::ECS::Service", {
DesiredCount: 2,
LaunchType: "FARGATE",
}));

expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', {
ContainerDefinitions: [
{
Environment: [
{
Name: "TEST_ENVIRONMENT_VARIABLE1",
Value: "test environment variable 1 value"
},
{
Name: "TEST_ENVIRONMENT_VARIABLE2",
Value: "test environment variable 2 value"
}
],
}
]
}));

test.done();
},

'test Fargateloadbalanced applet with TLS'(test: Test) {
// WHEN
const app = new cdk.App();
const stack = new ecsPatterns.LoadBalancedFargateServiceApplet(app, 'Service', {
image: 'test',
desiredCount: 2,
domainName: 'api.example.com',
domainZone: 'example.com',
certificate: 'helloworld'
});

// THEN - stack contains a load balancer and a service
expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::LoadBalancer'));

expect(stack).to(haveResource('AWS::ElasticLoadBalancingV2::Listener', {
Port: 443,
Certificates: [{
CertificateArn: "helloworld"
}]
}));

expect(stack).to(haveResource("AWS::ECS::Service", {
DesiredCount: 2,
LaunchType: "FARGATE",
}));

expect(stack).to(haveResource('AWS::Route53::RecordSet', {
Name: 'api.example.com.',
HostedZoneId: "/hostedzone/DUMMY",
Type: 'A',
AliasTarget: {
HostedZoneId: { 'Fn::GetAtt': ['FargateServiceLBB353E155', 'CanonicalHostedZoneID'] },
DNSName: { 'Fn::GetAtt': ['FargateServiceLBB353E155', 'DNSName'] },
}
}));

test.done();
},

"errors when setting domainName but not domainZone on applet"(test: Test) {
// THEN
test.throws(() => {
new ecsPatterns.LoadBalancedFargateServiceApplet(new cdk.App(), 'Service', {
image: 'test',
domainName: 'api.example.com'
});
});

test.done();
}
};

0 comments on commit a610017

Please sign in to comment.