Getting Started with AWS Using Access Key Credentials
This page introduces you to Cisco Cloud Observability Connections API resources and provides instructions to make your first API request. You'll learn how to create and manage an AWS connection using access key credentials. Examples will be shown using the command line with cURL commands.
Standard REST methods are supported on the Cisco Cloud Observability Connections API, which include POST
, GET
, PATCH
, and DELETE
operations through HTTPS. All payloads to and from the REST interface must be in JSON format.
Base URI
Every API request begins with this base URI:
Copyhttps://{tenant_name}.observe.appdynamics.com/cloud/v2
1. Create an AWS IAM User
To create and manage connections, you'll first need to Create an AWS IAM User in the AWS Management Console.
You'll need to provide the access key ID and the secret access key from the AWS Management Console in the following steps.
2. Create a Connection
Request
To create a connection, provide the connection display name, description, access key ID, and secret access key in the following request:
Copycurl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections' \
--data-raw '{
"displayName": "<display_name>",
"description": "<description>",
"type": "aws",
"details": {
"accessKeyId": "<access_key_ID>",
"secretAccessKey": "<secret_access_key>",
"accessType": "access_key"
}
}'
The response returns the connection id
. Save this value. You'll need to provide it in the following steps.
Example Response
Expand
Copy{
"id": "2db209f8-9f50-4047-ab6f-61cf3858e9db",
"createdAt": "2023-08-02T19:41:43.733Z",
"updatedAt": "2023-08-02T19:41:43.733Z",
"displayName": "access-key-test1",
"description": "Description for this AWS access key connection",
"type": "aws",
"state": "PENDING CONFIGURATION",
"stateMessage": "Finish configuring your connection.",
"details": {
"accessKeyId": "AKIAWC7DFORFNSZ2J5PL",
"secretAccessKey": "*******************",
"accountId": "418698851402",
"accessType": "access_key"
},
"configurationId": ""
}
3. Create a Configuration
To create a configuration, you'll first need to obtain a list of the supported AWS hosting regions and services that you want to monitor.
3a. Get AWS Regions
Request
Obtain the list of supported AWS hosting regions using the following request:
Copycurl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/regions?type=aws' \
--header 'Authorization: Bearer token-generated in auth step'
Example Response
Expand
Copy{
"items": [
{
"id": "us-gov-west-1",
"displayName": "AWS GovCloud (US)"
},
{
"id": "us-gov-east-1",
"displayName": "AWS GovCloud (US-East)"
},
{
"id": "us-east-1",
"displayName": "US East (N. Virginia)"
},
{
"id": "us-east-2",
"displayName": "US East (Ohio)"
},
{
"id": "us-west-1",
"displayName": "US West (N. California)"
},
{
"id": "us-west-2",
"displayName": "US West (Oregon)"
},
{
"id": "eu-west-1",
"displayName": "EU (Ireland)"
},
{
"id": "eu-west-2",
"displayName": "EU (London)"
},
{
"id": "eu-west-3",
"displayName": "EU (Paris)"
},
{
"id": "eu-central-1",
"displayName": "EU (Frankfurt)"
},
{
"id": "eu-north-1",
"displayName": "EU (Stockholm)"
},
{
"id": "eu-south-1",
"displayName": "EU (Milan)"
},
{
"id": "ap-east-1",
"displayName": "Asia Pacific (Hong Kong)"
},
{
"id": "ap-south-1",
"displayName": "Asia Pacific (Mumbai)"
},
{
"id": "ap-southeast-1",
"displayName": "Asia Pacific (Singapore)"
},
{
"id": "ap-southeast-2",
"displayName": "Asia Pacific (Sydney)"
},
{
"id": "ap-northeast-1",
"displayName": "Asia Pacific (Tokyo)"
},
{
"id": "ap-northeast-2",
"displayName": "Asia Pacific (Seoul)"
},
{
"id": "ap-northeast-3",
"displayName": "Asia Pacific (Osaka)"
},
{
"id": "sa-east-1",
"displayName": "South America (Sao Paulo)"
},
{
"id": "cn-north-1",
"displayName": "China (Beijing)"
},
{
"id": "cn-northwest-1",
"displayName": "China (Ningxia)"
},
{
"id": "ca-central-1",
"displayName": "Canada (Central)"
},
{
"id": "me-south-1",
"displayName": "Middle East (Bahrain)"
},
{
"id": "af-south-1",
"displayName": "Africa (Cape Town)"
},
{
"id": "us-iso-east-1",
"displayName": "US ISO East"
},
{
"id": "us-isob-east-1",
"displayName": "US ISOB East (Ohio)"
},
{
"id": "us-iso-west-1",
"displayName": "US ISO West"
}
]
}
3b. Get AWS Services
Request
Obtain the list of supported AWS services using the following request:
Copycurl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/services?type=aws' \
--header 'Authorization: Bearer token-generated in auth step'
Example Response
Expand
Copy {
"items": [
{
"id": "ec2",
"displayName": "Elastic Cloud Compute",
"description": "Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment."
},
{
"id": "elb",
"displayName": "Elastic Load Balancing",
"description": "Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, Lambda functions, and virtual appliances. It can handle the varying load of your application traffic in a single Availability Zone or across multiple Availability Zones. Elastic Load Balancing offers four types of load balancers that all feature the high availability, automatic scaling, and robust security necessary to make your applications fault tolerant."
},
{
"id": "ebs",
"displayName": "Elastic Block Storage",
"description": "Amazon EBS provides a range of options for storage performance and cost. These options are divided into two major categories: SSD-backed storage for transactional workloads, such as databases and boot volumes (performance depends primarily on IOPS), and disk-backed storage for throughput intensive workloads, such as MapReduce and log processing (performance depends primarily on MB/s)."
},
{
"id": "rds",
"displayName": "Amazon Relational Database Service",
"description": "Amazon Relational Database Service (or Amazon RDS) is a distributed relational database service by Amazon Web Services (AWS). It is a web service running \"in the cloud\" designed to simplify the setup, operation, and scaling of a relational database for use in applications. Administration processes like patching the database software, backing up databases and enabling point-in-time recovery are managed automatically. Scaling storage and compute resources can be performed by a single API call to the AWS control plane on-demand. AWS does not offer an SSH connection to the underlying virtual machine as part of the managed service."
},
{
"id": "ecs",
"displayName": "Amazon Elastic Container Service",
"description": "Amazon ECS is a fully managed container orchestration service that helps you easily deploy, manage, and scale containerized applications. It deeply integrates with the rest of the AWS platform to provide a secure and easy-to-use solution for running container workloads in the cloud and now on your infrastructure with Amazon ECS Anywhere."
},
{
"id": "lambda",
"displayName": "AWS Lambda",
"description": "AWS Lambda is an event-driven, serverless computing platform provided by Amazon as a part of Amazon Web Services. It is a computing service that runs code in response to events and automatically manages the computing resources required by that code."
},
{
"id": "efs",
"displayName": "Amazon Elastic File System",
"description": "Amazon Elastic File System is a cloud storage service provided by Amazon Web Services designed to provide scalable, elastic, concurrent with some restrictions, and encrypted file storage for use with both AWS cloud services and on-premises resources."
},
{
"id": "api_gateway",
"displayName": "Amazon API Gateway",
"description": "Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud."
},
{
"id": "eks",
"displayName": "Amazon Elastic Kubernetes Service",
"description": "Amazon Elastic Kubernetes Service (Amazon EKS) is a managed Kubernetes service to run Kubernetes in the AWS cloud and on-premises data centers."
},
{
"id": "autoscaling",
"displayName": "AWS Autoscaling",
"description": "AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost."
},
{
"id": "kinesis",
"displayName": "Amazon Kinesis Data Streams",
"description": "Amazon Kinesis Data Streams is a fully managed, serverless data streaming service that stores and ingests various streaming data in real time at any scale."
}
]
}
3c. Create a Configuration
Note: The default polling interval is 5 minutes. This interval is currently not configurable.
Create a configuration by providing the supported AWS hosting regions and services that you want to monitor in the following request. You can also specify if tags should be imported or if a tag filter should be used.
Request
Copy curl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "<configuration_display_name>",
"description": "<configuration_description>",
"type": "aws",
"details": {
"importTags": {
"enabled": <true_or_false>,
"excludedKeys": [
"<key>",
"<key>"
]
},
"tagFilter": "<(tags(env) = 'tag_name' || tags(env) = 'env_name'))>",
"regions": [
"<region>",
"<region>"
],
"polling": {
"interval": <interval_number>,
"unit": "<unit>"
},
"services": [
{
"name": "<service_name>",
"polling": {
"interval": <interval number>,
"unit": "<unit>"
}
},
{
"name": "<service_name>",
"polling": {
"interval": <interval number>,
"unit": "<unit>"
}
}
]
}'
The response returns the configuration id
. Save this value. You'll need to provide it in the following steps.
Example Request
Expand
Copycurl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "Example AWS Configuration",
"description": "AWS Example Configuration",
"type": "aws",
"details": {
"importTags": {
"enabled": true,
"excludedKeys": [
"local",
"sandbox"
]
},
"tagFilter": "(tags(env) = 'prod' || tags(env) = 'production'))",
"regions": [
"us-east-1",
"us-west-1"
],
"polling": {
"interval": 5,
"unit": "minute"
},
"services": [
{
"name": "elb",
"polling": {
"interval": 5,
"unit": "minute"
}
},
{
"name": "ec2",
"polling": {
"interval": 5,
"unit": "minute"
}
}
]
}'
Example Response
Expand
Copy{
"id": "92b9df33-25fc-439c-9f98-0efaafbb5ed9",
"type": "aws",
"displayName": "TestAWSConfig",
"description": "",
"details": {
"polling": {
"interval": 5,
"unit": "minute"
},
"services": [
{
"name": "ec2",
"polling": {
"interval": 5,
"unit": "minute"
},
"tagFilter": ""
}
],
"importTags": {
"enabled": true,
"excludedKeys": []
},
"regions": [],
"tagFilter": ""
},
"createdAt": "2023-08-02T19:43:18.872Z",
"updatedAt": "2023-08-02T19:43:18.872Z"
}
4. Update a Connection
To start data collection, you'll need to update the connection to add the configuration ID.
You can also update the following editable and immutable fields during this step:
Connection Type | Field | Editable? | Notes |
---|---|---|---|
AWS Access Key | Connection Name | YES | |
Description | YES | ||
Access Key | YES | AuthN: Validate with already persisted accountId for the connection | |
Secret | YES | AuthN: Validate with already persisted accountId for the connection | |
Type | NO | ||
Access Type | NO |
Any combination of editable fields can be given in the PATCH
connections request.
Request
Provide the connection ID and the configuration ID in the following request:
Copycurl --location -g --request PATCH 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections/<connection_Id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"configurationId": "<configuration_id>",
"state": "ACTIVE"
}
Example Response
Expand
Copy{
"id": "2db209f8-9f50-4047-ab6f-61cf3858e9db",
"createdAt": "2023-08-02T19:41:43.733Z",
"updatedAt": "2023-08-02T19:46:38.968Z",
"displayName": "access-key-test1",
"description": "Description for this AWS access key connection",
"type": "aws",
"state": "CONFIGURED",
"stateMessage": "Start the connection to begin collecting data.",
"details": {
"accessKeyId": "AKIAWC7DFORFNSZ2J5PL",
"secretAccessKey": "*******************",
"accountId": "418698851402",
"accessType": "access_key"
},
"configurationId": "92b9df33-25fc-439c-9f98-0efaafbb5ed9"
}
5. List Your Connections
Next, list your connections to obtain the connection ID of a connection that you want to delete.
Request
Copycurl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'
Example Response
Expand
Copy{
"items": [
{
"id": "d48bb6e1-fab1-4e04-8549-c7d7bb9bcadf",
"createdAt": "2023-07-28T20:01:48.358Z",
"updatedAt": "2023-07-28T20:01:48.358Z",
"displayName": "access-key-test",
"description": "Description for this AWS access key connection without assigned configurationId",
"type": "aws",
"state": "PENDING CONFIGURATION",
"stateMessage": "Finish configuring your connection.",
"details": {
"accessKeyId": "AKIARQIKGMDWD3F5CGBS",
"secretAccessKey": "*******************",
"accountId": "103637475564",
"accessType": "access_key"
},
"configurationId": ""
},
{
"id": "c0a73394-6c55-4089-9090-effe71f1741d",
"createdAt": "2023-08-01T04:18:28.457Z",
"updatedAt": "2023-08-01T04:18:42.395Z",
"displayName": "PaulTest",
"description": "",
"type": "aws",
"state": "ERROR",
"stateMessage": "AppDynamics is unable to collect data. Review error details to resolve, then resume the connection. [{\"service\":\"AWS/EC2\",\"statusMessage\":\"Incorrect Credentials\\n\"},{\"service\":\"AWS/EBS\",\"statusMessage\":\"Incorrect Credentials\\n\"},{\"service\":\"AWS/ELB\",\"statusMessage\":\"Incorrect Credentials\\n\"},{\"service\":\"AWS/RDS\",\"statusMessage\":\"Incorrect Credentials\\n\"}]",
"details": {
"accessKeyId": "AKIATMZHYYPGYVY7CPPQ",
"secretAccessKey": "*******************",
"accountId": "233622258637",
"accessType": "access_key"
},
"configurationId": "ab820ab1-f658-4e90-8f39-70a6cba80e5e"
},
{
"id": "2db209f8-9f50-4047-ab6f-61cf3858e9db",
"createdAt": "2023-08-02T19:41:43.733Z",
"updatedAt": "2023-08-02T19:46:38.968Z",
"displayName": "access-key-test1",
"description": "Description for this AWS access key connection without assigned configurationId",
"type": "aws",
"state": "CONFIGURED",
"stateMessage": "Start the connection to begin collecting data.",
"details": {
"accessKeyId": "AKIAWC7DFORFNSZ2J5PL",
"secretAccessKey": "*******************",
"accountId": "418698851402",
"accessType": "access_key"
},
"configurationId": "92b9df33-25fc-439c-9f98-0efaafbb5ed9"
}
]
}
6. Delete a Connection
Use the connection id
from the previous response to delete the connection using the following request.
Note: When you delete a connection, the corresponding configuration is also deleted if it is not used by any other connection.
Copycurl --location -g --request DELETE 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections/<connection_id>' \
--header 'Content-Type: application/json'
7. Verify that Connection is Deleted
To verify that the connection is deleted, list your connections again:
Copycurl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'
If the connection does not appear in the list of connections, it has been successfully deleted.