

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon Bedrock で SageMaker JumpStart モデルを使用する
<a name="jumpstart-foundation-models-use-studio-updated-register-bedrock"></a>

Amazon SageMaker JumpStart から Amazon Bedrock にデプロイしたモデルを登録できます。Amazon Bedrock では、複数のエンドポイントの背後でモデルをホストできます。エージェントやナレッジベースなどの Amazon Bedrock 機能を使用することもできます。Amazon Bedrock のモデルの使用の詳細については、「[https://docs.aws.amazon.com/bedrock/latest/userguide/amazon-bedrock-marketplace.html](https://docs.aws.amazon.com/bedrock/latest/userguide/amazon-bedrock-marketplace.html)」を参照してください。

**重要**  
モデルを Amazon Bedrock に移行するには、IAM ロールに [AmazonBedrockFullAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonBedrockFullAccess.html) ポリシーをアタッチすることをお勧めします。管理ポリシーをアタッチできない場合は、IAM ロールに次のアクセス許可があることを確認します。  

****  

```
{
    	"Version":"2012-10-17",		 	 	 
    	"Statement": [
    		{
    			"Sid": "BedrockAll",
    			"Effect": "Allow",
    			"Action": [
    				"bedrock:*"
    			],
    			"Resource": "*"
    		},
    		{
    			"Sid": "DescribeKey",
    			"Effect": "Allow",
    			"Action": [
    				"kms:DescribeKey"
    			],
    			"Resource": "arn:*:kms:*:::*"
    		},
    		{
    			"Sid": "APIsWithAllResourceAccess",
    			"Effect": "Allow",
    			"Action": [
    				"iam:ListRoles",
    				"ec2:DescribeVpcs",
    				"ec2:DescribeSubnets",
    				"ec2:DescribeSecurityGroups"
    			],
    			"Resource": "*"
    		},
    		{
    			"Sid": "MarketplaceModelEndpointMutatingAPIs",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:CreateEndpoint",
    				"sagemaker:CreateEndpointConfig",
    				"sagemaker:CreateModel",
    				"sagemaker:CreateInferenceComponent",
    				"sagemaker:DeleteInferenceComponent",
    				"sagemaker:DeleteEndpoint",
    				"sagemaker:UpdateEndpoint"
    			],
    			"Resource": [
    				"arn:aws:sagemaker:*:*:endpoint/*",
    				"arn:aws:sagemaker:*:*:endpoint-config/*",
    				"arn:aws:sagemaker:*:*:model/*"
    			],
    			"Condition": {
    				"StringEquals": {
    					"aws:CalledViaLast": "bedrock.amazonaws.com"
    				}
    			}
    		},
    		{
    			"Sid": "BedrockEndpointTaggingOperations",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:AddTags",
    				"sagemaker:DeleteTags"
    			],
    			"Resource": [
    				"arn:aws:sagemaker:*:*:endpoint/*",
    				"arn:aws:sagemaker:*:*:endpoint-config/*",
    				"arn:aws:sagemaker:*:*:model/*"
    			]
    		},
    		{
    			"Sid": "MarketplaceModelEndpointNonMutatingAPIs",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:DescribeEndpoint",
    				"sagemaker:DescribeEndpointConfig",
    				"sagemaker:DescribeModel",
    				"sagemaker:DescribeInferenceComponent",
    				"sagemaker:ListEndpoints",
    				"sagemaker:ListTags"
    			],
    			"Resource": [
    				"arn:aws:sagemaker:*:*:endpoint/*",
    				"arn:aws:sagemaker:*:*:endpoint-config/*",
    				"arn:aws:sagemaker:*:*:model/*"
    			],
    			"Condition": {
    				"StringEquals": {
    					"aws:CalledViaLast": "bedrock.amazonaws.com"
    				}
    			}
    		},
    		{
    			"Sid": "BedrockEndpointInvokingOperations",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:InvokeEndpoint",
    				"sagemaker:InvokeEndpointWithResponseStream"
    			],
    			"Resource": [
    				"arn:aws:sagemaker:*:*:endpoint/*"
    			],
    			"Condition": {
    				"StringEquals": {
    					"aws:CalledViaLast": "bedrock.amazonaws.com"
    				}
    			}
    		},
    		{
    			"Sid": "DiscoveringMarketplaceModel",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:DescribeHubContent"
    			],
    			"Resource": [
    				"arn:aws:sagemaker:*:aws:hub-content/SageMakerPublicHub/Model/*",
    				"arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
    			]
    		},
    		{
    			"Sid": "AllowMarketplaceModelsListing",
    			"Effect": "Allow",
    			"Action": [
    				"sagemaker:ListHubContents"
    			],
    			"Resource": "arn:aws:sagemaker:*:aws:hub/SageMakerPublicHub"
    		},
    		{
    			"Sid": "RetrieveSubscribedMarketplaceLicenses",
    			"Effect": "Allow",
    			"Action": [
    				"license-manager:ListReceivedLicenses"
    			],
    			"Resource": [
    				"*"
    			]
    		},
    		{
    			"Sid": "PassRoleToSageMaker",
    			"Effect": "Allow",
    			"Action": [
    				"iam:PassRole"
    			],
    			"Resource": [
    				"arn:aws:iam::*:role/*Sagemaker*ForBedrock*"
    			],
    			"Condition": {
    				"StringEquals": {
    					"iam:PassedToService": [
    						"sagemaker.amazonaws.com",
    						"bedrock.amazonaws.com"
    					]
    				}
    			}
    		},
    		{
    			"Sid": "PassRoleToBedrock",
    			"Effect": "Allow",
    			"Action": [
    				"iam:PassRole"
    			],
    			"Resource": "arn:aws:iam::*:role/*AmazonBedrock*",
    			"Condition": {
    				"StringEquals": {
    					"iam:PassedToService": [
    						"bedrock.amazonaws.com"
    					]
    				}
    			}
    		}
    	]
    }
```
Amazon Bedrock フルアクセスポリシーは、Amazon Bedrock API へのアクセス許可のみを提供します。で Amazon Bedrock を使用するには AWS マネジメントコンソール、IAM ロールに次のアクセス許可も必要です。  

```
{
        "Sid": "AllowConsoleS3AccessForBedrockMarketplace",
        "Effect": "Allow",
        "Action": [
          "s3:GetObject",
          "s3:GetBucketCORS",
          "s3:ListBucket",
          "s3:ListBucketVersions",
          "s3:GetBucketLocation"
        ],
        "Resource": "*"
    }
```
独自のポリシーを作成する場合は、リソースに対して Amazon Bedrock Marketplace アクションを許可するポリシーステートメントを含める必要があります。例えば、次のポリシーでは、エンドポイントにデプロイしたモデルに対して `InvokeModel` 操作を使用することを Amazon Bedrock に許可します。  

****  

```
{
    
        "Version":"2012-10-17",		 	 	 
        "Statement": [
            {
                "Sid": "BedrockAll",
                "Effect": "Allow",
                "Action": [
                    "bedrock:InvokeModel"
                ],
                "Resource": [
                "arn:aws:bedrock:us-east-1:111122223333:marketplace/model-endpoint/all-access"
                ]
            },
            {
                "Sid": "VisualEditor1",
                "Effect": "Allow",
                "Action": ["sagemaker:InvokeEndpoint"],
                "Resource": "arn:aws:sagemaker:us-east-1:111122223333:endpoint/*",
                "Condition": {
                    "StringEquals": {
                        "aws:ResourceTag/project": "example-project-id",
                        "aws:CalledViaLast": "bedrock.amazonaws.com"
                    }
                }
            }
        ]
    
}
```

モデルをデプロイしたら、Amazon Bedrock で使用できる場合があります。Amazon Bedrock で使用できるかどうかを確認するには、Studio UI のモデル詳細カードに移動します。モデルカードに **[Bedrock 対応]** と表示されている場合は、モデルを Amazon Bedrock に登録できます。

**重要**  
デフォルトでは、Amazon SageMaker JumpStart はデプロイするモデルのネットワークアクセスを無効にします。ネットワークアクセスを有効にしている場合、Amazon Bedrock でモデルを使用することはできません。Amazon Bedrock でモデルを使用する場合は、ネットワークアクセスを無効にしてモデルを再デプロイする必要があります。

Amazon Bedrock でモデルを使用するには、**[エンドポイントの詳細]** ページに移動し、Studio UI の右上隅にある **[Bedrock で使用]** を選択します。ポップアップが表示されたら、**[Bedrock に登録]** を選択します。