Skip to content

Instantly share code, notes, and snippets.

@romainPrignon
Last active September 13, 2021 10:13
Show Gist options
  • Save romainPrignon/dd220d105fb02bc2a7a2a90ab062e334 to your computer and use it in GitHub Desktop.
Save romainPrignon/dd220d105fb02bc2a7a2a90ab062e334 to your computer and use it in GitHub Desktop.

Revisions

  1. romainPrignon revised this gist Sep 13, 2021. 3 changed files with 74 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions cdktf.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    {
    "language": "typescript",
    "app": "ts-node stacks/main.ts",
    "terraformProviders": [
    "aws@~>3.0",
    "heroku/heroku@~>4.0"
    ],
    "terraformModules": [],
    "context": {
    "excludeStackIdFromLogicalIds": "true",
    "allowSepCharsInLogicalIds": "true"
    }
    }
    31 changes: 31 additions & 0 deletions ci.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    name: CI

    on:
    push:
    branches-ignore:
    - main

    env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    HEROKU_API_KEY: ***
    AWS_DEFAULT_REGION: eu-west-1

    jobs:
    ci:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - uses: actions/setup-node@v2
    with:
    node-version: 14.4
    - uses: hashicorp/setup-terraform@v1
    with:
    terraform_version: 0.14

    - name: install deps
    run: npm ci <--------- Error here !!!

    - name: synth stack
    run: npm run synth
    30 changes: 30 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    {
    "name": "infra",
    "version": "1.0.0",
    "scripts": {
    "prepare": "cdktf get",
    "compile": "tsc --noEmit --pretty",
    "dev": "nodemon",
    "test": "echo ok",
    "synth": "cdktf synth",
    "plan": "cdktf plan",
    "apply": "cdktf apply",
    "reset": "rm -rf ./cdktf.out/",
    "destroy": "cdktf destroy"
    },
    "engines": {
    "node": "^14",
    "npm": "^6.3"
    },
    "dependencies": {
    "cdktf": "^0.5.0",
    "cdktf-cli": "^0.5.0",
    "constructs": "^3.3.144",
    "ts-node": "^10.2.1"
    },
    "devDependencies": {
    "@types/node": "^16.7.10",
    "nodemon": "^2.0.12",
    "typescript": "^4.4.2"
    }
    }
  2. romainPrignon created this gist Sep 13, 2021.
    47 changes: 47 additions & 0 deletions output.log
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    Run npm ci
    npm ci
    shell: /usr/bin/bash -e {0}
    env:
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    HEROKU_API_KEY: ***
    AWS_DEFAULT_REGION: eu-west-1
    TERRAFORM_CLI_PATH: /home/runner/work/_temp/b4b31129-fa99-4920-90dc-02315089b831

    > @apollo/[email protected] postinstall /home/runner/work/bi-infra/bi-infra/node_modules/@apollo/protobufjs
    > node scripts/postinstall


    > [email protected] postinstall /home/runner/work/bi-infra/bi-infra/node_modules/core-js-pure
    > node -e "try{require('./postinstall')}catch(e){}"


    > [email protected] postinstall /home/runner/work/bi-infra/bi-infra/node_modules/nodemon
    > node bin/postinstall || exit 0


    > [email protected] prepare /home/runner/work/bi-infra/bi-infra
    > cdktf get

    SyntaxError: Unexpected token c in JSON at position 1
    at JSON.parse (<anonymous>)
    at /home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/lib/get/generator/provider-schema.js:145:35
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.withTempDir (/home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/lib/util.js:56:9)
    at async Object.readSchema (/home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/lib/get/generator/provider-schema.js:139:5)
    at async ConstructsMaker.generateTypeScript (/home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/lib/get/constructs-maker.js:176:24)
    ⠸ downloading and generating modules and providers...
    at async ConstructsMaker.generate (/home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/lib/get/constructs-maker.js:190:9)
    at async get (/home/runner/work/bi-infra/bi-infra/node_modules/cdktf-cli/bin/cmds/ui/get.js:50:17)
    Unexpected token c in JSON at position 1
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] prepare: `cdktf get`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] prepare script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /home/runner/.npm/_logs/2021-09-13T09_48_18_618Z-debug.log
    Error: Process completed with exit code 1.