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

feat: removal of default security group (#44) #45

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

flaviostutz
Copy link
Owner

Summary

Removing default security group creation as it seems an anti-pattern because it might create too many ENIs in production workloads. See #44 for more details

Breaking changes

  • "allowAllOutbound" property for lambda is not supported anymore.
  • "defaultSecurityGroup" attribute from NodeJS construct is not present anymore

Closing issues

Fixes #44

@MarcioMeier
Copy link
Collaborator

question: adding the !feat will create a new major version tag, right?
We should avoid it as we are in version 0 and not ready for version 1


// never use network configuration, only explicit VPC from previous step
// eslint-disable-next-line fp/no-delete
delete customResourceConfig?.network;
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: mutating a function parameter is bad practice, it can lead to confusion and make it harder to the caller to understand it.

As we never want to provide the network we could omit it from the customResourceConfig

const { network, ...customResourceConfig } = args.props.customResourceConfig ?? {};

or removing it from BaseNodeJsFunction props

const customResourceFunction = new BaseNodeJsFunction(args.scope, `${args.id}-custom-lambda`, {
    ...customResourceConfig,
    network: undefined,

Copy link
Owner Author

Choose a reason for hiding this comment

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

I agree! I was trying other alternatives but it was adding too much code. Thanks for the great suggestion!

@erik-am
Copy link
Contributor

erik-am commented Nov 7, 2024

Thank you @flaviostutz for the quick action! 😄

@flaviostutz flaviostutz changed the title !feat: removal of default security group (#44) feat: removal of default security group (#44) Nov 8, 2024
@flaviostutz
Copy link
Owner Author

question: adding the !feat will create a new major version tag, right? We should avoid it as we are in version 0 and not ready for version 1

Yes, I wasn't thinking of generating a major version, but would like to stress that it's a breaking change. I am changing it so we don't generate a "1.0.0" version as you mentioned :)

@flaviostutz flaviostutz merged commit 078a24d into main Nov 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't create a default Security Group
3 participants