projen-cdktf-hybrid-construct 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.copywrite.hcl +22 -0
- package/.gitattributes +4 -2
- package/.jsii +38 -38
- package/.prettierignore +1 -1
- package/.projenrc.ts +64 -27
- package/API.md +603 -24
- package/README.md +5 -0
- package/lib/defaults.d.ts +6 -0
- package/lib/defaults.js +7 -1
- package/lib/hybrid-module.d.ts +6 -2
- package/lib/hybrid-module.js +8 -4
- package/lib/index.d.ts +4 -0
- package/lib/index.js +11 -3
- package/lib/publishing.d.ts +13 -9
- package/lib/publishing.js +6 -2
- package/lib/terraform-module.d.ts +6 -2
- package/lib/terraform-module.js +7 -3
- package/node_modules/tslib/README.md +1 -1
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +37 -0
- package/node_modules/tslib/modules/index.js +13 -0
- package/node_modules/tslib/package.json +12 -3
- package/node_modules/tslib/tslib.d.ts +55 -0
- package/node_modules/tslib/tslib.es6.js +125 -3
- package/node_modules/tslib/tslib.es6.mjs +370 -0
- package/node_modules/tslib/tslib.js +107 -3
- package/package.json +19 -21
- package/projenrc/auto-approve.ts +62 -0
- package/projenrc/automerge.ts +55 -0
- package/projenrc/customized-license.ts +24 -0
- package/projenrc/upgrade-cdktf.ts +107 -0
- package/scripts/update-cdktf.sh +36 -0
package/.copywrite.hcl
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
schema_version = 1
|
2
|
+
|
3
|
+
project {
|
4
|
+
license = "MPL-2.0"
|
5
|
+
copyright_year = 2022
|
6
|
+
|
7
|
+
# (OPTIONAL) A list of globs that should not have copyright/license headers.
|
8
|
+
# Supports doublestar glob patterns for more flexibility in defining which
|
9
|
+
# files or folders should be ignored
|
10
|
+
header_ignore = [
|
11
|
+
# "vendors/**",
|
12
|
+
# "**autogen**",
|
13
|
+
"**/node_modules/**",
|
14
|
+
"**/.mergify.yml",
|
15
|
+
"**/.github/workflows/*.yml",
|
16
|
+
"**/coverage/**",
|
17
|
+
"**/test-reports/**",
|
18
|
+
"**/dist/**",
|
19
|
+
"examples/**", # this probably should have the headers, but I'm tired of fighting Projen
|
20
|
+
"test/helper.ts",
|
21
|
+
]
|
22
|
+
}
|
package/.gitattributes
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
-
# ~~ Generated by projen. To modify, edit .projenrc.
|
1
|
+
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
|
2
2
|
|
3
3
|
*.snap linguist-generated
|
4
4
|
/.eslintrc.json linguist-generated
|
5
5
|
/.gitattributes linguist-generated
|
6
6
|
/.github/pull_request_template.md linguist-generated
|
7
7
|
/.github/workflows/auto-approve.yml linguist-generated
|
8
|
+
/.github/workflows/automerge.yml linguist-generated
|
8
9
|
/.github/workflows/build.yml linguist-generated
|
9
10
|
/.github/workflows/pull-request-lint.yml linguist-generated
|
10
11
|
/.github/workflows/release.yml linguist-generated
|
12
|
+
/.github/workflows/upgrade-cdktf.yml linguist-generated
|
11
13
|
/.github/workflows/upgrade-main.yml linguist-generated
|
12
14
|
/.gitignore linguist-generated
|
13
|
-
/.mergify.yml linguist-generated
|
14
15
|
/.npmignore linguist-generated
|
16
|
+
/.npmrc linguist-generated
|
15
17
|
/.prettierignore linguist-generated
|
16
18
|
/.prettierrc.json linguist-generated
|
17
19
|
/.projen/** linguist-generated
|
package/.jsii
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"change-case": "^4.1.2"
|
12
12
|
},
|
13
13
|
"dependencies": {
|
14
|
-
"projen": ">= 0.
|
14
|
+
"projen": ">= 0.72.18"
|
15
15
|
},
|
16
16
|
"dependencyClosure": {
|
17
17
|
"projen": {
|
@@ -59,7 +59,7 @@
|
|
59
59
|
"stability": "stable"
|
60
60
|
},
|
61
61
|
"homepage": "https://github.com/cdktf/projen-cdktf-hybrid-construct.git",
|
62
|
-
"jsiiVersion": "1.
|
62
|
+
"jsiiVersion": "5.1.11 (build 1dfe48d)",
|
63
63
|
"license": "MPL-2.0",
|
64
64
|
"metadata": {
|
65
65
|
"jsii": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
},
|
72
72
|
"name": "projen-cdktf-hybrid-construct",
|
73
73
|
"readme": {
|
74
|
-
"markdown": "# Projen-CDKTF-Hybrid-Construct\n\nProjen template for CDKTF Constructs that should also be used as Terraform Modules and for republishing Terraform Modules as Constructs.\n\n## Usage\n\n### `HybridModule`\n\nIf you want to write a CDKTF construct and also publish it as a Terraform Module you can use the `HybridModule` template.\n\nYou can initialize such a project using `npx projen new --from projen-cdktf-hybrid-construct hybrid-module`.\n\nA configutation might look like this:\n\n```js\nconst { HybridModule } = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // The name of the module & repository need to start with terraform-cdk-\n name: \"terraform-cdk-my-new-hybrid-construct\",\n repositoryUrl:\n \"github.com/DanielMSchmidt/terraform-cdk-my-new-hybrid-construct\",\n\n author: \"Daniel Schmidt\",\n authorAddress: \"danielmschmidt92@gmail.com\",\n\n // If enabled an example folder with terraform code will be created\n terraformExamples: {\n enabled: true,\n folder: \"terraform\",\n // The configuration to add to the example terraform file\n providerConfig: `\n terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n version = \"~> 3.74\"\n }\n }\n # Terraform binary version constraint\n required_version = \">= 1.2.0\"\n }\n\n\n provider \"aws\" {\n region = \"eu-central-1\"\n }\n `,\n },\n\n // If enabled a constructs example folder will be created\n constructExamples: {\n enabled: true,\n folder: \"construct-examples\",\n },\n});\nproject.synth();\n```\n\n### `TerraformModule`\n\nIf you want to republish an existing Terraform module as a CDKTF construct or if you want to repackage them with an easier to use API you can use the `TerraformModule` template.\n\nYou can initialize such a project using `npx projen new --from projen-cdktf-hybrid-construct terraform-module`.\n\nA configutation might look like this:\n\n```js\nconst { TerraformModule } = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new TerraformModule({\n name: \"my-module\",\n author: \"Daniel Schmidt\",\n authorAddress: \"danielmschmidt92@gmail.com\",\n repositoryUrl: \"github.com/DanielMSchmidt/my-module\",\n\n terraformModules: [\n {\n name: \"eks\",\n source: \"terraform-aws-modules/eks/aws\",\n version: \"~> 18.0\",\n },\n {\n name: \"eks-managed-nodegroup\",\n source: \"terraform-aws-modules/eks/aws//modules/eks-managed-node-group\",\n version: \"~> 18.0\",\n },\n ],\n});\n\nproject.synth();\n```\n\n## Publishing\n\n### Open Source\n\nWe have a helper method for easy configuration, but there are still some manual steps required.\n\n```js\nconst {\n HybridModule,\n publishToRegistries,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToRegistries({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"pypi\", \"nuget\", \"maven\"],\n }),\n});\n```\n\n#### Terraform\n\n1. [Sign in at the registry](https://registry.terraform.io/sign-in)\n2. [Select your repository](https://registry.terraform.io/github/create) and create the module\n\nPlease make sure your repository name starts with `terraform-cdk-`.\n\n#### npm (Typescript)\n\n1. Create an account at [npmjs.com](https://npmjs.com/)\n2. Create an [automation token](https://docs.npmjs.com/creating-and-viewing-access-tokens) on npm\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NPM_TOKEN` and the value of the token\n\n#### pypi (Python)\n\n1. Create an account at [pypi.org](https://pypi.org/)\n2. Create an [API token](https://pypi.org/help/#apitoken) on pypi\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `TWINE_USERNAME` and the value `__token__` and a second one with the name `TWINE_PASSWORD` and the value of the token\n4. Set the `publishToPypi` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst name = \"name-of-my-hybrid-construct\";\nnew HybridModule({\n name,\n // ... other options\n publishToPypi: {\n distName: name,\n module: name.replace(/-/g, \"_\"),\n },\n});\n```\n\n#### Maven (Java)\n\n1. [Create a Sonatype account and repository](https://central.sonatype.org/publish/publish-guide/#introduction)\n2. Create [GitHub Action Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to configure maven:\n - `MAVEN_USERNAME`\n - `MAVEN_PASSWORD`\n - `MAVEN_STAGING_PROFILE_ID`\n - `MAVEN_GPG_PRIVATE_KEY_PASSPHRASE`\n - `MAVEN_GPG_PRIVATE_KEY_PASSPHRASE`\n3. Setup the `publishToMaven` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst githubNamespace = \"my-org\";\nconst name = \"name-of-my-hybrid-construct\";\nnew HybridModule({\n name,\n // ... other options\n publishToMaven: {\n javaPackage: name.replace(/-/g, \"_\"),\n mavenGroupId: `com.${githubNamespace}`,\n mavenArtifactId: name,\n },\n});\n```\n\n#### NuGet (C#)\n\n1. [Create a NuGet account](https://www.nuget.org/users/account/LogOn) (you might need to create a Microsoft Account if you don't have one)\n2. [Create API keys](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-api-keys)\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NUGET_API_KEY` and the value of the token\n4. Setup the `publishToNuget` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst githubNamespace = \"my-org\";\nconst name = \"name-of-my-hybrid-construct\";\n\nnew HybridModule({\n name,\n // ... other options\n publishToNuget: {\n dotNetNamespace: `MyOrg.NameOfMyHybridConstruct`,\n packageId: `MyOrg.NameOfMyHybridConstruct`,\n },\n});\n```\n\n### Github Packages\n\nWe have a helper method for easy configuration, no extra steps needed:\n\n```js\nconst {\n HybridModule,\n publishToGithubPackages,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToGithubPackages({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"maven\"], // pypi and nuget are not yet supported\n }),\n});\n```\n\n### Artifactory\n\nWe have a helper method for easy configuration, but there are also some manual steps required.\n\n```js\nconst {\n HybridModule,\n publishToGithubPackages,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToGithubPackages({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"pypi\", \"nuget\"], // maven is currently not supported, PRs welcome\n artifactoryApiUrl: \"https://artifactory.my-org.com/api/\",\n artifactoryRepository: \"my-repo\", // needs to be the same across all registries, defaults to namespace so \"my-org\" in this case\n }),\n});\n```\n\n#### Terraform\n\nYou can find more information about publishing Terraform Modules to Artifactory [here](https://www.jfrog.com/confluence/display/JFROG/Terraform+Registry#TerraformRegistry-SettingupaLocalModule/ProviderRegistry).\n\n#### npm (Typescript)\n\n1. [Create a virtual npm registry](https://www.jfrog.com/confluence/display/JFROG/npm+Registry#npmRegistry-VirtualnpmRegistry)\n2. [Authenticate against artifactory to get a token](https://www.jfrog.com/confluence/display/JFROG/npm+Registry#npmRegistry-AuthenticatingthenpmClient)\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NPM_TOKEN` and the value of the token\n\n#### pypi (Python)\n\n1. Create a [local repository](https://www.jfrog.com/confluence/display/JFROG/PyPI+Repositories#PyPIRepositories-LocalRepositories)\n2. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `TWINE_USERNAME` and the artifactory user name and a second one with the name `TWINE_PASSWORD` and the artifactory password\n"
|
74
|
+
"markdown": "# Projen-CDKTF-Hybrid-Construct\n\nProjen template for CDKTF Constructs that should also be used as Terraform Modules and for republishing Terraform Modules as Constructs.\n\n## Compatibility\n\n- `cdktf` >= 0.15.0\n- `constructs` >= 10.0.107\n\n## Usage\n\n### `HybridModule`\n\nIf you want to write a CDKTF construct and also publish it as a Terraform Module you can use the `HybridModule` template.\n\nYou can initialize such a project using `npx projen new --from projen-cdktf-hybrid-construct hybrid-module`.\n\nA configutation might look like this:\n\n```js\nconst { HybridModule } = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // The name of the module & repository need to start with terraform-cdk-\n name: \"terraform-cdk-my-new-hybrid-construct\",\n repositoryUrl:\n \"github.com/DanielMSchmidt/terraform-cdk-my-new-hybrid-construct\",\n\n author: \"Daniel Schmidt\",\n authorAddress: \"danielmschmidt92@gmail.com\",\n\n // If enabled an example folder with terraform code will be created\n terraformExamples: {\n enabled: true,\n folder: \"terraform\",\n // The configuration to add to the example terraform file\n providerConfig: `\n terraform {\n required_providers {\n aws = {\n source = \"hashicorp/aws\"\n version = \"~> 3.74\"\n }\n }\n # Terraform binary version constraint\n required_version = \">= 1.2.0\"\n }\n\n\n provider \"aws\" {\n region = \"eu-central-1\"\n }\n `,\n },\n\n // If enabled a constructs example folder will be created\n constructExamples: {\n enabled: true,\n folder: \"construct-examples\",\n },\n});\nproject.synth();\n```\n\n### `TerraformModule`\n\nIf you want to republish an existing Terraform module as a CDKTF construct or if you want to repackage them with an easier to use API you can use the `TerraformModule` template.\n\nYou can initialize such a project using `npx projen new --from projen-cdktf-hybrid-construct terraform-module`.\n\nA configutation might look like this:\n\n```js\nconst { TerraformModule } = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new TerraformModule({\n name: \"my-module\",\n author: \"Daniel Schmidt\",\n authorAddress: \"danielmschmidt92@gmail.com\",\n repositoryUrl: \"github.com/DanielMSchmidt/my-module\",\n\n terraformModules: [\n {\n name: \"eks\",\n source: \"terraform-aws-modules/eks/aws\",\n version: \"~> 18.0\",\n },\n {\n name: \"eks-managed-nodegroup\",\n source: \"terraform-aws-modules/eks/aws//modules/eks-managed-node-group\",\n version: \"~> 18.0\",\n },\n ],\n});\n\nproject.synth();\n```\n\n## Publishing\n\n### Open Source\n\nWe have a helper method for easy configuration, but there are still some manual steps required.\n\n```js\nconst {\n HybridModule,\n publishToRegistries,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToRegistries({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"pypi\", \"nuget\", \"maven\"],\n }),\n});\n```\n\n#### Terraform\n\n1. [Sign in at the registry](https://registry.terraform.io/sign-in)\n2. [Select your repository](https://registry.terraform.io/github/create) and create the module\n\nPlease make sure your repository name starts with `terraform-cdk-`.\n\n#### npm (Typescript)\n\n1. Create an account at [npmjs.com](https://npmjs.com/)\n2. Create an [automation token](https://docs.npmjs.com/creating-and-viewing-access-tokens) on npm\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NPM_TOKEN` and the value of the token\n\n#### pypi (Python)\n\n1. Create an account at [pypi.org](https://pypi.org/)\n2. Create an [API token](https://pypi.org/help/#apitoken) on pypi\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `TWINE_USERNAME` and the value `__token__` and a second one with the name `TWINE_PASSWORD` and the value of the token\n4. Set the `publishToPypi` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst name = \"name-of-my-hybrid-construct\";\nnew HybridModule({\n name,\n // ... other options\n publishToPypi: {\n distName: name,\n module: name.replace(/-/g, \"_\"),\n },\n});\n```\n\n#### Maven (Java)\n\n1. [Create a Sonatype account and repository](https://central.sonatype.org/publish/publish-guide/#introduction)\n2. Create [GitHub Action Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to configure maven:\n - `MAVEN_USERNAME`\n - `MAVEN_PASSWORD`\n - `MAVEN_STAGING_PROFILE_ID`\n - `MAVEN_GPG_PRIVATE_KEY_PASSPHRASE`\n - `MAVEN_GPG_PRIVATE_KEY_PASSPHRASE`\n3. Setup the `publishToMaven` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst githubNamespace = \"my-org\";\nconst name = \"name-of-my-hybrid-construct\";\nnew HybridModule({\n name,\n // ... other options\n publishToMaven: {\n javaPackage: name.replace(/-/g, \"_\"),\n mavenGroupId: `com.${githubNamespace}`,\n mavenArtifactId: name,\n },\n});\n```\n\n#### NuGet (C#)\n\n1. [Create a NuGet account](https://www.nuget.org/users/account/LogOn) (you might need to create a Microsoft Account if you don't have one)\n2. [Create API keys](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-api-keys)\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NUGET_API_KEY` and the value of the token\n4. Setup the `publishToNuget` section in the options of `HybridModule` or `TerraformModule` (or use the helper mentioned above)\n\n```js\nconst githubNamespace = \"my-org\";\nconst name = \"name-of-my-hybrid-construct\";\n\nnew HybridModule({\n name,\n // ... other options\n publishToNuget: {\n dotNetNamespace: `MyOrg.NameOfMyHybridConstruct`,\n packageId: `MyOrg.NameOfMyHybridConstruct`,\n },\n});\n```\n\n### Github Packages\n\nWe have a helper method for easy configuration, no extra steps needed:\n\n```js\nconst {\n HybridModule,\n publishToGithubPackages,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToGithubPackages({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"maven\"], // pypi and nuget are not yet supported\n }),\n});\n```\n\n### Artifactory\n\nWe have a helper method for easy configuration, but there are also some manual steps required.\n\n```js\nconst {\n HybridModule,\n publishToGithubPackages,\n} = require(\"projen-cdktf-hybrid-construct\");\n\nconst project = new HybridModule({\n // ... all the other options\n ...publishToGithubPackages({\n name: \"my-new-hybrid-construct\",\n namespace: \"my-org\",\n registries: [\"npm\", \"pypi\", \"nuget\"], // maven is currently not supported, PRs welcome\n artifactoryApiUrl: \"https://artifactory.my-org.com/api/\",\n artifactoryRepository: \"my-repo\", // needs to be the same across all registries, defaults to namespace so \"my-org\" in this case\n }),\n});\n```\n\n#### Terraform\n\nYou can find more information about publishing Terraform Modules to Artifactory [here](https://www.jfrog.com/confluence/display/JFROG/Terraform+Registry#TerraformRegistry-SettingupaLocalModule/ProviderRegistry).\n\n#### npm (Typescript)\n\n1. [Create a virtual npm registry](https://www.jfrog.com/confluence/display/JFROG/npm+Registry#npmRegistry-VirtualnpmRegistry)\n2. [Authenticate against artifactory to get a token](https://www.jfrog.com/confluence/display/JFROG/npm+Registry#npmRegistry-AuthenticatingthenpmClient)\n3. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `NPM_TOKEN` and the value of the token\n\n#### pypi (Python)\n\n1. Create a [local repository](https://www.jfrog.com/confluence/display/JFROG/PyPI+Repositories#PyPIRepositories-LocalRepositories)\n2. Create a [GitHub Action Secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the name `TWINE_USERNAME` and the artifactory user name and a second one with the name `TWINE_PASSWORD` and the artifactory password\n"
|
75
75
|
},
|
76
76
|
"repository": {
|
77
77
|
"type": "git",
|
@@ -94,7 +94,7 @@
|
|
94
94
|
"kind": "interface",
|
95
95
|
"locationInModule": {
|
96
96
|
"filename": "src/hybrid-module.ts",
|
97
|
-
"line":
|
97
|
+
"line": 11
|
98
98
|
},
|
99
99
|
"name": "ConstructExamplesOption",
|
100
100
|
"properties": [
|
@@ -106,7 +106,7 @@
|
|
106
106
|
"immutable": true,
|
107
107
|
"locationInModule": {
|
108
108
|
"filename": "src/hybrid-module.ts",
|
109
|
-
"line":
|
109
|
+
"line": 13
|
110
110
|
},
|
111
111
|
"name": "enabled",
|
112
112
|
"type": {
|
@@ -121,7 +121,7 @@
|
|
121
121
|
"immutable": true,
|
122
122
|
"locationInModule": {
|
123
123
|
"filename": "src/hybrid-module.ts",
|
124
|
-
"line":
|
124
|
+
"line": 15
|
125
125
|
},
|
126
126
|
"name": "folder",
|
127
127
|
"optional": true,
|
@@ -149,7 +149,7 @@
|
|
149
149
|
},
|
150
150
|
"locationInModule": {
|
151
151
|
"filename": "src/hybrid-module.ts",
|
152
|
-
"line":
|
152
|
+
"line": 171
|
153
153
|
},
|
154
154
|
"parameters": [
|
155
155
|
{
|
@@ -163,7 +163,7 @@
|
|
163
163
|
"kind": "class",
|
164
164
|
"locationInModule": {
|
165
165
|
"filename": "src/hybrid-module.ts",
|
166
|
-
"line":
|
166
|
+
"line": 170
|
167
167
|
},
|
168
168
|
"name": "HybridModule",
|
169
169
|
"symbolId": "src/hybrid-module:HybridModule"
|
@@ -181,7 +181,7 @@
|
|
181
181
|
"kind": "interface",
|
182
182
|
"locationInModule": {
|
183
183
|
"filename": "src/hybrid-module.ts",
|
184
|
-
"line":
|
184
|
+
"line": 29
|
185
185
|
},
|
186
186
|
"name": "HybridModuleOptions",
|
187
187
|
"properties": [
|
@@ -191,14 +191,14 @@
|
|
191
191
|
"custom": {
|
192
192
|
"featured": "true"
|
193
193
|
},
|
194
|
-
"default": "\"
|
194
|
+
"default": "\"0.15.0\"",
|
195
195
|
"stability": "stable",
|
196
196
|
"summary": "Minimum target version of this library."
|
197
197
|
},
|
198
198
|
"immutable": true,
|
199
199
|
"locationInModule": {
|
200
200
|
"filename": "src/hybrid-module.ts",
|
201
|
-
"line":
|
201
|
+
"line": 35
|
202
202
|
},
|
203
203
|
"name": "cdktfVersion",
|
204
204
|
"optional": true,
|
@@ -219,7 +219,7 @@
|
|
219
219
|
"immutable": true,
|
220
220
|
"locationInModule": {
|
221
221
|
"filename": "src/hybrid-module.ts",
|
222
|
-
"line":
|
222
|
+
"line": 55
|
223
223
|
},
|
224
224
|
"name": "constructExamples",
|
225
225
|
"optional": true,
|
@@ -230,14 +230,14 @@
|
|
230
230
|
{
|
231
231
|
"abstract": true,
|
232
232
|
"docs": {
|
233
|
-
"default": "\"^10.0.
|
233
|
+
"default": "\"^10.0.107\"",
|
234
234
|
"stability": "stable",
|
235
235
|
"summary": "Construct version to use."
|
236
236
|
},
|
237
237
|
"immutable": true,
|
238
238
|
"locationInModule": {
|
239
239
|
"filename": "src/hybrid-module.ts",
|
240
|
-
"line":
|
240
|
+
"line": 41
|
241
241
|
},
|
242
242
|
"name": "constructVersion",
|
243
243
|
"optional": true,
|
@@ -254,7 +254,7 @@
|
|
254
254
|
"immutable": true,
|
255
255
|
"locationInModule": {
|
256
256
|
"filename": "src/hybrid-module.ts",
|
257
|
-
"line":
|
257
|
+
"line": 62
|
258
258
|
},
|
259
259
|
"name": "projectId",
|
260
260
|
"optional": true,
|
@@ -271,7 +271,7 @@
|
|
271
271
|
"immutable": true,
|
272
272
|
"locationInModule": {
|
273
273
|
"filename": "src/hybrid-module.ts",
|
274
|
-
"line":
|
274
|
+
"line": 67
|
275
275
|
},
|
276
276
|
"name": "runPlan",
|
277
277
|
"optional": true,
|
@@ -292,7 +292,7 @@
|
|
292
292
|
"immutable": true,
|
293
293
|
"locationInModule": {
|
294
294
|
"filename": "src/hybrid-module.ts",
|
295
|
-
"line":
|
295
|
+
"line": 48
|
296
296
|
},
|
297
297
|
"name": "terraformExamples",
|
298
298
|
"optional": true,
|
@@ -313,7 +313,7 @@
|
|
313
313
|
"kind": "interface",
|
314
314
|
"locationInModule": {
|
315
315
|
"filename": "src/hybrid-module.ts",
|
316
|
-
"line":
|
316
|
+
"line": 18
|
317
317
|
},
|
318
318
|
"name": "TerraformExamplesOption",
|
319
319
|
"properties": [
|
@@ -325,7 +325,7 @@
|
|
325
325
|
"immutable": true,
|
326
326
|
"locationInModule": {
|
327
327
|
"filename": "src/hybrid-module.ts",
|
328
|
-
"line":
|
328
|
+
"line": 20
|
329
329
|
},
|
330
330
|
"name": "enabled",
|
331
331
|
"type": {
|
@@ -340,7 +340,7 @@
|
|
340
340
|
"immutable": true,
|
341
341
|
"locationInModule": {
|
342
342
|
"filename": "src/hybrid-module.ts",
|
343
|
-
"line":
|
343
|
+
"line": 26
|
344
344
|
},
|
345
345
|
"name": "exampleCode",
|
346
346
|
"optional": true,
|
@@ -356,7 +356,7 @@
|
|
356
356
|
"immutable": true,
|
357
357
|
"locationInModule": {
|
358
358
|
"filename": "src/hybrid-module.ts",
|
359
|
-
"line":
|
359
|
+
"line": 22
|
360
360
|
},
|
361
361
|
"name": "folder",
|
362
362
|
"optional": true,
|
@@ -372,7 +372,7 @@
|
|
372
372
|
"immutable": true,
|
373
373
|
"locationInModule": {
|
374
374
|
"filename": "src/hybrid-module.ts",
|
375
|
-
"line":
|
375
|
+
"line": 24
|
376
376
|
},
|
377
377
|
"name": "providerConfig",
|
378
378
|
"optional": true,
|
@@ -400,7 +400,7 @@
|
|
400
400
|
},
|
401
401
|
"locationInModule": {
|
402
402
|
"filename": "src/terraform-module.ts",
|
403
|
-
"line":
|
403
|
+
"line": 55
|
404
404
|
},
|
405
405
|
"parameters": [
|
406
406
|
{
|
@@ -414,7 +414,7 @@
|
|
414
414
|
"kind": "class",
|
415
415
|
"locationInModule": {
|
416
416
|
"filename": "src/terraform-module.ts",
|
417
|
-
"line":
|
417
|
+
"line": 54
|
418
418
|
},
|
419
419
|
"name": "TerraformModule",
|
420
420
|
"symbolId": "src/terraform-module:TerraformModule"
|
@@ -432,7 +432,7 @@
|
|
432
432
|
"kind": "interface",
|
433
433
|
"locationInModule": {
|
434
434
|
"filename": "src/terraform-module.ts",
|
435
|
-
"line":
|
435
|
+
"line": 20
|
436
436
|
},
|
437
437
|
"name": "TerraformModuleOptions",
|
438
438
|
"properties": [
|
@@ -448,7 +448,7 @@
|
|
448
448
|
"immutable": true,
|
449
449
|
"locationInModule": {
|
450
450
|
"filename": "src/terraform-module.ts",
|
451
|
-
"line":
|
451
|
+
"line": 43
|
452
452
|
},
|
453
453
|
"name": "terraformModules",
|
454
454
|
"type": {
|
@@ -466,14 +466,14 @@
|
|
466
466
|
"custom": {
|
467
467
|
"featured": "true"
|
468
468
|
},
|
469
|
-
"default": "\"
|
469
|
+
"default": "\"0.15.0\"",
|
470
470
|
"stability": "stable",
|
471
471
|
"summary": "Minimum target version of this library."
|
472
472
|
},
|
473
473
|
"immutable": true,
|
474
474
|
"locationInModule": {
|
475
475
|
"filename": "src/terraform-module.ts",
|
476
|
-
"line":
|
476
|
+
"line": 26
|
477
477
|
},
|
478
478
|
"name": "cdktfVersion",
|
479
479
|
"optional": true,
|
@@ -484,14 +484,14 @@
|
|
484
484
|
{
|
485
485
|
"abstract": true,
|
486
486
|
"docs": {
|
487
|
-
"default": "\"^10.0.
|
487
|
+
"default": "\"^10.0.107\"",
|
488
488
|
"stability": "stable",
|
489
489
|
"summary": "Construct version to use."
|
490
490
|
},
|
491
491
|
"immutable": true,
|
492
492
|
"locationInModule": {
|
493
493
|
"filename": "src/terraform-module.ts",
|
494
|
-
"line":
|
494
|
+
"line": 32
|
495
495
|
},
|
496
496
|
"name": "constructVersion",
|
497
497
|
"optional": true,
|
@@ -507,7 +507,7 @@
|
|
507
507
|
"immutable": true,
|
508
508
|
"locationInModule": {
|
509
509
|
"filename": "src/terraform-module.ts",
|
510
|
-
"line":
|
510
|
+
"line": 46
|
511
511
|
},
|
512
512
|
"name": "projectId",
|
513
513
|
"optional": true,
|
@@ -524,7 +524,7 @@
|
|
524
524
|
"immutable": true,
|
525
525
|
"locationInModule": {
|
526
526
|
"filename": "src/terraform-module.ts",
|
527
|
-
"line":
|
527
|
+
"line": 37
|
528
528
|
},
|
529
529
|
"name": "terraformProviders",
|
530
530
|
"optional": true,
|
@@ -550,7 +550,7 @@
|
|
550
550
|
"kind": "interface",
|
551
551
|
"locationInModule": {
|
552
552
|
"filename": "src/terraform-module.ts",
|
553
|
-
"line":
|
553
|
+
"line": 11
|
554
554
|
},
|
555
555
|
"name": "TerraformVersionConstraint",
|
556
556
|
"properties": [
|
@@ -562,7 +562,7 @@
|
|
562
562
|
"immutable": true,
|
563
563
|
"locationInModule": {
|
564
564
|
"filename": "src/terraform-module.ts",
|
565
|
-
"line":
|
565
|
+
"line": 13
|
566
566
|
},
|
567
567
|
"name": "name",
|
568
568
|
"type": {
|
@@ -577,7 +577,7 @@
|
|
577
577
|
"immutable": true,
|
578
578
|
"locationInModule": {
|
579
579
|
"filename": "src/terraform-module.ts",
|
580
|
-
"line":
|
580
|
+
"line": 15
|
581
581
|
},
|
582
582
|
"name": "source",
|
583
583
|
"type": {
|
@@ -592,7 +592,7 @@
|
|
592
592
|
"immutable": true,
|
593
593
|
"locationInModule": {
|
594
594
|
"filename": "src/terraform-module.ts",
|
595
|
-
"line":
|
595
|
+
"line": 17
|
596
596
|
},
|
597
597
|
"name": "version",
|
598
598
|
"type": {
|
@@ -603,6 +603,6 @@
|
|
603
603
|
"symbolId": "src/terraform-module:TerraformVersionConstraint"
|
604
604
|
}
|
605
605
|
},
|
606
|
-
"version": "0.3.
|
607
|
-
"fingerprint": "
|
606
|
+
"version": "0.3.4",
|
607
|
+
"fingerprint": "iSgqbIhgck0QpFRm+3byRJfp2s30ExMGQpNh24Vm1Ig="
|
608
608
|
}
|
package/.prettierignore
CHANGED
@@ -1 +1 @@
|
|
1
|
-
# ~~ Generated by projen. To modify, edit .projenrc.
|
1
|
+
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
|
package/.projenrc.ts
CHANGED
@@ -1,26 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
const SPDX = "MPL-2.0";
|
1
|
+
/**
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
4
|
+
*/
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
import { JsiiProject } from "projen/lib/cdk";
|
7
|
+
import { NpmAccess, UpgradeDependenciesSchedule } from "projen/lib/javascript";
|
8
|
+
import { AutoApprove } from "./projenrc/auto-approve";
|
9
|
+
import { Automerge } from "./projenrc/automerge";
|
10
|
+
import { CustomizedLicense } from "./projenrc/customized-license";
|
11
|
+
import { UpgradeCDKTF } from "./projenrc/upgrade-cdktf";
|
11
12
|
|
12
|
-
|
13
|
-
}
|
13
|
+
const name = "projen-cdktf-hybrid-construct";
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
const githubActionPinnedVersions = {
|
16
|
+
"actions/checkout": "c85c95e3d7251135ab7dc9ce3241c5835cc595a9", // v3.5.3
|
17
|
+
"actions/download-artifact": "9bc31d5ccc31df68ecc42ccf4149144866c47d8a", // v3.0.2
|
18
|
+
"actions/setup-node": "64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c", // v3.6.0
|
19
|
+
"actions/upload-artifact": "0b7f8abb1508181956e8e162db84b466c27e18ce", // v3.1.2
|
20
|
+
"amannn/action-semantic-pull-request":
|
21
|
+
"c3cd5d1ea3580753008872425915e343e351ab54", // v5.2.0
|
22
|
+
"peter-evans/create-pull-request": "284f54f989303d2699d373481a0cfa13ad5a6666", // v5.0.1
|
23
|
+
};
|
22
24
|
|
23
|
-
const name = "projen-cdktf-hybrid-construct";
|
24
25
|
const project = new JsiiProject({
|
25
26
|
defaultReleaseBranch: "main",
|
26
27
|
name,
|
@@ -37,34 +38,42 @@ const project = new JsiiProject({
|
|
37
38
|
release: true,
|
38
39
|
releaseToNpm: true,
|
39
40
|
npmAccess: NpmAccess.PUBLIC,
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
mergify: false,
|
42
|
+
depsUpgradeOptions: {
|
43
|
+
workflowOptions: {
|
44
|
+
labels: ["auto-approve", "automerge", "dependencies"],
|
45
|
+
schedule: UpgradeDependenciesSchedule.WEEKLY,
|
46
|
+
},
|
44
47
|
},
|
45
48
|
gitignore: [".idea/"],
|
46
49
|
workflowGitIdentity: {
|
47
50
|
name: "team-tf-cdk",
|
48
51
|
email: "github-team-tf-cdk@hashicorp.com",
|
49
52
|
},
|
53
|
+
jsiiVersion: "^5.1.0",
|
50
54
|
});
|
51
55
|
project.tsconfig?.exclude?.push("src/exampleCode/**");
|
52
56
|
project.tsconfig?.exclude?.push("example/**");
|
53
57
|
project.tsconfig?.exclude?.push("examples/**");
|
54
58
|
|
55
|
-
project.addPeerDeps("projen@>= 0.
|
59
|
+
project.addPeerDeps("projen@>= 0.72.18");
|
56
60
|
project.addBundledDeps("change-case");
|
57
61
|
project.addDevDeps(
|
58
62
|
"fs-extra",
|
59
63
|
"glob",
|
60
|
-
"projen
|
64
|
+
"projen@^0.72.18",
|
61
65
|
"@types/fs-extra",
|
62
66
|
"@types/glob",
|
63
67
|
"@types/change-case",
|
64
|
-
"ts-node@10.9.1"
|
68
|
+
"ts-node@10.9.1",
|
69
|
+
"jsii-docgen@^9.0.0",
|
70
|
+
"comment-json"
|
65
71
|
);
|
66
72
|
|
67
73
|
new CustomizedLicense(project);
|
74
|
+
new AutoApprove(project);
|
75
|
+
new Automerge(project);
|
76
|
+
new UpgradeCDKTF(project);
|
68
77
|
|
69
78
|
project.addPackageIgnore("examples");
|
70
79
|
|
@@ -75,11 +84,39 @@ project.addTask("buildExample:hybrid", {
|
|
75
84
|
exec: "git clean -dfx . && rm -rf lib modules src terraform construct-examples && yarn && yarn projen && yarn && yarn build",
|
76
85
|
cwd: "./examples/hybrid-module",
|
77
86
|
});
|
78
|
-
|
79
87
|
project.addTask("buildExample:terraform", {
|
80
88
|
exec: "git clean -dfx . && rm -rf lib modules src terraform construct-examples && yarn && yarn projen && yarn && yarn build",
|
81
89
|
cwd: "./examples/terraform-module",
|
82
90
|
});
|
83
91
|
|
92
|
+
project.addTask("upgrade:hybrid", {
|
93
|
+
exec: "yarn projen upgrade",
|
94
|
+
cwd: "./examples/hybrid-module",
|
95
|
+
});
|
96
|
+
project.addTask("upgrade:terraform", {
|
97
|
+
exec: "yarn projen upgrade",
|
98
|
+
cwd: "./examples/terraform-module",
|
99
|
+
});
|
100
|
+
project.removeTask("post-upgrade");
|
101
|
+
project.addTask("post-upgrade", {
|
102
|
+
description: "Runs after upgrading dependencies",
|
103
|
+
exec: "yarn projen upgrade:hybrid && yarn projen upgrade:terraform",
|
104
|
+
});
|
105
|
+
|
84
106
|
project.testTask.exec("yarn buildExample");
|
107
|
+
|
108
|
+
// Run copywrite tool to add copyright headers to all files
|
109
|
+
project.buildWorkflow?.addPostBuildSteps(
|
110
|
+
{
|
111
|
+
name: "Setup Copywrite tool",
|
112
|
+
uses: "hashicorp/setup-copywrite@867a1a2a064a0626db322392806428f7dc59cb3e", // v1.1.2
|
113
|
+
},
|
114
|
+
{ name: "Add headers using Copywrite tool", run: "copywrite headers" }
|
115
|
+
);
|
116
|
+
|
117
|
+
// Use pinned versions of github actions
|
118
|
+
Object.entries(githubActionPinnedVersions).forEach(([action, sha]) => {
|
119
|
+
project.github?.actions.set(action, `${action}@${sha}`);
|
120
|
+
});
|
121
|
+
|
85
122
|
project.synth();
|