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

Deprecate service.awsKmsKeyArn in favor of provider.kmsKeyArn #8261

Closed
medikoo opened this issue Sep 17, 2020 · 1 comment · Fixed by #8277
Closed

Deprecate service.awsKmsKeyArn in favor of provider.kmsKeyArn #8261

medikoo opened this issue Sep 17, 2020 · 1 comment · Fixed by #8277
Labels
cat/lambda deprecation Deprecation proposal (breaking with next major) good first issue help wanted refactor

Comments

@medikoo
Copy link
Contributor

medikoo commented Sep 17, 2020

Use case description

There's lone AWS provider property to be setup in context of service while all others are set in context of provider.

Historically (#3672 (comment)) it looks it was added as a start of moving everything from provider scope to service scope. Still It was not followed, and I don't see a reason, now, why configuration as service.aws* is better than provider.*

I believe, that for consistency we should move this property to provider context. It also makes schema configuration for AWS provider more complex.

Proposed solution

  1. Introduce provider.kmsKeyArn (it should shadow service.awsKmsKeyArn, but functions[].kmsKeyArn should take precedence)
  2. Deprecate service.awsKmsKeyArn usage
  3. Introduce functions[].kmsKeyArn (for consistency) and deprecate functions[].awsKmsKeyArn

Implementation should take place here:

let kmsKeyArn;
const serviceObj = this.serverless.service.serviceObject;
if ('awsKmsKeyArn' in functionObject) {
kmsKeyArn = functionObject.awsKmsKeyArn;
} else if (serviceObj && 'awsKmsKeyArn' in serviceObj) {
kmsKeyArn = serviceObj.awsKmsKeyArn;
}
if (kmsKeyArn) {

Also changes should be reflected in config schema (however schema should maintain support for deprecated properties)

@medikoo
Copy link
Contributor Author

medikoo commented Sep 24, 2020

Covered by #8277

@medikoo medikoo closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat/lambda deprecation Deprecation proposal (breaking with next major) good first issue help wanted refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant