About the AmazonBraketJobsExecutionPolicy policy - Amazon Braket

About the AmazonBraketJobsExecutionPolicy policy

The AmazonBraketJobsExecutionPolicy policy grants permissions for execution roles used in Amazon Braket Hybrid Jobs as follows:

  • Download containers from Amazon Elastic Container Registry - Permissions to read and download container images that are used for the Amazon Braket Hybrid Jobs feature. Containers must conform to the format "arn:aws:ecr:*:*:repository/amazon-braket*".

  • Create log groups and log events and query log groups in order to maintain usage log files for your account – Create, store, and view logging information about Amazon Braket usage in your account. Query metrics on hybrid jobs log groups. Encompass the proper Braket path and allow putting log data. Put metric data in CloudWatch.

  • Store data in Amazon S3 buckets – List the S3 buckets in your account, put objects into and get objects from any bucket in your account that starts with amazon-braket- in its name. These permissions are required for Braket to put files containing results from processed quantum tasks into the bucket, and to retrieve them from the bucket.

  • Pass IAM roles – Passing in IAM roles to the CreateJob API. Roles must conform to the format arn:aws:iam::*:role/service-role/AmazonBraketJobsExecutionRole*.

	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": [
				"s3:GetObject",
				"s3:PutObject",
				"s3:ListBucket",
				"s3:CreateBucket",
				"s3:PutBucketPublicAccessBlock",
				"s3:PutBucketPolicy"
			],
			"Resource": "arn:aws:s3:::amazon-braket-*"
		},
		{
			"Effect": "Allow",
			"Action": [
				"ecr:GetDownloadUrlForLayer",
				"ecr:BatchGetImage",
				"ecr:BatchCheckLayerAvailability"
			],
			"Resource": "arn:aws:ecr:*:*:repository/amazon-braket*"
		},
		{
			"Effect": "Allow",
			"Action": [
				"ecr:GetAuthorizationToken"
			],
			"Resource": "*"
		},
		{
			"Effect": "Allow",
			"Action": [
				"braket:CancelJob",
				"braket:CancelQuantumTask",
				"braket:CreateJob",
				"braket:CreateQuantumTask",
				"braket:GetDevice",
				"braket:GetJob",
				"braket:GetQuantumTask",
				"braket:SearchDevices",
				"braket:SearchJobs",
				"braket:SearchQuantumTasks",
				"braket:ListTagsForResource",
				"braket:TagResource",
				"braket:UntagResource"
			],
			"Resource": "*"
		},
		{
			"Effect": "Allow",
			"Action": [
				"iam:PassRole"
			],
			"Resource": "arn:aws:iam::*:role/service-role/AmazonBraketJobsExecutionRole*",
			"Condition": {
				"StringLike": {
					"iam:PassedToService": [
						"braket.amazonaws.com"
					]
				}
			}
		},
		{
			"Effect": "Allow",
			"Action": [
				"iam:ListRoles"
			],
			"Resource": "arn:aws:iam::*:role/*"
		},
		{
			"Effect": "Allow",
			"Action": [
				"logs:GetQueryResults"
			],
			"Resource": [
				"arn:aws:logs:*:*:log-group:*"
			]
		},
		{
			"Effect": "Allow",
			"Action": [
				"logs:PutLogEvents",
				"logs:CreateLogStream",
				"logs:CreateLogGroup",
				"logs:GetLogEvents",
				"logs:DescribeLogStreams",
				"logs:StartQuery",
				"logs:StopQuery"
			],
			"Resource": "arn:aws:logs:*:*:log-group:/aws/braket*"
		},
		{
			"Effect": "Allow",
			"Action": "cloudwatch:PutMetricData",
			"Resource": "*",
			"Condition": {
				"StringEquals": {
					"cloudwatch:namespace": "/aws/braket"
				}
			}
		}
	]
}