Class CfnPermissions

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:58.395Z") @Stability(Stable) public class CfnPermissions extends CfnResource implements IInspectable
A CloudFormation AWS::LakeFormation::Permissions.

The AWS::LakeFormation::Permissions resource represents the permissions that a principal has on an AWS Glue Data Catalog resource (such as AWS Glue database or AWS Glue tables). When you upload a permissions stack, the permissions are granted to the principal and when you remove the stack, the permissions are revoked from the principal. If you remove a stack, and the principal does not have the permissions referenced in the stack then AWS Lake Formation will throw an error because you can’t call revoke on non-existing permissions. To successfully remove the stack, you’ll need to regrant those permissions and then remove the stack.

New versions of AWS Lake Formation permission resources are now available. For more information, see: AWS:LakeFormation::PrincipalPermissions

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lakeformation.*;
 CfnPermissions cfnPermissions = CfnPermissions.Builder.create(this, "MyCfnPermissions")
         .dataLakePrincipal(DataLakePrincipalProperty.builder()
                 .dataLakePrincipalIdentifier("dataLakePrincipalIdentifier")
                 .build())
         .resource(ResourceProperty.builder()
                 .databaseResource(DatabaseResourceProperty.builder()
                         .catalogId("catalogId")
                         .name("name")
                         .build())
                 .dataLocationResource(DataLocationResourceProperty.builder()
                         .catalogId("catalogId")
                         .s3Resource("s3Resource")
                         .build())
                 .tableResource(TableResourceProperty.builder()
                         .catalogId("catalogId")
                         .databaseName("databaseName")
                         .name("name")
                         .tableWildcard(TableWildcardProperty.builder().build())
                         .build())
                 .tableWithColumnsResource(TableWithColumnsResourceProperty.builder()
                         .catalogId("catalogId")
                         .columnNames(List.of("columnNames"))
                         .columnWildcard(ColumnWildcardProperty.builder()
                                 .excludedColumnNames(List.of("excludedColumnNames"))
                                 .build())
                         .databaseName("databaseName")
                         .name("name")
                         .build())
                 .build())
         // the properties below are optional
         .permissions(List.of("permissions"))
         .permissionsWithGrantOption(List.of("permissionsWithGrantOption"))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnPermissions

      protected CfnPermissions(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnPermissions

      protected CfnPermissions(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnPermissions

      @Stability(Stable) public CfnPermissions(@NotNull Construct scope, @NotNull String id, @NotNull CfnPermissionsProps props)
      Create a new AWS::LakeFormation::Permissions.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getDataLakePrincipal

      @Stability(Stable) @NotNull public Object getDataLakePrincipal()
      The AWS Lake Formation principal.
    • setDataLakePrincipal

      @Stability(Stable) public void setDataLakePrincipal(@NotNull IResolvable value)
      The AWS Lake Formation principal.
    • setDataLakePrincipal

      @Stability(Stable) public void setDataLakePrincipal(@NotNull CfnPermissions.DataLakePrincipalProperty value)
      The AWS Lake Formation principal.
    • getResource

      @Stability(Stable) @NotNull public Object getResource()
      A structure for the resource.
    • setResource

      @Stability(Stable) public void setResource(@NotNull IResolvable value)
      A structure for the resource.
    • setResource

      @Stability(Stable) public void setResource(@NotNull CfnPermissions.ResourceProperty value)
      A structure for the resource.
    • getPermissions

      @Stability(Stable) @Nullable public List<String> getPermissions()
      The permissions granted or revoked.
    • setPermissions

      @Stability(Stable) public void setPermissions(@Nullable List<String> value)
      The permissions granted or revoked.
    • getPermissionsWithGrantOption

      @Stability(Stable) @Nullable public List<String> getPermissionsWithGrantOption()
      Indicates the ability to grant permissions (as a subset of permissions granted).
    • setPermissionsWithGrantOption

      @Stability(Stable) public void setPermissionsWithGrantOption(@Nullable List<String> value)
      Indicates the ability to grant permissions (as a subset of permissions granted).