View a markdown version of this page

Setting up IAM for AWS Payments Manager - AWS Payments Manager

Setting up IAM for AWS Payments Manager

To set up IAM for AWS Payments Manager, first make sure that your IAM identity has permissions to configure the integration. Then create the service role that AWS Payments Manager assumes to read your payment data.

In the JSON policies, replace 123456789012 with your AWS account ID. The policy and role names are samples, and you can change them.

For instructions on creating policies and roles in IAM, see Create IAM policies (console), Create a role using custom trust policies, and Adding and removing IAM identity permissions in the IAM User Guide.

Admin setup policy

With this policy, you can manage the integration and its authorized users, tag the integration, and view your payment preferences. You can also list and choose the service role, and pass that role to AWS Payments Manager. Your IAM user or role needs these permissions to set up the integration with AWS Payments Manager.

Whether you need this policy depends on your permissions:

  • If you're an administrator (the AWS account root user, or an identity with the AdministratorAccess policy), you don't need this policy. Skip to Service role and start with Step 1.

  • If you're missing the setup permissions, create this policy and attach it to your IAM user or role. You can also add the same permissions as an inline policy. For instructions on creating and attaching a policy, see Create IAM policies (console) and Adding and removing IAM identity permissions. For instructions on inline policies, see Add an inline IAM policy. All are in the IAM User Guide.

The policy refers to the service role that you create later in the service role setup. Replace role-name with the name that you plan to use for that role.

The following JSON policy shows the admin setup policy. This guide uses PaymentsManagerSetupPolicy as the sample policy name, but you can choose a different name.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "PaymentsManagerAdminSetup", "Effect": "Allow", "Action": [ "payments:ListPaymentsManagerIntegrations", "payments:GetPaymentsManagerIntegration", "payments:CreatePaymentsManagerIntegration", "payments:UpdatePaymentsManagerIntegration", "payments:DeletePaymentsManagerIntegration", "payments:ListPaymentsManagerIntegrationUsers", "payments:CreatePaymentsManagerIntegrationUser", "payments:DeletePaymentsManagerIntegrationUser", "payments:TagResource", "payments:UntagResource", "payments:ListTagsForResource" ], "Resource": "*" }, { "Sid": "ViewPaymentPreference", "Effect": "Allow", "Action": [ "payments:ListPaymentPreferences", "payments:GetPaymentStatus" ], "Resource": "*" }, { "Sid": "IamReadForRolePicker", "Effect": "Allow", "Action": [ "iam:GetRole", "iam:ListRoles" ], "Resource": "*" }, { "Sid": "PassServiceRoleToPaymentsManager", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::123456789012:role/role-name", "Condition": { "StringEquals": { "iam:PassedToService": "manager.payments.amazonaws.com" } } } ] }

Service role

AWS Payments Manager uses one service role (the IAM role that AWS Payments Manager assumes to read your payment data) in each AWS account that you use with it. You choose the service role when you create the integration.

Note

Prerequisites: To create the service role and its policy, use an IAM identity that has the iam:CreateRole, iam:CreatePolicy, and iam:AttachRolePolicy permissions.

Step 1: Create the permissions policy

Create a customer managed policy from the JSON in AWS Payments Manager permissions policy. This guide uses PaymentsManagerServiceRolePolicy as the sample name, but you can choose another name. This policy defines what AWS Payments Manager can read in your account: payments, invoices, and purchase orders. It also lets AWS Payments Manager open and update AWS Support cases on your behalf.

Step 2: Create the IAM role

Create the service role that AWS Payments Manager assumes to read your payment data. This guide uses AWSPaymentsManagerRole-Teams as the sample name, but you can choose another name. You choose this role when you create the integration.

Step 3: Attach the policy

Attach the permissions policy from Step 1 to the role. The role then has the permissions that AWS Payments Manager needs.

Step 4: Set the trust policy

Set the role's trust relationship using the JSON in Trust policy. The trust policy lets AWS Payments Manager assume the role (sts:AssumeRole) and record who is using the app on the session (sts:SetSourceIdentity).

AWS Payments Manager permissions policy

With this policy, AWS Payments Manager can read the following data in your account: payments, invoices, and purchase orders. With this policy, AWS Payments Manager can also open and update AWS Support cases when someone sends a request to AWS from the app.

The following JSON policy shows the AWS Payments Manager permissions policy.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "PaymentsRead", "Effect": "Allow", "Action": [ "payments:GetPaymentStatus" ], "Resource": "*" }, { "Sid": "PurchaseOrdersRead", "Effect": "Allow", "Action": [ "purchase-orders:ListPurchaseOrders", "purchase-orders:GetPurchaseOrder", "purchase-orders:ListPurchaseOrderInvoices" ], "Resource": "*" }, { "Sid": "InvoicingRead", "Effect": "Allow", "Action": [ "invoicing:ListInvoiceSummaries" ], "Resource": "*" }, { "Sid": "SupportRead", "Effect": "Allow", "Action": [ "support:DescribeCases", "support:DescribeServices", "support:DescribeSeverityLevels", "support:DescribeCreateCaseOptions" ], "Resource": "*" }, { "Sid": "SupportCases", "Effect": "Allow", "Action": [ "support:CreateCase", "support:AddAttachmentsToSet", "support:UploadAttachment", "support:AddCommunicationToCase" ], "Resource": "*" } ] }

