DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
609 stars 303 forks source link

AWSIntegration response obj missing aws account id #763

Open rjhornsby opened 1 year ago

rjhornsby commented 1 year ago

Describe the bug The API docs describe[1] the response to api.AwsIntegration.list() as including the AWS account ID. This field does not seem to be present in the response.

This is not specifically an issue with the python library. Rather, it appears to be missing from the raw REST object, but I wasn't sure where else to go.

This is an issue because while the list() method returns all of the accounts, it does not return any unique id such as the aws account id or datadog-owned id that could be used in the update() method, to for example, add a tag. The python update() method's first documented argument[2] is the aws account id. The inference is that this is the unique ID expected to be used to identify the object the user wishes to modify.

Python aside for a moment and using a REST call directly (ie cURL or Insomnia), the REST api[3] itself isn't returning the AWS account id:

{
  "accounts": [
    {
      "access_key_id": "Axxxxxxxx",
      "filter_tags": [],
      "host_tags": [
        "account-name-id:corp-lab-123"
      ],
      "account_specific_namespace_rules": {},
      "excluded_regions": [],
      "metrics_collection_enabled": true,
      "errors": [],
      "cspm_resource_collection_enabled": false,
      "resource_collection_enabled": false
    }
  ]
}

To Reproduce Steps to reproduce the behavior:

  1. Retrieve the list of AWS accounts via REST https://api.ddog-gov.com/api/v1/integration/aws
  2. Response object does not contain an aws account id or other DD-generated unique ID usable to identify the account in subsequent calls

Expected behavior As per the documentation and functionality requirements, the AWS account id or another unique id for each account should be contained in the response object, such that this id could be passed back to DD in calls such as update() or delete()

Additional context [1] https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations [2] https://github.com/DataDog/datadogpy/blob/master/datadog/api/aws_integration.py#L100-L107 [3] https://api.ddog-gov.com/api/v1/integration/aws

github-actions[bot] commented 1 year ago

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.