Skip to content

Commit

Permalink
fix: targetGroup errors appear in containerDefinition diff (#1258)
Browse files Browse the repository at this point in the history
The [container definition](https://www.pulumi.com/registry/packages/aws/api-docs/ecs/taskdefinition/#containerdefinitions_nodejs)
property of a Task Definition is a JSON string. We do not provide types
for the container definition which means it is possible to include
things in that JSON string that shouldn't be there. In the case of this
bug, we are including an additional `targetGroup` object in the
container definition string.

To fix this, I am removing the `targetGroup` field. 

fix #1248
  • Loading branch information
corymhall authored Apr 10, 2024
1 parent 0390f0d commit e3d30d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion awsx/ecs/container.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe("port mappings", () => {
hostPort: 2,
name: "test-mapping-1-2",
protocol: "tcp",
targetGroup,
});
});
});
Expand Down
4 changes: 3 additions & 1 deletion awsx/ecs/containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export function getMappingInputs(
tgPort: number | undefined,
): schema.TaskDefinitionPortMappingInputs {
return {
...mappingInput,
name: mappingInput.name,
containerPortRange: mappingInput.containerPortRange,
appProtocol: mappingInput.appProtocol,
containerPort: mappingInput.containerPort ?? mappingInput.hostPort ?? tgPort,
hostPort: mappingInput.hostPort ?? tgPort ?? mappingInput.containerPort,
protocol: mappingInput.protocol,
Expand Down

0 comments on commit e3d30d6

Please sign in to comment.