Skip to content

Commit

Permalink
fic(ecs): fix fromClusterAttributes (#2649)
Browse files Browse the repository at this point in the history
Remove unnecessary import call.

Fixes #2631.
  • Loading branch information
rix0rrr authored May 28, 2019
1 parent e6a9f9e commit f4817b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecs/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class ImportedCluster extends Construct implements ICluster {
constructor(scope: Construct, id: string, props: ClusterAttributes) {
super(scope, id);
this.clusterName = props.clusterName;
this.vpc = ec2.Vpc.fromVpcAttributes(this, "vpc", props.vpc);
this.vpc = props.vpc;
this.hasEc2Capacity = props.hasEc2Capacity !== false;
this._defaultNamespace = props.defaultNamespace;

Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ export = {
test.equal(cluster2.defaultNamespace!.type, cloudmap.NamespaceType.DnsPrivate);
test.deepEqual(stack2.node.resolve(cluster2.defaultNamespace!.namespaceId), 'import-namespace-id');

// Can retrieve subnets from VPC - will throw 'There are no 'Private' subnets in this VPC. Use a different VPC subnet selection.' if broken.
cluster2.vpc.selectSubnets();

test.done();
}
};

0 comments on commit f4817b1

Please sign in to comment.