question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

depends_on usage in Python version

See original GitHub issue

Hi,

CDKTF version: 0.11.2

I have got the need to specify that a resource depends_on on other. This is what I am trying to do:

created_schema = Schema(self,
                                    id_=schema["name"],
                                    database=schema["database"],
                                    name=schema["name"])

snowflake_table = SnowflakeTableModule(self,
                                               id_=f"{schema}_{table['name']}",
                                               columns=table_columns,
                                               database_name=database,
                                               schema_name=schema,
                                               table_name=table["name"],
                                               change_tracking=table["change_tracking"],
                                               data_retention_days=table["data_retention_days"])

 snowflake_table.add_override("depends_on", [Token.as_any(created_schema.fqn)])

It does not create errors during synth and indeed I see the following in the generated json:

"depends_on": [
        "${snowflake_schema.snowflake_schemas_DEMO2_BAZAARVOICE_STANDARD_CLIENT_FEED_07181D8A}"
      ],

But then, when trying to run terraform plan, I get:

│ Error: Invalid expression
│ 
│   on cdk.tf.json line 37, in module.snowflake_schemas_test_table_1_044C1F2F.depends_on:
│   37:         "${snowflake_schema.snowflake_schemas_test_07181D8A}"
│ 
│ A single static variable reference is required: only attribute access and
│ indexing with constant keys. No calculations, function calls, template
│ expressions, etc are allowed here.

Anyone knows how to fix this?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hragarwalcommented, Jun 14, 2022

@jsteinich this is custom module but weirdly it doesn’t have depends_on in the constructor parameters when module bindings are generated, anything specific needs to be done to add it in constructor while generation or creation of module ?

0reactions
github-actions[bot]commented, Nov 26, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Dependencies - Everything You Need to Know
Dependency Resolution – automatically ensures that all dependencies pulled in by a package are compatible with the rest of your Python ...
Read more >
Managing Application Dependencies
This tutorial walks you through the use of Pipenv to manage dependencies for an application. It will show you how to install and...
Read more >
Identifying the dependency relationship for python packages ...
Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg ......
Read more >
Azure Pipelines with Python - by example - Anthony Shaw
In this tutorial, I'll show you -by example- how to use Azure ... UsePythonVersion@0 — Use a specific Python version (like a virtual ......
Read more >
Jobs in Azure Pipelines and TFS - Microsoft Learn
Understand jobs in Azure Pipelines, Azure DevOps Server, and Team Foundation Server (TFS)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found