-
Notifications
You must be signed in to change notification settings - Fork 126
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
Adding support for egress and ingress settings #243
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@troykelly Great thanks for that improvement. Please see my comments, also please ensure that CI passes without errors
@@ -62,6 +62,18 @@ module.exports = { | |||
}); | |||
} | |||
|
|||
if (funcObject.egress) { | |||
_.assign(funcTemplate.properties, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use Object.assign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just following existing established formatting.
I will come back to these change requests in a few weeks, we will just have to work with our fork for now.
@@ -62,6 +62,18 @@ module.exports = { | |||
}); | |||
} | |||
|
|||
if (funcObject.egress) { | |||
_.assign(funcTemplate.properties, { | |||
vpcConnectorEgressSettings: _.get(funcObject, 'egress') || _.get(this, 'serverless.service.provider.egress'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_.get(funcObject, 'egress')
is guaranteed to be truthy at this logic point
if (funcObject.ingress) { | ||
_.assign(funcTemplate.properties, { | ||
ingressSettings: _.get(funcObject, 'ingress') || _.get(this, 'serverless.service.provider.ingress'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
* @param {*} functionName | ||
*/ | ||
const validateVpcEgressProperty = (funcObject, functionName) => { | ||
if (funcObject.egress && typeof funcObject.egress === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do just typeof
check (other is superfluous)
*/ | ||
const validateVpcEgressProperty = (funcObject, functionName) => { | ||
if (funcObject.egress && typeof funcObject.egress === 'string') { | ||
const validTypes = ['VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED', 'PRIVATE_RANGES_ONLY', 'ALL_TRAFFIC']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define it as Set
instance and outside of function body
if (funcObject.ingress && typeof funcObject.ingress === 'string') { | ||
const validTypes = ['INGRESS_SETTINGS_UNSPECIFIED', 'ALLOW_ALL', 'ALLOW_INTERNAL_ONLY', 'ALLOW_INTERNAL_AND_GCLB']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Hello, when will this be merged? I need this feature |
@ivanguimam can you help us in finalizing this PR? |
How can I make these corrections being that PR belongs to someone else? |
You can fork the repository, do updates, and propose another PR with updates |
I'll try to do that by the weekend |
@ivanguimam that'll be great. Thank you! |
@ivanguimam awesome let us know! |
Resolves #242