Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'InvalidParameterException' when calling remove-tag action on kinesis video stream #6981

Open
cjhallman opened this issue Nov 4, 2021 · 0 comments
Labels

Comments

@cjhallman
Copy link
Contributor

Describe the bug

When trying to run a policy that calls remove-tag action on kinesis video stream (aws.kinesis-video) I receive an 'InvalidParameterException' error:

Exception: Resource Tag Errors {'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-compliant/1635972255984': 'InvalidParameterException', 'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-knssvd-asv/1635972256031': 'InvalidParameterException', 'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-knssvd-ba/1635972256024': 'InvalidParameterException'}

What did you expect to happen?

I expected the tag to be removed from the kinesis video stream successfully but I instead got an 'InvalidParameterException'

Cloud Provider

Amazon Web Services (AWS)

Cloud Custodian version and dependency information

Custodian:   0.9.14
Python:      3.9.5 (default, May  4 2021, 03:33:11) 
             [Clang 12.0.0 (clang-1200.0.32.29)]
Platform:    posix.uname_result(sysname='Darwin', nodename='3c22fb4babd9', release='19.6.0', version='Darwin Kernel Version 19.6.0: Thu Sep 16 20:58:47 PDT 2021; root:xnu-6153.141.40.1~1/RELEASE_X86_64', machine='x86_64')
Using venv:  True
Docker: False
Installed: 

argcomplete==1.12.3
attrs==21.2.0
boto3==1.19.9
botocore==1.22.9
cffi==1.15.0
cryptography==35.0.0
importlib-metadata==4.8.1
jmespath==0.10.0
jsonschema==3.2.0
pycparser==2.20
pyrsistent==0.18.0
python-dateutil==2.8.2
pyyaml==5.4.1
s3transfer==0.5.0
setuptools==58.4.0
six==1.16.0
tabulate==0.8.9
typing-extensions==3.10.0.2
urllib3==1.26.7
zipp==3.6.0

Policy

- name: enterprise-knssvd-tagging-existing-unmark
  resource: aws.kinesis-video
  filters:
  - tag:c7n-tag-compliance: present
  - not:
    - tag:c7n-resource-classification: net-new
  - or:
    - type: value
      key: tag:OwnerContact
      op: regex
      value: ^arn:aws:sns:us-(east|west)-[12]:[0-9]{12}:[a-z0-9_-]{1,256}$
      value_type: normalize
    - type: value
      key: tag:OwnerContact
      op: regex
      value: ^[a-z0-9][a-z0-9._-]*@capitalone[.]com$
      value_type: normalize
    - type: value
      key: tag:OwnerContact
      op: regex
      value: ^[a-z]{3}[0-9]{3}$
      value_type: normalize
  - or:
    - and:
      - tag:BA: not-null
      - type: value
        key: tag:BA
        op: ne
        value: ''
      - type: value
        key: tag:BA
        op: in
        value_from:
          expr: keys(not_null(active, `[]`))
          format: json
          url: s3://cof-cloud-custodian-prod-us-east-1/runtime_files/asv_ba_list_lowercase.json
        value_type: normalize
    - and:
      - tag:ASV: not-null
      - type: value
        key: tag:ASV
        op: ne
        value: ''
      - type: value
        key: tag:ASV
        op: in
        value_from:
          expr: keys(not_null(active, `[]`))
          format: json
          url: s3://cof-cloud-custodian-prod-us-east-1/runtime_files/asv_ba_list_lowercase.json
        value_type: normalize
  actions:
  - type: remove-tag
    tags:
    - c7n-tag-compliance

Relevant log/traceback output

2021-11-03 16:48:11,163: custodian.policy:INFO policy:enterprise-knssvd-tagging-existing-unmark resource:aws.kinesis-video region:us-east-1 count:3 time:14.32
2021-11-03 16:48:11,506: custodian.actions:ERROR Exception with tags: ['c7n-tag-compliance']  Resource Tag Errors {'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-compliant/1635972255984': 'InvalidParameterException', 'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-knssvd-asv/1635972256031': 'InvalidParameterException', 'arn:aws:kinesisvideo:us-east-1:851925785310:stream/sbx-jgryjj-knssvd-ba/1635972256024': 'InvalidParameterException'}
2021-11-03 16:48:11,508: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
  File "/Users/DLX707/Desktop/repos/enterprise-policies/.venv/lib/python3.9/site-packages/c7n/policy.py", line 322, in run
    results = a.process(resources)
  File "/Users/DLX707/Desktop/repos/enterprise-policies/.venv/lib/python3.9/site-packages/c7n/tags.py", line 465, in process
    _common_tag_processer(
  File "/Users/DLX707/Desktop/repos/enterprise-policies/.venv/lib/python3.9/site-packages/c7n/tags.py", line 120, in _common_tag_processer
    raise error
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/DLX707/Desktop/repos/enterprise-policies/.venv/lib/python3.9/site-packages/c7n/tags.py", line 897, in process_resource_set
    return universal_retry(
  File "/Users/DLX707/Desktop/repos/enterprise-policies/.venv/lib/python3.9/site-packages/c7n/tags.py", line 1148, in universal_retry
    raise Exception("Resource Tag Errors %s" % (errors))

Extra information or context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant