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

azurerm provider: Python package cdktf-cdktf-provider-azurerm extremely slow to import #2792

Closed
james-mwakichako opened this issue Apr 11, 2023 · 1 comment · Fixed by #3030
Assignees
Labels
bug Something isn't working language/python performance Gotta go fast pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. provider/azure Issue shows up using Azure provider ux/configuration
Milestone

Comments

@james-mwakichako
Copy link

We are currently using the azurerm provider to create terraform resources. We have noticed that importing the specific resources takes ~ 45 seconds which is slowing our processes down.

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 - 0.15.5
python - 3.10.9
Terraform - v1.4.3-dev

Affected Provider / Resource(s)

azurerm
python Pre-Built Provider : cdktf-cdktf-provider-azurerm = "5.0.13"

Debug Output

Expected Behavior

importing the package within a python file should be fast.

Actual Behavior

importing cdktf-cdktf-provider-azurerm take about 45 seconds to complete.

Steps to Reproduce

Below is the source code.

from constructs import Construct
from cdktf import TerraformStack, App
from cdktf_cdktf_provider_azurerm.provider import AzurermProvider


class TestStack(TerraformStack):
    def __init__(self, scope: Construct, id: str):
        super().__init__(scope, id)

        AzurermProvider(self, "azurerm", features={})

Important Factoids

On running importtime against our script, here is what we found:

import time:   9501138 |    9501138 |               cdktf_cdktf_provider_azurerm._jsii
import time:        26 |   54269769 |           cdktf_cdktf_provider_azurerm.provider

Are there any workarounds to speed up import time ?

@james-mwakichako james-mwakichako added bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager labels Apr 11, 2023
@DanielMSchmidt DanielMSchmidt added priority/important-soon High priority, to be worked on as part of our current release or the following one. ux/configuration performance Gotta go fast language/python and removed new Un-triaged issue labels Apr 13, 2023
@xiehan xiehan added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. provider/azure Issue shows up using Azure provider and removed priority/important-soon High priority, to be worked on as part of our current release or the following one. labels Jun 1, 2023
@xiehan xiehan added this to the 0.18 milestone Jul 24, 2023
@xiehan xiehan linked a pull request Jul 27, 2023 that will close this issue
@DanielMSchmidt DanielMSchmidt self-assigned this Aug 4, 2023
@github-actions
Copy link
Contributor

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 Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working language/python performance Gotta go fast pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. provider/azure Issue shows up using Azure provider ux/configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants