sparse-intern-71089
03/01/2019, 10:26 PMcold-piano-21918
03/01/2019, 10:29 PM.get() but it throws an error Cannot call '.get' during update or previewwhite-balloon-205
apply for this - as in:
containerDefintiions: x.repositoryUrl.apply(repositoryUrl => JSON.stringify({ ... repositoryUrl ... }))white-balloon-205
cold-piano-21918
03/01/2019, 10:33 PM.apply returns another output objectcold-piano-21918
03/01/2019, 10:34 PMwhite-balloon-205
Output as an Input to any resource - in particular as the containerDefinitions.cold-piano-21918
03/01/2019, 10:34 PMcold-piano-21918
03/01/2019, 10:35 PMcold-piano-21918
03/01/2019, 10:35 PMcold-piano-21918
03/01/2019, 10:35 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 stringcold-piano-21918
03/01/2019, 10:38 PMimage 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-containerDefinitionswhite-balloon-205
string 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.jsoncold-piano-21918
03/01/2019, 10:43 PMwhite-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 PMcold-piano-21918
03/01/2019, 10:48 PM