Because your stack trace should be more encouraging

Cloud Formation

aws cloudformation deploy --stack-name CodeArtifact --template-file ./code-artifact.yaml --capabilities CAPABILITY_NAMED_IAM
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Waiting for changeset to be created..
Waiting for stack create/update to complete

Failed to create/update the stack. 
Really good try though.

Run this to find out more:
aws cloudformation describe-stack-events --stack-name CodeArtifact

Better luck next time!