Configuration
AWS App2Container (A2C) tasks generate the analysis.json and
deployment.json files. These files have configurable values to
control what comprises the generated Docker image and the specifications of the target
environment on AWS.
Provide values for the following parameters supported by
analysis.json:
-
appExcludedFiles– The list of files that should be excluded from the container image. -
appSpecificFiles– The application-specific files that should be included within the container image. -
applicationMode(Boolean, required) – The approach that App2Container uses to determine which files to include in your container image. App2Container uses application mode (value=true) for supported application frameworks, and process mode (value=false) for all other configurations. You can override this value if necessary. For example, if your application runs on a supported framework, but App2Container does not recognize it and assigns process mode, you can override the setting to use application mode instead. -
imageRepository– The location where the container image is stored. -
logLocations– Specific log files or log directories to be routed tostdout.Be careful when specifying paths in the including and excluding parameters, because the paths have a direct impact on how the application runs after deployment. For example, if you exclude certain application-dependent files, the application might not start or run successfully. Similarly, including non-dependent files in the container build might unnecessarily increase the container size.
For the complete list of parameters supported by
analysis.json, see the App2Container documentation.
The deployment.json file generated by the containerize task provides
configurable values to choose the target environment on AWS.
-
Don’t change the
a2CTemplateVersion,applicationId, andimageNamevalues. -
Choose the target deployment environment of Amazon ECS or Amazon EKS or AWS App Runner by setting
createEcsArtifactsorcreateEksArtifactsorcreateAppRunnerArtifactstotrue. -
Configure the
reuseResourcesobject. Include shared resources, such asvpcId,sshKeyPairName, andacmCertificateName, that you can re-use across the AWS CloudFormation template.For the compete list of parameters supported by
deployment.json, see the App2Container documentation.
When App2Container runs in process mode, the container image generated can be huge, because it includes most of the folders running on the application server. For a detailed approach on reducing the size of the Docker image generated by App2Container, use the Optimize AWS App2Container generated Docker images pattern. The optimized Docker image can then be further used in the next App2Container command.