Setting up nOps (Manual Setup)

Creating the IAM policy

  1. From AWS console login, go to ‘Identity and Access Management’ screen.
  2. From the left navigation panel choose ‘Policies’
  3. Click on ‘Create Policy’.
  4. Choose ‘Json Tab’
  5. Replace the existing Json script with the script given below and the click on ‘Review Policy’. Make sure you replace [bucket_name] with your billing bucket name to ensure policy efficacy.

IAM policy for nOps Last Updated: 20 March, 2020

JSON

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "autoscaling:DescribeAutoScalingGroups",
        "ce:GetCostAndUsage",
        "ce:GetReservationPurchaseRecommendation",
        "ce:GetRightsizingRecommendation",
        "ce:GetSavingsPlansPurchaseRecommendation",
        "cloudformation:DescribeStackResources",
        "cloudformation:DescribeStacks",
        "cloudformation:GetTemplate",
        "cloudtrail:GetTrailStatus",
        "cloudtrail:DescribeTrails",
        "cloudtrail:LookupEvents",
        "cloudwatch:GetMetricStatistics",
        "cloudwatch:ListMetrics",
        "config:DescribeConfigurationRecorderStatus",
        "config:DescribeConfigurationRecorders",
        "config:DescribeDeliveryChannelStatus",
        "config:DescribeDeliveryChannels",
        "cur:DescribeReportDefinitions",
        "cur:PutReportDefinition",
        "dynamodb:DescribeContinuousBackups",
        "dynamodb:DescribeTable",
        "dynamodb:ListTables",
        "ec2:DescribeAddresses",
        "ec2:DescribeInstanceStatus",
        "ec2:DescribeInstances",
        "ec2:DescribeNatGateways",
        "ec2:DescribeNetworkInterfaces",
        "ec2:DescribeRouteTables",
        "ec2:DescribeSecurityGroups",
        "ec2:DescribeSnapshots",
        "ec2:DescribeSubnets",
        "ec2:DescribeVolumes",
        "ec2:DescribeVpcs",
        "ecs:DescribeClusters",
        "ecs:ListClusters",
        "eks:ListClusters",
        "elasticache:DescribeCacheClusters",
        "elasticache:DescribeCacheSubnetGroups",
        "elasticfilesystem:DescribeFileSystems",
        "elasticloadbalancing:DescribeLoadBalancers",
        "es:DescribeElasticsearchDomains",
        "iam:GetAccessKeyLastUsed",
        "iam:GetAccountSummary",
        "iam:GetLoginProfile",
        "iam:GetRole",
        "iam:ListAccessKeys",
        "iam:ListAccountAliases",
        "iam:ListAttachedGroupPolicies",
        "iam:ListAttachedUserPolicies",
        "iam:ListGroupsForUser",
        "iam:ListMFADevices",
        "iam:ListRoles",
        "iam:ListUserPolicies",
        "iam:ListUsers",
        "lambda:GetFunction",
        "lambda:ListFunctions",
        "rds:DescribeDBInstances",
        "rds:DescribePendingMaintenanceActions",
        "rds:ListTagsForResource",
        "s3:GetBucketAcl",
        "s3:GetBucketLogging",
        "s3:GetBucketPolicy",
        "s3:GetBucketPolicyStatus",
        "s3:GetBucketPublicAccessBlock",
        "s3:GetBucketVersioning",
        "s3:GetEncryptionConfiguration",
        "s3:HeadBucket",
        "s3:ListAllMyBuckets",
        "support:DescribeTrustedAdvisorCheckRefreshStatuses",
        "support:DescribeTrustedAdvisorCheckResult",
        "support:DescribeTrustedAdvisorChecks",
        "tag:getResources",
        "tag:getTagKeys",
        "tag:getTagValues"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}
  1. Provide some name and description to the policy.
  2. Click on ‘Create Policy’.

Creating IAM roles

  1. From the left navigation panel choose ‘Roles’
  2. Click on ‘Create Role’
  3. Select type of trusted identity: Choose

