cold-piano-21918
03/01/2019, 10:26 PMrepositoryUrl
of a ECR repo as a string so I can update my task definition (which takes containerDefinitions
as a string)?.get()
but it throws an error Cannot call '.get' during update or preview
white-balloon-205
apply
for this - as in:
containerDefintiions: x.repositoryUrl.apply(repositoryUrl => JSON.stringify({ ... repositoryUrl ... }))
cold-piano-21918
03/01/2019, 10:33 PM.apply
returns another output objectwhite-balloon-205
Output
as an Input
to any resource - in particular as the containerDefinitions
.cold-piano-21918
03/01/2019, 10:34 PMlet content = fs.readFileSync("task-definition.json");
const repo = new aws.ecr.Repository('flexkeygen', {});
const taskDefinition = new aws.ecs.TaskDefinition('flexkeygen_test', {
containerDefinitions: JSON.stringify(taskDefinitionJson.taskDefinition.containerDefinitions),
...
white-balloon-205
Output<string>
into a string
- but you can do all the work needed to transofmr that output into the value that you need as n input inside an apply
.cold-piano-21918
03/01/2019, 10:36 PMcontainerDefinitions
is a stringimage
registry URL with the ECR registryUrl, is that not possible to do?white-balloon-205
containerDefinitions
is an `Input<string>`: https://pulumi.io/reference/pkg/nodejs/@pulumi/aws/ecs/#TaskDefinitionArgs-containerDefinitionsstring
or an Output<string>
.cold-piano-21918
03/01/2019, 10:40 PMwhite-balloon-205
apply
?cold-piano-21918
03/01/2019, 10:42 PMaws ecs describe-task-definition --task-definition flexkeygen_webapp:6 > task-definition.json
white-balloon-205
let taskDefinitionJson = JSON.parse(fs.readFileSync("task-definition.json").toString());
const repo = new aws.ecr.Repository('flexkeygen', {});
const taskDefinition = new aws.ecs.TaskDefinition('flexkeygen_test', {
containerDefinitions: repo.rpositoryUrl.apply(repositoryUrl => {
taskDefinitionJson.taskDefinition.containerDefinitions.something = repositoryUrl;
return JSON.stringify(taskDefinitionJson.taskDefinition.containerDefinitions);
}),
});
cold-piano-21918
03/01/2019, 10:47 PM