Skip to content

chore: remove SQS and Idempotency examples #754

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

Merged
merged 1 commit into from
Feb 17, 2022
Merged
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: 0 additions & 7 deletions example/HelloWorldFunction/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@ repositories {
}

dependencies {
aspect 'software.amazon.lambda:powertools-logging:1.11.0'
aspect 'software.amazon.lambda:powertools-tracing:1.11.0'
aspect 'software.amazon.lambda:powertools-metrics:1.11.0'
aspect 'software.amazon.lambda:powertools-sqs:1.11.0'
aspect 'software.amazon.lambda:powertools-parameters:1.11.0'
aspect 'software.amazon.lambda:powertools-validation:1.11.0'

implementation 'software.amazon.lambda:powertools-idempotency:1.11.0'
aspectpath 'software.amazon.lambda:powertools-idempotency:1.11.0'

implementation 'com.amazonaws:aws-lambda-java-core:1.2.1'
implementation 'com.amazonaws:aws-lambda-java-events:3.11.0'

Expand Down
41 changes: 0 additions & 41 deletions example/HelloWorldFunction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@
</properties>

<dependencies>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-tracing</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-logging</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-metrics</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-parameters</artifactId>
Expand All @@ -38,16 +23,6 @@
<artifactId>powertools-validation</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-sqs</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-idempotency</artifactId>
<version>1.11.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
Expand Down Expand Up @@ -93,22 +68,6 @@
<target>${maven.compiler.target}</target>
<complianceLevel>${maven.compiler.target}</complianceLevel>
<aspectLibraries>
<aspectLibrary>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-tracing</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-logging</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-metrics</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-sqs</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-validation</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

79 changes: 1 addition & 78 deletions example/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,6 @@ Resources:
Name: id
Type: String

HelloWorldIdempotentFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: HelloWorldFunction
Handler: helloworld.AppIdempotency::handleRequest
MemorySize: 512
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
POWERTOOLS_LOG_LEVEL: INFO
AWS_ENDPOINT_DISCOVERY_ENABLED: false
Tracing: Active
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref IdempotencyTable
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /helloidem
Method: post

UserPwd:
Type: AWS::SecretsManager::Secret
Properties:
Expand Down Expand Up @@ -131,55 +110,6 @@ Resources:
Value: aGVsbG8gd29ybGQ=
Description: Base64 SSM Parameter for lambda-powertools-java powertools-parameters module

TestSqsQueue:
Type: AWS::SQS::Queue

HelloWorldSqsEventFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: HelloWorldFunction
Handler: helloworld.AppSqsEvent::handleRequest
MemorySize: 512
Tracing: Active
Policies:
- Statement:
- Sid: AdditionalPermisssionForPowertoolsSQSUtils
Effect: Allow
Action:
- sqs:GetQueueUrl
- sqs:DeleteMessageBatch
Resource: !GetAtt TestSqsQueue.Arn
Events:
TestSQSEvent:
Type: SQS
Properties:
Queue: !GetAtt TestSqsQueue.Arn
BatchSize: 10

TestAnotherSqsQueue:
Type: AWS::SQS::Queue

HelloWorldSqsEventUtilFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: HelloWorldFunction
Handler: helloworld.AppSqsEventUtil::handleRequest
MemorySize: 512
Tracing: Active
Policies:
- Statement:
- Sid: AdditionalPermisssionForPowertoolsSQSUtils
Effect: Allow
Action:
- sqs:GetQueueUrl
- sqs:DeleteMessageBatch
Resource: !GetAtt TestAnotherSqsQueue.Arn
Events:
TestSQSEvent:
Type: SQS
Properties:
Queue: !GetAtt TestAnotherSqsQueue.Arn
BatchSize: 10

Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
Expand All @@ -198,11 +128,4 @@ Outputs:
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/helloparams/"
HelloWorldParamsFunction:
Description: "Hello World Params Lambda Function ARN"
Value: !GetAtt HelloWorldParamsFunction.Arn

HelloWorldIdempotencyApi:
Description: "API Gateway endpoint URL for Prod stage for Hello World idempotency function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/helloidem/"
HelloWorldIdempotencyFunction:
Description: "Hello World Idempotency Lambda Function ARN"
Value: !GetAtt HelloWorldIdempotentFunction.Arn
Value: !GetAtt HelloWorldParamsFunction.Arn