diff --git a/docker-compose.yml b/docker-compose.yml index b10aecd..3786b2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ version: "3.9" services: spring-native-aws-lambda-function-infra: - image: muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2-awscliv2 + image: ghcr.io/muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2-awscliv2 volumes: - ./:/app - ${M2_REPO}:/home/worker/.m2 @@ -51,22 +51,22 @@ services: print_info_message "divider" "Package GraalVM function" && - ./mvnw -ntp clean package -U -Pnative -pl spring-native-aws-lambda-function && + ./mvnw -ntp clean package -U -X -Pnative -pl spring-native-aws-lambda-function && + print_info_message "divider" "Creating LAMBDA function" && lambda_create_function lambda-FUNCTION provided.al2023 512 ./spring-native-aws-lambda-function/target/spring-native-aws-lambda-function-native-zip.zip spring-native-aws-lambda-function && lambda_wait_for_function lambda-FUNCTION && lambda_list_functions && print_info_message "divider" "Creating API Gateway" && + REST_API_ID="$(apigateway_create_restApi "somerestapiname")" && + RESOURCE_ID="$(apigateway_create_resource "$$REST_API_ID" "somePathId")" + apigateway_create_method "$$REST_API_ID" "$$RESOURCE_ID" "POST" && + apigateway_create_lambda_integration "$$REST_API_ID" "$$RESOURCE_ID" "POST" "arn:aws:apigateway:ap-southeast-2:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:000000000000:function:lambda-FUNCTION/invocations" && + apigateway_create_deployment "$$REST_API_ID" "test" && + apigateway_list_restapis && - REST_API_ID="$(aws apigateway --endpoint-url="http://localstack:4566" create-rest-api --name 'someapigateway' --query 'id' --output text)" && - ROOT_RESOURCE_ID=$(aws apigateway --endpoint-url="http://localstack:4566" get-resources --rest-api-id "$$REST_API_ID" --query 'items[0].id' --output text) - RESOURCE_ID=$(aws apigateway --endpoint-url="http://localstack:4566" create-resource --rest-api-id $$REST_API_ID --parent-id $$ROOT_RESOURCE_ID --path-part '{somethingPathId}' --query 'id' --output text) - aws apigateway --endpoint-url="http://localstack:4566" put-method --rest-api-id $$REST_API_ID --resource-id $$RESOURCE_ID --http-method POST --request-parameters 'method.request.path.somethingPathId=true' --authorization-type 'NONE' && - aws apigateway --endpoint-url="http://localstack:4566" put-integration --rest-api-id $$REST_API_ID --resource-id $$RESOURCE_ID --http-method POST --type AWS_PROXY --integration-http-method POST --uri arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-southeast-2:000000000000:function:lambda-FUNCTION/invocations --passthrough-behavior WHEN_NO_MATCH && - aws apigateway --endpoint-url="http://localstack:4566" create-deployment --rest-api-id $$REST_API_ID --stage-name test && - - print_info_message "plain" "http://localhost:4566/restapis/$$REST_API_ID/test/_user_request_/test" && + print_info_message "plain" "Endpoint available at: http://localhost:4566/restapis/$$REST_API_ID/test/_user_request_/test" && print_info_message "block" "Successfully creating 'spring-native-aws-lambda-function'" '