Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vpc and architectures option to the creation of lambda from source #4723

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/app/piped/platformprovider/lambda/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,24 @@
Variables: fm.Spec.Environments,
},
}
if len(fm.Spec.Architectures) != 0 {
var architectures []types.Architecture
nnnkkk7 marked this conversation as resolved.
Show resolved Hide resolved
for _, arch := range fm.Spec.Architectures {
architectures = append(architectures, types.Architecture(arch.Name))
}
input.Architectures = architectures

Check warning on line 192 in pkg/app/piped/platformprovider/lambda/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/platformprovider/lambda/client.go#L187-L192

Added lines #L187 - L192 were not covered by tests
}
if fm.Spec.EphemeralStorage != nil {
input.EphemeralStorage = &types.EphemeralStorage{
Size: aws.Int32(fm.Spec.EphemeralStorage.Size),
}
}
if fm.Spec.VPCConfig != nil {
input.VpcConfig = &types.VpcConfig{
SecurityGroupIds: fm.Spec.VPCConfig.SecurityGroupIDs,
SubnetIds: fm.Spec.VPCConfig.SubnetIDs,
}
}

Check warning on line 204 in pkg/app/piped/platformprovider/lambda/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/app/piped/platformprovider/lambda/client.go#L199-L204

Added lines #L199 - L204 were not covered by tests
_, err = c.client.CreateFunction(ctx, input)
if err != nil {
return fmt.Errorf("failed to create Lambda function %s: %w", fm.Spec.Name, err)
Expand Down
Loading