Users in the Administrators group for an account have access to all AWS services and resources in that account. Granting direct access to all AWS resources goes against the best practice of applying the least privileged permissions to a user. This section describes how you can create roles with permissions that are limited to AWS Elemental MediaConnect. This section also describes how your users can assume that role to grant secure and temporary credentials.
Step 1: Create a
non-admin policy
Create two policies for AWS Elemental MediaConnect: one to provide read/write access and one to provide read-only access. Perform these steps one time only for each policy. Later, you will attach these policies to roles. Those roles can then be temporarily assumed by users to grant access to MediaConnect.
To create policies
-
Use your AWS account ID or account alias, and the credentials for your admin user, to sign in to the IAM console
. -
In the navigation pane of the console, choose Policies.
On the Policies page, create a policy named
MediaConnectAllAccess
that allows all actions on all resources in AWS Elemental MediaConnect:-
Choose Create policy.
-
Choose the JSON tab and paste the following policy:
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "mediaconnect:*" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "ec2:DescribeAvailabilityZones" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "cloudwatch:GetMetricData" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "iam:PassRole" ], "Effect": "Allow", "Resource": "*", "Condition": { "StringLike": { "iam:PassedToService": "mediaconnect.amazonaws.com" } } } ] }
This policy allows all actions on all resources in AWS Elemental MediaConnect.
-
Choose Next: Tags.
-
Choose Next: Review.
-
On the Review and create page, for Policy name, enter
MediaConnectAllAccess
, and then choose Create policy.
-
On the Policies page, create a read-only policy named
MediaConnectReadOnlyAccess
for AWS Elemental MediaConnect:-
Choose Create policy.
-
Choose the JSON tab and paste the following policy:
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "mediaconnect:List*", "mediaconnect:Describe*" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "ec2:DescribeAvailabilityZones" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "cloudwatch:GetMetricData" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "iam:PassRole" ], "Effect": "Allow", "Resource": "*", "Condition": { "StringLike": { "iam:PassedToService": "mediaconnect.amazonaws.com" } } } ] } .
-
Choose Next: Tags.
-
Choose Next: Review.
-
On the Review and create page, for Policy name, enter
MediaConnectReadOnlyAccess
, and then choose Create policy.
-
Step 2: Create
non-admin roles
You can create a role for each policy and users can assume that role, rather than attaching individual policies to each user. Using the following procedure, create two roles: one for the MediaConnectAllAccess policy and one for the MediaConnectReadOnlyAccess policy.
To create roles
-
In the navigation pane of the IAM console, choose Roles.
On the Roles page, create an administrator role using the
MediaConnectAllAccess
policy:Choose Create role.
-
In the Select trusted entity section, select AWS account.
-
In the An AWS account section, select the account with the users that will be assuming this role.
-
If a third-party will be accessing this role, it is a best practice to select Require external ID. For more information about external IDs, visit: Using an external ID for third-party access in the IAM User Guide.
-
It is a best practice to require multi-factor authentication (MFA). You can select the checkbox next to Require MFA. For more information about MFA, visit: Multi-factor authentication (MFA) in the IAM User Guide.
-
-
Choose Next to move to the Add permissions section.
-
In the Permissions policy section, choose the MediaConnectAllAccess policy that you created in the procedure in Step 3a: Create a Policy.
-
Verify that the correct policies are added to this group, and then choose Next.
-
In the Name, review and create section, name the role
MediaConnectAdmins
. (Optional) Add a description for the role. Select Create role.
On the Roles page, create an administrator role using the
MediaConnectReadOnlyAccess
policy:Choose Create role.
-
In the Select trusted entity section, select AWS account.
-
In the An AWS account section, select the account with the users that will be assuming this role.
-
If a third-party will be accessing this role, it is a best practice to select Require external ID. For more information about external IDs, visit: Using an external ID for third-party access in the IAM User Guide.
-
It is a best practice to require multi-factor authentication (MFA). You can select the checkbox next to Require MFA. For more information about MFA, visit: Multi-factor authentication (MFA) in the IAM User Guide.
-
-
Choose Next to move to the Add permissions section.
-
In the Permissions policy section, choose the MediaConnectReadOnlyAccess policy that you created in the procedure in Step 3a: Create a Policy.
-
Verify that the correct policies are added to this group, and then choose Next.
-
In the Name, review and create section, name the role
MediaConnectReaders
. (Optional) Add a description for the role. Select Create role.
Step 3: Assume the
role
After creating a policy and attaching that policy to a role, your users will need to assume that role to be granted secure and temporary access to MediaConnect.
View the following resources for learning about granting permissions for users to assume the role and how users can switch to the role from the console or AWS CLI.
-
Granting a user permissions to switch roles: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_permissions-to-switch.html
-
Switching roles (console): https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html
-
Switching roles (AWS CLI): https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-cli.html