public async Task Create_DoesNotReturnNull() { var factory = new LambdaFactory(); var result = await factory.Create(); Assert.That(result, Is.Not.EqualTo(null)); }
public async Task <Response?> Wait() { var props = Request.ResourceProperties; IAmazonCertificateManager acmClient = await acmFactory.Create(props.CreationRoleArn); IAmazonLambda lambdaClient = await lambdaFactory.Create(); var request = new DescribeCertificateRequest { CertificateArn = PhysicalResourceId }; var response = await acmClient.DescribeCertificateAsync(request); var status = response?.Certificate?.Status?.Value; switch (status) { case "PENDING_VALIDATION": Thread.Sleep(WaitInterval * 1000); var invokeResponse = await lambdaClient.InvokeAsync(new InvokeRequest { FunctionName = Context.FunctionName, Payload = JsonSerializer.Serialize(Request, SerializerOptions), InvocationType = InvocationType.Event, }); break; case "ISSUED": return(new Response()); default: throw new Exception($"Certificate could not be issued. (Got status: {status})"); } return(null); }