https://pulumi.com logo
Title
e

early-airline-53287

01/10/2022, 7:22 PM
Hi, should it be possible to use docker-based Lambda resource directly with publicly available Docker image: https://gallery.ecr.aws/grafana/lambda-promtail (via Docker image uri) ?
(Without the need to make "dummy" Dockerfile which just inherits from public image and without pushing it to a private repository) . I have been trying to use public Docker image uri directly like this:
promtail_registry_image = docker.get_registry_image(
    name="public.ecr.aws/grafana/lambda-promtail:latest"
)
remote_image = docker.RemoteImage(
    "x-lambda-promtail-remote-image",
    name=promtail_registry_image.name,
    pull_triggers=[promtail_registry_image.sha256_digest],
)
promtail_lambda = aws.lambda_.Function(
    "x-lambda-promtail",
    timeout=30,
    memory_size=128,
    role=lambda_role.arn,
    image_uri=remote_image.id,
    package_type="Image",
    publish=True,
    opts=pulumi.ResourceOptions(depends_on=[lambda_role_policy]),
)
But it ends with an error message: 
error creating Lambda Function (1): InvalidParameterValueException: Source image sha256:fae905fb261fc02ffcd09052ae97c56c7ee18cf96d5dc2ddaf583ff2314284depublic.ecr.aws/grafana/lambda-promtail:latest is not valid. Provide a valid source image.
I also tried another property from remote_image output:
image_uri=remote_image.repo_digest
, with the same error ...
m

miniature-king-36473

01/11/2022, 3:01 PM
perhaps silly, but can you just use `public.ecr.aws/grafana/lambda-promtail:latest`as the
image_uri
?
e

early-airline-53287

01/11/2022, 6:32 PM
Hi, I have tried
public.ecr.aws/grafana/lambda-promtail:latest
and also
<https://public.ecr.aws/grafana/lambda-promtail:latest>
without success. Eventually I have tried it also in AWS Lambda console and it fails with this error: This is an invalid Elastic Container Registry Image URI.
It really seems, that it is not possible to create Lambda function directly with the public ECR uri, at least for now.
m

miniature-king-36473

01/11/2022, 8:16 PM
oh well good to know I guess ...