I don’t know how to create a dynamic resource module
resource "aws_sagemaker_user_profile" "user_profile" {
domain_id = aws_sagemaker_domain.sagemaker_domain.id
user_profile_name = var.user_profile_name
}
for every sagemaker user. The idea would be that this block would be displayed for each username entered in the tfvars file with the user_profile_name variable.
2
Answers
yes it's exactly what I wanted.Thank you very much Marko!!.
If I understood the question, you want to create a Sagemaker user profile for every value defined under the
user_profile_name
variable. To achieve that, you would first need to define the variable like this:Since you want to create a profile for each of the values, you can use the
for_each
meta-argument. The final code would then look like:Since the variable is defined as a set, the
each.key
andeach.value
give the same result.