From 64c2eb481ef4ae9aaa169fca4d693e79c914ee1a Mon Sep 17 00:00:00 2001 From: try-panwiac <93744932+try-panwiac@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:17:20 -0700 Subject: [PATCH] Create main_sage.tf --- ai/main_sage.tf | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ai/main_sage.tf diff --git a/ai/main_sage.tf b/ai/main_sage.tf new file mode 100644 index 0000000000..2b4ab63216 --- /dev/null +++ b/ai/main_sage.tf @@ -0,0 +1,27 @@ +resource "aws_sagemaker_model" "example" { + name = "my-model" + execution_role_arn = aws_iam_role.example.arn + + primary_container { + image = data.aws_sagemaker_prebuilt_ecr_image.test.registry_path + } +} + +resource "aws_iam_role" "example" { + assume_role_policy = data.aws_iam_policy_document.assume_role.json +} + +data "aws_iam_policy_document" "assume_role" { + statement { + actions = ["sts:AssumeRole"] + + principals { + type = "Service" + identifiers = ["sagemaker.amazonaws.com"] + } + } +} + +data "aws_sagemaker_prebuilt_ecr_image" "test" { + repository_name = "kmeans" +}