Skip to content

Commit

Permalink
fixed readme and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Meiler committed May 7, 2024
1 parent aff683f commit b9e147c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
31 changes: 19 additions & 12 deletions cdk/java/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Welcome to your CDK Java project!
# How to deploy the AWS Lambda Power Tuning using the CDK for Java

This is a blank project for CDK development with Java.
This CDK project deploys *AWS Lambda Power Tuning* using Java.

The `cdk.json` file tells the CDK Toolkit how to execute your app.
You can use the project as a standalone or reuse it within your own CDK projects.


## CDK Prerequisites

It is a [Maven](https://maven.apache.org/) based project, so you can open this project with any Maven compatible Java IDE to build and run tests.
See [here](../README.md).

## Useful commands

* `mvn package` compile and run tests
* `cdk ls` list all stacks in the app
* `cdk synth` emits the synthesized CloudFormation template
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk docs` open CDK documentation
## Language specific prerequisites
- [Java Development Kit (JDK) 8 (a.k.a. 1.8) or later](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites)
- [Apache Maven 3.5 or later](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites)
- [Requirements for CDK with Java](https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-java.html)

## Building, testing, and deploying the app
* `mvn package` compile and run tests
* `cdk synth` emits the synthesized CloudFormation template
* `cdk deploy` deploy this app

The `cdk.json` file tells the CDK Toolkit how to execute your app.

Enjoy!
It is a [Maven](https://maven.apache.org/) based project, so you can open this project with any Maven compatible Java IDE to build and run tests.
2 changes: 1 addition & 1 deletion cdk/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>com.myorg.JavaApp</mainClass>
<mainClass>com.myorg.TheLambdaPowerTunerApp</mainClass>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package com.myorg;

import software.amazon.awscdk.App;
import software.amazon.awscdk.Environment;
import software.amazon.awscdk.StackProps;

import java.util.Arrays;

public class JavaApp {
public class TheLambdaPowerTunerApp {
public static void main(final String[] args) {
App app = new App();

new JavaStack(app, "JavaStack", StackProps.builder()
new TheLambdaPowerTunerStack(app, "JavaStack", StackProps.builder()
// If you don't specify 'env', this stack will be environment-agnostic.
// Account/Region-dependent features and context lookups will not work,
// but a single synthesized template can be deployed anywhere.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import java.util.HashMap;
import java.util.Map;

public class JavaStack extends Stack {
public class TheLambdaPowerTunerStack extends Stack {

//Set constants
private static final String SAR_APPLICATION_ID = "arn:aws:serverlessrepo:us-east-1:451282441545:applications/aws-lambda-power-tuning";
private static final String SAR_SEMANTIC_VERSION = "4.3.4";

public JavaStack(final Construct scope, final String id) {
public TheLambdaPowerTunerStack(final Construct scope, final String id) {
this(scope, id, null);
}

public JavaStack(final Construct scope, final String id, final StackProps props) {
public TheLambdaPowerTunerStack(final Construct scope, final String id, final StackProps props) {
super(scope, id, props);

//create an empty Map
Expand Down
2 changes: 1 addition & 1 deletion cdk/java/src/test/java/com/myorg/JavaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class JavaTest {
@Test
public void testStack() throws IOException {
App app = new App();
JavaStack stack = new JavaStack(app, "test");
TheLambdaPowerTunerStack stack = new TheLambdaPowerTunerStack(app, "test");

Template template = Template.fromStack(stack);
Map<String, String> child = new HashMap<>();
Expand Down

0 comments on commit b9e147c

Please sign in to comment.