-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda_function.py
More file actions
332 lines (304 loc) · 13 KB
/
Copy pathlambda_function.py
File metadata and controls
332 lines (304 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
import json
from typing import Dict, Any
# Sample CV data
CV_DATA = {
"personal_info": {
"name": "John Smith",
"title": "Senior DevOps Engineer",
"email": "john.smith@example.com",
"phone": "+1-555-0123",
"location": "San Francisco, CA, USA",
"linkedin": "https://linkedin.com/in/johnsmith",
"github": "https://github.com/johnsmith",
"website": "https://johnsmith.dev",
},
"summary": "Experienced DevOps Engineer with 6+ years specializing in cloud infrastructure, automation, and scalable systems. Proven track record of managing high-traffic applications serving millions of daily requests, delivering CI/CD pipelines and cloud migrations within strict deadlines, and architecting both cloud solutions and on-premises infrastructure in fast-paced environments.",
"experience": [
{
"company": "TechCorp Solutions",
"position": "Senior DevOps Engineer",
"duration": "January 2022 - Present",
"location": "San Francisco, CA",
"description": "Lead DevOps initiatives for enterprise clients, managing cloud infrastructure and implementing automation solutions. Collaborate with development teams to optimize deployment pipelines and ensure system reliability.",
"technologies": [
"AWS",
"Docker",
"Kubernetes",
"Terraform",
"Jenkins",
"Prometheus",
"Grafana",
"Python",
],
"achievements": [
"Reduced deployment time by 75% through automated CI/CD pipeline implementation",
"Managed infrastructure serving 10+ million daily API requests with 99.9% uptime",
"Led migration of legacy applications to cloud-native architecture",
"Implemented comprehensive monitoring and alerting solutions",
],
},
{
"company": "CloudTech Innovations",
"position": "DevOps Engineer",
"duration": "March 2020 - December 2021",
"location": "Austin, TX",
"description": "Designed and maintained cloud infrastructure for multiple client projects. Implemented Infrastructure as Code practices and automated deployment processes for various applications.",
"technologies": [
"AWS",
"Azure",
"Docker",
"Ansible",
"GitLab CI",
"Terraform",
"PostgreSQL",
],
"achievements": [
"Architected multi-region AWS infrastructure supporting 50+ microservices",
"Implemented blue-green deployment strategy reducing downtime by 90%",
"Automated infrastructure provisioning reducing setup time from days to hours",
"Mentored junior engineers in DevOps best practices",
],
},
{
"company": "StartupTech Inc",
"position": "Systems Administrator",
"duration": "June 2018 - February 2020",
"location": "Seattle, WA",
"description": "Managed on-premises and cloud infrastructure for growing startup. Responsible for system administration, backup solutions, and network management.",
"technologies": [
"Linux",
"VMware",
"AWS",
"MySQL",
"Nginx",
"Python",
"Bash",
],
"achievements": [
"Built scalable infrastructure supporting company growth from 10 to 100+ employees",
"Implemented automated backup and disaster recovery procedures",
"Optimized database performance resulting in 40% faster query response times",
"Established monitoring and logging infrastructure using open-source tools",
],
},
],
"education": [
{
"institution": "State University of Technology",
"degree": "Bachelor of Science in Computer Science",
"duration": "2014 - 2018",
"location": "California, USA",
"gpa": "3.7/4.0",
}
],
"skills": {
"cloud_platforms": ["AWS", "Azure", "Google Cloud Platform"],
"containerization": ["Docker", "Kubernetes", "OpenShift"],
"infrastructure_as_code": [
"Terraform",
"CloudFormation",
"Pulumi",
"ARM Templates",
],
"ci_cd": ["Jenkins", "GitLab CI", "GitHub Actions", "Azure DevOps", "CircleCI"],
"monitoring": ["Prometheus", "Grafana", "ELK Stack", "Datadog", "New Relic"],
"configuration_management": ["Ansible", "Chef", "Puppet"],
"programming_languages": ["Python", "Bash", "JavaScript", "Go", "PowerShell"],
"databases": ["PostgreSQL", "MySQL", "MongoDB", "Redis", "DynamoDB"],
"operating_systems": ["Linux (Ubuntu, CentOS, RHEL)", "Windows Server"],
"networking": ["TCP/IP", "DNS", "Load Balancers", "VPN", "Firewalls"],
"version_control": ["Git", "GitHub", "GitLab", "Bitbucket"],
"collaboration_tools": ["Jira", "Confluence", "Slack", "Microsoft Teams"],
},
"projects": [
{
"name": "CV API",
"description": "Serverless CV API built with AWS Lambda and API Gateway demonstrating modern cloud architecture",
"technologies": [
"Python",
"AWS Lambda",
"API Gateway",
"SAM",
"CloudFormation",
],
"github": "https://github.com/johnsmith/cv-api",
"highlights": [
"Serverless architecture with auto-scaling capabilities",
"RESTful API design with comprehensive endpoints",
"Infrastructure as Code using AWS SAM",
"Comprehensive unit testing and CI/CD pipeline",
],
},
{
"name": "Infrastructure Automation Platform",
"description": "Internal platform for automated infrastructure provisioning and management",
"technologies": ["Python", "Terraform", "AWS", "React", "PostgreSQL"],
"github": "https://github.com/johnsmith/infra-platform",
"highlights": [
"Reduced infrastructure provisioning time by 80%",
"Self-service portal for development teams",
"Automated compliance and security scanning",
"Multi-cloud support with consistent APIs",
],
},
{
"name": "Monitoring and Alerting Solution",
"description": "Comprehensive monitoring solution for microservices architecture",
"technologies": [
"Prometheus",
"Grafana",
"AlertManager",
"Kubernetes",
"Helm",
],
"github": "https://github.com/johnsmith/monitoring-stack",
"highlights": [
"Custom dashboards for business metrics",
"Intelligent alerting with reduced false positives",
"Multi-cluster monitoring capability",
"Integration with incident response workflows",
],
},
],
"certifications": [
{
"name": "AWS Certified Solutions Architect - Professional",
"issuer": "Amazon Web Services",
"date": "2023",
"credential_id": "AWS-PSA-12345",
},
{
"name": "Certified Kubernetes Administrator (CKA)",
"issuer": "Cloud Native Computing Foundation",
"date": "2023",
"credential_id": "CKA-67890",
},
{
"name": "HashiCorp Certified: Terraform Associate",
"issuer": "HashiCorp",
"date": "2022",
"credential_id": "HC-TA-54321",
},
],
"languages": [
{"language": "English", "proficiency": "Native speaker"},
{"language": "Spanish", "proficiency": "Conversational"},
],
"key_achievements": [
"Successfully architected and deployed infrastructure serving 10+ million daily requests",
"Led cloud migration projects resulting in 60% cost reduction",
"Implemented DevOps practices reducing deployment time from hours to minutes",
"Maintained 99.9% uptime across critical production systems",
"Mentored 15+ junior engineers in cloud technologies and DevOps practices",
"Established security best practices reducing security incidents by 85%",
],
"personal_interests": [
"Open Source Contribution: Regular contributor to cloud-native projects",
"Technology Blogging: Writing about DevOps trends and best practices",
"Continuous Learning: Staying current with emerging cloud technologies",
"Home Lab: Experimenting with new tools and technologies",
"Community Speaking: Presenting at local tech meetups and conferences",
],
}
def lambda_handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]:
"""
AWS Lambda handler for Personal API
"""
# CORS headers
headers = {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token",
"Access-Control-Allow-Methods": "GET,OPTIONS",
}
try:
# Handle CORS preflight request
if event.get("httpMethod") == "OPTIONS":
return {"statusCode": 200, "headers": headers, "body": ""}
# Get the HTTP method and path
http_method = event.get("httpMethod", "")
path = event.get("path", "")
query_parameters = event.get("queryStringParameters") or {}
if http_method != "GET":
return {
"statusCode": 405,
"headers": headers,
"body": json.dumps({"error": "Method not allowed"}),
}
# Route handling
if path == "/cv" or path == "/":
# Return full CV
response_data = CV_DATA
elif path == "/cv/personal":
# Return personal information only
response_data = CV_DATA["personal_info"]
elif path == "/cv/experience":
# Return work experience
response_data = CV_DATA["experience"]
elif path == "/cv/education":
# Return education
response_data = CV_DATA["education"]
elif path == "/cv/skills":
# Return skills
response_data = CV_DATA["skills"]
elif path == "/cv/projects":
# Return projects
response_data = CV_DATA["projects"]
elif path == "/cv/summary":
# Return summary
response_data = {"summary": CV_DATA["summary"]}
elif path == "/cv/certifications":
# Return certifications
response_data = CV_DATA["certifications"]
elif path == "/cv/languages":
# Return languages
response_data = CV_DATA["languages"]
elif path == "/cv/achievements":
# Return key achievements
response_data = CV_DATA["key_achievements"]
elif path == "/cv/interests":
# Return personal interests
response_data = CV_DATA["personal_interests"]
elif path.startswith("/cv/search"):
# Search functionality
search_term = query_parameters.get("q", "").lower()
if not search_term:
return {
"statusCode": 400,
"headers": headers,
"body": json.dumps(
{"error": "Search term required. Use ?q=keyword"}
),
}
# Search through CV data
results = search_cv(search_term)
response_data = {"search_term": search_term, "results": results}
else:
return {
"statusCode": 404,
"headers": headers,
"body": json.dumps({"error": "Endpoint not found"}),
}
return {
"statusCode": 200,
"headers": headers,
"body": json.dumps(response_data, indent=2),
}
except Exception as e:
print(f"Error: {str(e)}") # CloudWatch logs
return {
"statusCode": 500,
"headers": headers,
"body": json.dumps({"error": "Internal server error"}),
}
def search_cv(search_term: str) -> Dict[str, Any]:
"""Search through CV data - ultra-simple version"""
results = {}
# Convert entire CV to searchable text and check each section
for section_name, section_data in CV_DATA.items():
if section_name == "personal_info":
continue # Skip personal info from search
section_text = json.dumps(section_data, default=str).lower()
if search_term in section_text:
results[section_name] = section_data
return results