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

Support vpc configuration to lambda #4551

Merged

Conversation

sivchari
Copy link
Member

@sivchari sivchari commented Aug 18, 2023

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #4550

Does this PR introduce a user-facing change?:

  • How are users affected by this change:

Users can configure a vpc configuration for lambda function.

  • Is this breaking change:

No

  • How to migrate (if breaking change):

Signed-off-by: sivchari <shibuuuu5@gmail.com>
…ate a vpc config

Signed-off-by: sivchari <shibuuuu5@gmail.com>
Signed-off-by: sivchari <shibuuuu5@gmail.com>
@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.06% ⚠️

Comparison is base (b4a4f6c) 29.99% compared to head (42d4545) 29.93%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4551      +/-   ##
==========================================
- Coverage   29.99%   29.93%   -0.06%     
==========================================
  Files         220      220              
  Lines       25834    25851      +17     
==========================================
- Hits         7749     7739      -10     
- Misses      17438    17465      +27     
  Partials      647      647              
Files Changed Coverage Δ
pkg/app/piped/platformprovider/lambda/client.go 4.72% <0.00%> (-0.23%) ⬇️
pkg/app/piped/platformprovider/lambda/function.go 63.75% <ø> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@khanhtc1202
Copy link
Member

@sivchari How about adding that vpc configuration here instead of the application configuration? Since it quite specific for Lambda (or AWS service only)
https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/platformprovider/lambda/function.go#L58-L73

@sivchari
Copy link
Member Author

@@ -121,6 +121,7 @@ spec:
| timeout | duration | The maximum length of time to execute deployment before giving up. Default is 6h. | No |
| notification | [DeploymentNotification](#deploymentnotification) | Additional configuration used while sending notification to external services. | No |
| postSync | [PostSync](#postsync) | Additional configuration used as extra actions once the deployment is triggered. | No |
| vpcConfig | [VPCConfig](#vpcconfig) | Additional configuration used to link to specific vpc. | No |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivchari I mean instead of adding it here, only make the vpc configuration available via Function manifest file. I think we should keep this configuration file contains generic configurations only.

Copy link
Member Author

@sivchari sivchari Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khanhtc1202
Oops, sorry. I fixed it. Like this ?

Signed-off-by: sivchari <shibuuuu5@gmail.com>
Signed-off-by: sivchari <shibuuuu5@gmail.com>
@@ -9,7 +9,7 @@ description: >
## Kubernetes Application

``` yaml
apiVersion: pipecd.dev/v1beta1
apiVersion: pipecd.devI mean instead of adding it here, only make the vpc configuration available via Function manifest file. I think we should keep this configuration file contains generic configurations only./v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was this? 😆

Copy link
Member Author

@sivchari sivchari Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐱 stepped on the keyboard ?? 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐈

Comment on lines 113 to 116
"vpcConfig": {
securityGroupIds: ["sg-1234567890", "sg-0987654321"],
subnetIds: ["subnet-1234567890", "subnet-0987654321"]
}
Copy link
Member

@khanhtc1202 khanhtc1202 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@sivchari sivchari force-pushed the support-vpc-configuration-to-lambda branch 3 times, most recently from ae05b63 to 2e2eb4e Compare August 18, 2023 13:59
Signed-off-by: sivchari <shibuuuu5@gmail.com>
@sivchari sivchari force-pushed the support-vpc-configuration-to-lambda branch from 2e2eb4e to 710800c Compare August 18, 2023 14:01
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost LGTM. Left a simple nits.

Comment on lines 136 to 141
if fm.Spec.VPCConfig != nil {
input.VpcConfig = &types.VpcConfig{
SecurityGroupIds: fm.Spec.VPCConfig.SecurityGroupIDs,
SubnetIds: fm.Spec.VPCConfig.SubnetIDs,
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this block to L128 or after L152, I want to keep "packing using container image" and "Zip on S3" block near by since they mean to same thing (code of the function).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I fix.

Signed-off-by: sivchari <shibuuuu5@gmail.com>
khanhtc1202
khanhtc1202 previously approved these changes Aug 18, 2023
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you 🙌

@khanhtc1202
Copy link
Member

@sivchari one testcase is failed, could you check?

Signed-off-by: sivchari <shibuuuu5@gmail.com>
@sivchari
Copy link
Member Author

@khanhtc1202
All test is passed.

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGreatTM 👍

@khanhtc1202 khanhtc1202 merged commit 145d59b into pipe-cd:master Aug 18, 2023
11 of 13 checks passed
@github-actions github-actions bot mentioned this pull request Aug 23, 2023
sZma5a pushed a commit to sZma5a/pipecd that referenced this pull request Aug 27, 2023
Signed-off-by: sZma5a <masaaki.haribote@gmail.com>
moko-poi pushed a commit to moko-poi/pipecd that referenced this pull request Nov 3, 2023
Signed-off-by: moko-poi <mokopoi44@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support VPC Configuration for lambda
2 participants