> ## Documentation Index
> Fetch the complete documentation index at: https://support.i.moneyforward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Web Services (AWS IAM)

> Steps to integrate Amazon Web Services (AWS) with MoneyForward Admina, from logging in as an administrator to completing the integration.

## Supported Features

<Badge color="blue">Account Deletion</Badge> <Badge color="blue">Account Provisioning</Badge>

## Prerequisites

### How to Log In to Amazon Web Services

Go to the [AWS login page](https://console.aws.amazon.com) and sign in as a root user or IAM user.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1667957723469-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=a86e286beec7183a3a49b8a242cc757d" alt="AWS login screen" width="812" height="1196" data-path="images/integrations/dc2mjsw9oy/1667957723469-image.png" />

### How to Create an Integration Policy

1. Go to [Identity and Access Management (IAM)](https://console.aws.amazon.com/iam), click **Policies** in the left menu, then click **Create policy**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710834486770-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=0cd3e2a3e55808f579580603a19d40b3" alt="IAM Policies screen" width="3054" height="1302" data-path="images/integrations/dc2mjsw9oy/1710834486770-image.png" />

2. On the Create policy screen, click the `JSON` tab and overwrite it with the following script.

To retrieve the LastActivity of roles, add `"iam:GetRole",` below `"iam:ListRoles",` in the policy script.

```json theme={null}
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": [
				"iam:GetAccessKeyLastUsed",
				"iam:ListAccessKeys",
				"iam:ListAttachedUserPolicies",
				"iam:ListGroupsForUser",
				"iam:ListMFADevices",
				"iam:ListRolePolicies",
				"iam:ListRoles",
				"iam:GetRole",
				"iam:ListUsers",
				"iam:ListUserTags",
				"iam:DeleteUser",
				"iam:DeleteAccessKey",
				"iam:DeleteRole",
				"iam:ListAttachedRolePolicies",
				"iam:DetachRolePolicy",
				"iam:DeleteLoginProfile",
				"iam:ListAttachedUserPolicies",
				"iam:DetachUserPolicy",
				"iam:CreateUser",
				"iam:TagUser",
				"iam:ListUserPolicies",
				"account:GetContactInformation"
			],
			"Resource": "*"
		}
	]
}
```

<Tip>
  If you do not need account deletion or provisioning from Admina (Read Only), use the following script instead.

  To retrieve the LastActivity of roles, add `"iam:GetRole",` below `"iam:ListRoles",` in the policy script.
</Tip>

```json theme={null}
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": [
				"iam:GetAccessKeyLastUsed",
				"iam:ListAccessKeys",
				"iam:ListAttachedUserPolicies",
				"iam:ListGroupsForUser",
				"iam:ListMFADevices",
				"iam:ListRolePolicies",
				"iam:ListRoles",
				"iam:GetRole",
				"iam:ListUsers",
				"iam:ListUserTags",
				"iam:ListAttachedRolePolicies",
				"iam:ListAttachedUserPolicies",
				"iam:TagUser",
				"iam:ListUserPolicies",
				"account:GetContactInformation"
			],
			"Resource": "*"
		}
	]
}
```

3. After entering the details, click **Next**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710834614108-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=27e3d3b3a096ba79f0adc005604bd302" alt="Policy JSON editing screen" width="3254" height="1850" data-path="images/integrations/dc2mjsw9oy/1710834614108-image.png" />

4. On the next screen, enter any name in the **Policy name** field and click **Create policy**. The policy is now created.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710834732620-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=7277c40e9d03a9ddb4a6588958947401" alt="Policy name input screen" width="2562" height="1774" data-path="images/integrations/dc2mjsw9oy/1710834732620-image.png" />

### How to Create an Integration Role

1. Go to [Identity and Access Management (IAM)](https://console.aws.amazon.com/iam), click **Roles** in the left menu, then click **Create role**.

Note: Role LastActivity cannot be retrieved.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710834870029-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=bd018f095dbf223ebf4ced2efefe7ec6" alt="IAM Roles screen" width="3068" height="820" data-path="images/integrations/dc2mjsw9oy/1710834870029-image.png" />

2. Under Select trusted entity, enter the following values:

* Trusted entity type: Select **AWS account**
* AWS account: Select **Another AWS account** and enter `162001151631` as the Account ID
* Check **Require external ID (Best practice when a third party will assume this role)**
* For the External ID, enter a random alphanumeric string (at least 24 characters, no symbols recommended)
* Uncheck **Require MFA**

Click **Next** when done.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710835053479-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=00a62ce616d1f8db0a1946badc8d1f41" alt="Role creation screen" width="2984" height="1608" data-path="images/integrations/dc2mjsw9oy/1710835053479-image.png" />

3. The Add permissions screen will appear. Select the policy created in the previous step, scroll down, then click **Next**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710835121503-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=3cb36a15b59dee2c38bffc3547410df4" alt="Add permissions screen" width="3198" height="1776" data-path="images/integrations/dc2mjsw9oy/1710835121503-image.png" />

4. Enter a name for the role (any name), scroll down, then click **Create role**. The role is now created.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710835217427-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=1ae23f9b7659480139c87189d13e4499" alt="Role name input screen" width="3270" height="1770" data-path="images/integrations/dc2mjsw9oy/1710835217427-image.png" />

### How to Find the Role ARN

Search for the role you created on the Roles screen and click it.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710835390111-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=6b437d629b46a9153b03349a84c22cfc" alt="Roles list screen" width="3080" height="526" data-path="images/integrations/dc2mjsw9oy/1710835390111-image.png" />

The **Role ARN** will be displayed. Copy and save it.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1710835338354-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=5c30778ecbaef22edab598818483d2ea" alt="Role ARN display screen" width="3052" height="720" data-path="images/integrations/dc2mjsw9oy/1710835338354-image.png" />

## Integration Setup

1. In the MoneyForward Admina integration screen, search for **AWS IAM**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1754989747725-screenshot.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=656073e199b43c76dc78558850102a0e" alt="Admina integration search screen" width="650" height="426" data-path="images/integrations/dc2mjsw9oy/1754989747725-screenshot.png" />

2. Enter the **Role ARN** obtained in the previous step and the **External ID** set when creating the role.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1754989840214-screenshot.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=041efd2f7d9b18ef2dc8e3ddbed5f586" alt="Role ARN input screen" width="656" height="592" data-path="images/integrations/dc2mjsw9oy/1754989840214-screenshot.png" />

3. Select the permissions.

If you do not want to retrieve roles during integration, select **Read And Write (excluding roles)**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1754989918912-screenshot.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=9958f0f3636a1a0f240179bc2ee90ae3" alt="Permissions selection screen" width="610" height="258" data-path="images/integrations/dc2mjsw9oy/1754989918912-screenshot.png" />

4. Review the entered details and click **Connect**.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1754990118378-screenshot.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=6eacada90cc928517b1b175ecbc8a7f6" alt="Integration confirmation screen" width="172" height="82" data-path="images/integrations/dc2mjsw9oy/1754990118378-screenshot.png" />

5. Once the integration with AWS is successful, the registered user information will appear in the account list.

If the integration does not complete successfully, go to the Status tab on the integration screen, click **Edit**, and try connecting again.

If the issue persists, please contact us via chat.

For an overview of the AWS integration, visit the [integration page](http://admina.moneyforward.com/en/integrations/amazon-web-service-aws).

### Supplement: Retrieving Email Addresses

AWS does not retrieve email addresses by default, so the user type will be shown as "Unknown" or "System."

To retrieve email addresses, use one of the following methods:

1. Use the [Account Merge feature](/en/it-management/saas-management/d97dy5z2l7-merge)

This allows user types to be assigned, enabling more accurate management of offboarded employees.

2. Assign email addresses directly to IAM users using tags.

By setting the tag key to `email` and the tag value to the email address, MoneyForward Admina will retrieve the email address.

<img src="https://mintcdn.com/moneyforwardi/tJkXXxBZH7Ty4mGf/images/integrations/dc2mjsw9oy/1667987881744-image.png?fit=max&auto=format&n=tJkXXxBZH7Ty4mGf&q=85&s=17b8a4b21af6fbc8ebcbeda8cb6dbed0" alt="IAM tag settings screen" width="2754" height="610" data-path="images/integrations/dc2mjsw9oy/1667987881744-image.png" />
