Creating a kinesis resource

When setting up a kinesis stream with the following config:

resources:
  Resources:
    KinesisStream:
      Type: AWS::Kinesis::Stream
      Properties:
        Name: ${self:custom.names.kinesis}
        ShardCount: 1

The first time the config runs, it will successfully create the stream. The second time we try to run (without changes to this bit of code) we get the following error:

An error occurred: KinesisStream - my-stream-name already exists in stack arn:aws:cloudformation:myregion:myaccount:stack/mystack/id

We expected that it would not try to create an already-existing kinesis stream. When we take that section out of resources, the kinesis stream is deleted.

Additionally, we have

events:
      - stream:
        type: kinesis
        batchSize: 50
        arn: my-stream-name

within the section defining the lambda, and even when it does create it successfully it doesn’t seem to be creating the trigger

You indentation looks wrong.

events:
  - stream:
      type: kinesis
      batchSize: 50
      arn: my-stream-name

Can I confirm you’re deploying to the same stage both times?

hi, thanks for your reply, yes we are deploying to the same (prod) stage each time, via CircleCI

the full block looks like this - 2 space indentation on each level, following https://serverless.com/framework/docs/providers/aws/events/streams/

functions:
mylambda:
handler: dist/functions/mylambda.handler
events:
- stream:
type: kinesis
batchSize: 50
arn: ${env:AWS_KINESIS_STREAM}