handsome-actor-1155
07/16/2019, 6:41 PMconst ecr = new aws.ecr.Repository("ecr", {
name: "stream-app/corrective-action-producer"
});
const ecrCreds = ecr.registryId.apply(async (registryId) => {
const credentials = await aws.ecr.getCredentials({
registryId: registryId,
});
const decodedCredentials = Buffer.from(credentials.authorizationToken, "base64").toString();
const [username, password] = decodedCredentials.split(":");
return { server: credentials.proxyEndpoint, username, password };
});
return new docker.Image("correctiveActionProducer", {
imageName: ecr.repositoryUrl,
build: "./",
registry: ecrCreds
});