{"id":13505639,"url":"https://github.com/LinguaRobot/aws-cdk-maven-plugin","last_synced_at":"2025-03-30T00:31:19.726Z","repository":{"id":36965312,"uuid":"269126365","full_name":"LinguaRobot/aws-cdk-maven-plugin","owner":"LinguaRobot","description":"Define and deploy CDK applications using Java and Maven","archived":false,"fork":false,"pushed_at":"2023-01-27T07:01:09.000Z","size":216,"stargazers_count":14,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T03:32:38.676Z","etag":null,"topics":["aws","aws-cdk","cdk","java","maven","maven-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinguaRobot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-03T15:33:04.000Z","updated_at":"2024-07-15T19:18:15.000Z","dependencies_parsed_at":"2023-02-15T06:31:52.580Z","dependency_job_id":null,"html_url":"https://github.com/LinguaRobot/aws-cdk-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinguaRobot%2Faws-cdk-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinguaRobot%2Faws-cdk-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinguaRobot%2Faws-cdk-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinguaRobot%2Faws-cdk-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinguaRobot","download_url":"https://codeload.github.com/LinguaRobot/aws-cdk-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cdk","cdk","java","maven","maven-plugin"],"created_at":"2024-08-01T00:01:10.947Z","updated_at":"2025-03-30T00:31:14.715Z","avatar_url":"https://github.com/LinguaRobot.png","language":"Java","funding_links":[],"categories":["Language Support"],"sub_categories":["Multi-accounts setup"],"readme":"# AWS CDK Maven Plugin\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.linguarobot/aws-cdk-maven-plugin/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/io.linguarobot/aws-cdk-maven-plugin)\n\nThe AWS CDK Maven plugin produces and deploys CloudFormation templates based on your cloud infrastructure defined by \nmeans of [CDK][1]. The goal of the project is to improve the experience of Java developers while working with CDK by \neliminating the need for installing [Node.js][2] and interacting with the CDK application by means of [CDK Toolkit][3].\n\n## Prerequisites\n\nThe plugin requires Java \u003e= 8 and Maven \u003e= 3.5.\n\n## Authentication\n\nThe plugin tries to find the credentials and region in different sources in the following order:\n\n* If `\u003cprofile\u003e` configuration parameter is defined, the plugin looks for the corresponding credentials and region in \nthe default AWS credentials and config files (`~/.aws/credentials` and `~/.aws/config`, the location may be different \ndepending on the platform). \n* Using Java system properties `aws.accessKeyId`, `aws.secretKey` and `aws.region`.\n* Using environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_DEFAULT_REGION`\n* Looking for the credentials and region associated with the default profile in the credentials and config files.\n\n## Getting Started\n\nAdd the plugin to your Maven project:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eio.linguarobot\u003c/groupId\u003e\n    \u003cartifactId\u003eaws-cdk-maven-plugin\u003c/artifactId\u003e\n    \u003c!-- Please use the latest available version: https://search.maven.org/artifact/io.linguarobot/aws-cdk-maven-plugin --\u003e\n    \u003cversion\u003e${cdk.maven.plugin.version}\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003edeploy-cdk-app\u003c/id\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003esynth\u003c/goal\u003e\n                \u003cgoal\u003ebootstrap\u003c/goal\u003e\n                \u003cgoal\u003edeploy\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003c!-- Full class name of the app class defining your stacks --\u003e\n                \u003capp\u003e${cdk.app}\u003c/app\u003e\n                \u003c!-- Input parameters for the stacks. --\u003e\n                \u003cparameters\u003e\n                    \u003cParameterName\u003e...\u003c/ParameterName\u003e\n                    ...\n                \u003c/parameters\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\nPlease take a look at the [example project][6]. It is based on the project generated using `cdk init` with the \ndifference that it uses `aws-cdk-maven-plugin` instead of the CDK CLI. You can also find more examples in the\n[integration test](./aws-cdk-maven-plugin/src/it) directory.\n\n## Usage\n\nThe plugin provides three goals:\n\n* `synth`: Synthesizes [CloudFormation][4] templates based on the resources defined in your CDK application.\n* `bootstrap`: Deploys toolkit stacks required by the CDK application to an AWS.\n* `deploy`: Deploys the CDK application to an AWS (based on the synthesized resources)\n\n### Synthesis\n\nDuring the execution of `synth` goal, a cloud assembly is synthesized. The cloud assembly is a directory \n(`target/cdk.out` by default) containing the artifacts required for the deployment, i.e. CloudFormation templates, AWS \nLambda bundles, file and Docker image assets etc. The artifacts in the cloud assembly directory are later used by \n`bootstrap` and `deploy` goals.\n\nThe only mandatory parameter required by the goal is `\u003capp\u003e`, which is a full class name of the CDK app class defining \nthe cloud infrastructure. The application class must either extend `software.amazon.awscdk.core.App` or define a \n`main` method which is supposed to create an instance of `App`, define cloud [constructs][5] and call `App#synth()` \nmethod in order to produce a cloud assembly with CloudFormation templates.\n\nExtending `App` class:\n```java\nimport software.amazon.awscdk.core.App;\n\npublic class MyApp extends App {\n\n    public Mypp() {\n        new MyStack(this, \"my-stack\");\n    }\n\n}\n```\n\nDefining `main` method:\n\n```java\nimport software.amazon.awscdk.core.App;\n\npublic class MyApp {\n\n    public static void main(String[] args) {\n        App app = new App();\n        new MyStack(app, \"my-stack\");\n        app.synth();\n    }\n    \n}\n```\n\n#### Configuration\n\n| Parameter | Type | Since | Description |\n| --- | --- | --- | --- |\n| `\u003capp\u003e` \u003cbr/\u003e `-Daws.cdk.app` | `String` | `0.0.1` | Full class name of the CDK app class defining the cloud infrastructure. |\n| `\u003cprofile\u003e` \u003cbr/\u003e `-Daws.cdk.profile` | `String` | `0.0.1` | A profile that will be used to find credentials and region. |\n| `\u003ccloudAssemblyDirectory\u003e` \u003cbr/\u003e `-Daws.cdk.cloud.assembly.directory` | `String` | `0.0.1` | A directory where the cloud assembly will be synthesized. |\n| `\u003carguments\u003e` \u003cbr/\u003e `-Daws.cdk.arguments` | `List\u003cString\u003e` | `0.0.5` | A list of arguments to be passed to the CDK application. |\n| `\u003cskip\u003e` \u003cbr/\u003e `-Daws.cdk.skip` | `boolean` | `0.0.7` | Enables/disables the execution of the goal. | \n\n### Bootstrapping\n\nSome CDK applications may require a \"toolkit stack\" that includes the resources required for the application operation. \nFor example, the toolkit stack may include S3 bucket used to store templates and assets for the deployment.\n\nThe plugin is able to detect if a stack requires a toolkit stack and if it does, the plugin will automatically deploy it \n(or update if needed) during the execution of `bootstrap` goal (provided that the required toolkit stack version wasn't \nalready deployed). You may also choose to omit `bootstrap` goal if you don't want to rely on the plugin and control this \nprocess by yourself or just want to make sure that the toolkit stack is not created by a mistake. If you choose to omit \n`bootstrap` goal, you will need to install the toolkit stack the first time you deploy an AWS CDK application into an \nenvironment (account/region) by running `cdk bootstrap` command (please refer to [AWS CDK Toolkit][3] for the details).\n\n#### Configuration\n\n| Parameter | Type | Since | Description |\n| --- | --- | --- | --- |\n| `\u003cprofile\u003e` \u003cbr/\u003e `-Daws.cdk.profile` | `String` | `0.0.1` | A profile that will be used to find credentials and region. |\n| `\u003ccloudAssemblyDirectory\u003e` \u003cbr/\u003e `-Daws.cdk.cloud.assembly.directory` | `String` | `0.0.1` | A cloud assembly directory with the deployment artifacts (`target/cdk.out` by default). |\n| `\u003ctoolkitStackName\u003e` \u003cbr/\u003e `-Daws.cdk.toolkit.stack.name` | `String` | `0.0.1` | The name of the CDK toolkit stack (`CDKToolkit` by default). |\n| `\u003cstacks\u003e` \u003cbr/\u003e `-Daws.cdk.stacks` | `List\u003cString\u003e` | `0.0.4` | Stacks to deploy. The plugin will create the toolkit stacks only for those stacks that are being deployed (by default, all the stacks defined in your application will be deployed). |\n| `\u003cskip\u003e` \u003cbr/\u003e `-Daws.cdk.skip` | `boolean` | `0.0.7` | Enables/disables the execution of the goal. |\n\n### Deployment\n\nTo deploy the synthesized application into an AWS, add `deploy` goal to the execution (`deploy` and `bootstrap` goals are\nattached to the `deploy` Maven phase).\n\n#### Configuration\n\n| Parameter | Type | Since | Description |\n| --- | --- | --- | --- |\n| `\u003cprofile\u003e` \u003cbr/\u003e `-Daws.cdk.profile` | `String` | `0.0.1` | A profile that will be used to find credentials and region. |\n| `\u003ccloudAssemblyDirectory\u003e` \u003cbr/\u003e `-Daws.cdk.cloud.assembly.directory` | `String` | `0.0.1` | A cloud assembly directory with the deployment artifacts (`target/cdk.out` by default). |\n| `\u003ctoolkitStackName\u003e` \u003cbr/\u003e `-Daws.cdk.toolkit.stack.name` | `String` | `0.0.1` | The name of the CDK toolkit stack to use (`CDKToolkit` is used by default). |\n| `\u003cstacks\u003e` \u003cbr/\u003e `-Daws.cdk.stacks` | `List\u003cString\u003e` | `0.0.4` | Stacks to deploy. By default, all the stacks defined in your application will be deployed. |\n| `\u003cparameters\u003e` | `Map\u003cString, String\u003e` | `0.0.4` | Input parameters for the stacks. For the new stacks, all the parameters without a default value must be specified. In the case of an update, existing values will be reused. |\n| `\u003cskip\u003e` \u003cbr/\u003e `-Daws.cdk.skip` | `boolean` | `0.0.7` | Enables/disables the execution of the goal. |\n\n\n[1]: https://aws.amazon.com/cdk/\n[2]: https://nodejs.org/en/download\n[3]: https://docs.aws.amazon.com/cdk/latest/guide/tools.html#cli\n[4]: https://aws.amazon.com/cloudformation/\n[5]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html\n[6]: https://github.com/LinguaRobot/aws-cdk-maven-plugin-example","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinguaRobot%2Faws-cdk-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLinguaRobot%2Faws-cdk-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinguaRobot%2Faws-cdk-maven-plugin/lists"}