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

Provider google-beta@3.60.0 is incompatible with Python #602

Closed
lightningboltemoji opened this issue Mar 17, 2021 · 3 comments · Fixed by #605
Closed

Provider google-beta@3.60.0 is incompatible with Python #602

lightningboltemoji opened this issue Mar 17, 2021 · 3 comments · Fixed by #605

Comments

@lightningboltemoji
Copy link
Contributor

lightningboltemoji commented Mar 17, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

  • cdktf-cli@0.2.0
  • cdktf@0.2.0 (Python)
  • Python 3.9.1
  • google-beta@3.60.0

Affected Resource(s)

google-beta provider when used with Python bindings

Debug Output

(Don't know of any relevant debug info)

Expected Behavior

google-beta provider can be generated by cdktf and imported as Python module

Actual Behavior

Python spits out errors relating to invalid docstrings

>>> import imports.google_beta
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../imports/google_beta/__init__.py", line 205618
    haracters. When evaluated, the total size of all mapped attributes must not exceed 8KB. For AWS providers, the
    following rules apply: - If no attribute mapping is defined, the following default mapping applies: ''' { "google.subject"
    :"assertion.arn", "attribute.aws_role": "assertion.arn.contains('assumed-role')" " ? assertion.arn.extract(
    '{account_arn}assumed-role/')" " + 'assumed-role/'" " + assertion.arn.extract('assumed-role/{role_name}/')
    " " : assertion.arn", } ''' - If any custom attribute mappings are defined, they must include a mapping to the 
   'google.subject' attribute. For OIDC providers, the following rules apply: - Custom attribute mappings must 
    be defined, and must include a mapping to the 'google.subject' attribute. For example, the following maps the
    'sub' claim of the incoming credential to the 'subject' attribute on a Google token. ''' {"google.subject": "assertion.sub"} '''
^
SyntaxError: invalid syntax

Steps to Reproduce

$ cdktf --version
0.2.0
$ mkdir tmp && cd tmp
$ cdktf init --template python --project-name gh-report --project-description=. --local
# add google-beta@3.60.0 to provider list
$ sed -i.bak 's/"terraformProviders": \[\]/"terraformProviders":["google-beta@3.60.0"]/' cdktf.json
# this seems to be a separate bug? for me, this has to be removed for `cdktf get` to complete
$ sed -i.bak '5,7d' cdktf.json
$ cdktf get
$ pipenv run python
Python 3.9.1 (default, Jan 30 2021, 15:51:05) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import imports.google_beta
<big stack trace, seen above>

Important Factoids

This is fixable by deleting the following lines (all broken docstrings):

sed -i.bak -e '205618d;205960d;206126,206136d;206145,206147d;206235d;206262,206265d' imports/google_beta/__init__.py

References

@lightningboltemoji lightningboltemoji added the bug Something isn't working label Mar 17, 2021
@skorfmann
Copy link
Contributor

Thanks for reporting this issue - Gonna have a look at this

@skorfmann
Copy link
Contributor

Looks like a regression introduced with 0.2.0 - Will push a fix

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@skorfmann @lightningboltemoji and others