Skip to content

Commit cbb37d1

Browse files
committed
feat(lambda): convert to swift
1 parent ad13ba1 commit cbb37d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+737
-2487
lines changed

.bun-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.5
1+
1.3.2

.gitignore

Lines changed: 100 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@
99
*.tfstate
1010
*.tfstate.*
1111

12-
# Crash log files
13-
crash.log
14-
crash.*.log
15-
16-
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
17-
# password, private keys, and other secrets. These should not be part of version
18-
# control as they are data points which are potentially sensitive and subject
19-
# to change depending on the environment.
12+
2013
*.tfvars
2114
*.tfvars.json
2215

@@ -26,163 +19,10 @@ override.tf
2619
override.tf.json
2720
*_override.tf
2821
*_override.tf.json
29-
+ .turbo
30-
31-
# Include override files you do wish to add to version control using negated pattern
32-
# !example_override.tf
33-
34-
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
35-
# example: *tfplan*
36-
37-
# Ignore CLI configuration files
3822
.terraformrc
3923
terraform.rc
4024

41-
# End of https://www.toptal.com/developers/gitignore/api/terraform
42-
# Created by https://www.toptal.com/developers/gitignore/api/node
43-
# Edit at https://www.toptal.com/developers/gitignore?templates=node
44-
45-
### Node ###
46-
# Logs
47-
logs
48-
*.log
49-
npm-debug.log*
50-
yarn-debug.log*
51-
yarn-error.log*
52-
lerna-debug.log*
53-
.pnpm-debug.log*
54-
55-
# Diagnostic reports (https://nodejs.org/api/report.html)
56-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
57-
58-
# Runtime data
59-
pids
60-
*.pid
61-
*.seed
62-
*.pid.lock
63-
64-
# Directory for instrumented libs generated by jscoverage/JSCover
65-
lib-cov
66-
67-
# Coverage directory used by tools like istanbul
68-
coverage
69-
*.lcov
70-
71-
# nyc test coverage
72-
.nyc_output
73-
74-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
75-
.grunt
76-
77-
# Bower dependency directory (https://bower.io/)
78-
bower_components
79-
80-
# node-waf configuration
81-
.lock-wscript
82-
83-
# Compiled binary addons (https://nodejs.org/api/addons.html)
84-
build/Release
85-
86-
# Dependency directories
87-
node_modules/
88-
jspm_packages/
89-
90-
# Snowpack dependency directory (https://snowpack.dev/)
91-
web_modules/
92-
93-
# TypeScript cache
94-
*.tsbuildinfo
95-
96-
# Optional npm cache directory
97-
.npm
98-
99-
# Optional eslint cache
100-
.eslintcache
101-
102-
# Optional stylelint cache
103-
.stylelintcache
104-
105-
# Microbundle cache
106-
.rpt2_cache/
107-
.rts2_cache_cjs/
108-
.rts2_cache_es/
109-
.rts2_cache_umd/
110-
111-
# Optional REPL history
112-
.node_repl_history
11325

114-
# Output of 'npm pack'
115-
*.tgz
116-
117-
# Yarn Integrity file
118-
.yarn-integrity
119-
120-
# dotenv environment variable files
121-
.env
122-
.env.development.local
123-
.env.test.local
124-
.env.production.local
125-
.env.local
126-
127-
# parcel-bundler cache (https://parceljs.org/)
128-
.cache
129-
.parcel-cache
130-
131-
# Next.js build output
132-
.next
133-
out
134-
135-
# Nuxt.js build / generate output
136-
.nuxt
137-
dist
138-
139-
# Gatsby files
140-
.cache/
141-
# Comment in the public line in if your project uses Gatsby and not Next.js
142-
# https://nextjs.org/blog/next-9-1#public-directory-support
143-
# public
144-
145-
# vuepress build output
146-
.vuepress/dist
147-
148-
# vuepress v2.x temp and cache directory
149-
.temp
150-
151-
# Docusaurus cache and generated files
152-
.docusaurus
153-
154-
# Serverless directories
155-
.serverless/
156-
157-
# FuseBox cache
158-
.fusebox/
159-
160-
# DynamoDB Local files
161-
.dynamodb/
162-
163-
# TernJS port file
164-
.tern-port
165-
166-
# Stores VSCode versions used for testing VSCode extensions
167-
.vscode-test
168-
169-
# yarn v2
170-
.yarn/cache
171-
.yarn/unplugged
172-
.yarn/build-state.yml
173-
.yarn/install-state.gz
174-
.pnp.*
175-
176-
### Node Patch ###
177-
# Serverless Webpack directories
178-
.webpack/
179-
180-
# Optional stylelint cache
181-
182-
# SvelteKit build / generate output
183-
.svelte-kit
184-
185-
# End of https://www.toptal.com/developers/gitignore/api/node
18626
certs
18727
.terraform.lock.hcl
18828
.terraform
@@ -194,19 +34,105 @@ lambda.zip
19434
.idea
19535

