Just out of curiosity, is this the best way to cre...
# general
h
Just out of curiosity, is this the best way to create an ECR and build/upload an image?
Copy code
const 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
    });