Skip to content

Commit 2a47d24

Browse files
authored
S3 connectors and Delta Tables in S3 destination connector: simplify steps, how to attach access role for S3 only (#704)
1 parent 8f73596 commit 2a47d24

File tree

4 files changed

+71
-68
lines changed

4 files changed

+71
-68
lines changed

api-reference/workflow/destinations/delta-table.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import DeltaTablePrerequisites from '/snippets/general-shared-text/delta-table.m
2020

2121
<DeltaTablePrerequisites />
2222

23+
## Create the destination connector
24+
2325
To create a Delta Tables in Amazon S3 destination connector, see the following examples.
2426

2527
import DeltaTableSDK from '/snippets/destination_connectors/delta_table_sdk.mdx';

snippets/general-shared-text/delta-table.mdx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ For more information about requirements, see the following:
2626
allowfullscreen
2727
></iframe>
2828

29-
- An S3 bucket. [Create an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html).
30-
Additional approaches are in the following video and in the how-to sections at the end of this page.
29+
- An S3 bucket. You can create an S3 bucket by using the S3 console, following the steps [in the S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html) or in the following video.
30+
Additional approaches that use AWS CloudFormation or the AWS CLI are in the how-to sections later on this page.
3131

3232
<iframe
3333
width="560"
@@ -39,8 +39,15 @@ For more information about requirements, see the following:
3939
allowfullscreen
4040
></iframe>
4141

42-
- For authenticated bucket read access, the authenticated AWS IAM user must have at minimum the permissions of `s3:ListBucket` and `s3:GetObject` for that bucket. [Learn how](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html).
42+
- For authenticated bucket write access or both, you should first
43+
[block all public access to the bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/configuring-block-public-access-bucket.html).
4344

45+
After blocking all public access to the bucket, for read access, the authenticated AWS IAM user must have at minimum the permissions of `s3:ListBucket` and `s3:GetObject` for that bucket.
46+
For write access, the authenticated AWS IAM user must have at minimum the permission of `s3:PutObject` for that bucket. To grant permissions,
47+
attach the appropriate bucket policy to the bucket. See the policy examples later on this page, and [learn about bucket policies for S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html). These permissions remain in effect until the bucket policy is removed from the bucket.
48+
To apply a bucket policy by using the S3 console, follow the steps [in the S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/add-bucket-policy.html) or in the following video.
49+
Additional approaches that use AWS CloudFormation or the AWS CLI are in the how-to sections later on this page.
50+
4451
<iframe
4552
width="560"
4653
height="315"
@@ -51,11 +58,8 @@ For more information about requirements, see the following:
5158
allowfullscreen
5259
></iframe>
5360

54-
- For bucket write access, authenticated access to the bucket must be enabled (anonymous access must not be enabled), and the authenticated AWS IAM user must have at
55-
minimum the permission of `s3:PutObject` for that bucket. [Learn how](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html).
56-
57-
- For authenticated access, an AWS access key and secret access key for the authenticated AWS IAM user in the account.
58-
[Create an AWS access key and secret access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey).
61+
- Provide an AWS access key and secret access key for the authenticated AWS IAM user in the account.
62+
Create an AWS access key and secret access key by following the steps [in the IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) or in the following video.
5963

6064
<iframe
6165
width="560"
@@ -67,10 +71,10 @@ For more information about requirements, see the following:
6771
allowfullscreen
6872
></iframe>
6973

70-
- If the target files are in the root of the bucket, the path to the bucket, formatted as `protocol://bucket/` (for example, `s3://my-bucket/`).
74+
- If the target files are in the root of the bucket, provide the path to the bucket, formatted as `protocol://bucket/` (for example, `s3://my-bucket/`).
7175
If the target files are in a folder, the path to the target folder in the S3 bucket, formatted as `protocol://bucket/path/to/folder/` (for example, `s3://my-bucket/my-folder/`).
7276
- If the target files are in a folder, make sure the authenticated AWS IAM user has
73-
authenticated access to the folder as well. [Enable authenticated folder access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-folders).
77+
authenticated access to the folder as well. [See examples of authenticated folder access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-folders).
7478

7579
## Add an access policy to an existing bucket
7680

snippets/general-shared-text/s3.mdx

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ allowfullscreen
1111
></iframe>
1212

1313
The preceding video does not show how to create an AWS account; enable anonymous access to the bucket (which is supported but
14-
not recommended); or generate an AWS STS session token for temporary access, if required by your organization's security
14+
not recommended); or generate AWS STS temporary access credentials if required by your organization's security
1515
requirements. For more information about requirements, see the following:
1616

