Skip to content

Commit

Permalink
Change the data source to query saml idp metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhukiran9999 committed Sep 18, 2024
1 parent f324761 commit 3855cd3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ data "keycloak_realm" "kc-lz-sso-realm" {
realm = var.kc_realm
}

// more-or-less drop-in replacement for (broken-in-0.14) http provider
data "external" "saml_idp_descriptor" {
program = ["${path.module}/bin/http_get.sh"]

query = {
url = "${var.kc_base_url}/realms/${var.kc_realm}/protocol/saml/descriptor"
}
data "http" "saml_idp_metadata" {
url = "${var.kc_base_url}/realms/${var.kc_realm}/protocol/saml/descriptor"
}

resource "aws_iam_saml_provider" "default" {
name = var.aws_saml_idp_name
saml_metadata_document = tostring(data.external.saml_idp_descriptor.result.data)
saml_metadata_document = data.http.saml_idp_metadata.response_body
}

resource "aws_iam_role" "admin_role" {
Expand Down

0 comments on commit 3855cd3

Please sign in to comment.