Skip to content

Commit

Permalink
patch: made user profile resource only for IAM (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
thulasirajkomminar authored May 15, 2024
1 parent 6313024 commit 9f3e8eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions examples/example.tf
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f3e8eb

Please sign in to comment.