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

[custom-resources] Support function name in AwsCustomResource construct #9771

Closed
2 tasks
kinbald opened this issue Aug 17, 2020 · 2 comments · Fixed by #9774
Closed
2 tasks

[custom-resources] Support function name in AwsCustomResource construct #9771

kinbald opened this issue Aug 17, 2020 · 2 comments · Fixed by #9774
Assignees
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2

Comments

@kinbald
Copy link

kinbald commented Aug 17, 2020

Hello,

As we have hands on the role of the Signleton Lambda created by the AwsCustomResource construct, could it possible to add the functionName ?

Use Case

In the environment of my entreprise, we require naming convention over resources like lambdas, roles, etc.
We can't use the AwsCustomResource at the moment because we don't have hands on the functionName created by the resource.

Proposed Solution

Add an optional parameter which allow to set the functionName when needed.

const awsCustom1 = new AwsCustomResource(this, 'API1', {
 functionName: 'lambda-env-call',
  onCreate: {
    service: '...',
    action: '...',
    physicalResourceId: PhysicalResourceId.of('...')
  },
  policy: AwsCustomResourcePolicy.fromSdkCalls({resources: AwsCustomResourcePolicy.ANY_RESOURCE})
});

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@kinbald kinbald added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 17, 2020
@github-actions github-actions bot added the @aws-cdk/custom-resources Related to AWS CDK Custom Resources label Aug 17, 2020
jogold added a commit to jogold/aws-cdk that referenced this issue Aug 17, 2020
Add the `functionName` prop to customize the name of the Lambda function
implementing the custom resource.

Closes aws#9771
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Aug 18, 2020
@SomayaB SomayaB assigned rix0rrr and unassigned eladb Aug 18, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Aug 18, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Aug 24, 2020

I think this is a bad idea and your environment should learn not to care about resource names. You should probably be tagging instead.

Unlikely we will implement this, but PRs are welcome.

@rix0rrr rix0rrr added p2 effort/small Small work item – less than a day of effort labels Aug 24, 2020
@fdelhoste
Copy link

@rix0rrr Agreed, tags are far better for managing resources. However, I'd argue other constructs already allow this. Plus there are cases where names are used by AWS customers, for ex, by operation teams outside the boundary of the CDK developer like @kinbald who needs to comply.

@mergify mergify bot closed this as completed in #9774 Aug 25, 2020
mergify bot pushed a commit that referenced this issue Aug 25, 2020
Add the `functionName` prop to customize the name of the Lambda function
implementing the custom resource.

Closes #9771


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. in-progress This issue is being actively worked on. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants