Wie authentifiziere ich mich sicher mit Google Service-Konto von einer AWS-Lambda-Funktion? Ich möchte einige Google API von AWS Lambda aufrufen.Google OAuth von AWS Lambda
1
A
Antwort
0
Sie können die Anmeldeinformationen auch in Lambda-Umgebungsvariablen verschlüsselt speichern. Sie können sie entweder programmatisch in der aws-Konsole speichern oder konfigurieren.
Weitere Details:
http://docs.aws.amazon.com/lambda/latest/dg/env_variables.html
CLI:
aws lambda create-function \
--region us-east-1
--function-name myTestFunction
--zip-file fileb://path/package.zip
--role role-arn
--environment Variables="{LD_LIBRARY_PATH=/usr/bin/test/lib64}"
--handler index.handler
--runtime nodejs6.10
--profile default
NodeJS:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html
Überprüfung
Variablen: {
im Code unten.
Um zu verschlüsseln, überprüfen Sie KMSKeyArn und geben Sie Ihren KMS Arn Value an.
var params = {
FunctionName: 'STRING_VALUE', /* required */
DeadLetterConfig: {
TargetArn: 'STRING_VALUE'
},
Description: 'STRING_VALUE',
Environment: {
Variables: {
'<EnvironmentVariableName>': 'STRING_VALUE',
/* '<EnvironmentVariableName>': ... */
}
},
Handler: 'STRING_VALUE',
KMSKeyArn: 'STRING_VALUE',
MemorySize: 0,
Role: 'STRING_VALUE',
Runtime: nodejs | nodejs4.3 | nodejs6.10 | java8 | python2.7 | python3.6 | dotnetcore1.0 | nodejs4.3-edge,
Timeout: 0,
TracingConfig: {
Mode: Active | PassThrough
},
VpcConfig: {
SecurityGroupIds: [
'STRING_VALUE',
/* more items */
],
SubnetIds: [
'STRING_VALUE',
/* more items */
]
}
};
lambda.updateFunctionConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Ich hoffe, es hilft.
Verwandte Themen
- 1. Wie oAuth Google API von Lambda AWS?
- 2. Google OAuth signir redirecturll AWS
- 3. Integration von Google Guice in AWS Lambda
- 4. Einschränkungen von AWS Lambda
- 5. Oauth2 google Leute api auf aws Lambda
- 6. Anruf aws-cli von AWS Lambda
- 7. Upload von AWS Lambda zu AWS S3
- 8. Integration von AWS Lambda und Google Drive Push Notification möglich?
- 9. Lambda Aufruf von AWS RDS
- 10. AWS Lambda: Ermitteln von Kaltstarts
- 11. AWS Cognito adminCreateUser von Lambda
- 12. AWS Lambda Throughput
- 13. Sklearn auf aws Lambda
- 14. Chrome --headless für AWS Lambda?
- 15. AWS Lambda - CloudWatch Ereignistyp
- 16. AWS Lambda S3Event-Deserialisierung
- 17. AWS ASG + SNS + Lambda
- 18. AWS Lambda JavaCompiler-Instanz
- 19. Überwachung AWS Lambda Fehler
- 20. Rückgabewerte in aws Lambda
- 21. AWS Lambda: Service Fehler
- 22. Unterstützt AWS Lambda PHP?
- 23. AWS Lambda: org.apache.http.conn.ConnectTimeoutException
- 24. AWS Lambda Dynamischer Endpunkt
- 25. AWS Lambda Authorizer
- 26. AWS Lambda - Erstellen Thumbnail
- 27. AWS Lambda Leistungsprobleme
- 28. AWS Lambda-Unterstützung - Autoscaling
- 29. AWS Lambda Verwendung
- 30. AWS Lambda-Trigger-Status
Haben Sie die Google OAuth-Dokumentation und die Lambda-Dokumentation gelesen, um zu verstehen, wie Sie sie integrieren? – Kannaiyan
Bitte überprüfen Sie [ask] – Aron
@Kannaiyan Was ich meinte ist, ich muss Service-Konto JSON-Datei zu halten..wenn ich in einem VM waren, kann ich es im Ordner behalten und ich kann GOOGLE_APPLICATION_CREDENTIALS env Variable zu authentifizieren..aber wenn ich benutze Lambda-Funktion Was soll ich tun? .. Ich kann meinen Schlüssel nicht in meiner Code-Basis behalten –