Mavvrik supports both types of AWS authentication:
Role-based access is generally considered to be more secure than user-based access, as it allows organizations to control access to resources and functions based on defined roles and responsibilities. We recommend using roles over individual users
Roles
-
Login to AWS Member account you're trying to onboard as an Administrator if not already logged in. And navigate to
IAMservice using AWS search bar. -
On the
IAMConsole, SelectRolesfrom the left menu, and clickCreate role. -
Select
Custom trust policy -
Copy the JSON
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["sts:AssumeRole"], "Principal": { "AWS": [ "arn:aws:iam::911403356698:user/global-user-for-assume-role", "arn:aws:iam::911403356698:user/mavvrik-svc-user", "arn:aws:iam::911403356698:role/mavvrik-svc-role" ] }, "Condition": { "StringEquals": { "sts:ExternalId": "<TENANT-ID>" } } } ] } -
Paste the copied JSON in Custom trust policy editor
Paste the custom trust policy JSON -
Remove <TENANT-ID>
-
Enter your tenant id as shown image. To get the tenant id to follow instructions,
-
-
Login to Mavvrik
-
From the side menu, select
APIunder theAdminsection -
Capture the Tenant ID
-
-
Click
Next, on next screen for permissions, Choose 'AWS Managed - job function' in the filter. Search and select the listed policies below.-
ReadOnlyAccess -
ViewOnlyAccess
-
Choose 'AWS Managed in the filter. Search and select the listed policies below.
-
IAMReadOnlyAccess -
CloudWatchReadOnlyAccess -
ComputeOptimizerReadOnlyAccess -
AWSOrganizationsReadOnlyAccess
or use the policy Step 2: Create an IAM role for Mavvrik | OR use below permissions and create a inline policy for the newly created role if you don't wish to use IAMReadOnlyAccess
-
Click
Nextagain & on a final page, enter a name to the role & clickCreate role -
Search for the newly created role
-
Click on Add permissions → Create inline policy.
-
Search for Cost Explorer Service
-
Click on Write → StartSavingsPlansPurchaseRecommendationGeneration →
Next
-
Enter the policy name.
-
Click on
Create policy.
-
Once the role is created, please note the ARN of a role, which will be required in the next step.
OR use below permissions and create an inline policy for the newly created role
ReadOnlyAccess
ViewOnlyAccess
CloudWatchReadOnlyAccess
ComputeOptimizerReadOnlyAccess
AWSOrganizationsReadOnlyAccess
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowIAMReadOnlyActions",
"Effect": "Allow",
"Action": [
"iam:SimulatePrincipalPolicy",
"iam:GetAccountSummary"
],
"Resource": "arn:aws:iam::<ACCOUNT_ID>:role/<ROLE_NAME>"
},
{
"Sid": "DenyAllOtherIAMActions",
"Effect": "Deny",
"NotAction": [
"iam:SimulatePrincipalPolicy",
"iam:GetAccountSummary"
],
"Resource": "arn:*:iam::*:*"
}
]
}
Enable AWS Cost Optimization Hub (once per account)
Mavvrik reads cost-saving recommendations from AWS Cost Optimization Hub. The policies above already give Mavvrik read access, so no extra policy is needed. The account must be enrolled:
-
Open the Billing and Cost Management console → Cost Optimization Hub.
-
On the Cost Optimization Hub page, choose your relevant organization and member account settings:
-
Enable Cost Optimization Hub for this account and all member accounts: Recommendations in this account and all member accounts will be imported into Cost Optimization Hub.
-
Enable Cost Optimization Hub for this account only: Only recommendations in this account will be imported into Cost Optimization Hub.
-
-
Choose Enable. Recommendations appear in Mavvrik about 24 hours after enrollment.
You can also enable Cost Optimization Hub through AWS CLI
aws cost-optimization-hub update-enrollment-status --status Active --region us-east-1
Permissions for the person enabling it: cost-optimization-hub:UpdateEnrollmentStatus, plus iam:CreateServiceLinkedRole and iam:PutRolePolicy on the AWSServiceRoleForCostOptimizationHub role (AWS: Getting started with Cost Optimization Hub).
Recommended: in Cost Management preferences → Cost Optimization Hub → Savings estimation mode, choose After discounts in every account Mavvrik connects to, so savings reflect your Reserved Instances and Savings Plans. In an AWS Organization, the management account must also set Member account discount visibility to All (Cost Management preferences → Cost Optimization Hub).
Users
-
Login to AWS Member account you're trying to onboard as an Administrator if not already logged in. And navigate to
IAMservice using AWS search bar. -
On the
IAMConsole, SelectUsersfrom the left menu
-
Click on Create User
-
Enter the Username & click Next.
-
Select Attach policies directly, on next screen for permissions, please choose 'All Types' in the filter and select the listed policies below.
-
ReadOnlyAccess -
ViewOnlyAccess -
IAMReadOnlyAccess -
CloudWatchReadOnlyAccess -
ComputeOptimizerReadOnlyAccess -
AWSOrganizationsReadOnlyAccess
-
or you can use below policies
ViewOnlyAccess
CloudWatchReadOnlyAccess
ComputeOptimizerReadOnlyAccess
AWSOrganizationsReadOnlyAccess
-
Click
Nextagain & on a final page, give a name to the role & clickCreate user
-
Once the user is created, please click on the user to create a Secret Key
-
Go to Security Credentials tab & Click on Create Access Key
-
Select Application running outside AWS & Click on Next
-
Click on Create access key.
-
Secret Key will get generated.
-
Copy the Access Key & Secret Key which will be required in the next step.
-
Open newly created user
-
Click on Add permissions → Create inline policy.
-
Search for Cost Explorer Service
-
Click on Write → StartSavingsPlansPurchaseRecommendationGeneration →
Next
-
Enter the policy name.
-
Click on
Create policy.
Enable AWS Cost Optimization Hub (once per account)
Mavvrik reads cost-saving recommendations from AWS Cost Optimization Hub. The policies above already give Mavvrik read access, so no extra policy is needed. The account must be enrolled:
-
Open the Billing and Cost Management console → Cost Optimization Hub.
-
On the Cost Optimization Hub page, choose your relevant organization and member account settings:
-
Enable Cost Optimization Hub for this account and all member accounts: Recommendations in this account and all member accounts will be imported into Cost Optimization Hub.
-
Enable Cost Optimization Hub for this account only: Only recommendations in this account will be imported into Cost Optimization Hub.
-
-
Choose Enable. Recommendations appear in Mavvrik about 24 hours after enrollment.
You can also enable Cost Optimization Hub through AWS CLI
aws cost-optimization-hub update-enrollment-status --status Active --region us-east-1
Permissions for the person enabling it: cost-optimization-hub:UpdateEnrollmentStatus, plus iam:CreateServiceLinkedRole and iam:PutRolePolicy on the AWSServiceRoleForCostOptimizationHub role (AWS: Getting started with Cost Optimization Hub).
Recommended: in Cost Management preferences → Cost Optimization Hub → Savings estimation mode, choose After discounts in every account Mavvrik connects to, so savings reflect your Reserved Instances and Savings Plans. In an AWS Organization, the management account must also set Member account discount visibility to All (Cost Management preferences → Cost Optimization Hub).