AWS Private 5G service-linked role - AWS Private 5G

AWS Private 5G service-linked role

AWS Private 5G uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is a unique type of IAM role that is linked directly to Private 5G. Service-linked roles are predefined by Private 5G and include the permissions that the service requires to call other AWS services on your behalf.

A service-linked role makes setting up Private 5G easier because you don’t have to manually add the necessary permissions. Private 5G defines the permissions of its service-linked roles, and unless defined otherwise, only Private 5G can assume its roles. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity.

Service-linked role permissions for Private 5G

Private 5G uses the service-linked role named AWSServiceRoleForPrivateNetworks to publish network performance and health metrics to Amazon CloudWatch.

The AWSServiceRoleForPrivateNetworks service-linked role trusts the following services to assume the role:

  • private-networks.amazonaws.com

The service-linked role uses the AWSPrivateNetworksServiceRolePolicy policy, which is defined as follows.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudwatch:PutMetricData" ], "Resource": "*", "Condition": { "StringEquals": {"cloudwatch:namespace": "AWS/Private5G"} } } ] }

You must configure permissions to allow an IAM entity (such as a user, group, or role) to create, edit, or delete a service-linked role. For more information, see Service-linked role permissions in the IAM User Guide.

Create the service-linked role for Private 5G

Use the following create-service-linked-role command from the AWS CLI to create the service-linked role for Private 5G.

aws iam create-service-linked-role --aws-service-name private-networks.amazonaws.com

This command creates a role named AWSServiceRoleForPrivateNetworks that trusts the private-networks.amazon.com service to assume it.

If you delete AWSServiceRoleForPrivateNetworks, you can use the same process to create the role again.

For more information, see Creating a service-linked role in the IAM User Guide.

Edit the service-linked role

You can edit the description for AWSServiceRoleForPrivateNetworks using IAM. For more information, see Editing a service-linked role in the IAM User Guide.

Delete the service-linked role

If you no longer need to use Private 5G, we recommend that you delete the AWSServiceRoleForPrivateNetworks role.

You can delete this service-linked role only after you delete your Private 5G network.

You can use the IAM console, the IAM CLI, or the IAM API to delete a service-linked role. For more information, see Deleting a service-linked role in the IAM User Guide.