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

AWS::SQS::Queue `QueueName` can be used as identifier

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

Description

### Name of the resource

AWS::SQS::Queue

### Resource Name

_No response_

### Issue Description

The resource type schema of `AWS::SQS::Queue` resource lists `QueueUrl` as the primary identifier of this resource. However, if you try to retrieve this resource (e.g. by using CloudControl GetResource API), you can retrieve it using the `QueueName` instead. The response will also contain the value of `QueueName` as the value of the `QueueUrl` property.

```
❯ aws cloudformation describe-type --type RESOURCE --type-name AWS::SQS::Queue
{
...
"Schema": "..."primaryIdentifier": [ "/properties/QueueUrl ]...",
...
}
```

```
❯ aws cloudcontrol get-resource --type-name AWS::SQS::Queue --identifier https://sqs.us-west-2.amazonaws.com/xxx/awesome_queue
{
"TypeName": "AWS::SQS::Queue",
"ResourceDescription": {
"Identifier": "https://sqs.us-west-2.amazonaws.com/xxx/awesome_queue",
"Properties": "{..."QueueName":"awesome_queue", "QueueUrl":"https://sqs.us-west-2.amazonaws.com/xxx/awesome_queue"...}"
}
}
```

```
❯ aws cloudcontrol get-resource --type-name AWS::SQS::Queue --identifier awesome_queue
{
"TypeName": "AWS::SQS::Queue",
"ResourceDescription": {
"Identifier": "https://sqs.us-west-2.amazonaws.com/xxx/awesome_queue",
"Properties": "{..."QueueName":"awesome_queue", "QueueUrl":"awesome_queue"...}"
}
}
```

### Expected Behavior

(for an existing SQS Queue with `awesome_queue` as its `QueueName`)
```
❯ aws cloudcontrol get-resource --type-name AWS::SQS::Queue --identifier awesome_queue

An error occurred (ResourceNotFoundException) when calling the GetResource operation: AWS::SQS::Queue Handler returned status FAILED: Resource of type 'AWS::SQS::Queue' with identifier 'awesome_queue' was not found. (HandlerErrorCode: NotFound, RequestToken: xxx)
```

### Observed Behavior

(for an existing SQS Queue with `awesome_queue` as its `QueueName`)
```
❯ aws cloudcontrol get-resource --type-name AWS::SQS::Queue --identifier awesome_queue
{
"TypeName": "AWS::SQS::Queue",
"ResourceDescription": {
"Identifier": "awesome_queue",
"Properties": "{\"SqsManagedSseEnabled\":true,\"ReceiveMessageWaitTimeSeconds\":0,\"DelaySeconds\":0,\"MessageRetentionPeriod\":345600,\"MaximumMessageSize\":262144,\"VisibilityTimeout\":30,\"Arn\":\"arn:aws:sqs:us-west-2:xxx:awesome_queue\",\"QueueName\":\"awesome_queue\",\"QueueUrl\":\"awesome_queue\"}"
}
}
```

### Test Cases

* Pass `QueueName` as identifier to get SQS queue and make sure that a `ResourceNotFound` returns

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the two aws cloudcontrol get-resource commands for an existing AWS::SQS::Queue, using its QueueName as the identifier. Compare the identifier and returned QueueUrl with the expected ResourceNotFound behavior. Done means QueueName is rejected as an identifier and the documented primary identifier behavior is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.