Skip to content

Commit

Permalink
feat(AWS IAM): Resign from deprecating old format of IAM settings
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Aug 9, 2021
1 parent 3ccc8cf commit 847dd8f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 127 deletions.
7 changes: 4 additions & 3 deletions docs/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,17 @@ Adapt to this behaviour now by adding `unresolvedVariablesNotificationMode: erro

Deprecation code: `PROVIDER_IAM_SETTINGS`

Staring with v3.0.0, all IAM-related settings of _provider_ including `iamRoleStatements`, `iamManagedPolicies`, `role` and `cfnRole` will be grouped under `iam` property. Refer to the[IAM Guide](/framework/docs/providers/aws/guide/iam.md).
_Note: Originally support for old IAM settings was scheduled to be dropped with new major release. It's no longer the case. If you see this deprecation notice please upgrade to latest version of Serverless Framework_

All IAM-related settings of _provider_ including `iamRoleStatements`, `iamManagedPolicies`, `role` and `cfnRole` are also now supported at `iam` property. Refer to the [IAM Guide](/framework/docs/providers/aws/guide/iam.md).

- `provider.role` -> `provider.iam.role`
- `provider.rolePermissionsBoundary` -> `provider.iam.role.permissionsBoundary`
- `provider.iamRoleStatements` -> `provider.iam.role.statements`
- `provider.iamManagedPolicies` -> `provider.iam.role.managedPolicies`
- `provider.cfnRole` -> `provider.iam.deploymentRole`

In addition, a prior update had documented the new Permissions Boundary property as `iam.role.permissionBoundary`. This
has now been deprecated in favor of `iam.role.permissionsBoundary` to match the CloudFormation property.
In addition `iam.role.permissionBoundary` can also be set at `iam.role.permissionsBoundary` (which matches CloudFormation property name).

<a name="AWS_API_GATEWAY_SPECIFIC_KEYS"><div>&nbsp;</div></a>

Expand Down
14 changes: 0 additions & 14 deletions lib/plugins/aws/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const fs = require('fs');
const getS3EndpointForRegion = require('./utils/getS3EndpointForRegion');
const memoizeeMethods = require('memoizee/methods');
const readline = require('readline');
const reportDeprecatedProperties = require('../../utils/report-deprecated-properties');
const { ALB_LISTENER_REGEXP } = require('./package/compile/events/alb/lib/validate');
const d = require('d');
const path = require('path');
Expand Down Expand Up @@ -229,19 +228,6 @@ class AwsProvider {
}
}
}

reportDeprecatedProperties(
'PROVIDER_IAM_SETTINGS',
{
'provider.role': 'provider.iam.role',
'provider.rolePermissionsBoundary': 'provider.iam.role.permissionsBoundary',
'provider.iam.role.permissionBoundary': 'provider.iam.role.permissionsBoundary',
'provider.iamManagedPolicies': 'provider.iam.role.managedPolicies',
'provider.iamRoleStatements': 'provider.iam.role.statements',
'provider.cfnRole': 'provider.iam.deploymentRole',
},
{ serviceConfig: this.serverless.service }
);
},
};

Expand Down
30 changes: 0 additions & 30 deletions lib/utils/report-deprecated-properties.js

This file was deleted.

80 changes: 0 additions & 80 deletions test/unit/lib/utils/report-deprecated-properties.test.js

This file was deleted.

0 comments on commit 847dd8f

Please sign in to comment.