Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Config Data Model missing resource types #2535

Closed
lorengordon opened this issue Oct 15, 2021 · 6 comments
Closed

AWS Config Data Model missing resource types #2535

lorengordon opened this issue Oct 15, 2021 · 6 comments
Labels
bug This issue is a confirmed bug. configservice p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.

Comments

@lorengordon
Copy link

lorengordon commented Oct 15, 2021

Describe the bug
I was looking for a definitive set of the resource types supported by AWS Config. However, it seems the API Docs, the Service Docs, and the Data Model are all out of sync. I first checked the API doc and collected the types there:

Then I found the Service Docs, so I grabbed those too:

Then a coworker said, surely this data is available in botocore, so I checked there also and found:

Steps to reproduce

Here's a hacky little script to collect the types from each so you can compare yourself:

import json
import pkgutil
import re
import urllib.request

import botocore

api_doc = "https://docs.aws.amazon.com/config/latest/APIReference/API_ResourceIdentifier.html"
service_doc = "https://docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html"

def load_config_types(url):
    with urllib.request.urlopen(url) as response:
        res = response.read().decode("utf-8")
        return re.findall(r"AWS::\w*::\w*", res)

resource_types_api = sorted(load_config_types(api_doc))
resource_types_service = sorted(load_config_types(service_doc))
resource_types_data_model = sorted(json.loads(pkgutil.get_data("botocore", "data/config/2014-11-12/service-2.json"))["shapes"]["ResourceType"]["enum"])
resource_types_all = sorted(set(resource_types_api + resource_types_service + resource_types_data_model))

set(resource_types_all) - set(resource_types_api)
# {'AWS::OpenSearch::Domain', 'AWS::EC2::TransitGateway', 'AWS::ECS::TaskSet', 'AWS::Kinesis::StreamConsumer', 'AWS::Kinesis::Stream'}
set(resource_types_all) - set(resource_types_service)
# {'AWS::WAFv2::IPSet', 'AWS::WAFv2::RegexPatternSet', 'AWS::EC2::RegisteredHAInstance'}
set(resource_types_all) - set(resource_types_data_model)
# {'AWS::ECS::TaskSet', 'AWS::Kinesis::Stream', 'AWS::EC2::TransitGateway', 'AWS::Kinesis::StreamConsumer'}

Expected behavior
The data model of the latest botocore should always match the API and service docs.

Additional info
I also opened a support ticket: Case ID 9057168721.

I am pretty sure the data models are generated, and this is really an issue for the service team. Just hoping to raise awareness with the issue here. Thanks!

@lorengordon lorengordon added the needs-triage This issue or PR still needs to be triaged. label Oct 15, 2021
@stobrien89 stobrien89 added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Oct 18, 2021
@stobrien89 stobrien89 self-assigned this Oct 18, 2021
@stobrien89 stobrien89 added configservice service-api This issue is caused by the service API, not the SDK implementation. bug This issue is a confirmed bug. and removed needs-triage This issue or PR still needs to be triaged. investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 18, 2021
@stobrien89
Copy link

Hi @lorengordon,

Thanks for pointing this out! And thanks for the script— that's a huge time saver.

I double-checked the botocore Config service model and it does appear to be getting updates, but, like you pointed out, it looks like there about four resource types missing. I'll submit an internal ticket to the Config team to see if we can expedite your support request.

@stobrien89
Copy link

P54004750

@kapilt
Copy link
Contributor

kapilt commented Oct 19, 2021

keep in mind aws config has differential api support across the set of resources if purports to support, ie this repo classifies the half that are actually supported by select api https://github.com/awslabs/aws-config-resource-schema

@lorengordon
Copy link
Author

Hi @kapilt thanks for the update! I'm kinda struggling to understand how to use that info, or the project awslabs/aws-config-resource-schema... Can you clarify what you mean?

When I am using the API PutConfigurationRecorder, the resourceTypes argument accepts a list of resource types. What I'm looking for is a definitive list of accepted values for that argument. The three sources I've found so far (in the issue description) are all incomplete.

Ideally, the source and schema providing the accepted values would also identify whether each resource type was global or regional. That way I could construct the list per region and add global resource types to just a single region, while excluding resource types that I did not want to collect in any region.

@stobrien89 stobrien89 removed their assignment Jan 7, 2022
@RyanFitzSimmonsAK RyanFitzSimmonsAK added the p2 This is a standard priority issue label Nov 4, 2022
@tim-finnigan
Copy link
Contributor

Checking in — we heard from the Config team that these were since addressed. For any other inconsistencies involving the APIs please reach out in our cross-SDK repository and we will escalate to the service team. Thanks!

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. configservice p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

5 participants