Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the object representations of the CloudWatch alarms #492

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
9 changes: 6 additions & 3 deletions .github/workflows/aws-lambda-java-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-core/**'
- 'aws-lambda-java-core/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-core/**'
- 'aws-lambda-java-core/**'
- '.github/workflows/aws-lambda-java-core.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand All @@ -38,3 +39,5 @@ jobs:
- name: Run 'pr' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make pr
env:
IS_JAVA_8: true
7 changes: 4 additions & 3 deletions .github/workflows/aws-lambda-java-events-sdk-transformer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-events-sdk-transformer/**'
- 'aws-lambda-java-events-sdk-transformer/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-events-sdk-transformer/**'
- 'aws-lambda-java-events-sdk-transformer/**'
- '.github/workflows/aws-lambda-java-events-sdk-transformer.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/aws-lambda-java-events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-events/**'
- 'aws-lambda-java-events/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-events/**'
- 'aws-lambda-java-events/**'
- '.github/workflows/aws-lambda-java-events.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/aws-lambda-java-log4j2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-log4j2/**'
- 'aws-lambda-java-log4j2/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-log4j2/**'
- 'aws-lambda-java-log4j2/**'
- '.github/workflows/aws-lambda-java-log4j2.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/aws-lambda-java-serialization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-serialization/**'
- 'aws-lambda-java-serialization/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-serialization/**'
- 'aws-lambda-java-serialization/**'
- '.github/workflows/aws-lambda-java-serialization.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/aws-lambda-java-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches: [ main ]
paths:
- 'aws-lambda-java-tests/**'
- 'aws-lambda-java-tests/**'
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-tests/**'
- 'aws-lambda-java-tests/**'
- '.github/workflows/aws-lambda-java-tests.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/repo-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Repo Sync
on:
schedule:
- cron: "0 8 * * 1-5" # At 08:00 on every day-of-week from Monday through Friday
pull_request:
branches: [ '*' ]
paths:
- '.github/workflows/repo-sync.yml'
workflow_dispatch:

jobs:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/runtime-interface-client_merge_to_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
branches: [ main ]
paths:
- 'aws-lambda-java-runtime-interface-client/**'
workflow_dispatch:

jobs:

Expand All @@ -29,13 +30,13 @@ jobs:
- uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -48,9 +49,11 @@ jobs:
- name: Test Runtime Interface Client xplatform build - Run 'build' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make build
env:
IS_JAVA_8: true

- name: Issue AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/runtime-interface-client_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
pull_request:
branches: [ '*' ]
paths:
- 'aws-lambda-java-runtime-interface-client/**'
- 'aws-lambda-java-runtime-interface-client/**'
- '.github/workflows/runtime-interface-client_pr.yml'

jobs:

Expand All @@ -17,28 +18,30 @@ jobs:
- uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto

- name: Runtime Interface Client smoke tests - Run 'pr' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make pr
env:
IS_JAVA_8: true

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -51,9 +54,11 @@ jobs:
- name: Test Runtime Interface Client xplatform build - Run 'build' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make build
env:
IS_JAVA_8: true

- name: Save the built jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: aws-lambda-java-runtime-interface-client
path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar
3 changes: 2 additions & 1 deletion .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
branches: [ '*' ]
paths:
- 'samples/kinesis-firehose-event-handler/**'
- '.github/workflows/samples.yml'

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 8
distribution: corretto
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ dependency-reduced-pom.xml
.project

# OSX
.DS_Store
.DS_Store

# snapshot process
aws-lambda-java-runtime-interface-client/pom.xml.versionsBackup
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The purpose of this package is to allow developers to deploy their applications
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-runtime-interface-client</artifactId>
<version>2.5.0</version>
<version>2.5.1</version>
</dependency>
```

Expand Down
4 changes: 4 additions & 0 deletions aws-lambda-java-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* `AppSyncLambdaAuthorizerResponse`
* `CloudFormationCustomResourceEvent`
* `CloudFrontEvent`
* `CloudWatchCompositeAlarmEvent`
* `CloudWatchLogsEvent`
* `CloudWatchMetricAlarmEvent`
* `CodeCommitEvent`
* `CognitoEvent`
* `CognitoUserPoolCreateAuthChallengeEvent`
Expand Down Expand Up @@ -44,6 +46,8 @@
* `KinesisFirehoseEvent`
* `LambdaDestinationEvent`
* `LexEvent`
* `MSKFirehoseEvent`
* `MSKFirehoseResponse`
* `RabbitMQEvent`
* `S3BatchEvent`
* `S3BatchResponse`
Expand Down
2 changes: 2 additions & 0 deletions aws-lambda-java-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<lombok.version>1.18.22</lombok.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<distributionManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.amazonaws.services.lambda.runtime.events;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Represents an CloudWatch Composite Alarm event. This event occurs when a composite alarm is triggered.
*
* @see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-actions">Using Amazon CloudWatch alarms</a>
*/
@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public class CloudWatchCompositeAlarmEvent {
private String source;
private String alarmArn;
private String accountId;
private String time;
private String region;
private AlarmData alarmData;

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public static class AlarmData {
private String alarmName;
private State state;
private PreviousState previousState;
private Configuration configuration;
}

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public static class State {
private String value;
private String reason;
private String reasonData;
private String timestamp;
}

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public static class PreviousState {
private String value;
private String reason;
private String reasonData;
private String timestamp;
private String actionsSuppressedBy;
private String actionsSuppressedReason;
}

@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public static class Configuration {
private String alarmRule;
private String actionsSuppressor;
private Integer actionsSuppressorWaitPeriod;
private Integer actionsSuppressorExtensionPeriod;
}
}
Loading
Loading