Open j4mcs opened 1 week ago
A bit more context on what is happening in your lambda code: When POST calls to https://api.datadoghq.com/api/v1/integration/aws
result in a 409, the response is an error object. This gets caught as an exception by the lambda handler and returned as a FAILED
response. Given a GET won't return the external ID I think CREATE
requests should list the existing AWS integrations for the given account_id
and if there are any request a new ExternalID with the supplied configuration and return SUCCESS
Expected Behavior
When installing the AWS integration into an account which already has been registered in Datadog, the integration should either fail and leave the existing registration unchanged or succeed and update the existing registration with the configuration passed to the integration.
Actual Behavior
When installing the AWS integration into an account with which already has been registered in Datadog, the integration will fail and then delete the pre-existing registration
We are encountering this as we have the V1 Datadog integration configured for our older accounts but would like to use the V2 integration for all new accounts. This would require us to load the stackset for all OUs instead of manually per new account. However to do this we need a way for stack instances run in existing accounts to not fail (and rollback resources it didn't create).
Steps to Reproduce the Problem
This issue is related to https://github.com/DataDog/cloudformation-template/issues/85 but highlights broader problem with how the integration Lambda function is written
MainDatadogStackV2
)Specifications
https://datadog-cloudformation-template.s3.amazonaws.com/aws/main_organizations.yaml
Stacktrace
Here are the relevant cloudwatch logs