{"id":20678371,"url":"https://github.com/codecentric/serverless-astra-graalvm","last_synced_at":"2025-03-10T19:25:40.235Z","repository":{"id":44384746,"uuid":"367324294","full_name":"codecentric/serverless-astra-graalvm","owner":"codecentric","description":"Sample serverless order processing API using DataStax Astra Serverless and AWS Lambda.","archived":false,"fork":false,"pushed_at":"2023-08-11T12:03:48.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-08T15:07:20.665Z","etag":null,"topics":["aws-lambda","datastax-astra","graalvm","graalvm-native-image","serverless"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codecentric.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-14T10:11:54.000Z","updated_at":"2024-03-06T04:03:00.000Z","dependencies_parsed_at":"2023-02-10T14:01:08.534Z","dependency_job_id":null,"html_url":"https://github.com/codecentric/serverless-astra-graalvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fserverless-astra-graalvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fserverless-astra-graalvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fserverless-astra-graalvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codecentric%2Fserverless-astra-graalvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codecentric","download_url":"https://codeload.github.com/codecentric/serverless-astra-graalvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242910999,"owners_count":20205416,"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-lambda","datastax-astra","graalvm","graalvm-native-image","serverless"],"created_at":"2024-11-16T21:19:50.637Z","updated_at":"2025-03-10T19:25:40.165Z","avatar_url":"https://github.com/codecentric.png","language":"Java","readme":"# Serverless Astra GraalVM\n\n## Build\n\n### Prerequisites\n\n- GraalVM (if you have [SdkMan!](https://sdkman.io/usage), execute `sdk env` or\n  set `sdkman_auto_env=true` in `~/.sdkman/etc/config`)\n- GraalVM Native Image (`gu install native-image`)\n\n### Package\n\n```bash\n./mvnw package\n```\n\nNote that for the Lambda deployment to work, you need to build a linux-amd64 native image. At this\npoint in time, cross compilation doesn't seem to work so if you are on Mac or Windows, you might\nneed a VM if you're planning to build this locally.\n\n## Deployment\n\n### Prerequisites\n\n- [gotf](https://github.com/craftypath/gotf)\n- [Terraform Cloud](https://app.terraform.io) Workspace (optional)\n- Packaged artifacts\n- [DataStax Astra](https://astra.datastax.com) account + client API tokens\n- [AWS](https://portal.aws.amazon.com/) account + IAM user\n\nThe Astra admin token should have permissions to create databases and keyspaces. Ideally you want a\nseparate application token that can only access databases and keyspaces. At the point of writing\nthis it was not possible to create the application token through Terraform.\n\nThe IAM user can use the following AWS managed policies:\n\n- `AWSLambda_FullAccess`\n- `CloudWatchFullAccess`\n- `AmazonAPIGatewayAdministrator`\n- `AmazonSSMFullAccess`\n\nAlso add this inline policy to allow the management of Lambda roles and policies:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"iam:AttachRolePolicy\",\n        \"iam:CreatePolicy\",\n        \"iam:CreateRole\",\n        \"iam:DeletePolicy\",\n        \"iam:DeleteRole\",\n        \"iam:DetachRolePolicy\",\n        \"iam:ListEntitiesForPolicy\",\n        \"iam:ListInstanceProfilesForRole\",\n        \"iam:ListPolicyVersions\",\n        \"iam:TagRole\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n### Initialization\n\n```bash\ngotf -m tf login\necho 'astra_client_token = \"AstraCS:ZZZ' \u003e tf/secrets.auto.tfvars\necho 'astra_db_client_id = \"XXX\"' \u003e\u003e tf/secrets.auto.tfvars\necho 'astra_db_client_secret = \"YYY\"' \u003e\u003e tf/secrets.auto.tfvars\necho 'astra_db_client_token = \"AstraCS:ZZZ\"' \u003e\u003e tf/secrets.auto.tfvars\ngotf -m tf init\n```\n\n### Apply\n\n```bash\ngotf -m tf apply\n```\n\n### Destroy\n\n```bash\ngotf -m tf destroy\n```\n\n## Usage\n\n```\naws lambda invoke --function-name serverless-astra-graalvm --log-type Tail --payload \"{}\" response.json\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Fserverless-astra-graalvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodecentric%2Fserverless-astra-graalvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodecentric%2Fserverless-astra-graalvm/lists"}