diff --git a/samcli/commands/local/cli_common/options.py b/samcli/commands/local/cli_common/options.py index 050e6201e8..75aeb23314 100644 --- a/samcli/commands/local/cli_common/options.py +++ b/samcli/commands/local/cli_common/options.py @@ -231,7 +231,7 @@ def warm_containers_common_options(f): click.option( "--debug-function", help="Optional. Specifies the Lambda Function logicalId to apply debug options to when" - " --warm-containers is specified. This parameter applies to --debug-port, --debugger-path," + " --warm-containers is specified. This parameter applies to --debug-port, --debugger-path," " and --debug-args.", type=click.STRING, multiple=False, diff --git a/schema/samcli.json b/schema/samcli.json index d9076c0d9f..2c8c98078e 100644 --- a/schema/samcli.json +++ b/schema/samcli.json @@ -187,9 +187,139 @@ "properties": { "parameters": { "title": "Parameters for the local invoke command", - "description": "Available parameters for the local invoke command:\n", + "description": "Available parameters for the local invoke command:\n* hook_name:\nHook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']\n* skip_prepare_infra:\nSkip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name.\n* event:\nJSON file containing event data passed to the Lambda function during invoke. If this option is not specified, no event is assumed. Pass in the value '-' to input JSON via stdin\n* no_event:\nDEPRECATED: By default no event is assumed.\n* template_file:\nAWS SAM template which references built artifacts for resources in the template. (if applicable)\n* env_vars:\nJSON file containing values for Lambda function's environment variables.\n* parameter_overrides:\nString that contains AWS CloudFormation parameter overrides encoded as key=value pairs.\n* debug_port:\nWhen specified, Lambda function container will start in debug mode and will expose this port on localhost.\n* debugger_path:\nHost path to a debugger that will be mounted into the Lambda container.\n* debug_args:\nAdditional arguments to be passed to the debugger.\n* container_env_vars:\nJSON file containing environment variables to be set within the container environment\n* docker_volume_basedir:\nSpecify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine.\n* log_file:\nFile to capture output logs.\n* layer_cache_basedir:\nSpecify the location basedir where the lambda layers used by the template will be downloaded to.\n* skip_pull_image:\nSkip pulling down the latest Docker image for Lambda runtime.\n* docker_network:\nName or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.\n* force_image_build:\nForce rebuilding the image used for invoking functions with layers.\n* shutdown:\nEmulate a shutdown event after invoke completes, to test extension handling of shutdown behavior.\n* container_host:\nHost of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`\n* container_host_interface:\nIP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.\n* invoke_image:\nContainer image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* profile:\nSelect a specific profile from your credential file to get AWS credentials.\n* region:\nSet the AWS Region of the service. (e.g. us-east-1)", "type": "object", - "properties": {} + "properties": { + "hook_name": { + "title": "hook_name", + "type": "string", + "description": "Hook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']" + }, + "skip_prepare_infra": { + "title": "skip_prepare_infra", + "type": "boolean", + "description": "Skip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name." + }, + "event": { + "title": "event", + "type": "string", + "description": "JSON file containing event data passed to the Lambda function during invoke. If this option is not specified, no event is assumed. Pass in the value '-' to input JSON via stdin" + }, + "no_event": { + "title": "no_event", + "type": "boolean", + "description": "DEPRECATED: By default no event is assumed.", + "default": true + }, + "template_file": { + "title": "template_file", + "type": "string", + "description": "AWS SAM template which references built artifacts for resources in the template. (if applicable)", + "default": "template.[yaml|yml|json]" + }, + "env_vars": { + "title": "env_vars", + "type": "string", + "description": "JSON file containing values for Lambda function's environment variables." + }, + "parameter_overrides": { + "title": "parameter_overrides", + "type": "string", + "description": "String that contains AWS CloudFormation parameter overrides encoded as key=value pairs." + }, + "debug_port": { + "title": "debug_port", + "type": "integer", + "description": "When specified, Lambda function container will start in debug mode and will expose this port on localhost." + }, + "debugger_path": { + "title": "debugger_path", + "type": "string", + "description": "Host path to a debugger that will be mounted into the Lambda container." + }, + "debug_args": { + "title": "debug_args", + "type": "string", + "description": "Additional arguments to be passed to the debugger." + }, + "container_env_vars": { + "title": "container_env_vars", + "type": "string", + "description": "JSON file containing environment variables to be set within the container environment" + }, + "docker_volume_basedir": { + "title": "docker_volume_basedir", + "type": "string", + "description": "Specify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine." + }, + "log_file": { + "title": "log_file", + "type": "string", + "description": "File to capture output logs." + }, + "layer_cache_basedir": { + "title": "layer_cache_basedir", + "type": "string", + "description": "Specify the location basedir where the lambda layers used by the template will be downloaded to." + }, + "skip_pull_image": { + "title": "skip_pull_image", + "type": "boolean", + "description": "Skip pulling down the latest Docker image for Lambda runtime." + }, + "docker_network": { + "title": "docker_network", + "type": "string", + "description": "Name or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network." + }, + "force_image_build": { + "title": "force_image_build", + "type": "boolean", + "description": "Force rebuilding the image used for invoking functions with layers." + }, + "shutdown": { + "title": "shutdown", + "type": "boolean", + "description": "Emulate a shutdown event after invoke completes, to test extension handling of shutdown behavior." + }, + "container_host": { + "title": "container_host", + "type": "string", + "description": "Host of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`", + "default": "localhost" + }, + "container_host_interface": { + "title": "container_host_interface", + "type": "string", + "description": "IP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.", + "default": "127.0.0.1" + }, + "invoke_image": { + "title": "invoke_image", + "type": "string", + "description": "Container image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used." + }, + "beta_features": { + "title": "beta_features", + "type": "boolean", + "description": "Enable/Disable beta features." + }, + "debug": { + "title": "debug", + "type": "boolean", + "description": "Turn on debug logging to print debug message generated by AWS SAM CLI and display timestamps." + }, + "profile": { + "title": "profile", + "type": "string", + "description": "Select a specific profile from your credential file to get AWS credentials." + }, + "region": { + "title": "region", + "type": "string", + "description": "Set the AWS Region of the service. (e.g. us-east-1)" + } + } } }, "required": [ @@ -202,9 +332,160 @@ "properties": { "parameters": { "title": "Parameters for the local start api command", - "description": "Available parameters for the local start api command:\n", + "description": "Available parameters for the local start api command:\n* hook_name:\nHook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']\n* skip_prepare_infra:\nSkip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name.\n* host:\nLocal hostname or IP address to bind to (default: '127.0.0.1')\n* port:\nLocal port number to listen on (default: '3000')\n* static_dir:\nAny static assets (e.g. CSS/Javascript/HTML) files located in this directory will be presented at /\n* template_file:\nAWS SAM template which references built artifacts for resources in the template. (if applicable)\n* env_vars:\nJSON file containing values for Lambda function's environment variables.\n* parameter_overrides:\nString that contains AWS CloudFormation parameter overrides encoded as key=value pairs.\n* debug_port:\nWhen specified, Lambda function container will start in debug mode and will expose this port on localhost.\n* debugger_path:\nHost path to a debugger that will be mounted into the Lambda container.\n* debug_args:\nAdditional arguments to be passed to the debugger.\n* container_env_vars:\nJSON file containing environment variables to be set within the container environment\n* docker_volume_basedir:\nSpecify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine.\n* log_file:\nFile to capture output logs.\n* layer_cache_basedir:\nSpecify the location basedir where the lambda layers used by the template will be downloaded to.\n* skip_pull_image:\nSkip pulling down the latest Docker image for Lambda runtime.\n* docker_network:\nName or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.\n* force_image_build:\nForce rebuilding the image used for invoking functions with layers.\n* warm_containers:\nOptional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.\n* debug_function:\nOptional. Specifies the Lambda Function logicalId to apply debug options to when --warm-containers is specified. This parameter applies to --debug-port, --debugger-path, and --debug-args.\n* shutdown:\nEmulate a shutdown event after invoke completes, to test extension handling of shutdown behavior.\n* container_host:\nHost of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`\n* container_host_interface:\nIP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.\n* invoke_image:\nContainer image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* profile:\nSelect a specific profile from your credential file to get AWS credentials.\n* region:\nSet the AWS Region of the service. (e.g. us-east-1)", "type": "object", - "properties": {} + "properties": { + "hook_name": { + "title": "hook_name", + "type": "string", + "description": "Hook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']" + }, + "skip_prepare_infra": { + "title": "skip_prepare_infra", + "type": "boolean", + "description": "Skip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name." + }, + "host": { + "title": "host", + "type": "string", + "description": "Local hostname or IP address to bind to (default: '127.0.0.1')", + "default": "127.0.0.1" + }, + "port": { + "title": "port", + "type": "integer", + "description": "Local port number to listen on (default: '3000')", + "default": 3000 + }, + "static_dir": { + "title": "static_dir", + "type": "string", + "description": "Any static assets (e.g. CSS/Javascript/HTML) files located in this directory will be presented at /", + "default": "public" + }, + "template_file": { + "title": "template_file", + "type": "string", + "description": "AWS SAM template which references built artifacts for resources in the template. (if applicable)", + "default": "template.[yaml|yml|json]" + }, + "env_vars": { + "title": "env_vars", + "type": "string", + "description": "JSON file containing values for Lambda function's environment variables." + }, + "parameter_overrides": { + "title": "parameter_overrides", + "type": "string", + "description": "String that contains AWS CloudFormation parameter overrides encoded as key=value pairs." + }, + "debug_port": { + "title": "debug_port", + "type": "integer", + "description": "When specified, Lambda function container will start in debug mode and will expose this port on localhost." + }, + "debugger_path": { + "title": "debugger_path", + "type": "string", + "description": "Host path to a debugger that will be mounted into the Lambda container." + }, + "debug_args": { + "title": "debug_args", + "type": "string", + "description": "Additional arguments to be passed to the debugger." + }, + "container_env_vars": { + "title": "container_env_vars", + "type": "string", + "description": "JSON file containing environment variables to be set within the container environment" + }, + "docker_volume_basedir": { + "title": "docker_volume_basedir", + "type": "string", + "description": "Specify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine." + }, + "log_file": { + "title": "log_file", + "type": "string", + "description": "File to capture output logs." + }, + "layer_cache_basedir": { + "title": "layer_cache_basedir", + "type": "string", + "description": "Specify the location basedir where the lambda layers used by the template will be downloaded to." + }, + "skip_pull_image": { + "title": "skip_pull_image", + "type": "boolean", + "description": "Skip pulling down the latest Docker image for Lambda runtime." + }, + "docker_network": { + "title": "docker_network", + "type": "string", + "description": "Name or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network." + }, + "force_image_build": { + "title": "force_image_build", + "type": "boolean", + "description": "Force rebuilding the image used for invoking functions with layers." + }, + "warm_containers": { + "title": "warm_containers", + "type": "string", + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", + "enum": [ + "EAGER", + "LAZY" + ] + }, + "debug_function": { + "title": "debug_function", + "type": "string", + "description": "Optional. Specifies the Lambda Function logicalId to apply debug options to when --warm-containers is specified. This parameter applies to --debug-port, --debugger-path, and --debug-args." + }, + "shutdown": { + "title": "shutdown", + "type": "boolean", + "description": "Emulate a shutdown event after invoke completes, to test extension handling of shutdown behavior." + }, + "container_host": { + "title": "container_host", + "type": "string", + "description": "Host of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`", + "default": "localhost" + }, + "container_host_interface": { + "title": "container_host_interface", + "type": "string", + "description": "IP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.", + "default": "127.0.0.1" + }, + "invoke_image": { + "title": "invoke_image", + "type": "string", + "description": "Container image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used." + }, + "beta_features": { + "title": "beta_features", + "type": "boolean", + "description": "Enable/Disable beta features." + }, + "debug": { + "title": "debug", + "type": "boolean", + "description": "Turn on debug logging to print debug message generated by AWS SAM CLI and display timestamps." + }, + "profile": { + "title": "profile", + "type": "string", + "description": "Select a specific profile from your credential file to get AWS credentials." + }, + "region": { + "title": "region", + "type": "string", + "description": "Set the AWS Region of the service. (e.g. us-east-1)" + } + } } }, "required": [ @@ -217,7 +498,7 @@ "properties": { "parameters": { "title": "Parameters for the local generate event command", - "description": "Available parameters for the local generate event command:\n", + "description": "Available parameters for the local generate event command:\n* ", "type": "object", "properties": {} } @@ -232,9 +513,154 @@ "properties": { "parameters": { "title": "Parameters for the local start lambda command", - "description": "Available parameters for the local start lambda command:\n", + "description": "Available parameters for the local start lambda command:\n* hook_name:\nHook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']\n* skip_prepare_infra:\nSkip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name.\n* host:\nLocal hostname or IP address to bind to (default: '127.0.0.1')\n* port:\nLocal port number to listen on (default: '3001')\n* template_file:\nAWS SAM template which references built artifacts for resources in the template. (if applicable)\n* env_vars:\nJSON file containing values for Lambda function's environment variables.\n* parameter_overrides:\nString that contains AWS CloudFormation parameter overrides encoded as key=value pairs.\n* debug_port:\nWhen specified, Lambda function container will start in debug mode and will expose this port on localhost.\n* debugger_path:\nHost path to a debugger that will be mounted into the Lambda container.\n* debug_args:\nAdditional arguments to be passed to the debugger.\n* container_env_vars:\nJSON file containing environment variables to be set within the container environment\n* docker_volume_basedir:\nSpecify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine.\n* log_file:\nFile to capture output logs.\n* layer_cache_basedir:\nSpecify the location basedir where the lambda layers used by the template will be downloaded to.\n* skip_pull_image:\nSkip pulling down the latest Docker image for Lambda runtime.\n* docker_network:\nName or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network.\n* force_image_build:\nForce rebuilding the image used for invoking functions with layers.\n* warm_containers:\nOptional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.\n* debug_function:\nOptional. Specifies the Lambda Function logicalId to apply debug options to when --warm-containers is specified. This parameter applies to --debug-port, --debugger-path, and --debug-args.\n* shutdown:\nEmulate a shutdown event after invoke completes, to test extension handling of shutdown behavior.\n* container_host:\nHost of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`\n* container_host_interface:\nIP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.\n* invoke_image:\nContainer image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used.\n* beta_features:\nEnable/Disable beta features.\n* debug:\nTurn on debug logging to print debug message generated by AWS SAM CLI and display timestamps.\n* profile:\nSelect a specific profile from your credential file to get AWS credentials.\n* region:\nSet the AWS Region of the service. (e.g. us-east-1)", "type": "object", - "properties": {} + "properties": { + "hook_name": { + "title": "hook_name", + "type": "string", + "description": "Hook package id to extend AWS SAM CLI commands functionality. \n\nExample: `terraform` to extend AWS SAM CLI commands functionality to support terraform applications. \n\nAvailable Hook Names: ['terraform']" + }, + "skip_prepare_infra": { + "title": "skip_prepare_infra", + "type": "boolean", + "description": "Skip preparation stage when there are no infrastructure changes. Only used in conjunction with --hook-name." + }, + "host": { + "title": "host", + "type": "string", + "description": "Local hostname or IP address to bind to (default: '127.0.0.1')", + "default": "127.0.0.1" + }, + "port": { + "title": "port", + "type": "integer", + "description": "Local port number to listen on (default: '3001')", + "default": 3001 + }, + "template_file": { + "title": "template_file", + "type": "string", + "description": "AWS SAM template which references built artifacts for resources in the template. (if applicable)", + "default": "template.[yaml|yml|json]" + }, + "env_vars": { + "title": "env_vars", + "type": "string", + "description": "JSON file containing values for Lambda function's environment variables." + }, + "parameter_overrides": { + "title": "parameter_overrides", + "type": "string", + "description": "String that contains AWS CloudFormation parameter overrides encoded as key=value pairs." + }, + "debug_port": { + "title": "debug_port", + "type": "integer", + "description": "When specified, Lambda function container will start in debug mode and will expose this port on localhost." + }, + "debugger_path": { + "title": "debugger_path", + "type": "string", + "description": "Host path to a debugger that will be mounted into the Lambda container." + }, + "debug_args": { + "title": "debug_args", + "type": "string", + "description": "Additional arguments to be passed to the debugger." + }, + "container_env_vars": { + "title": "container_env_vars", + "type": "string", + "description": "JSON file containing environment variables to be set within the container environment" + }, + "docker_volume_basedir": { + "title": "docker_volume_basedir", + "type": "string", + "description": "Specify the location basedir where the SAM template exists. If Docker is running on a remote machine, Path of the SAM template must be mounted on the Docker machine and modified to match the remote machine." + }, + "log_file": { + "title": "log_file", + "type": "string", + "description": "File to capture output logs." + }, + "layer_cache_basedir": { + "title": "layer_cache_basedir", + "type": "string", + "description": "Specify the location basedir where the lambda layers used by the template will be downloaded to." + }, + "skip_pull_image": { + "title": "skip_pull_image", + "type": "boolean", + "description": "Skip pulling down the latest Docker image for Lambda runtime." + }, + "docker_network": { + "title": "docker_network", + "type": "string", + "description": "Name or ID of an existing docker network for AWS Lambda docker containers to connect to, along with the default bridge network. If not specified, the Lambda containers will only connect to the default bridge docker network." + }, + "force_image_build": { + "title": "force_image_build", + "type": "boolean", + "description": "Force rebuilding the image used for invoking functions with layers." + }, + "warm_containers": { + "title": "warm_containers", + "type": "string", + "description": "Optional. Specifies how AWS SAM CLI manages \ncontainers for each function.\nTwo modes are available:\nEAGER: Containers for all functions are \nloaded at startup and persist between \ninvocations.\nLAZY: Containers are only loaded when each \nfunction is first invoked. Those containers \npersist for additional invocations.", + "enum": [ + "EAGER", + "LAZY" + ] + }, + "debug_function": { + "title": "debug_function", + "type": "string", + "description": "Optional. Specifies the Lambda Function logicalId to apply debug options to when --warm-containers is specified. This parameter applies to --debug-port, --debugger-path, and --debug-args." + }, + "shutdown": { + "title": "shutdown", + "type": "boolean", + "description": "Emulate a shutdown event after invoke completes, to test extension handling of shutdown behavior." + }, + "container_host": { + "title": "container_host", + "type": "string", + "description": "Host of locally emulated Lambda container. This option is useful when the container runs on a different host than AWS SAM CLI. For example, if one wants to run AWS SAM CLI in a Docker container on macOS, this option could specify `host.docker.internal`", + "default": "localhost" + }, + "container_host_interface": { + "title": "container_host_interface", + "type": "string", + "description": "IP address of the host network interface that container ports should bind to. Use 0.0.0.0 to bind to all interfaces.", + "default": "127.0.0.1" + }, + "invoke_image": { + "title": "invoke_image", + "type": "string", + "description": "Container image URIs for invoking functions or starting api and function. One can specify the image URI used for the local function invocation (--invoke-image public.ecr.aws/sam/build-nodejs14.x:latest). One can also specify for each individual function with (--invoke-image Function1=public.ecr.aws/sam/build-nodejs14.x:latest). If a function does not have invoke image specified, the default AWS SAM CLI emulation image will be used." + }, + "beta_features": { + "title": "beta_features", + "type": "boolean", + "description": "Enable/Disable beta features." + }, + "debug": { + "title": "debug", + "type": "boolean", + "description": "Turn on debug logging to print debug message generated by AWS SAM CLI and display timestamps." + }, + "profile": { + "title": "profile", + "type": "string", + "description": "Select a specific profile from your credential file to get AWS credentials." + }, + "region": { + "title": "region", + "type": "string", + "description": "Set the AWS Region of the service. (e.g. us-east-1)" + } + } } }, "required": [ diff --git a/schema/schema.py b/schema/schema.py index 3472bd8b7a..b16e197a53 100644 --- a/schema/schema.py +++ b/schema/schema.py @@ -12,6 +12,14 @@ from samcli.cli.command import _SAM_CLI_COMMAND_PACKAGES from samcli.lib.config.samconfig import SamConfig +PARAMS_TO_EXCLUDE = [ + "config_env", # shouldn't allow different environment from where the config is being read from + "config_file", # shouldn't allow reading another file within current file +] +PARAMS_TO_OMIT_DEFAULT_FIELD = [ + "layer_cache_basedir" # sets default to root directory to that of machine the schema is generated on +] + class SchemaKeys(Enum): SCHEMA_FILE_NAME = "schema/samcli.json" @@ -145,7 +153,7 @@ def format_param(param: click.core.Option) -> SamCliParameterSchema: items="string" if formatted_param_type == "array" else None, ) - if param.default: + if param.default and param.name not in PARAMS_TO_OMIT_DEFAULT_FIELD: formatted_param.default = list(param.default) if isinstance(param.default, tuple) else param.default if param.type.name == "choice" and isinstance(param.type, click.Choice): @@ -156,14 +164,10 @@ def format_param(param: click.core.Option) -> SamCliParameterSchema: def get_params_from_command(cli) -> List[SamCliParameterSchema]: """Given a CLI object, return a list of all parameters in that CLI, formatted as SamCliParameterSchema objects.""" - params_to_exclude = [ - "config_env", # shouldn't allow different environment from where the config is being read from - "config_file", # shouldn't allow reading another file within current file - ] return [ format_param(param) for param in cli.params - if param.name and isinstance(param, click.core.Option) and param.name not in params_to_exclude + if param.name and isinstance(param, click.core.Option) and param.name not in PARAMS_TO_EXCLUDE ]