Skip to content

(gen2-migration) generate command should handle function custom policiesย #14565

@iliapolo

Description

@iliapolo

Is this feature request related to a new or existing Amplify category?

No response

Is this related to another service?

No response

Describe the feature you'd like to request

We need to support the custom-policies.json file that allows functions to access existing AWS resources that are managed outside of the amplify environment.

See https://docs.amplify.aws/gen1/javascript/build-a-backend/functions/set-up-function/#access-existing-aws-resource-from-lambda-function

For multi environment support, we also need to convert ${env} to ${branchName}

See https://docs.amplify.aws/gen1/javascript/build-a-backend/functions/set-up-function/#multi-environment-workflow

Describe the solution you'd like

The solution should use CDK code to explicitly add the policies to the appropriate functions.

backend.myfunction.resources.lambda.addToPrincipalPolicy(...)`

Describe alternatives you've considered

None. I'm not sure if there is a native way to support this in Gen2, if there is we should use that one.

Additional context

No response

Is this something that you'd be interested in working on?

  • ๐Ÿ‘‹ I may be able to implement this feature request

Would this feature include a breaking change?

  • โš ๏ธ This feature might incur a breaking change

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions