Understand how to set up and manage the AWS integration by using the Wavefront REST API.

The Amazon Web Services integration allows you to ingest metrics directly from AWS. In addition to setting up and managing the AWS integration through the UI, you can also use the Wavefront REST API for setting up and managing the AWS integration. This doc page provides some basic steps and examples on how to do this.

In these examples, you access the REST API through the interface, so that you don’t need to provide the Bearer token.

Before You Start

To set up the Amazon Web Services integration, you must provide Tanzu Observability by Wavefront with read-only access to your Amazon account. To do that, you need to provide an account ID and external ID. While the account ID is a constant value (in our case - the Wavefront ID) to which you want to grant access to your resources, the external ID is not a constant value. The external ID is a secret identifier that is known by you and Tanzu Observability by Wavefront (the third-party). The external ID is time-sensitive and regenerated each time you reopen the AWS Integration setup page, and you cannot reuse it.

For information about external IDs and how they are used in AWS, see How to Use External ID When Granting Access to Your AWS Resources.

For more information, see Giving Tanzu Observability Access to Your AWS Account.

Create an External ID

  1. Log in to your Wavefront cluster.
  2. Click the gear icon in the top right and select API Documentation.
  3. Expand the Cloud Integration category.
  4. To create a new cloud integration, click the POST /api/v2/cloudintegration/awsExternalId request.
  5. Click the Try it out button in the top right of the request and click Execute.
  6. Copy the external ID from the response body of the request.

    {
      "status": {
     "result": "OK",
     "message": "",
     "code": 200
      },
      "response": "<external-ID>"
      }
    

Provide Read-Only Access to Your Amazon Account and Get the Role ARN

  1. Log in to your AWS account.
  2. Search for the IAM (AWS Identity and Access Management) service and click it.
  3. Under Access management on the left, click Roles.
  4. Click Create role.
  5. Click the AWS account tile, and select the Another AWS account radio button.
  6. Enter the Wavefront account information:
    • Account ID - The identifier of the Wavefront account to which you want to grant access. To get the Wavefront account ID:
      1. Navigate to your Wavefront cluster.
      2. Click Integrations on the toolbar and click the Amazon Web Services integration tile.
      3. Click the Setup tab and click the How to get Role ARN link.
      4. Copy the Account ID displayed in the instructions.
    • Select the Require external ID check box and provide the external ID that you have copied.

      You can also copy and paste the External ID displayed in the instructions on the Amazon Web Services integration Setup page (in the Wavefront instance UI).

  7. Click Next.
  8. On the Add permissions screen, search for, and select the ReadOnlyAccess check box.
  9. Click Next.
  10. In the Role name text box, provide a unique name of the role and click Create role.
  11. On the Roles page, click the newly created role.
  12. Copy the ARN value, so that you can use it when you configure your AWS integration.

Set Up an AWS Integration

