IAM policy to use Amazon S3 objects with DataBrew
The AwsGlueDataBrewSpecificS3BucketPolicy
policy grants the permissions
needed to access S3 on behalf of nonadministrative users.
Customize the policy as follows:
-
Replace the Amazon S3 paths in the policy so they point to the paths that you want to use. In the sample text,
represents a specific object or file.BUCKET-NAME-1/SPECIFIC-OBJECT-NAME
represents all objects (BUCKET-NAME-2/
*
) whose path name starts withBUCKET-NAME-2/
. Update these to name the buckets that you are using. -
(Optional) Use wildcards in the Amazon S3 paths to further restrict permissions. For more information, see IAM policy elements: Variables and tags in the IAM User Guide.
As part of doing this, you might restrict permissions for the actions
s3:PutObject
ands3:PutBucketCORS
. These actions are required only for users who create DataBrew projects, because those users need to be able to send output files to S3.
For more information and to see some examples of what you can add to an IAM policy for Amazon S3, see Bucket Policy Examples in the Amazon S3 Developer Guide.
The following table describes the permissions granted by this policy.
Action | Resource | Description |
---|---|---|
|
|
Allows you to preview your files. |
|
|
Allows sending output files to S3. |
|
|
Allows deleting an object. |
To define the AwsGlueDataBrewSpecificS3BucketPolicy IAM policy for DataBrew (console)
-
Download the JSON for the
AwsGlueDataBrewSpecificS3BucketPolicy
IAM policy. -
Sign in to the Amazon Web Services Management Console and open the IAM console at https://console.amazonaws.cn/iam/
. -
In the navigation pane, choose Policies.
-
For each policy, choose Create Policy.
-
On the Create Policy screen, navigate to the JSON tab.
-
Paste in the policy JSON statement over the sample statement in the editor.
-
Verify that the policy is customized to your account, security requirements, and required Amazon resources. If you need to make changes, you can make them in the editor.
-
Choose Review policy.
To define the AwsGlueDataBrewSpecificS3BucketPolicy IAM policy for DataBrew (Amazon CLI)
-
Download the JSON for
AwsGlueDataBrewSpecificS3BucketPolicy
. -
Customize the policy as described in the first step of the previous procedure.
-
Run the following command to create the policy.
aws iam create-policy --policy-name AwsGlueDataBrewSpecificS3BucketPolicy --policy-document file://iam-policy-AwsGlueDataBrewSpecificS3BucketPolicy.json