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: remove the function name #54

Closed
wants to merge 3 commits into from
Closed

Conversation

ahammond
Copy link
Contributor

Named functions are more trouble than they're worth.
The description provides the same value, without the annoyance.

Fixes: #53

Named functions are more trouble than they're worth.
The description provides the same value, without the annoyance.

Fixes: #53
@ahammond
Copy link
Contributor Author

The alternative is to use something like https://www.npmjs.com/package/multi-convention-namer with the maxLength option.

@LukvonStrom
Copy link

@udondan This is a good first step, but I think this ressource should follow the CDK standard of autogenerating all names and leaving it up to L2 ressource where possible

@LukvonStrom
Copy link

So please merge :)

@cameroncf
Copy link

I'm running into a function length problem as well and came here to make this exact PR. Glad someone else beat me to it. Removing the function name would be fantastic and unblock my work.

@cameroncf
Copy link

Looks like the role name and managed policy name have similar "explicitly named resources" problems. The error checking on length that reports "Cloudformation limits names to 63 characters." could also be removed.

My use case is using a domain name as part of the key name, which can get quite long.

@ahammond
Copy link
Contributor Author

ahammond commented May 6, 2022

@cameroncf you can override it using the resourcePrefix property, but it's still problematic.

@ahammond
Copy link
Contributor Author

ahammond commented May 6, 2022

@cameroncf I also removed the name from the role, which as you point out has the same problem. And standardized the imports.

@cameroncf
Copy link

bump

@LukvonStrom
Copy link

cc/ @udondan

@udondan
Copy link
Owner

udondan commented Aug 15, 2022

Please see the related ticket #53. CFN now has native support for creating Key pairs. Most probably the only thing I'm going to do with this project is to archive it 😸

@udondan
Copy link
Owner

udondan commented Sep 18, 2023

Personally I do not have a problem with this. Though AWS does. You cannot change the Lambda function name for existing custom resources. CFN will fail with:

Modifying service token is not allowed.

By removing the function name we would force all users to delete and re-create their KeyPairs.

I see only one option how we can change this: A new contruct property, e.g. lambdaName.

  • If undefined: We use the name as currently implemented. So this is backwards compatible and not messing with existing KeyPairs
  • If false: No names for the function, role and policy will be set
  • If typeof String: User can set a custom name

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.

names function but doesn't constrain name length
4 participants