Screenshot

  1. Specify accounts that can use this role: AWS will ask for Account ID and External ID. For Account ID enter the nOps account ID (202279780353) and for External ID, enter any unique string. The External ID adds an extra level of security for you. Please do not check ‘Require MFA’. Please save the External ID, you will have to use it while adding the project in nOps.

Screenshot

  1. Click on ‘Next: Permissions’
  2. On Next Step, we will attach policy created in earlier task and then click on ‘Next:Review’
  3. Provide some name and description to the role and click on ‘Create Role’
  4. Return to nOps to complete setup.

Setup Cost & Report Usage

  1. Go to: Billing & Cost Management Dashboard → Report section. https://console.aws.amazon.com/billing/home?#/reports

  2. Click on create report

Screenshot

  1. Enter the report name, and tick Include resource IDs checkbox. (required)

Screenshot

Suggestion:
Report name: nopsbilling-daily-gzip
Tick: Include resource IDs
Tick: Automatically refresh your Cost & Usage Report when charges are detected for previous months with closed bills.

Create the S3 billing bucket

  • Enter the S3 bucket to deliver the report. Click on verify. (Make sure the S3 bucket has appropriate Policy for delivery report, check section II. )
  • Enter the report path prefix (Optional) - Suggestion: nopsbilling
  • Choose Daily (required) for Time granularity
  • Choose the Report versioning (Optional) - Suggestion: Overwrite existing report
  • Choose GZIP as Compression type (Required)

Screenshot

S3 Bucket policy for cost and usage report

  1. Get Sample Policy by clicking on the link.

Screenshot

  1. Go to the S3 bucket → Permissions → Bucket Policy and Save the Policy.

Screenshot

Setup the Cost and Usage report on nOps

Automatically

Provide cur:DescribeReportDefinitions permission for IAM role using for nOps. In the next ingestion, the report would be tried to fetch report data from AWS APU.

Manually:

  • Go to project details.
  • Enter:
    • S3 bucket name
    • Report name
    • Prefix path

Screenshot

Adding project in nOps:

In nops setting up AWS account is a 2-step process. One is adding AWS account details to fetch CloudTrail data and other is adding billing bucket to fetch billing data, you can add both at the same time (recommended). If you don’t add billing bucket your billing stats pages in nops will not show any data.

  1. Login to Nops.io and click on ‘settings’[under username section]

Screenshot

  1. In the Settings page, click on AWS Accounts tab on left.
  2. To add new project, click on ‘Add New AWS Account’.

Screenshot

  1. Select “Manual Setup” method on the “Setup Method” page.

Screenshot

  1. Add AWS Account Name.

Screenshot

  1. For role based access, we need arn of the IAM role.

Retrieving the ARN

  • Go to IAM service in AWS. In the roles tab, look for the role for which we need arn.

Screenshot

  • Click the role and copy the ARN of the role and paste it into the ‘ARN of IAM role’ field in nOps.

Screenshot

  1. For External ID, use the same one you used when created role earlier.

  2. Add billing bucket name. Make sure the billing bucket name is the same as the S3 bucket you created for billing.

  3. Make sure you save the settings after filling all the fields as in screenshot below.

Screenshot

Note: It’ll take about a day for billing data to populate & couple of hours for CloudTrail data to populate. If you have any questions, please contact us at support@nops.io, or by phone at +1 866-673-9330.

Viewing Added Projects:

  1. You can view the list of all added projects in your project settings. To view go to UserName Dropdown (Top right) → Settings → AWS Accounts. where it shows name of billing bucket [If added] and also the “Last fetch” time of billing bucket.

Screenshot

Editing a Existing Project:

  1. Go to UserName Dropdown (Top right) → Settings → AWS Accounts

Screenshot

  1. Click on any project you want to edit and it will open edit “Account Details” page.

Screenshot

  1. You can do changes as per your requirements and make sure to click “Update Account” button in order to save changes.

Note: If you try to edit billing bucket of an existing project it can cause the changes in cost pages data or undesired results.