cdktf-tf-module-stack


Namecdktf-tf-module-stack JSON
Version 5.0.13 PyPI version JSON
download
home_pagehttps://github.com/cdktf/cdktf-tf-module-stack.git
SummaryA drop-in replacement for cdktf.TerraformStack that lets you define Terraform modules as constructs
upload_time2024-04-22 00:15:16
maintainerNone
docs_urlNone
authorHashiCorp
requires_python~=3.8
licenseMPL-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cdktf-tf-module-stack

![Status: Tech Preview](https://img.shields.io/badge/status-experimental-EAAA32) [![Releases](https://img.shields.io/github/release/cdktf/cdktf-tf-module-stack.svg)](https://github.com/cdktf/cdktf-tf-module-stack/releases)
[![LICENSE](https://img.shields.io/github/license/cdktf/cdktf-tf-module-stack.svg)](https://github.com/cdktf/cdktf-tf-module-stack/blob/main/LICENSE)
[![build](https://github.com/cdktf/cdktf-tf-module-stack/actions/workflows/build.yml/badge.svg)](https://github.com/cdktf/cdktf-tf-module-stack/actions/workflows/build.yml)

A drop-in replacement for cdktf.TerraformStack that lets you define Terraform modules as constructs.

*cdktf-tf-module-stack* is in technical preview, which means it's a community supported project. It still requires extensive testing and polishing to mature into a HashiCorp officially supported project. Please [file issues](https://github.com/cdktf/cdktf-tf-module-stack/issues/new/choose) generously and detail your experience while using the library. We welcome your feedback.

By using the software in this repository, you acknowledge that:

* *cdktf-tf-module-stack* is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp.
* *cdktf-tf-module-stack* is provided on an "as-is" basis, and may include bugs, errors, or other issues.
* *cdktf-tf-module-stack* is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of *cdktf-tf-module-stack*.
* HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of *cdktf-tf-module-stack*, at any time and without any obligation or liability whatsoever.

## Compatibility

* `cdktf` >= 0.20.0
* `constructs` >= 10.0.25

## Available Packages

### NPM

The npm package is available at [https://www.npmjs.com/package/@cdktf/tf-module-stack](https://www.npmjs.com/package/@cdktf/tf-module-stack).

`npm install @cdktf/tf-module-stack`

NOTE: Originally, this package was named `cdktf-tf-module-stack`, and the legacy versions (<= 0.2.0) can be found on npm [here](https://www.npmjs.com/package/cdktf-tf-module-stack).

### PyPI

The PyPI package is available at [https://pypi.org/project/cdktf-tf-module-stack](https://pypi.org/project/cdktf-tf-module-stack).

`pipenv install cdktf-tf-module-stack`

### Nuget

The Nuget package is available at [https://www.nuget.org/packages/HashiCorp.Cdktf.TfModuleStack](https://www.nuget.org/packages/HashiCorp.Cdktf.TfModuleStack).

`dotnet add package HashiCorp.Cdktf.TfModuleStack`

### Maven

The Maven package is available at [https://mvnrepository.com/artifact/com.hashicorp/cdktf-tf-module-stack](https://mvnrepository.com/artifact/com.hashicorp/cdktf-tf-module-stack).

```
<dependency>
    <groupId>com.hashicorp</groupId>
    <artifactId>cdktf-tf-module-stack</artifactId>
    <version>[REPLACE WITH DESIRED VERSION]</version>
</dependency>
```

### Go

The go package is generated into the [`github.com/cdktf/cdktf-tf-module-stack-go`](https://github.com/cdktf/cdktf-tf-module-stack-go) package.

`go get github.com/cdktf/cdktf-tf-module-stack-go/tfmodulestack`

## Usage

### Typescript

```python
import { App } from "cdktf";
import {
  TFModuleStack,
  TFModuleVariable,
  TFModuleOutput,
  ProviderRequirement,
} from "@cdktf/tf-module-stack";
import { Resource } from '@cdktf/provider-null/lib/resource';

class MyAwesomeModule extends TFModuleStack {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    new ProviderRequirement(this, "null", "~> 2.0");
    const resource = new Resource(this, "resource");

    new TFModuleVariable(this, "my_var", {
      type: "string",
      description: "A variable",
      default: "default",
    });

    new TFModuleOutput(this, "my_output", {
      value: resource.id,
    });
  }
}

const app = new App();
new MyAwesomeModule(app, "my-awesome-module");
app.synth();
```

### Python

```python
from constructs import Construct
from cdktf import App, TerraformStack
from imports.null.resource import Resource
from cdktf_tf_module_stack import TFModuleStack, TFModuleVariable, TFModuleOutput, ProviderRequirement


class MyAwesomeModule(TFModuleStack):
    def __init__(self, scope: Construct, ns: str):
        super().__init__(scope, ns)

        ProviderRequirement(self, "null", provider_version_constraint="~> 2.0")

        TFModuleVariable(self, "my_var", type="string", description="A variable", default="default")

        resource = Resource(self, "resource")

        TFModuleOutput(self, "my_output", value=resource.id)


app = App()
MyAwesomeModule(app, "my-awesome-module")
app.synth()
```

This will synthesize a Terraform JSON file that looks like this:

```json
{
  "output": {
    "my_output": [
      {
        "value": "${null_resource.resource.id}"
      }
    ]
  },
  "resource": {
    "null_resource": {
      "resource": {}
    }
  },
  "terraform": {
    "required_providers": {
      "null": {
        "source": "null",
        "version": "~> 2.0"
      }
    },
    "variable": {
      "my_var": {
        "default": "default",
        "description": "A variable",
        "type": "string"
      }
    }
  }
}
```

Please note that the provider section is missing, so that the Terraform Workspace using the generated module can be used with any provider matching the version.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cdktf/cdktf-tf-module-stack.git",
    "name": "cdktf-tf-module-stack",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "HashiCorp",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/1c/34/4393de49f55b21ff2a9c84aaf827f70703ba2aae4c86ae9cc687c2ddedbf/cdktf-tf-module-stack-5.0.13.tar.gz",
    "platform": null,
    "description": "# cdktf-tf-module-stack\n\n![Status: Tech Preview](https://img.shields.io/badge/status-experimental-EAAA32) [![Releases](https://img.shields.io/github/release/cdktf/cdktf-tf-module-stack.svg)](https://github.com/cdktf/cdktf-tf-module-stack/releases)\n[![LICENSE](https://img.shields.io/github/license/cdktf/cdktf-tf-module-stack.svg)](https://github.com/cdktf/cdktf-tf-module-stack/blob/main/LICENSE)\n[![build](https://github.com/cdktf/cdktf-tf-module-stack/actions/workflows/build.yml/badge.svg)](https://github.com/cdktf/cdktf-tf-module-stack/actions/workflows/build.yml)\n\nA drop-in replacement for cdktf.TerraformStack that lets you define Terraform modules as constructs.\n\n*cdktf-tf-module-stack* is in technical preview, which means it's a community supported project. It still requires extensive testing and polishing to mature into a HashiCorp officially supported project. Please [file issues](https://github.com/cdktf/cdktf-tf-module-stack/issues/new/choose) generously and detail your experience while using the library. We welcome your feedback.\n\nBy using the software in this repository, you acknowledge that:\n\n* *cdktf-tf-module-stack* is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp.\n* *cdktf-tf-module-stack* is provided on an \"as-is\" basis, and may include bugs, errors, or other issues.\n* *cdktf-tf-module-stack* is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of *cdktf-tf-module-stack*.\n* HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of *cdktf-tf-module-stack*, at any time and without any obligation or liability whatsoever.\n\n## Compatibility\n\n* `cdktf` >= 0.20.0\n* `constructs` >= 10.0.25\n\n## Available Packages\n\n### NPM\n\nThe npm package is available at [https://www.npmjs.com/package/@cdktf/tf-module-stack](https://www.npmjs.com/package/@cdktf/tf-module-stack).\n\n`npm install @cdktf/tf-module-stack`\n\nNOTE: Originally, this package was named `cdktf-tf-module-stack`, and the legacy versions (<= 0.2.0) can be found on npm [here](https://www.npmjs.com/package/cdktf-tf-module-stack).\n\n### PyPI\n\nThe PyPI package is available at [https://pypi.org/project/cdktf-tf-module-stack](https://pypi.org/project/cdktf-tf-module-stack).\n\n`pipenv install cdktf-tf-module-stack`\n\n### Nuget\n\nThe Nuget package is available at [https://www.nuget.org/packages/HashiCorp.Cdktf.TfModuleStack](https://www.nuget.org/packages/HashiCorp.Cdktf.TfModuleStack).\n\n`dotnet add package HashiCorp.Cdktf.TfModuleStack`\n\n### Maven\n\nThe Maven package is available at [https://mvnrepository.com/artifact/com.hashicorp/cdktf-tf-module-stack](https://mvnrepository.com/artifact/com.hashicorp/cdktf-tf-module-stack).\n\n```\n<dependency>\n    <groupId>com.hashicorp</groupId>\n    <artifactId>cdktf-tf-module-stack</artifactId>\n    <version>[REPLACE WITH DESIRED VERSION]</version>\n</dependency>\n```\n\n### Go\n\nThe go package is generated into the [`github.com/cdktf/cdktf-tf-module-stack-go`](https://github.com/cdktf/cdktf-tf-module-stack-go) package.\n\n`go get github.com/cdktf/cdktf-tf-module-stack-go/tfmodulestack`\n\n## Usage\n\n### Typescript\n\n```python\nimport { App } from \"cdktf\";\nimport {\n  TFModuleStack,\n  TFModuleVariable,\n  TFModuleOutput,\n  ProviderRequirement,\n} from \"@cdktf/tf-module-stack\";\nimport { Resource } from '@cdktf/provider-null/lib/resource';\n\nclass MyAwesomeModule extends TFModuleStack {\n  constructor(scope: Construct, id: string) {\n    super(scope, id);\n\n    new ProviderRequirement(this, \"null\", \"~> 2.0\");\n    const resource = new Resource(this, \"resource\");\n\n    new TFModuleVariable(this, \"my_var\", {\n      type: \"string\",\n      description: \"A variable\",\n      default: \"default\",\n    });\n\n    new TFModuleOutput(this, \"my_output\", {\n      value: resource.id,\n    });\n  }\n}\n\nconst app = new App();\nnew MyAwesomeModule(app, \"my-awesome-module\");\napp.synth();\n```\n\n### Python\n\n```python\nfrom constructs import Construct\nfrom cdktf import App, TerraformStack\nfrom imports.null.resource import Resource\nfrom cdktf_tf_module_stack import TFModuleStack, TFModuleVariable, TFModuleOutput, ProviderRequirement\n\n\nclass MyAwesomeModule(TFModuleStack):\n    def __init__(self, scope: Construct, ns: str):\n        super().__init__(scope, ns)\n\n        ProviderRequirement(self, \"null\", provider_version_constraint=\"~> 2.0\")\n\n        TFModuleVariable(self, \"my_var\", type=\"string\", description=\"A variable\", default=\"default\")\n\n        resource = Resource(self, \"resource\")\n\n        TFModuleOutput(self, \"my_output\", value=resource.id)\n\n\napp = App()\nMyAwesomeModule(app, \"my-awesome-module\")\napp.synth()\n```\n\nThis will synthesize a Terraform JSON file that looks like this:\n\n```json\n{\n  \"output\": {\n    \"my_output\": [\n      {\n        \"value\": \"${null_resource.resource.id}\"\n      }\n    ]\n  },\n  \"resource\": {\n    \"null_resource\": {\n      \"resource\": {}\n    }\n  },\n  \"terraform\": {\n    \"required_providers\": {\n      \"null\": {\n        \"source\": \"null\",\n        \"version\": \"~> 2.0\"\n      }\n    },\n    \"variable\": {\n      \"my_var\": {\n        \"default\": \"default\",\n        \"description\": \"A variable\",\n        \"type\": \"string\"\n      }\n    }\n  }\n}\n```\n\nPlease note that the provider section is missing, so that the Terraform Workspace using the generated module can be used with any provider matching the version.\n",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "A drop-in replacement for cdktf.TerraformStack that lets you define Terraform modules as constructs",
    "version": "5.0.13",
    "project_urls": {
        "Homepage": "https://github.com/cdktf/cdktf-tf-module-stack.git",
        "Source": "https://github.com/cdktf/cdktf-tf-module-stack.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "196438a6f1d396705036023b653821278b640bed669a75d5501f4d3a24e08d67",
                "md5": "5243ee6db9306c0b0c05812b01d6b2c8",
                "sha256": "29d3cf53686370cbcb0c93ae84e4044d50b3846581bd55c618d3c7afb43939d0"
            },
            "downloads": -1,
            "filename": "cdktf_tf_module_stack-5.0.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5243ee6db9306c0b0c05812b01d6b2c8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 53138,
            "upload_time": "2024-04-22T00:15:10",
            "upload_time_iso_8601": "2024-04-22T00:15:10.480762Z",
            "url": "https://files.pythonhosted.org/packages/19/64/38a6f1d396705036023b653821278b640bed669a75d5501f4d3a24e08d67/cdktf_tf_module_stack-5.0.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c344393de49f55b21ff2a9c84aaf827f70703ba2aae4c86ae9cc687c2ddedbf",
                "md5": "3566e6ee52d559a4991e316e5e90b1c9",
                "sha256": "118e950d9cb19117298e64524fb0e698cc603b9d2f737f639115d59a7756dd20"
            },
            "downloads": -1,
            "filename": "cdktf-tf-module-stack-5.0.13.tar.gz",
            "has_sig": false,
            "md5_digest": "3566e6ee52d559a4991e316e5e90b1c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 55038,
            "upload_time": "2024-04-22T00:15:16",
            "upload_time_iso_8601": "2024-04-22T00:15:16.709908Z",
            "url": "https://files.pythonhosted.org/packages/1c/34/4393de49f55b21ff2a9c84aaf827f70703ba2aae4c86ae9cc687c2ddedbf/cdktf-tf-module-stack-5.0.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 00:15:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cdktf",
    "github_project": "cdktf-tf-module-stack",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cdktf-tf-module-stack"
}
        
Elapsed time: 0.25355s