nccgroup / aws-inventory

Discover resources created in an AWS account.
Apache License 2.0
704 stars 131 forks source link

ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the DescribeEmergencyContactSettings operation: The subscription does not exist. #7

Closed PremaPrems closed 6 years ago

PremaPrems commented 6 years ago

I am getting the error when i trying to call the API, ERROR:aws_inventory.invoker:Unknown error while invoking API for service "shield" in region "us-east-1". Traceback (most recent call last): File "d:\aws-inventory-master\aws_inventory\invoker.py", line 165, in svc_worker response = getattr(params['client'], py_op)() File "C:\Python27\lib\site-packages\botocore\client.py", line 314, in _api_call return self._make_api_call(operation_name, kwargs) File "C:\Python27\lib\site-packages\botocore\client.py", line 612, in _make_api_call raise error_class(parsed_response, operation_name) ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the DescribeDRTAccess operation: The subscription does not exist.

bitsandsalsa commented 6 years ago

It looks like the AWS Shield service has prerequisites (in this case, a subscription) for even calling the APIs. The tool seems to work as expected. I recommend excluding the service when using the tool. You can do this using a commandline argument or the blacklist file.

jakehsiao0909 commented 5 years ago

Im having the same issue now

bitsandsalsa commented 5 years ago

Does the tool stop running as a result of this error or are you just seeing this error and concerned as to its cause?

kashish-dev commented 1 year ago

I am using terraform as an IaC tool to provision AWS Shield Protection resource. Please find my code

data "aws_availability_zones" "available" {}
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}

resource "aws_eip" "example" {
  vpc = true
}

resource "aws_shield_protection" "example" {
  name         = "example"
  resource_arn = "arn:aws:ec2:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:eip-allocation/${aws_eip.example.id}"

  tags = {
    Environment = "Dev"
  }

As per my knowledge, AWS Shield Standard is automatically enabled when we use AWS services like Elastic IP Address. But still, I am getting following error while running terraform apply

Error: creating Shield Protection: ResourceNotFoundException: The subscription does not exist.
{
   RespMetadata: {
     StatusCode: 400,
     RequestID: "a1827275-4d03-492f-b3c1-10d1ef95958f"
   },
   Message_: "The subscription does not exist."
 }
winston0410 commented 6 months ago

@kashish-dev I have encountered the same error, have you found a solution?