Repository: localstack/localstack

Issue:
bug: Error tagging kinesis stream (invalid characters) after upgrade to 0.12.16
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

This worked using version 0.12.13. No configuration changes were made other than bumping the image version to 0.12.16, and the same tag key/value pairs are present from .13 to .16. The error is related to the value `test@company.com` for tagging. Full output:

```# aws_kinesis_stream.stream will be created
  + resource "aws_kinesis_stream" "stream" {
      + arn                       = (known after apply)
      + encryption_type           = "NONE"
      + enforce_consumer_deletion = false
      + id                        = (known after apply)
      + kms_key_id                = "alias/aws/kinesis"
      + name                      = "ci0-p631641-kinesis-kinesis-test"
      + retention_period          = 48
      + shard_count               = 2
      + tags                      = {
          + "chart_name"       = "kinesis"
          + "deployment_model" = "mcs2"
          + "env_name"         = "ci0-p631641"
          + "owner"            = "test@company.com"
         ...
         ...
        }
      + tags_all                  = {
          + "chart_name"       = "kinesis"
          + "deployment_model" = "mcs2"
          + "env_name"         = "ci0-p631641"
          + "owner"            = "test@company.com"
          ...
          ...
        }
    }
Plan: 4 to add, 0 to change, 0 to destroy.
Changes to Outputs:
  + arn                  = (known after apply)
  + consumer_policy_arn  = (known after apply)
  + id                   = (known after apply)
  + name                 = "ci0-p631641-kinesis-kinesis-test"
  + producer_policy_arn  = (known after apply)
  + shard_count          = 2
  + shard_mgt_policy_arn = (known after apply)
# terraform apply -lock=false plan.out 
aws_kinesis_stream.stream: Creating...
aws_kinesis_stream.stream: Still creating... [10s elapsed]
Error: error updating Kinesis Stream (ci0-p631641-kinesis-kinesis-test) tags: error tagging resource (ci0-p631641-kinesis-kinesis-test): InvalidArgumentException: Values contain invalid characters. Invalid values: test@company.com
  on kinesis.tf line 3, in resource "aws_kinesis_stream" "stream":
   3: resource "aws_kinesis_stream" "stream" {
```



### Expected Behavior

The kinesis stream resource is able to be tagged using the same tagging key/value pairs that were valid in 0.12.13, and are valid in AWS. 

### How are you starting LocalStack?

Custom (please describe below)

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    As a kubernetes deployment


### Environment

```markdown
- Kubernetes 1.18
- LocalStack: 0.12.16
```


### Anything else?

_No response_


Discussion:
After doing some further investigation and coming across https://github.com/localstack/localstack/issues/4459; the tags were able to be applied successfully setting the `KINESIS_PROVIDER` environment variable to `kinesalite`. 
Thanks for reporting @TechDawg270 . We're currently using `kinesis-mock` as the default Kinesis provider, the error message seems to be coming from here: https://github.com/etspaceman/kinesis-mock/blob/0fd7e7dcb92a7821097a9efccc519ebe45701690/src/main/scala/kinesis/mock/api/AddTagsToStreamRequest.scala#L44

@etspaceman - would you be able to help out with this issue? Thanks!
Hmm, that is indeed a bug. Looks like I'm using the valid chars regex for a StreamName rather than what's defined for Tags here:

https://docs.aws.amazon.com/kinesis/latest/APIReference/API_Tag.html
I could give it a go if you are looking for help with a fix
That would be awesome! I'd need the fix also in the `Arbitrary` instance, which ensures test values fall within the expected parameters:

https://github.com/etspaceman/kinesis-mock/blob/0fd7e7dcb92a7821097a9efccc519ebe45701690/src/test/scala/kinesis/mock/instances/arbitrary.scala#L201-L213
Feel free to reach out to me as needed if you need help with setting up the local dev environment / tests.
@TechDawg270 I went ahead and implemented a fix here: https://github.com/etspaceman/kinesis-mock/pull/170. Will merge / release when green.
0.1.9 is being released right now with the fix

Resolving patch:
diff --git a/localstack/services/install.py b/localstack/services/install.py
--- a/localstack/services/install.py
+++ b/localstack/services/install.py
@@ -89,7 +89,7 @@
 )
 
 # kinesis-mock version
-KINESIS_MOCK_VERSION = os.environ.get("KINESIS_MOCK_VERSION") or "0.1.8"
+KINESIS_MOCK_VERSION = os.environ.get("KINESIS_MOCK_VERSION") or "0.1.9"
 KINESIS_MOCK_RELEASE_URL = (
     "https://api.github.com/repos/etspaceman/kinesis-mock/releases/tags/" + KINESIS_MOCK_VERSION
 )


Test patch: