feat(ecs): accept a resolvable ContainerDefinition.image - #164
Merged
JeroenSoeters merged 1 commit intoAug 9, 2026
Conversation
ContainerDefinition.image was typed as a bare String, the only reference-shaped field left on the ECS task definition family that was not a String|formae.Resolvable union. Sibling fields (Secret.valueFrom, RepositoryCredentials.credentialsParameter, EFSVolumeConfiguration.filesystemId, TaskDefinition.executionRoleArn and taskRoleArn) all accept one already. The practical cost was that nothing could wire a built image into a task definition. An AWS::CodeBuild::ImageBuild publishes a digest and an AWS::ECR::Repository publishes a URI, but neither could reach the image field: passing a Resolvable failed PKL type checking, and interpolating one into a string shipped the framed envelope to RegisterTaskDefinition verbatim, which AWS rejects as invalid characters. The workaround was to resolve the digest out of band and pin it as a literal, then re-pin it by hand on every image rebuild. Widening the type to String|formae.Resolvable removes that hand-edit. The conformance fixture ecs-taskdefinition-image-ref.pkl creates an ECR repository from scratch and points the container image at its resolved repositoryUri, so an apply fails outright if the reference does not resolve. Fargate refuses an ECR image without an execution role, so the fixture declares one; that requirement is AWS's and is unrelated to the reference resolving.
JeroenSoeters
deleted the
jeroensoeters/pla-495-ecs-containerdefinitionimage-lacks-resolvable-support
branch
August 9, 2026 00:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AWS::ECS::TaskDefinition'sContainerDefinition.imagewas typed as a bareString, the only reference-shaped field left on the task definition familythat was not a
String|formae.Resolvableunion. Its siblings(
Secret.valueFrom,RepositoryCredentials.credentialsParameter,EFSVolumeConfiguration.filesystemId,TaskDefinition.executionRoleArnandtaskRoleArn) all accept a resolvable already.The practical cost: nothing could wire a built image into a task definition. An
AWS::CodeBuild::ImageBuildpublishes a digest and anAWS::ECR::Repositorypublishes a URI, but neither could reach the image field. Passing a Resolvable
failed PKL type checking, and interpolating one into a string shipped the framed
envelope to
RegisterTaskDefinitionverbatim, which AWS rejects as invalidcharacters. The workaround was to resolve the digest out of band, pin it as a
literal, and re-pin it by hand on every image rebuild.
Widening the type to
String|formae.Resolvableremoves that hand-edit.Also adds a conformance fixture,
testdata/ecs-taskdefinition-image-ref.pkl,which creates an ECR repository from scratch and points the container image at
its resolved
repositoryUri, so an apply fails outright if the reference doesnot resolve. Confirmed it is a real regression test: it fails to evaluate
against the old bare-
Stringtype and passes with the new one. Fargate refusesan ECR image without an execution role, so the fixture declares one; that
requirement is AWS's and is unrelated to the reference resolving.
The full conformance CRUD run passes (Create, Verify, Extract, Sync, Destroy and
out-of-band delete green; Update and Replace skipped, as there is no
-updatevariant, matching the sibling
ecs-taskdefinition-secret-arnfixture).