cdktf / projen-cdktf-hybrid-construct Goto Github PK
View Code? Open in Web Editor NEWProjen template for CDKTF Constructs that should also be used as Terraform Modules.
License: Mozilla Public License 2.0
Projen template for CDKTF Constructs that should also be used as Terraform Modules.
License: Mozilla Public License 2.0
I have created a TFModule stack under directory "src/services/azure/static-app" as follows:
import {
ProviderRequirement,
TFModuleStack,
TFModuleVariable,
} from "@cdktf/tf-module-stack";
import { App } from "cdktf";
import { Construct } from "constructs";
import { AzStaticApp } from "./main";
class AzStaticAppModule extends TFModuleStack {
constructor(scope: Construct, id: string) {
super(scope, id);
let azurermProvider = new ProviderRequirement(this, "azurerm", "~> 3.70.0", "hashicorp/azurerm");
new ProviderRequirement(this, "github", "~> 5.36.0", "integrations/github");
let appName = new TFModuleVariable(this, "appName", {
type: "string",
description: "Name of the application",
default: "test-app",
});
let environmentName = new TFModuleVariable(this, "environmentName", {
type: "string",
default: "dev",
});
let location = new TFModuleVariable(this, "location", {
type: "string",
default: "westeurope",
});
let skuSize = new TFModuleVariable(this, "skuSize", {
type: "string"
});
let skuTier = new TFModuleVariable(this, "skuTier", {
type: "string"
});
let namePrefix = new TFModuleVariable(this, "namePrefix", {
type: "string",
description: "Prefix for all resources",
default: "tf",
});
let apiLocation = new TFModuleVariable(this, "apiLocation", {
type: "string",
default: "api"
});
let appLocation = new TFModuleVariable(this, "appLocation", {
type: "string"
});
let appBuildCommand = new TFModuleVariable(this, "appBuildCommand", {
type: "string"
});
let repositoryName = new TFModuleVariable(this, "repositoryName", {
type: "string"
});
let branchName = new TFModuleVariable(this, "branchName", {
type: "string"
});
let apiTokenVar = new TFModuleVariable(this, "apiTokenVar", {
type: "string"
});
let outputLocation = new TFModuleVariable(this, "outputLocation", {
type: "string"
});
let existingRgName = new TFModuleVariable(this, "existingRgName", {
type: "string",
default: ""
});
let providerAlias = new TFModuleVariable(this, "providerAlias", {
type: "string",
default: ""
});
let tags = new TFModuleVariable(this, "tags", {
type: "map(string)"
});
azurermProvider.alias = providerAlias.value;
new AzStaticApp(this, "static-app", {
provider: azurermProvider,
appName: appName.value,
environmentName: environmentName.value,
location: location.value,
skuSize: skuSize.value,
skuTier: skuTier.value,
namePrefix: namePrefix.value,
apiLocation: apiLocation.value,
appLocation: appLocation.value,
appBuildCommand: appBuildCommand.value,
repositoryName: repositoryName.value,
branchName: branchName.value,
apiTokenVar: apiTokenVar.value,
outputLocation: outputLocation.value,
tags: tags.value,
existingRgName: existingRgName.value
});
}
}
const app = new App();
// This is the name the module can be found under.
// We expect a "my-awesome-module.md" file in this directory.
// The README.md file will be generated from this file.
new AzStaticAppModule(app, "az-static-app");
app.synth();
language: null
cdktf-cli: 0.18.0
node: v18.17.1
terraform: 1.5.2
arch: x64
os: win32 10.0.19045
No response
No response
No response
No response
No response
No response
After hitting some errors, one causing issue I believe is the use of cdktf-tf-module-stack
instead of @cdktf/tf-module-stack
in this project.
The now old (seemingly not maintained) cdktf-tf-module-stack
package gets installed into node-modules and appears in dependencies after a fresh npx projen new --from projen-cdktf-hybrid-construct hybrid-module
and causes package dependency issues. This is most probably because its use in https://github.com/cdktf/projen-cdktf-hybrid-construct/blob/main/src/hybrid-module.ts
.
I believe this needs to be replaced with @cdktf/tf-module-stack
.
language: null
cdktf-cli: 0.17.3
node: v18.16.1
terraform: 1.5.4
arch: arm64
os: darwin 22.5.0
No response
No response
No response
No response
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.