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

cfn test fails with an "unexpected keyword 'region'" error #3

Open
tomwwright opened this issue Aug 31, 2020 · 0 comments
Open

cfn test fails with an "unexpected keyword 'region'" error #3

tomwwright opened this issue Aug 31, 2020 · 0 comments
Labels

Comments

@tomwwright
Copy link
Owner

cloudformation_cli_python_lib.exceptions.InternalFailure: __init__() got an unexpected keyword argument 'region/awsPartition/awsAccountId' (TypeError)

Caused by changes to the contract test request format upstream aws-cloudformation/cloudformation-cli#502

Partial fix applied here https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/pull/107/files, but cloudformation-cli-python-lib hasn't released as v2.1.0 on pypi yet

Solution for now is to monkey patch dataclass in build/cloudformation_cli_python_lib/utils.py to expect the extra fields:

@dataclass
class UnmodelledRequest:
  clientRequestToken: str
  desiredResourceState: Optional[Mapping[str, Any]] = None
  previousResourceState: Optional[Mapping[str, Any]] = None
  logicalResourceIdentifier: Optional[str] = None
  nextToken: Optional[str] = None       
  region: Optional[str] = None          # <--- add these
  awsAccountId: Optional[str] = None    # <---
  awsPartition: Optional[str] = None    # <---
@tomwwright tomwwright added the type/bug Broken functionality label Aug 31, 2020
@tomwwright tomwwright changed the title cfn test fails withan "unexpected keyword 'region'" error cfn test fails with an "unexpected keyword 'region'" error Aug 31, 2020
@tomwwright tomwwright added type/bug Broken functionality and removed type/bug Broken functionality labels Oct 15, 2020
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