Trust policy

With the trust policy, AWS Payments Manager can assume the service role (sts:AssumeRole) and record on the session who is using the app (sts:SetSourceIdentity).

The following JSON policy shows the trust policy.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "manager.payments.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:SetSourceIdentity" ], "Condition": { "StringEquals": { "aws:SourceAccount": "123456789012" }, "ArnLike": { "aws:SourceArn": "arn:aws:payments::123456789012:payments-manager-integration/*" } } } ] }

Replace 123456789012 with your AWS account ID in both places.

Why sts:SetSourceIdentity? Because the trust policy allows sts:SetSourceIdentity, you can attribute activity to the individual user. When AWS Payments Manager assumes the service role on behalf of a person using the app, it sets that person's identity as the session's source identity. Every AWS CloudTrail event that AWS Payments Manager generates with these credentials then carries the sourceIdentity field. For details, see Monitor and control actions taken with assumed roles in the IAM User Guide.

Troubleshooting IAM setup

The following table lists common issues and how to fix them.

Symptom Cause Fix
You can't create or manage the integration. The IAM user or role that you use for setup lacks the admin setup policy actions or equivalent inline permissions. An AWS Organizations service control policy (SCP) might also deny them. Attach the admin setup policy to the IAM user or role, or add equivalent inline permissions. For the policy, see Admin setup policy. If access is still denied, ask your organization administrator to check whether an SCP denies the operation.
The service role doesn't appear in the AWS console. The setup IAM identity lacks iam:GetRole or iam:ListRoles. Grant those permissions through the admin setup policy or equivalent permissions. For the policy, see Admin setup policy.
You can't pass the role to AWS Payments Manager. The setup IAM identity lacks iam:PassRole, the policy resource doesn't match the service role ARN, or the iam:PassedToService condition doesn't name manager.payments.amazonaws.com. In the statement that grants iam:PassRole, confirm that the resource matches the exact service role ARN and that iam:PassedToService is manager.payments.amazonaws.com. Make sure the setup identity has this statement through the admin setup policy or equivalent permissions. For the policy, see Admin setup policy.
AWS Payments Manager can't assume the role. The trust relationship doesn't match the documented service principal, actions, or conditions. Compare the role's trust relationship with Trust policy. Verify the principal manager.payments.amazonaws.com, the actions sts:AssumeRole and sts:SetSourceIdentity, the correct aws:SourceAccount, and an aws:SourceArn that matches the AWS Payments Manager integration ARN pattern.