{"record":{"id":"9c6f25a9a22fc724","repo":"crowdsecurity/crowdsec","slug":"stream-arn-and-stream-name-are-mutually-exclusive","errorCode":null,"errorMessage":"stream_arn and stream_name are mutually exclusive","messagePattern":"stream_arn and stream_name are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kinesis/config.go","lineNumber":89,"sourceCode":"\n\treturn nil\n}\n\nfunc (c *Configuration) Validate() error {\n\tif c.StreamName == \"\" && !c.UseEnhancedFanOut {\n\t\treturn errors.New(\"stream_name is mandatory when use_enhanced_fanout is false\")\n\t}\n\n\tif c.StreamARN == \"\" && c.UseEnhancedFanOut {\n\t\treturn errors.New(\"stream_arn is mandatory when use_enhanced_fanout is true\")\n\t}\n\n\tif c.ConsumerName == \"\" && c.UseEnhancedFanOut {\n\t\treturn errors.New(\"consumer_name is mandatory when use_enhanced_fanout is true\")\n\t}\n\n\tif c.StreamARN != \"\" && c.StreamName != \"\" {\n\t\treturn errors.New(\"stream_arn and stream_name are mutually exclusive\")\n\t}\n\n\treturn nil\n}\n\nfunc (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, metricsLevel metrics.AcquisitionMetricsLevel) error {\n\ts.logger = logger\n\ts.metricsLevel = metricsLevel\n\n\terr := s.UnmarshalConfig(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = s.newClient(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot create kinesis client: %w\", err)\n\t}","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kinesis/config.go#L71-L107","documentation":"StreamName and StreamARN are two alternative ways to address the same Kinesis stream, so Configuration.Validate() refuses configs that set both, since which one wins would be ambiguous. Pick exactly one identifier — the name for shared-consumer mode or the ARN for enhanced fan-out mode.","triggerScenarios":"Calling Validate() on a kinesis Configuration where both StreamARN and StreamName are non-empty, regardless of UseEnhancedFanOut.","commonSituations":"Users add stream_arn to an existing stream_name config while migrating to enhanced fan-out but forget to delete stream_name, or merge config fragments from two examples.","solutions":["Remove stream_name and keep only stream_arn (with use_enhanced_fanout: true and consumer_name), or","Remove stream_arn and keep only stream_name for non-fan-out mode.","Search the effective merged YAML (including included files) for duplicate stream keys."],"exampleFix":"// before (yaml)\nsource: kinesis\nstream_name: logs\nstream_arn: arn:aws:kinesis:us-east-1:123456789012:stream/logs\n\n// after (yaml)\nsource: kinesis\nstream_name: logs","handlingStrategy":"validation","validationCode":"if cfg.StreamARN != \"\" && cfg.StreamName != \"\" {\n    return fmt.Errorf(\"kinesis: set either stream_arn or stream_name, not both\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When migrating between modes, delete the old key rather than adding the new one alongside.","Review the fully merged YAML (including included config files) for duplicate stream identifiers.","Add config linting to CI that flags both keys set."],"tags":["aws","kinesis","config-validation","conflicting-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}