From 9f3e8eb8c9f10935836124ffd13f899575c2f3d6 Mon Sep 17 00:00:00 2001 From: Thulasiraj Komminar <39799163+thulasirajkomminar@users.noreply.github.com> Date: Wed, 15 May 2024 17:11:24 +0200 Subject: [PATCH] patch: made user profile resource only for IAM (#7) --- examples/example.tf | 11 +++++++++++ main.tf | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/example.tf b/examples/example.tf index 8441125..f116860 100644 --- a/examples/example.tf +++ b/examples/example.tf @@ -1,3 +1,14 @@ +terraform { + required_version = ">= 1.3" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.62.0" + } + } +} + provider "aws" { region = "eu-central-1" } diff --git a/main.tf b/main.tf index bf98e02..1c85f4f 100644 --- a/main.tf +++ b/main.tf @@ -50,7 +50,7 @@ resource "aws_sagemaker_studio_lifecycle_config" "kernel" { } resource "aws_sagemaker_user_profile" "default" { - for_each = { for user in var.user_profiles : user => true } + for_each = var.auth_mode == "IAM" ? { for user in var.user_profiles : user => true } : {} domain_id = aws_sagemaker_domain.default.id user_profile_name = each.key tags = var.tags