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

[Resource Type] - [BUG] - CloudControl cannot update `AWS::ApiGateway::Stage` with empty Tags array

Open
#2,236 0 comments 3 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::ApiGateway::Stage

### Resource Name

_No response_

### Issue Description

When trying to update the tags of an `AWS::ApiGateway::Stage` that currently has an empty tag array, Cloud Control fails with: `An error occurred (ValidationException) when calling the UpdateResource operation: [REPLACE Operation] noSuchPath in source, path provided : //Tags`

### Expected Behavior

Updating an API Gateway Stage with Tags that were explicitly set to an empty array should work.

### Observed Behavior

It fails with the above mentioned error message. It seems like the JSON patch semantics aren't properly respected. Going from an empty `Tags` array to one with entries should be possible with a replace operation.

### Test Cases

1. Create Stage:
```bash
aws cloudcontrol create-resource \
--type-name AWS::ApiGateway::Stage \
--desired-state '{
"RestApiId": "$REST_API_ID",
"StageName": "testing",
"DeploymentId": "$DEPLOYMENT_ID",
"Tags": []
}'
```
2. Update Stage and observe error:
```bash
aws cloudcontrol update-resource \
--type-name AWS::ApiGateway::Stage \
--identifier '$REST_API_ID|testing' \
--patch-document '[{"op":"replace","path":"/Tags","value":[{"Key":"foo","Value":"bar"}]}]'
```

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure using the AWS Cloud Control create-resource and update-resource commands in the issue for AWS::ApiGateway::Stage. Start by checking the documented update behavior for an empty Tags array and the reported JSON patch error. Done means updating Tags from [] to an entry succeeds without the ValidationException.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
api, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.