Create Policy

Create Policy

In this step, we will create a custom IAM policy that allows the iam:PassRole action for the AWSGlueServiceRoleDefault role, then attach it to that role.

  1. In the IAM console:

    • Select Policies
    • Click Create policy

    Create Policy

  2. In the Specify permissions page:

    • Select JSON
    • Paste the following JSON policy into the Policy editor

    Paste JSON Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:PassRole",
            "Resource": "arn:aws:iam::AccountID:role/AWSGlueServiceRoleDefault"
        }
    ]
}

Replace AccountID in the Resource ARN with your actual 12-digit AWS Account ID. You can find your Account ID in the top-right corner of the AWS Console. Example: arn:aws:iam::123456789012:role/AWSGlueServiceRoleDefault

  1. Scroll down and verify no errors:

    • Ensure Security: 0, Errors: 0, Warnings: 0
    • Click Next

    Verify Policy

  2. In the Review and create page:

    • For Policy name, enter AllowPassRoleToGlueServiceRole
    • Review the Permissions defined in this policy section

    Name Policy

  3. Scroll down to review:

    • Check the permissions summary
    • Click Create policy

    Review and Create

  4. Policy AllowPassRoleToGlueServiceRole has been created successfully

    Policy Created

  5. Now we need to attach this policy to the AWSGlueServiceRoleDefault role:

    • Go to Roles, search for AWSGlueServiceRoleDefault
    • Select the AWSGlueServiceRoleDefault role

    Select Role

  6. In the role details page:

    • Click Add permissions
    • Select Attach policies

    Add Permissions

  7. In the Attach policy page:

    • Search for AllowPassRoleToGlueServiceRole
    • Select the AllowPassRoleToGlueServiceRole policy
    • Click Add permissions

    Attach Policy

  8. The policy has been successfully attached to the role. The AWSGlueServiceRoleDefault role now has 3 policies:

    • AllowPassRoleToGlueServiceRole (Customer managed)
    • AmazonS3FullAccess (AWS managed)
    • AWSGlueServiceRole (AWS managed)

    Policy Attached Successfully