Stack deployment fail without warning due to invalid resource names
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Description:
When defining a sam template, I unknowingly made the mistake of naming a resource **iotSensor-traffic-stream**
It is a mistake because per [cloudformation resource documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html), the resource names you write in the template must be alphanumeric, but i didn't know that at the time.
"sam build" went though without issue but then when i tried to deploy the stack "sam deploy" failed with the following message.
> ChangeSetCreateComplete failed: Max attempts exceeded
First time seeing that error, so I went to cloudformation to see the stack deployment status. And it was stuck in "REVIEW_IN_PROGRESS" and it didn't advance any further.
### Steps to reproduce:
Define a sam template with an invalid resource name and deploy
```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
iot-sensor-traffic-stream
Resources:
iotSensor-traffic-stream:
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1
```
### Observed result:
sam build succeed without warning
sam deploy fails with an error message that doesn't give a clue of what the problem could be
cloudformation stack deployment gets stuck
### Expected result:
sam build should fail when encountering the invalid resource names
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
1. OS: Windows, Linux
2. If using SAM CLI, `sam --version`: 1.18.1
3. AWS region: eu-west-1
Contributor guide
Assessment
This issue has not been assessed yet.