Skip to content

Commit fae2819

Browse files
committed
Refactor ECS scaling resource ID to use Pulumi's interpolation for improved readability and maintainability.
1 parent f46d6b6 commit fae2819

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/infra/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as aws from "@pulumi/aws";
22
import * as awsx from "@pulumi/awsx";
3+
import * as pulumi from "@pulumi/pulumi";
34

45
// VPC with public subnets for ALB and private subnets for containers
56
const vpc = new awsx.ec2.Vpc("pathfinder-vpc");
@@ -157,9 +158,7 @@ const service = new awsx.ecs.FargateService("pathfinder-service", {
157158
const scaling = new aws.appautoscaling.Target("pathfinder-scaling", {
158159
maxCapacity: 10,
159160
minCapacity: 2,
160-
resourceId: service.service.name.apply(
161-
(name) => `service/${cluster.name}/${name}`
162-
),
161+
resourceId: pulumi.interpolate`service/${cluster.name}/${service.service.name}`,
163162
scalableDimension: "ecs:service:DesiredCount",
164163
serviceNamespace: "ecs",
165164
});

0 commit comments

Comments
 (0)