Skip to content
GitHubXDiscord

Resource

The Resource resource allows you to manage AWS LakeFormation Resources for data lake management and governance, enabling fine-grained access control.

Create a basic LakeFormation resource with required properties:

import AWS from "alchemy/aws/control";
const lakeFormationResource = await AWS.LakeFormation.Resource("basicLakeFormationResource", {
ResourceArn: "arn:aws:s3:::my-data-lake",
UseServiceLinkedRole: true
});

Configure a LakeFormation resource with additional optional settings, such as federation and hybrid access:

const advancedLakeFormationResource = await AWS.LakeFormation.Resource("advancedLakeFormationResource", {
ResourceArn: "arn:aws:s3:::my-data-lake",
UseServiceLinkedRole: true,
WithFederation: true,
HybridAccessEnabled: true,
RoleArn: "arn:aws:iam::123456789012:role/LakeFormationRole"
});

Adopt an existing LakeFormation resource instead of failing when the resource already exists:

const adoptExistingResource = await AWS.LakeFormation.Resource("adoptExistingResource", {
ResourceArn: "arn:aws:s3:::my-existing-data-lake",
UseServiceLinkedRole: false,
adopt: true
});

Create a LakeFormation resource with hybrid access enabled for cross-account data sharing:

const hybridAccessResource = await AWS.LakeFormation.Resource("hybridAccessResource", {
ResourceArn: "arn:aws:s3:::my-hybrid-data-lake",
UseServiceLinkedRole: true,
HybridAccessEnabled: true,
RoleArn: "arn:aws:iam::123456789012:role/HybirdAccessRole"
});