You can add an AWS integration by using the Wavefront REST API.

  1. Log in to your Wavefront cluster.
  2. Click the gear icon in the top right and select API Documentation.
  3. Expand the Cloud Integration category.
  4. To create a new cloud integration, click the POST /api/v2/cloudintegration request.
  5. Click the Try it out button in the top right of the request.
  6. To add an integration, in the Edit Value text box enter one of the following examples for each AWS integration.

    You can add one integration at a time. You cannot use a single API request to register all AWS services together.

    • CloudWatch integration:

      {
      "name":"CloudWatch integration",
      "service":"CLOUDWATCH",
      "cloudWatch":{
       "baseCredentials":{
       "roleArn":"arn:aws:iam::<accountid>:role/<rolename>",
       "externalId":"string"
       },
       "metricFilterRegex":"^aws.(sqs|ec2|ebs|elb).*$",
       "pointTagFilterRegex":"(region|name)"
      },
      "serviceRefreshRateInMins":5
      }
      
    • AWS Metrics+ integration:

      {
      "name":"AWSMetric+ integration",
      "service":"ec2",
      "ec2":{
       "baseCredentials":{
       "roleArn":"arn:aws:iam::<accountid>:role/<rolename>",
      "externalId": "string"
       },
       "metricFilterRegex":"^aws.(sqs|ec2|ebs|elb).*$",
       "pointTagFilterRegex":"(region|name)"
      },
      "serviceRefreshRateInMins":5
      }
      
    • CloudTrail integration:

      {
        "name":"CloudTrail integration",
        "service":"cloudTrail",
      "region":"string",
      "prefix": "string",
      "bucketName":"string"
        "cloudTrail":{
       "baseCredentials":{
      "roleArn":"arn:aws:iam::<accountid>:role/<rolename>",
        "externalId":"string"
       },
       "filterRule":"string"
      }
      

    In these examples, the roleArn value is the Role ARN from your Amazon account, and the externalId value is the external ID that you have provided while you created the role. If you don’t provide an external ID, the request will time out.

  7. Click Execute.

Update an AWS Integration

You can update an AWS integration through the API. You do not need the external ID value to update an existing AWS integration.

In this example, we update an existing CloudWatch integration to retrieve the service metrics for 10 more services in addition to DynamoDB:

  • EBS
  • ApiGateway
  • EC2
  • ELB
  • ElastiCache
  • ApplicationELB
  • SES
  • NATGateway
  • AutoScaling
  • RDS

We also add the metrics for these services to a metric allow list by using a regular expression and change the service refresh rate from 5 to 10 minutes.

  1. In the Wavefront REST API documentation, click the GET/api/v2/cloudintegration request.
  2. Click the Try it out button in the top right of the request and click Execute.

    In the Response Body section, under namespaces you can see the list of all configured cloud services integrations. For example:

     {
      "forceSave": false,
      "name": "AWS",
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee",
      "service": "CLOUDWATCH",
      "lastReceivedDataPointMs": 1634038298092,
      "lastMetricCount": 210,
      "cloudWatch": {
        "namespaces": [
          "AWS/DynamoDB"
        ],
        "metricFilterRegex": "",
        "baseCredentials": {
          "roleArn": "arn:aws:iam::<accountid>:role/<rolename>"
        },
        "pointTagFilterRegex": "",
        "instanceSelectionTags": {},
        "volumeSelectionTags": {}
      },
      "disabled": false,
      "lastProcessorId": "3198d07c-210c-4670-9bd0-eb407d2a71dc",
      "lastProcessingTimestamp": 1634038421682,
      "createdEpochMillis": 1620216033503,
      "updatedEpochMillis": 1622707203597,
      "serviceRefreshRateInMins": 5,
      "deleted": false,
      "inTrash": false,
      "lastErrorEvent": {
        ...
        ...
    
      "creatorId": "user-account-email-address",
      "updaterId": "user-account-email-address"
    },
    
    

    In this example, you can see that the CloudWatch integration retrieves only DynamoDB metrics and that the service refresh rate is 5 minutes.

  3. Copy the value of the "id" parameter of the integration that you want to update.
  4. Copy the content of the response in a text file.
  5. Edit the copied response body.

    1. To update the list of services, under "namespaces", add the list of services:

      Updated list of services.

    2. To add the regular expression, under the list of services, add the following "metricFilterRegex" value:

      Regular expression to allow the metrics flow from the updated list of services.

    3. To change the service refresh rate to 10 minutes, update the "serviceRefreshRateInMins" value:

      Updated service refresh rate from 5 to 10 minutes.

    The updated response body will look like that:

    {
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee",
      "name":"AWS",
      "service":"CLOUDWATCH",
      "cloudWatch":{
     "namespaces": [
       "AWS/DynamoDB"
       "AWS/EBS",
       "AWS/ApiGateway",
       "AWS/EC2",
       "AWS/ELB",
       "AWS/ElastiCache",
       "AWS/ApplicationELB",
       "AWS/SES",
       "AWS/NATGateway",
       "AWS/AutoScaling",
       "AWS/RDS"
     ],
     "metricFilterRegex":^(aws.(ecs|ses|instance|autoscaling|sqs|sns|reservedInstance|ebs|route53.health|ec2.status|ec2.cpuutilization|ec2.network|ec2.autoscaling|autoscaling|elb|dynamodb|kinesis|firehose|s3|applicationelb|networkelb|lambda|rds|elasticache|applicationelb|natgateway).*),
     "pointTagFilterRegex": "",
     "baseCredentials":{
       "roleArn":"arn:aws:iam::<accountid>:role/<rolename>"
     },
     "instanceSelectionTags": {},
     "volumeSelectionTags": {}
     }
     },
     "disabled": false,
     "lastProcessorId": "3198d07c-210c-4670-9bd0-eb407d2a71dc",
     "lastProcessingTimestamp": 1634038421682,
     "createdEpochMillis": 1620216033503,
     "updatedEpochMillis": 1622707203597,
     "serviceRefreshRateInMins": 10,
     "deleted": false,
     "inTrash": false,
     "lastErrorEvent": {
       ...
       ...
    
     "creatorId": "user-account-email-address",
     "updaterId": "user-account-email-address"
      },
    
    
  6. In the Wavefront REST API documentation, click the PUT /api/v2/cloudintegration/{id} request.
  7. Click the Try it out button in the top right of the request.
  8. Under Parameters, in the id text box enter the ID of the integration that you copied.
  9. In Edit Value text box enter the edited response body with the new services.
  10. Click Execute.
  11. Verify that the response returns 200 status code to indicate that the update was successful.

Enable and Disable an AWS Integration

Tanzu Observability automatically disables integrations that are experiencing errors due to invalid credentials. To enable an integration after the credential has been corrected or to manually disable an integration, you need the integration ID.

  1. In the Wavefront REST API documentation, click the GET/api/v2/cloudintegration request.
  2. Click the Try it out button in the top right of the request and click Execute.

    In the Response Body section, you can see the list of all configured cloud services integrations. For example:

     {
      "forceSave": false,
      "name": "AWS",
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee",
      "service": "CLOUDWATCH",
      "lastReceivedDataPointMs": 1634038298092,
      "lastMetricCount": 210,
      "cloudWatch": {
        "namespaces": [
          "AWS/DynamoDB"
        ],
        "metricFilterRegex": "",
        "baseCredentials": {
          "roleArn": "arn:aws:iam::<accountid>:role/<rolename>"
        },
        "pointTagFilterRegex": "",
        "instanceSelectionTags": {},
        "volumeSelectionTags": {}
      },
      "disabled": false,
      "lastProcessorId": "3198d07c-210c-4670-9bd0-eb407d2a71dc",
      "lastProcessingTimestamp": 1634038421682,
      "createdEpochMillis": 1620216033503,
      "updatedEpochMillis": 1622707203597,
      "serviceRefreshRateInMins": 5,
      "deleted": false,
      "inTrash": false,
      "lastErrorEvent": {
        ...
        ...
    
      "creatorId": "user-account-email-address",
      "updaterId": "user-account-email-address"
    },
    
    
  3. Copy the value of the "id" parameter of the cloud integration that you want to enable or disable.
  4. To enable the integration, run the POST /api/v2/cloudintegration/{id}/enable request with the ID of the integration that you copied.
  5. To disable the integration, run the POST /api/v2/cloudintegration/{id}/disable request with the ID of the integration that you copied.

Delete and Recover a Deleted AWS Integration

To delete a cloud service integration that you no longer want to use, you need the integration ID. If you decide to move the integration to the recycle bin, you can recover it at a later stage.

  1. In the Wavefront REST API documentation, click the GET/api/v2/cloudintegration request.
  2. Click the Try it out button in the top right of the request and click Execute.

    In the Response Body section, you can see the list of all configured cloud services integrations. For example:

     {
      "forceSave": false,
      "name": "AWS",
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee",
      "service": "CLOUDWATCH",
      "lastReceivedDataPointMs": 1634038298092,
      "lastMetricCount": 210,
      "cloudWatch": {
        "namespaces": [
          "AWS/DynamoDB"
        ],
        "metricFilterRegex": "",
        "baseCredentials": {
          "roleArn": "arn:aws:iam::<accountid>:role/<rolename>"
        },
        "pointTagFilterRegex": "",
        "instanceSelectionTags": {},
        "volumeSelectionTags": {}
      },
      "disabled": false,
      "lastProcessorId": "3198d07c-210c-4670-9bd0-eb407d2a71dc",
      "lastProcessingTimestamp": 1634038421682,
      "createdEpochMillis": 1620216033503,
      "updatedEpochMillis": 1622707203597,
      "serviceRefreshRateInMins": 5,
      "deleted": false,
      "inTrash": false,
      "lastErrorEvent": {
        ...
        ...
    
      "creatorId": "user-account-email-address",
      "updaterId": "user-account-email-address"
    },
    
    
  3. Copy the value of the "id" parameter of the integration that you want to delete.
  4. To delete the integration, click the DELETE /api/v2/cloudintegration/{id} request.
  5. Click the Try it out button in the top right of the request.
    1. Under Parameters, in the id text box enter the integration ID that you copied.
    2. From the skipTrash drop-down menu select whether you want to keep the deleted integration in the recycle bin.

      • Select false, to move the integration to the recycle bin, so that you can recover it at a later stage.
      • Select true, to delete the integration forever. You won’t be able to recover it.
    3. Click Execute.
  6. To recover an integration from the recycle bin, i.e., an integration that was not permanently deleted, in the Wavefront REST API documentation, click the POST /api/v2/cloudintegration/{id}/undelete request and click Try it out.
    1. Under Parameters, in the id text box enter the ID of the integration that you want to recover.
    2. Click Execute.