1717
- An AWS account. [Create an AWS account](https://aws.amazon.com/free).
@@ -26,8 +26,8 @@ requirements. For more information about requirements, see the following:
2626
allowfullscreen
2727
></iframe>
2828

29-
- An S3 bucket. [Create an S3 bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html).
30-
Additional approaches are in the following video and in the how-to sections at the end of this page.
29+
- An S3 bucket. You can create an S3 bucket by using the S3 console, following the steps [in the S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html) or in the following video.
30+
Additional approaches that use AWS CloudFormation or the AWS CLI are in the how-to sections later on this page.
3131

3232
<iframe
3333
width="560"
@@ -39,61 +39,44 @@ requirements. For more information about requirements, see the following:
3939
allowfullscreen
4040
></iframe>
4141

42-
- Anonymous (supported but not recommended) or authenticated access to the bucket.
42+
- Anonymous access to the bucket is supported but not recommended. (Use authenticated bucket read or write access or both instead.) To enable anonymous access, follow the steps
43+
[in the S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-anonymous-user) or in the following animation.
4344

44-
- [Enable anonymous bucket access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-anonymous-user).
45+
![Enable anonymous bucket access](/img/connectors/s3-anon-access.gif)
4546

46-
![Enable anonymous bucket access](/img/connectors/s3-anon-access.gif)
47+
- For authenticated bucket read or write access or both, which is recommended over anonymous access, you should first
48+
[block all public access to the bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/configuring-block-public-access-bucket.html).
4749

48-
- [Enable authenticated bucket access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/walkthrough1.html).
49-
50-
![Enable authenticated bucket access](/img/connectors/s3-auth-access.gif)
51-
52-
- For authenticated bucket read access, the authenticated AWS IAM user must have at minimum the permissions of `s3:ListBucket` and `s3:GetObject` for that bucket. [Learn how](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html).
53-
54-
<iframe
55-
width="560"
56-
height="315"
57-
src="https://www.youtube.com/embed/y4SfQoJpipo"
58-
title="YouTube video player"
59-
frameborder="0"
60-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
61-
allowfullscreen
62-
></iframe>
63-
64-
- For bucket write access, authenticated access to the bucket must be enabled (anonymous access must not be enabled), and the authenticated AWS IAM user must have at
65-
minimum the permission of `s3:PutObject` for that bucket. [Learn how](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html).
66-
67-
- For authenticated access, an AWS access key and secret access key for the authenticated AWS IAM user in the account.
68-
[Create an AWS access key and secret access key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey).
69-
70-
<iframe
71-
width="560"
72-
height="315"
73-
src="https://www.youtube.com/embed/MoFTaGJE65Q"
74-
title="YouTube video player"
75-
frameborder="0"
76-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
77-
allowfullscreen
78-
></iframe>
79-
80-
- For authenticated access in untrusted environments or enhanced security scenarios, an AWS STS session token for temporary access, in addition to an AWS access key and secret access key. [Create a session token](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken).
81-
82-
<iframe
83-
width="560"
84-
height="315"
85-
src="https://www.youtube.com/embed/4_csSXc_GNU"
86-
title="YouTube video player"
87-
frameborder="0"
88-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
89-
allowfullscreen
90-
></iframe>
50+
After blocking all public access to the bucket, for read access, the authenticated AWS IAM user must have at minimum the permissions of `s3:ListBucket` and `s3:GetObject` for that bucket.
51+
For write access, the authenticated AWS IAM user must have at minimum the permission of `s3:PutObject` for that bucket. Permissions
52+
can be granted in one of the following ways:
53+
54+
- Attach the appropriate bucket policy to the bucket. See the policy examples later on this page, and [learn about bucket policies for S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html). These permissions remain in effect until the bucket policy is removed from the bucket.
55+
To apply a bucket policy by using the S3 console, follow the steps [in the S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/add-bucket-policy.html) or in the following video.
56+
Additional approaches that use AWS CloudFormation or the AWS CLI are in the how-to sections later on this page.
57+
58+
<iframe
59+
width="560"
60+
height="315"
61+
src="https://www.youtube.com/embed/y4SfQoJpipo"
62+
title="YouTube video player"
63+
frameborder="0"
64+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
65+
allowfullscreen
66+
></iframe>
67+
68+
- Have the IAM user temporarily assume an IAM role that contains the appropriate user policy. See the policy examples later on this page, and [learn about user policies for S3](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html). These permission remain in effect until the assumed role's time period expires.
69+
Learn how to use the IAM console to [create a policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html),
70+
[create a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html) that references this policy, and then
71+
[have the user temporarily assume the role by using the AWS CLI or an AWS SDK](https://docs.aws.amazon.com/code-library/latest/ug/sts_example_sts_AssumeRole_section.html), which produces
72+
a temporary AWS access key (`AccessKeyId`), AWS secret access key (`SecretAccessKey`), and AWS STS session token (`SessionToken`).
73+
74+
<Warning>
75+
AWS STS credentials (consisting of an AWS access key, AWS secret access key, and AWS STS session token) can be valid for as little as 15 minutes or as long as 36 hours, depending on how the credentials were initially
76+
generated. After the expiry time, the credentials are no longer valid and will no longer work with the corresponding S3 connector.
77+
You must get a new set of credentials to replace the expired ones by [having the user temporarily assume the role again by using the AWS CLI or an AWS SDK](https://docs.aws.amazon.com/code-library/latest/ug/sts_example_sts_AssumeRole_section.html), which produces
78+
a new, refreshed temporary AWS access key, AWS secret access key, and AWS STS session token.
9179

92-
<Warning>
93-
AWS STS credentials can be valid for as little as 15 minutes or as long as 36 hours, depending on how the credentials were initially
94-
generated. After the expiry time, the credentials are no longer valid will no longer work with the corresponding S3 connector.
95-
You must get a new set of credentials to replace the expired ones by calling
96-
[GetSessionToken](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html) in the AWS STS API.
9780
To overwrite the expired credentials with the new set:
9881

9982
- For the Unstructured user interface (UI), manually update the AWS Key, AWS Secret Key, and STS Token fields in the Unstructured UI
@@ -105,10 +88,22 @@ requirements. For more information about requirements, see the following:
10588
[destination](/api-reference/workflow/destinations/s3) connector.
10689
- For Unstructured Ingest, change the values of `--key`, `--secret`, and `--token` (CLI) or `key`, `secret`, and `token` (Python) in your command or code for the
10790
corresponding S3 [source](/open-source/ingestion/source-connectors/s3) or [destination](/open-source/ingestion/destination-connectors/s3) connector.
91+
</Warning>
10892

109-
</Warning>
110-
111-
- If the target files are in the root of the bucket, the path to the bucket, formatted as `protocol://bucket/` (for example, `s3://my-bucket/`).
93+
- If you used a bucket policy intead of having the IAM user temporarily assume an IAM role for authenticated bucket access, you must provide a long-term AWS access key and secret access key for the authenticated AWS IAM user in the account.
94+
Create an AWS access key and secret access key by following the steps [in the IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) or in the following video.
95+
96+
<iframe
97+
width="560"
98+
height="315"
99+
src="https://www.youtube.com/embed/MoFTaGJE65Q"
100+
title="YouTube video player"
101+
frameborder="0"
102+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
103+
allowfullscreen
104+
></iframe>
105+
106+
- If the target files are in the root of the bucket, you will need the path to the bucket, formatted as `protocol://bucket/` (for example, `s3://my-bucket/`).
112107
If the target files are in a folder, the path to the target folder in the S3 bucket, formatted as `protocol://bucket/path/to/folder/` (for example, `s3://my-bucket/my-folder/`).
113108
- If the target files are in a folder, and authenticated bucket access is enabled, make sure the authenticated AWS IAM user has
114-
authenticated access to the folder as well. [Enable authenticated folder access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-folders).
109+
authenticated access to the folder as well. [See examples of authenticated folder access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-folders).

ui/destinations/delta-table.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import DeltaTablePrerequisites from '/snippets/general-shared-text/delta-table.m
2020

2121
<DeltaTablePrerequisites />
2222

23+
## Create the destination connector
24+
2325
To create the destination connector:
2426

2527
1. On the sidebar, click **Connectors**.

0 commit comments

Comments
 (0)