aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

[AWS::Lambda::Function] - [Enhancement] - Support ImageUri as an attribute

Open
#2,211 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::Lambda::Function

### Resource name

_No response_

### Description

The [return values](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#aws-resource-lambda-function-return-values) are limited to the following:
- `SnapStartResponse`
- `SnapStartResponse.ApplyOn`
- `SnapStartResponse.OptimizationStatus`
- `Arn`

In the use case of a Sam Template, if you do an `AWS::Serverless::Function`, it does an `AWS::Lambda::Function` under the covers. If you are using an image_function, each function builds an independent Container Image. If `AWS::Lambda::Function` allowed you to get the ImageUri, you could have a single function build the image, and additional functions refer back to the initial image, reducing build times.

Example:
```
Function1:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
CodeUri: funcCode
ImageConfig:
Command:
- "app.lambda_handler1"
Metadata:
Dockerfile: funcCode/Dockerfile
DockerTag: Function1
Function2:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
CodeUri: !GetAtt Function1.ImageUri
ImageConfig:
Command:
- "app.lambda_handler2"
Function3:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
CodeUri: !GetAtt Function1.ImageUri
ImageConfig:
Command:
- "app.lambda_handler3"
```

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the AWS::Lambda::Function return values documentation linked in the issue and review the provided AWS SAM example. Done means ImageUri is available through GetAtt so later image-based functions can reuse the image built by Function1.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.