title: Need assistance understanding terraform code
body: <p>I am not sure if I am able to understand the code perfectly please help me out here. This is the code I have I am not understand what is Azure Active Directory doing here and what is the purpose of vault.</p>
  <pre><code>data &quot;vault_generic_secret&quot; &quot;client_id&quot; {
    path = var.settings.client_id
  }
  
  data &quot;vault_generic_secret&quot; &quot;client_secret&quot; {
    path = var.settings.client_secret
  }
  
  # Display a secret client for Azure Service Principal
  output &quot;secret&quot; {
    value = data.vault_generic_secret.client_id.data[&quot;client_id&quot;]
  }
  
  
  locals {
    vault_client_id     = data.vault_generic_secret.client_id.data[&quot;client_id&quot;]
    vault_client_secret = data.vault_generic_secret.client_secret.data[&quot;client_secret&quot;]
  
    settings_with_secrets = merge(var.settings, {
      client_id     = local.vault_client_id
      client_secret = local.vault_client_secret
    })
  
  }
  
  
  resource &quot;aws_cognito_identity_provider&quot; &quot;universal_provider&quot; {
  
    user_pool_id  = var.user_pool_id
    provider_name = var.provider_name
    provider_type = var.provider_type
  
    provider_details = local.settings_with_secrets
  
    attribute_mapping = var.attribute_mappings
  
    # We use this to avoid changes to this every execution as described here: 
    # https://github.com/hashicorp/terraform-provider-aws/issues/4831
    # https://github.com/hashicorp/terraform-provider-aws/issues/4807
    lifecycle {
      ignore_changes = [
        provider_details[&quot;attributes_url&quot;],
        provider_details[&quot;attributes_url_add_attributes&quot;],
        provider_details[&quot;authorize_url&quot;],
        provider_details[&quot;token_request_method&quot;],
        provider_details[&quot;token_url&quot;],
        provider_details[&quot;oidc_issuer&quot;]
      ]
    }
  
  }
  </code></pre>