I am looking to implement a `deploy-awslambda` goa...
# general
b
I am looking to implement a
deploy-awslambda
goal that will execute
aws lambda update-function-code --function-name my-function --image-uri <image_ref>
by referencing its image ref after it is packaged + published in
docker_image
target. I have created a
deployment_awslambda
target and confirmed that it works up to the point where I get the DockerFieldSet from the DockerImageTarget in dependencies. After this I will need to run the DockerFieldSet.image_refs method, but it looks a bit complicated. helm deployment is what I am trying to reference, do I still have to implement these for this requirement? https://github.com/pantsbuild/pants/blob/main/src/python/pants/backend/helm/util_rules/post_renderer.py#L72-L155 Or is there an easier way to get the image_refs from the DockerFieldSet?
c
I would probably go with getting hold of the
PublishDockerImageFieldSet
for the images in question (likely by invoking
publish
for them.. not exactly sure what you need to do about that atm) so you can get the image names off of it (from
.get_output_data()
❤️ 1
b
Thank you very much! I will try a few. But I’m also wondering why you implemented this way with helm deploy.
I checked PublishDockerImageFieldSet and found that it does not have any tag information, and from the following implementation, it seems that an instance of PublishDockerImageRequest is required. https://github.com/pantsbuild/pants/blob/d35dba851815bba26e575e4da6f9766dc028987c/src/python/pants/backend/docker/goals/publish.py#L59-L96
c
the tag information is in the
names
field. https://github.com/pantsbuild/pants/pull/13292
the helm stuff is not by me 😉
b
Thank you! Your help is very helpful! I don’t know how to reference PublishOutput when implementing that deploy goal, but I feel like I don’t understand the pantsbuild plugin enough to begin with, so I’ll look into it some more.
c
pls do 🙂 and I’ll have a look during the day if I can provide some better guidance on how to do this..
❤️ 1