Skip to content

fix: Increase Lambda timeout from 5 to 300 seconds#309

Open
rarikmilkrai wants to merge 1 commit into
DataDog:masterfrom
rarikmilkrai:fix/timeout-creation-lamba
Open

fix: Increase Lambda timeout from 5 to 300 seconds#309
rarikmilkrai wants to merge 1 commit into
DataDog:masterfrom
rarikmilkrai:fix/timeout-creation-lamba

Conversation

@rarikmilkrai
Copy link
Copy Markdown

### What does this PR do?

Increases the Lambda function timeout from 5 to 300 seconds in the `aws_attach_integration_permissions` CloudFormation template.

### Motivation

The default 5-second timeout was insufficient for the Lambda function to complete its operations. The function performs multiple time-intensive operations including:
- Fetching IAM permissions from the Datadog API
- Creating multiple customer-managed IAM policies
- Attaching policies to the integration role
- Cleaning up existing policies

During testing, the Lambda consistently timed out at 5 seconds, causing the CloudFormation stack to fail. Increasing the timeout to 300 seconds resolved the issue, allowing all operations to complete successfully.

### Testing Guidelines

- ✅ Tested the CloudFormation stack deployment in AWS with the 300-second timeout
- ✅ Verified that the Lambda function successfully completes all IAM operations
- ✅ Confirmed that policies are correctly created and attached to the integration role
- ❌ Previous tests with 5-second timeout consistently failed

### Additional Notes

This change aligns the timeout value with similar Lambda functions in other templates within this repository that perform IAM operations and API calls.

Descrição do PR (Português - para referência interna)

### O que este PR faz?

Aumenta o timeout da função Lambda de 5 para 300 segundos no template CloudFormation `aws_attach_integration_permissions`.

### Motivação

O timeout padrão de 5 segundos era insuficiente para a função Lambda completar suas operações. A função executa múltiplas operações que consomem tempo, incluindo:
- Buscar permissões IAM da API do Datadog
- Criar múltiplas políticas IAM gerenciadas pelo cliente
- Anexar políticas ao role de integração
- Limpar políticas existentes

Durante os testes, a Lambda consistentemente excedia o timeout em 5 segundos, causando falha na stack CloudFormation. Aumentar o timeout para 300 segundos resolveu o problema, permitindo que todas as operações fossem concluídas com sucesso.

### Diretrizes de Teste

- ✅ Testei o deployment da stack CloudFormation na AWS com timeout de 300 segundos
- ✅ Verifiquei que a função Lambda completa com sucesso todas as operações IAM
- ✅ Confirmei que as políticas são corretamente criadas e anexadas ao role de integração
- ❌ Testes anteriores com timeout de 5 segundos falharam consistentemente

### Notas Adicionais

Esta mudança alinha o valor do timeout com funções Lambda similares em outros templates deste repositório que executam operações IAM e chamadas de API.

@rarikmilkrai rarikmilkrai requested a review from a team as a code owner May 17, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant