Heisenberg
Heisenberg

Reputation: 5299

What is app section and what is the purpose of this in cdk.json

When I develop sample apps by using AWS CDK,I found app section in cdk.json.I have question about app. what is app ? it seems that app.js is executed. When this command will be executed ? when we run cdk synth,is this command executed? I don't know the purpose of this use. Thanks

{
  "app": "node packages/cdk/dist/app",
  "output": "build/cdk.out",
  "context": {
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
    "@aws-cdk/core:enableStackNameDuplicates": "true",
    "aws-cdk:enableDiffNoFail": "true",
    "@aws-cdk/core:stackRelativeExports": "true",
    "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true,
    "@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true,
    "@aws-cdk/aws-kms:defaultKeyPolicies": true,
    "@aws-cdk/aws-s3:grantWriteWithoutAcl": true,
    "@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true,
    "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
    "@aws-cdk/aws-efs:defaultEncryptionAtRest": true,

    "systemName": "devio",
    "envType": "stg"
  }
}

Upvotes: 0

Views: 1367

Answers (1)

jarmod
jarmod

Reputation: 78823

Per the CDK documentation:

Since the AWS CDK supports programs written in a variety of languages, it uses a configuration option to specify the exact command necessary to run your app. This option can be specified in two ways.

First, and most commonly, it can be specified using the app key inside the file cdk.json, which is in the main directory of your AWS CDK project. The CDK Toolkit provides an appropriate command when creating a new project with cdk init.

Here is the cdk.json from a fresh TypeScript project, for instance:

{
  "app": "npx ts-node bin/hello-cdk.ts"
}

Upvotes: 1

Related Questions