aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

DescribeStackResources API doesn't return all of the resources with a given PhysicalResourceId

Open
#998 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement NeedTriage
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

Other

### Resource Name

N/A

### Issue Description

The [`DescribeStackResources` API](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html) doesn't return all of the resources with a given `PhysicalResourceId`. For example, the following command only returns the `AWS::RDS::DBInstance` resource even though a `AWS::RDS::DBCluster` resource exists with the same ID.

```shell
aws cloudformation describe-stack-resources --physical-resource-id test-id
```
```json
{
"StackResources": [
{
"StackName": "test-stack-name",
"StackId": "test-stack-id",
"LogicalResourceId": "DBInstance",
"PhysicalResourceId": "test-id",
"ResourceType": "AWS::RDS::DBInstance",
"Timestamp": "2021-01-01T00:00:00.000000+00:00",
"ResourceStatus": "UPDATE_COMPLETE",
"DriftInformation": {
"StackResourceDriftStatus": "NOT_CHECKED"
}
}
]
}
```

### Expected Behavior

`DescribeStackResources` API returns all of the resources with a given `PhysicalResourceId`

### Observed Behavior

`DescribeStackResources` API only returns one resource with the given `PhysicalResourceId`

### Test Cases

Create two resources with the same `PhysicalResourceId` and then run the following command:
```shell
aws cloudformation describe-stack-resources --physical-resource-id ${physical_resource_id}
```

### Other Details

CloudFormation already has an internal ticket for this issue, but this GitHub issue would let this issue be tracked publicly

See [Support Center Case ID 8781395251](https://console.aws.amazon.com/support/home#/case/?displayId=8781395251)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.