19636

197-
# Created by https://www.toptal.com/developers/gitignore/api/dotnetcore
198-
# Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore
199-
200-
### DotnetCore ###
201-
# .NET Core build folders
202-
bin/
203-
obj/
204-
obj
205-
37+
# Created by https://www.toptal.com/developers/gitignore/api/swift
38+
# Edit at https://www.toptal.com/developers/gitignore?templates=swift
39+
40+
### Swift ###
41+
# Xcode
42+
#
43+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
44+
45+
## User settings
46+
xcuserdata/
47+
48+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
49+
*.xcscmblueprint
50+
*.xccheckout
51+
52+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
53+
build/
54+
DerivedData/
55+
*.moved-aside
56+
*.pbxuser
57+
!default.pbxuser
58+
*.mode1v3
59+
!default.mode1v3
60+
*.mode2v3
61+
!default.mode2v3
62+
*.perspectivev3
63+
!default.perspectivev3
64+
65+
## Obj-C/Swift specific
66+
*.hmap
67+
68+
## App packaging
69+
*.ipa
70+
*.dSYM.zip
71+
*.dSYM
72+
73+
## Playgrounds
74+
timeline.xctimeline
75+
playground.xcworkspace
76+
77+
# Swift Package Manager
78+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
79+
# Packages/
80+
# Package.pins
81+
# Package.resolved
82+
# *.xcodeproj
83+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
84+
# hence it is not needed unless you have added a package configuration file to your project
85+
# .swiftpm
86+
87+
.build/
88+
89+
# CocoaPods
90+
# We recommend against adding the Pods directory to your .gitignore. However
91+
# you should judge for yourself, the pros and cons are mentioned at:
92+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
93+
# Pods/
94+
# Add this line if you want to avoid checking in source code from the Xcode workspace
95+
# *.xcworkspace
96+
97+
# Carthage
98+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
99+
# Carthage/Checkouts
100+
101+
Carthage/Build/
102+
103+
# Accio dependency management
104+
Dependencies/
105+
.accio/
106+
107+
# fastlane
108+
# It is recommended to not store the screenshots in the git repo.
109+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
110+
# For more information about the recommended setup visit:
111+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
112+
113+
fastlane/report.xml
114+
fastlane/Preview.html
115+
fastlane/screenshots/**/*.png
116+
fastlane/test_output
117+
118+
# Code Injection
119+
# After new code Injection tools there's a generated folder /iOSInjectionProject
120+
# https://github.com/johnno1962/injectionforxcode
121+
122+
iOSInjectionProject/
123+
124+
# End of https://www.toptal.com/developers/gitignore/api/swift
125+
.DS_Store
126+
/.build
127+
/Packages
128+
xcuserdata/
129+
DerivedData/
130+
.swiftpm/configuration/registries.json
131+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
132+
.netrc
206133

134+
.vscode
207135

208-
# Common node modules locations
209-
/node_modules
210-
/wwwroot/node_modules
136+
*.swiftpm
211137

212-
# End of https://www.toptal.com/developers/gitignore/api/dotnetcore
138+
*.resolved

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.11.0
1+
22

Package.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// swift-tools-version: 6.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "lambda",
8+
platforms: [.macOS(.v15)],
9+
products: [
10+
.executable(name: "lambda", targets: ["lambda"]),
11+
.executable(name: "authorizer", targets: ["authorizer"]),
12+
],
13+
dependencies: [
14+
// for local dev
15+
.package(
16+
url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.4.0"),
17+
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
18+
],
19+
targets: [
20+
.executableTarget(
21+
name: "authorizer",
22+
dependencies: [
23+
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
24+
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
25+
26+
]
27+
),
28+
.executableTarget(
29+
name: "lambda",
30+
dependencies: [
31+
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
32+
.product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"),
33+
],
34+
),
35+
]
36+
)

0 commit comments

Comments
 (0)