If I’m trying to deploy a new image with a specifi...
# aws
p
If I’m trying to deploy a new image with a specific version, should I do something like this:
Copy code
const version = require('../../apps/service/package.json').version;
...
const image = new awsx.ecr.Image(`image:${version}`, {
  repositoryUrl: repository.url,
  path: "./app/service/",
});
Or is there a different way to specify the version on the image?
b
awsx.ecr.Image
is designed to build the image locally for you and push it. If the image already exists in the ECR repo and you know the image tag, just specify that in your task definition
p
Is there some way of having the image be tagged with a specific version? Specifically I want to be able to "roll back" to a previous version without going through a build process
b
not with
awsx.ecr.Image
no, it auto generates an image tag for you. If you want more control over the image and the process of building/pushing, you likely want to use https://www.pulumi.com/registry/packages/docker/api-docs/image/ which allows you to set a tag in the image name. It’s worth pointing out though, Pulumi drives towards a desired state, so with this:
Specifically I want to be able to “roll back” to a previous version without going through a build process
You’ll probably want to just modify the task definition and do your docker image builds outside Pulumi