|
812 | 812 | }, |
813 | 813 | }, |
814 | 814 | }, |
| 815 | + "model_eval": { |
| 816 | + "role_name": "SageMaker-AutoRole-Evaluation", |
| 817 | + "trust_policy": { |
| 818 | + "Version": "2012-10-17", |
| 819 | + "Statement": [ |
| 820 | + { |
| 821 | + "Effect": "Allow", |
| 822 | + "Principal": { |
| 823 | + "Service": "sagemaker.amazonaws.com" |
| 824 | + }, |
| 825 | + "Action": "sts:AssumeRole", |
| 826 | + "Condition": { |
| 827 | + "StringEquals": {"aws:SourceAccount": "ACCOUNT_PLACEHOLDER"} |
| 828 | + }, |
| 829 | + } |
| 830 | + ], |
| 831 | + }, |
| 832 | + "policies": { |
| 833 | + # --- Training permissions (superset of "training" role type) --- |
| 834 | + "s3_policy": { |
| 835 | + "Version": "2012-10-17", |
| 836 | + "Statement": [ |
| 837 | + { |
| 838 | + "Effect": "Allow", |
| 839 | + "Action": [ |
| 840 | + "s3:GetObject", |
| 841 | + "s3:PutObject", |
| 842 | + "s3:ListBucket", |
| 843 | + "s3:GetBucketLocation", |
| 844 | + ], |
| 845 | + "Resource": "S3_PLACEHOLDER", |
| 846 | + } |
| 847 | + ], |
| 848 | + }, |
| 849 | + "ecr_policy": { |
| 850 | + "Version": "2012-10-17", |
| 851 | + "Statement": [ |
| 852 | + { |
| 853 | + "Effect": "Allow", |
| 854 | + "Action": ["ecr:GetAuthorizationToken"], |
| 855 | + "Resource": "*", |
| 856 | + }, |
| 857 | + { |
| 858 | + "Effect": "Allow", |
| 859 | + "Action": [ |
| 860 | + "ecr:GetDownloadUrlForLayer", |
| 861 | + "ecr:BatchGetImage", |
| 862 | + "ecr:BatchCheckLayerAvailability", |
| 863 | + ], |
| 864 | + "Resource": "arn:aws:ecr:*:*:repository/*", |
| 865 | + }, |
| 866 | + ], |
| 867 | + }, |
| 868 | + "cloudwatch_policy": { |
| 869 | + "Version": "2012-10-17", |
| 870 | + "Statement": [ |
| 871 | + { |
| 872 | + "Effect": "Allow", |
| 873 | + "Action": ["cloudwatch:PutMetricData"], |
| 874 | + "Resource": "*", |
| 875 | + }, |
| 876 | + { |
| 877 | + "Effect": "Allow", |
| 878 | + "Action": [ |
| 879 | + "logs:CreateLogGroup", |
| 880 | + "logs:CreateLogStream", |
| 881 | + "logs:PutLogEvents", |
| 882 | + "logs:DescribeLogStreams", |
| 883 | + ], |
| 884 | + "Resource": "arn:aws:logs:*:*:log-group:/aws/sagemaker/TrainingJobs*", |
| 885 | + }, |
| 886 | + ], |
| 887 | + }, |
| 888 | + "kms_policy": { |
| 889 | + "Version": "2012-10-17", |
| 890 | + "Statement": [ |
| 891 | + { |
| 892 | + "Effect": "Allow", |
| 893 | + "Action": ["kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey"], |
| 894 | + "Resource": "KMS_PLACEHOLDER", |
| 895 | + } |
| 896 | + ], |
| 897 | + }, |
| 898 | + # --- Evaluation-specific permissions --- |
| 899 | + "bedrock_evaluation_policy": { |
| 900 | + "Version": "2012-10-17", |
| 901 | + "Statement": [ |
| 902 | + { |
| 903 | + "Effect": "Allow", |
| 904 | + "Action": [ |
| 905 | + "bedrock:CreateEvaluationJob", |
| 906 | + "bedrock:GetEvaluationJob", |
| 907 | + ], |
| 908 | + "Resource": "*", |
| 909 | + }, |
| 910 | + { |
| 911 | + "Effect": "Allow", |
| 912 | + "Action": [ |
| 913 | + "bedrock:InvokeModel", |
| 914 | + "bedrock:InvokeModelWithResponseStream", |
| 915 | + ], |
| 916 | + "Resource": [ |
| 917 | + "arn:aws:bedrock:*:*:foundation-model/*", |
| 918 | + "arn:aws:bedrock:*::foundation-model/*", |
| 919 | + ], |
| 920 | + }, |
| 921 | + ], |
| 922 | + }, |
| 923 | + "mlflow_policy": { |
| 924 | + "Version": "2012-10-17", |
| 925 | + "Statement": [ |
| 926 | + { |
| 927 | + "Effect": "Allow", |
| 928 | + "Action": [ |
| 929 | + "sagemaker-mlflow:GetExperimentByName", |
| 930 | + "sagemaker-mlflow:CreateExperiment", |
| 931 | + "sagemaker-mlflow:CreateRun", |
| 932 | + "sagemaker-mlflow:LogBatch", |
| 933 | + "sagemaker-mlflow:LogMetric", |
| 934 | + "sagemaker-mlflow:LogParam", |
| 935 | + "sagemaker-mlflow:SetTag", |
| 936 | + "sagemaker-mlflow:UpdateRun", |
| 937 | + ], |
| 938 | + "Resource": "arn:aws:sagemaker:*:*:mlflow-app/*", |
| 939 | + } |
| 940 | + ], |
| 941 | + }, |
| 942 | + "sagemaker_evaluation_policy": { |
| 943 | + "Version": "2012-10-17", |
| 944 | + "Statement": [ |
| 945 | + { |
| 946 | + "Effect": "Allow", |
| 947 | + "Action": [ |
| 948 | + "sagemaker:CreateTrainingJob", |
| 949 | + "sagemaker:DescribeTrainingJob", |
| 950 | + "sagemaker:StopTrainingJob", |
| 951 | + "sagemaker:CreatePipeline", |
| 952 | + "sagemaker:DescribePipeline", |
| 953 | + "sagemaker:StartPipelineExecution", |
| 954 | + "sagemaker:DescribePipelineExecution", |
| 955 | + "sagemaker:AddTags", |
| 956 | + ], |
| 957 | + "Resource": [ |
| 958 | + "arn:aws:sagemaker:*:*:training-job/*", |
| 959 | + "arn:aws:sagemaker:*:*:pipeline/*", |
| 960 | + ], |
| 961 | + } |
| 962 | + ], |
| 963 | + }, |
| 964 | + }, |
| 965 | + }, |
815 | 966 | } |
816 | 967 |
|
817 | 968 | # Actions the *caller* must have to orchestrate Pipeline-based evaluations |
|
0 commit comments