Skip to content

Commit deec55e

Browse files
authored
Update iam passrole readme instructions (#130)
Description of changes: Previously the policy provided in the readme was allowing for iamPassRole to have access to all resources. This changes this so that it is only scoped to a resource in the account the controller was created in. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 9b6bf47 commit deec55e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ printf '{
118118
' > ./trust.json
119119
```
120120

121-
Updating an ApplicationAutoscaling ScalableTarget requires the following permissions. Create a file named pass_role_policy.json to create the policy required for the IAM role.
121+
Updating an ApplicationAutoscaling ScalableTarget requires the following permissions. First create a service-linked role for ApplicationAutoscaling.
122+
123+
```sh
124+
aws iam create-service-linked-role --aws-service-name sagemaker.application-autoscaling.amazonaws.com
125+
```
126+
127+
Then create a file named pass_role_policy.json to create the policy required for the IAM role.
122128

123129
```sh
124130
printf '{
@@ -127,7 +133,7 @@ printf '{
127133
{
128134
"Effect": "Allow",
129135
"Action": "iam:PassRole",
130-
"Resource": "*"
136+
"Resource": "arn:aws:iam::'$AWS_ACCOUNT_ID':role/aws-service-role/sagemaker.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_SageMakerEndpoint"
131137
}
132138
]
133139
}

0 commit comments

Comments
 (0)