https://pulumi.com logo
Title
g

gentle-school-19497

01/28/2023, 9:54 AM
I'm trying to deploy an image to ECR and I am getting this error AttributeError: module 'pulumi_aws.ecr' has no attribute 'Image'
e

echoing-dinner-19531

01/28/2023, 10:03 AM
pulumi_aws.ecr
doesn't have any attribute `Image`: https://www.pulumi.com/registry/packages/aws/api-docs/ecr/
g

gentle-school-19497

01/28/2023, 10:17 AM
Yeah what I think I'm supposed to do is this
import pulumi_docker as docker

image = docker.RemoteImage("ubuntu",
  name='ubuntu:precise'
)

container = docker.Container("ubuntu",
  image=image.latest
)
I've ran pip install pulumi-docker but I'm getting ModuleNotFoundError: No module named 'pulumi_docker'
There docs are a little outdated
So I figured out what was going on. I use conda, and pulumi up uses the python in venv. So it needs to be installed with venv's pip. I'm pretty sure it wasn't always this way, but I also might be confused with how CDK works.
e

echoing-dinner-19531

01/28/2023, 1:50 PM
Ah yeh, we should probably look into conda
g

gentle-school-19497

01/30/2023, 2:42 AM
Yeah it's weird that bot CDK and pulumi are opinionated with respect to what virtual environment. CDK has a similar thing when creating a new python project by creating a virtual, but you can just use the requirement.txt it creates in your conda environment and CDK will use that python. It seems that pulumi will use the created virtual environment. This should probably be communicated.