Skip to content

Commit

Permalink
feat: add load balancer config and desired count
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgonand committed Oct 17, 2023
1 parent 24f83a7 commit 80f492e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/aws/deployServiceProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ async function createService(
networkConfiguration:
project.customNetworkConfiguration ||
(await getSubnetsForNetworkConfiguration(project)),
loadBalancers: [{}],
enableECSManagedTags: true,
loadBalancers: project.loadBalancers,
desiredCount: project.desiredCount,
propagateTags: 'SERVICE',
tags: [
{
key: 'name',
Expand Down Expand Up @@ -57,11 +60,13 @@ async function updateService(
cluster: getCluster(project),
service: getServiceName(project),
taskDefinition: taskDefinitionArn,
forceNewDeployment: forceNewDeploy,
capacityProviderStrategy: project.customCapacityProviderStrategy,
networkConfiguration:
project.customNetworkConfiguration ||
(await getSubnetsForNetworkConfiguration(project)),
capacityProviderStrategy: project.customCapacityProviderStrategy,
loadBalancers: project.loadBalancers,
desiredCount: project.desiredCount,
forceNewDeployment: forceNewDeploy,
}),
);
}
Expand Down
12 changes: 11 additions & 1 deletion src/models/serviceDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const projectSchema = z.object({
serviceName: z.string().optional(),
cluster: z.string().optional(),
alreadyExists: z.boolean().optional(),
desiredCount: z.number().default(1),
customCapacityProviderStrategy: z
.array(
z.object({
Expand All @@ -37,7 +38,16 @@ const projectSchema = z.object({
}),
})
.optional(),
// loadBalancers:
loadBalancers: z
.array(
z.object({
targetGroupArn: z.string(),
loadBalancerName: z.string(),
containerName: z.string().optional(),
containerPort: z.number().optional(),
}),
)
.optional(),
});

export const serviceDefinitionSchema = z.object({
Expand Down

0 comments on commit 80f492e

Please sign in to comment.