Step 1: Provision your resources using Amazon CloudFormation templates
The CloudFormation template for the producer account generates the following resources:
An Amazon S3 bucket to serve as the data lake.
A Lambda function (for Lambda-backed Amazon CloudFormation custom resources). We use the function to copy sample data files from the public Amazon S3 bucket to your Amazon S3 bucket.
IAM users and policies: DataLakeAdminProducer.
The appropriate Lake Formation settings and permissions including:
Defining the Lake Formation data lake administrator in the producer account
Registering an Amazon S3 bucket as the Lake Formation data lake location (producer account)
An Amazon Glue Data Catalog database, table, and partition. Since there are two options for sharing resources across Amazon Web Services accounts, this template creates two separate sets of database and table.
The Amazon CloudFormation template for the consumer account generates the following resources:
IAM users and policies:
DataLakeAdminConsumer
DataAnalyst
-
An Amazon Glue Data Catalog database. This database is for creating resource links to shared resources.
Create your resources in the producer account
Sign into the Amazon CloudFormation console at https://console.amazonaws.cn/cloudformation
in the US East (N. Virginia) region. Choose Launch Stack
. -
Choose Next.
For Stack name, enter a stack name, such as
stack-producer
.-
In the User Configuration section, enter user name and password for
ProducerDatalakeAdminUserName
andProducerDatalakeAdminUserPassword
. -
For DataLakeBucketName, enter the name of your data lake bucket. This name needs to be globally unique.
-
For DatabaseName and TableName, leave the default values.
-
Choose Next.
-
On the next page, choose Next.
Review the details on the final page and select I acknowledge that Amazon CloudFormation might create IAM resources.
Choose Create.
The stack creation can take up to one minute.
Create your resources in the consumer account
Sign into the Amazon CloudFormation console at https://console.amazonaws.cn/cloudformation
in the US East (N. Virginia) region. Choose Launch Stack
. -
Choose Next.
For Stack name, enter a stack name, such as
stack-consumer
.-
In the User Configuration section, enter user name and password for
ConsumerDatalakeAdminUserName
andConsumerDatalakeAdminUserPassword
. For
DataAnalystUserName
andDataAnalystUserPassword
, enter the user name and password you want for the data analyst IAM user.-
For DataLakeBucketName, enter the name of your data lake bucket. This name needs to be globally unique.
-
For DatabaseName, leave the default values.
For
AthenaQueryResultS3BucketName
, enter the name of the Amazon S3 bucket that stores Amazon Athena query results. If you don’t have one, create an Amazon S3 bucket. -
Choose Next.
-
On the next page, choose Next.
Review the details on the final page and select I acknowledge that Amazon CloudFormation might create IAM resources.
Choose Create.
The stack creation can take up to one minutes.
Note
After completing the tutorial, delete the stack in Amazon CloudFormation to avoid incurring charges. Verify that the resources are successfully deleted in the event status for the stack.