# Preparation

* This page explains things you need to be done on your AWS account for start using Mobingi Wave.
* After finishing preparation, you will need to give Mobingi the below informations.&#x20;

```
- AWS account ID (12 digit numbers).

- Information of the report you made.

    - Report name

    - S3 bucket

    - Report path prefix, or Report path

- ARN of IAM Role which allow the specific bucket.(Ex: arn:aws:iam::xxxxxxxxxxxx:role/crossacounnt-access-for-mobingi)
```

## Step 1 : Create S3 bucket and daily report (option) <a href="#step1" id="step1"></a>

* Create daily repot with the AWS account you want to share the billing information with Wave.
* You can skip if you already have the report definition with below conditions.

  `Time unit:` `Hourly`

  `Rsource IDsis included in the report.`

  `There is no object which Mobingi shouldn't see.(Since the access atuhority will be a whole bucket).`

### Step1-1: **Create S3 bucket**

* Create bucket with any name from S3 bucket. Option can leave as default.

  Please keep the bucket name for using it as output destination of report.

### Step1-2: Create daily report

* Choose **Billing** from AWS management console and move to **Reports**.

Click **Create report**.

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIONedwKYPnq5oHKL_W%2F-LIOgRG3_avdKD30zae4%2FSnip20180727_7.png?alt=media\&token=358cb9e8-1cb5-4b8e-8ce3-544a9bacc403)

* Fill out `Step 1: Select Content` same as below.
  * Report name: Any
  * Time unit: **Hourly**
  * Include: **Resource IDs**
  * Enable support for...: Optional

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LNwmDCVzvrwx1ftXcnI%2F-LNwmUKCPN2a-tHp6BHy%2FSnip20181004_14.png?alt=media\&token=1257ac39-3f0c-44f5-b5ac-ce08710f1fbd)

* `Step2: Select Delivery Options` will be the following process.
  * Put S3 bucket name (you made at Step1-1)
  * Display and copy **Sample policy** (\* make sure to click after you entered S3 bucket name)

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LNwmDCVzvrwx1ftXcnI%2F-LNwm_N5JlakvI_PiQpw%2FSnip20181004_16.png?alt=media\&token=d764239c-b63a-49aa-b30e-9097df75bea5)

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIONedwKYPnq5oHKL_W%2F-LIOjN11YZ8VXI-P4kT7%2FSnip20180727_10.png?alt=media\&token=c79c4879-afdf-43e9-a981-7c324160f7f0)

* After copy **sample policy,** open the **S3 bucket which you create on step1-1** and open detail (\* we suggest to open the page with new window or new tab).
* On S3 page, go to **Permissions** >> **Bucket Policy.**
* Put the policy you copied at before into **Bucket policy editor** and Save.

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIONedwKYPnq5oHKL_W%2F-LIOnVSCnSHb5s4vee-1%2FSnip20180727_17.png?alt=media\&token=ceabe5b8-3615-4c0c-96de-bab5eb4731ea)

Go back to `Step2: Select Delivery Options` and put below info.

* Report path prefix: Optional  (\*blank also works)&#x20;
* Compression: Optional

It shows **Valid Bucket** only when the bucket policy is correct.

Check your S3 again.

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LNwmDCVzvrwx1ftXcnI%2F-LNwmf-PVVBjsAW96zgi%2FSnip20181004_16.png?alt=media\&token=cc656c42-21e1-4153-b1a3-8272eae5cb27)

Check the info again and click **Review and Complete.**

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LNwmDCVzvrwx1ftXcnI%2F-LNwml6cxEDp0N4vglQS%2FSnip20181004_18.png?alt=media\&token=1bfb83f8-2bf6-49d6-bae2-b57e7a191b08)

## Step 2 : Create IAM role for Mobingi <a href="#step2" id="step2"></a>

From AWS management console, select **IAM** service and click **Roles** >> **Create role.**

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiFAu6MvqLmF8dBEFs%2F-LIiFOMlOXismoU7Y_Tq%2FSnip20180727_19.png?alt=media\&token=aa0ac553-9c92-4f8c-bee0-a197b24d5106)

Choose **Another AWS Account** at `Select type of trusted entity`and put Mobingi account ID.

* Mobingi Account ID: 131920598436

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiFAu6MvqLmF8dBEFs%2F-LIiGT4sBGfZ4xKWnQ9H%2FSnip20180727_21.png?alt=media\&token=ce79c009-e526-4016-b84a-3f49bcfd1aba)

Click **Create policy**.

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiFAu6MvqLmF8dBEFs%2F-LIiGvwlVshnEL6lGAek%2FSnip20180727_23.png?alt=media\&token=b1fe0b3b-da26-4c83-b35d-8a3582e0b335)

New tab or window will open. Choose JSON as input format and type the policy same as below. Make sure to change`{replace_to_report_bucket}` at "Resource" to **the bucket name you use for report.**

```bash
{
    "Version": "2012-10-17",
    "Statement": [
         {
               "Effect": "Allow",
               "Action": [
                     "s3:Get*",
                     "s3:List*"
               ],
               "Resource": [
                     "arn:aws:s3:::{replace_to_report_bucket}",
                     "arn:aws:s3:::{replace_to_report_bucket}/*"
               ]
         }
   ]
}
```

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LYdjmYW086v2nHT7pUd%2F-LYdjugo94_Cm8941hZZ%2Fcreate-policy-en.png?alt=media\&token=01fbf66f-4ae4-433b-83a4-7aadd069c013)

After fill the informations below, you can finish to create policy.

* Name: Any (\*required)
* Description: Option

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiFAu6MvqLmF8dBEFs%2F-LIiFgJCKNMA3R9_Zi3Y%2FSnip20180727_31.png?alt=media\&token=10a0cdf3-277d-4b79-9e34-a8b7403a236f)

Go back to **Create Role** and refresh, the policy suppose to display on the list. Active the policy and move to review page. *\*\**

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiFAu6MvqLmF8dBEFs%2F-LIiI6Exnwh5jADTN7Dx%2FSnip20180727_33.png?alt=media\&token=0f3744c9-e627-4f94-8345-46c209d664e7)

At **Review**, fill the informations below.

* Role name: Any (\*required)
* Role description: Option

After check **Trusted entities** and **Policies** are correctly applied, click **Create role**.

![](https://3832719824-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LEMvLfZDvQFZLQc2YmY%2F-LIiK-hvvk4HNjLYHNTt%2F-LIiK5CyayelVEmWrwY1%2FSnip20180731_39.png?alt=media\&token=9f8556fa-1e3f-4464-a12c-d8188ea84d14)

Keep the ARN of the role.
