Created
February 23, 2021 16:07
-
-
Save axelhodler/491245ab19f5af10dbb5b27869c572f4 to your computer and use it in GitHub Desktop.
Test containerdefinition image
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
test('Fargate is using the latest image in ECR', () => { | |
const app = new cdk.App(); | |
const stack = new Cdktests.CdktestsStack(app, 'MyTestStack'); | |
expectCDK(stack).to(haveResourceLike("AWS::ECS::TaskDefinition",{ | |
ContainerDefinitions: [{ | |
Image: { | |
"Fn::Join": [ | |
"", | |
[ | |
{ | |
"Fn::Select": [ | |
4, | |
{ | |
"Fn::Split": [ | |
":", | |
{ | |
"Fn::GetAtt": [ | |
"testrepository3CFC24EC", | |
"Arn" | |
] | |
} | |
] | |
} | |
] | |
}, | |
".dkr.ecr.", | |
{ | |
"Fn::Select": [ | |
3, | |
{ | |
"Fn::Split": [ | |
":", | |
{ | |
"Fn::GetAtt": [ | |
"testrepository3CFC24EC", | |
"Arn" | |
] | |
} | |
] | |
} | |
] | |
}, | |
".", | |
{ | |
"Ref": "AWS::URLSuffix" | |
}, | |
"/", | |
{ | |
"Ref": "testrepository3CFC24EC" | |
}, | |
":latest" | |
] | |
] | |
} | |
}] | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment