I am using a python script to fetch active resources from my AWS account. I am using the following method:
member_session = boto3.session.Session(
aws_access_key_id=credentials["Credentials"]["AccessKeyId"],
aws_secret_access_key=credentials["Credentials"]["SecretAccessKey"],
aws_session_token=credentials["Credentials"]["SessionToken"],
)
member_session.client('config').list_discovered_resources(resourceType="AWS::CloudFormation::Stack", includeDeletedResources=False)
This returns all resources including the deleted ones of a specific resource type. I validated from the aws console and they are under the deleted tab for cloudformation-stack.
Is there something I am missing? Is there a time period after which the deleted resources are not visible as response to this api? I couldn't find something related in the docs.
Why is the call returning deleted resources even though flag includeDeletedResources
is set to False?