Skip to content

Commit

Permalink
Replace deprecated AWS managed policy for codedeploy
Browse files Browse the repository at this point in the history
After March 1, 2021, the AWS managed policies AWSLambdaReadOnlyAccess and AWSLambdaFullAccess will be deprecated and can no longer be attached to new IAM users.

AWS Lambda has introduced a new AWS managed policy.

The AWSLambda_FullAccess policy grants full access to Lambda, Lambda console features, and other related AWS services. This policy was created by scoping down the previous policy AWSLambdaFullAccess.

fixes #115
  • Loading branch information
valentinpalkovic committed Mar 27, 2021
1 parent 3ee442a commit 6d98f83
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion fixtures/1.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/10.output.v2-websocket.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/11.output.v2-websocket-authorizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/12.output-with-permissions-boundary.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/13.output.multiple-function-hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/2.output.without-hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/5.output.with-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess",
"arn:aws:iam::aws:policy/AWSLambda_FullAccess",
"arn:aws:iam::aws:policy/AmazonSNSFullAccess"
],
"AssumeRolePolicyDocument": {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/6.output.cloudwatch-events-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/7.output.cloudwatch-logs-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/8.output.sns-subscriptions-trigger.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess"
"arn:aws:iam::aws:policy/AWSLambda_FullAccess"
],
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
Expand Down
2 changes: 1 addition & 1 deletion fixtures/9.output.iot-topic-rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
"Properties": {
"ManagedPolicyArns": [
"arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
"arn:aws:iam::aws:policy/AWSLambdaFullAccess",
"arn:aws:iam::aws:policy/AWSLambda_FullAccess",
"arn:aws:iam::aws:policy/AmazonSNSFullAccess"
],
"AssumeRolePolicyDocument": {
Expand Down
2 changes: 1 addition & 1 deletion lib/CfTemplateGenerators/Iam.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const _ = require('lodash/fp')
function buildCodeDeployRole (codeDeployRolePermissionsBoundaryArn, areTriggerConfigurationsSet) {
const attachedPolicies = [
'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited',
'arn:aws:iam::aws:policy/AWSLambdaFullAccess'
'arn:aws:iam::aws:policy/AWSLambda_FullAccess'
]
if (areTriggerConfigurationsSet) {
attachedPolicies.push('arn:aws:iam::aws:policy/AmazonSNSFullAccess')
Expand Down
8 changes: 4 additions & 4 deletions lib/CfTemplateGenerators/Iam.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Iam', () => {
Properties: {
ManagedPolicyArns: [
'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited',
'arn:aws:iam::aws:policy/AWSLambdaFullAccess'
'arn:aws:iam::aws:policy/AWSLambda_FullAccess'
],
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Expand All @@ -35,7 +35,7 @@ describe('Iam', () => {
Properties: {
ManagedPolicyArns: [
'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited',
'arn:aws:iam::aws:policy/AWSLambdaFullAccess',
'arn:aws:iam::aws:policy/AWSLambda_FullAccess',
'arn:aws:iam::aws:policy/AmazonSNSFullAccess'
],
AssumeRolePolicyDocument: {
Expand All @@ -62,7 +62,7 @@ describe('Iam', () => {
Properties: {
ManagedPolicyArns: [
'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited',
'arn:aws:iam::aws:policy/AWSLambdaFullAccess'
'arn:aws:iam::aws:policy/AWSLambda_FullAccess'
],
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('Iam', () => {
Properties: {
ManagedPolicyArns: [
'arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited',
'arn:aws:iam::aws:policy/AWSLambdaFullAccess'
'arn:aws:iam::aws:policy/AWSLambda_FullAccess'
],
AssumeRolePolicyDocument: {
Version: '2012-10-17',
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"afterEach"
]
}
}
}

0 comments on commit 6d98f83

Please sign in to comment.