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

AWS Workspace creation raises ParamValidationError #122

Open
Chaimaa-Br opened this issue Oct 26, 2023 · 0 comments
Open

AWS Workspace creation raises ParamValidationError #122

Chaimaa-Br opened this issue Oct 26, 2023 · 0 comments

Comments

@Chaimaa-Br
Copy link

Hello,

I'm trying to automate AWS Workspace creation using the aws.workspaces_create_workspaces action but the input format seems to be wrong.

The action parameters are :

image

In my Workspaces input parameter, I provide an array as follow :

{ 'DirectoryId': 'xxxxxxx', 'BundleId': 'xxxxxxx', 'UserName': 'xxxxxxx'}

But I receive the following error because it takes every comma seperated K/V and it considers it a value in the Workspaces[n] array :

{
  "stdout": "",
  "stderr": "st2.actions.python.ActionManager: DEBUG    Calling method \"boto3.workspaces.create_workspaces\" with kwargs: {'Workspaces': [\"{ 'DirectoryId': 'xxxxxxxxxx'\", \"'BundleId': 'xxxxxx'\", \"'UserName': 'xxxxxx'}\"]}
Traceback (most recent call last):
  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>
    obj.run()
  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 214, in run
    output = action.run(**self._parameters)
  File \"/opt/stackstorm/packs/aws/actions/run.py\", line 36, in run
    return self.do_method(module_path, cls, aws_action, **kwargs)
  File \"/opt/stackstorm/packs/aws/actions/lib/action.py\", line 224, in do_method
    resultset = getattr(obj, action)(**kwargs)
  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 251, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 512, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/client.py\", line 565, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File \"/opt/stackstorm/virtualenvs/aws/lib/python3.8/site-packages/botocore/validate.py\", line 270, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Workspaces[0], value: { 'DirectoryId': 'xxxxxxx', type: <class 'str'>, valid types: <class 'dict'>
Invalid type for parameter Workspaces[1], value: 'BundleId': 'xxxxxxxx', type: <class 'str'>, valid types: <class 'dict'>
Invalid type for parameter Workspaces[2], value: 'UserName': 'xxxxxxx'}, type: <class 'str'>, valid types: <class 'dict'>
",
  "exit_code": 1,
  "result": "None"
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant