terraform-provider-datadog icon indicating copy to clipboard operation
terraform-provider-datadog copied to clipboard

Feature Request: Add support to upload the SAML IdP metadata

Open michelzanini opened this issue 4 years ago • 7 comments

Hi,

It would be useful to have a resource to update the SAML IdP metadata. We can configure everything around SAML with datadog_organization_settings, except the IdP metadata.

This is the API that can be used: https://docs.datadoghq.com/api/latest/organizations/#upload-idp-metadata

Thanks.

michelzanini avatar Sep 20 '21 16:09 michelzanini

Is their any progress on this request

rajivchirania avatar Jan 17 '22 20:01 rajivchirania

Can we have an code for idp_metadata_file upload for datadog_organisation in terraform?

RaghavK12RK avatar Sep 05 '22 16:09 RaghavK12RK

I am also looking for the ability to work with this API endpoint in terraform.

Does anyone have a decent work around in the meantime? Maybe a proof of concept for running some sort of local-exec that makes a curl/python/etc. call to the API directly?

briggsy87 avatar Oct 28 '22 21:10 briggsy87

This is also an issue for me. Can we get some eyes on this?

carlindesautels avatar Oct 31 '22 13:10 carlindesautels

Also waiting for this feature 👍

jorneilander avatar Dec 01 '22 10:12 jorneilander

I am also looking for the ability to work with this API endpoint in terraform.

Does anyone have a decent work around in the meantime? Maybe a proof of concept for running some sort of local-exec that makes a curl/python/etc. call to the API directly?

We're using this at the moment. Also takes into account rate limiting that Datadog has implemented.

idp_metadata_url = "https://login.microsoftonline.com/<AZURE_TENANT_ID>/federationmetadata/2007-06/federationmetadata.xml?appid=<AZURE_APP_ID>"

provisioner "local-exec" {
    environment = {
      DD_API_KEY         = ""
      DD_APPLICATION_KEY = ""
    }
    command = <<-EOC
      curl --silent --fail --request POST "https://api.datadoghq.eu/api/v2/saml_configurations/idp_metadata" \
        --header "Content-Type: application/xml" \
        --header "DD-API-KEY: $DD_API_KEY" \
        --header "DD-APPLICATION-KEY: $DD_APPLICATION_KEY" \
        --retry 5 \
        --retry-delay 30 \
        --data "$(curl --silent --fail "${local.idp_metadata_url}" | tail -c +4)"
EOC
  }

}

tail -c +4 is in there because Azure adds an XML BOM to the download which isn't accepted by Datadog's API. Funny fact, the BOM isn't in there when you download it via your browser 🤨 .

jorneilander avatar Dec 01 '22 10:12 jorneilander

any update on it?

mtavaresmedeiros avatar Jul 19 '23 09:07 mtavaresmedeiros