Open gliptak opened 3 years ago
Hey @gliptak :wave:
Thanks for suggesting this feature request. If you're in need of a workaround you can always name the lambda function manually via the functionName
prop. See CDK lambda docs
I am marking this issue as p2 which means that we are unable to work on this immediately. We use +1s to help us prioritize our work, and as always we are happy to take contributions if anyone is interested to pick this up and submit a PR (please make sure to follow our contribution guidelines.)
@ryparker any pointers on what changes might this require (and I will work towards a PR)?
After investigating this a little to try and find a good starting place, I found that I was not able to reproduce the naming that you're seeing. Could you provide some repro code?
Here's what I see:
Code:
import * as cdk from '@aws-cdk/core';
import * as lambda from '@aws-cdk/aws-lambda';
class LambdaStack extends cdk.Stack {
constructor(scope: cdk.App, name: string, props?: cdk.StackProps) {
super(scope, name, props);
new lambda.Function(this, 'lambdaFunction1', {
code: lambda.Code.fromInline('// code'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
});
}
};
const app = new cdk.App();
new LambdaStack(app, 'LambdaStack')
Output:
@ryparker thank you for looking into this. The code came from below repo, subclassing core.Construct
(not cdk.Stack
)
class HitCounter(core.Construct):
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
cdk
generates below naming pattern likestackName-constructNameresourceNamepostfix
note no dash between constructName and resourceName
https://cdkworkshop.com/30-python/40-hit-counter/logs1.png
Use Case
Separating constructName and resourceName with dash makes listing of resources more readable and consistent with stackName approach
Proposed Solution
Separate with dash constructName and resourceName
Other
This is a :rocket: Feature Request