/// <summary> /// Default constructor. This constructor is used by Lambda to construct the instance. When invoked in a Lambda environment /// the AWS credentials will come from the IAM role associated with the function and the AWS region will be set to the /// region the Lambda function is executed in. /// </summary> public Function() { var serviceCollectionDecorator = new ServiceCollectionDecorator(); var serviceProvider = serviceCollectionDecorator.BuildServiceProvider(); RequestProcessService = serviceProvider.GetRequiredService <IEventProcessService>(); S3Client = serviceProvider.GetRequiredService <IAmazonS3>(); }
/// <summary> /// Constructs an instance with a preconfigured S3 client. This can be used for testing the outside of the Lambda environment. /// </summary> /// <param name="s3Client"></param> internal Function(IAmazonS3 s3Client, IEventProcessService requestProcessService) { this.S3Client = s3Client; RequestProcessService = requestProcessService; }