Catalog

class aws_cdk.aws_glue_alpha.Catalog(scope, id, *, catalog_name, description=None, connection_password_encryption=None, encryption_at_rest=None)

Bases: CatalogBase

(experimental) A Glue Data Catalog.

Use Catalog.forAccount(scope) to obtain the implicit account-wide catalog, Catalog.encryptAccount(scope, options) to configure its Data Catalog encryption, or new Catalog(...) to create an AWS::Glue::Catalog resource.

Stability:

experimental

ExampleMetadata:

infused

Example:

# key: kms.Key

glue.Catalog.encrypt_account(self,
    encryption_at_rest=glue.DataCatalogEncryptionAtRest.kms(key)
)
Parameters:
  • scope (Construct)

  • id (str)

  • catalog_name (str) – (experimental) The name of the catalog.

  • description (Optional[str]) – (experimental) A description of the catalog. Default: - no description

  • connection_password_encryption (Union[ConnectionPasswordEncryption, Dict[str, Any], None]) – (experimental) Connection-password encryption configuration for the catalog. Default: - connection-password encryption is not managed by CDK

  • encryption_at_rest (Optional[DataCatalogEncryptionAtRest]) – (experimental) Encryption-at-rest configuration for the catalog. Default: - encryption at rest is not managed by CDK (the catalog default applies)

Stability:

experimental

Methods

apply_cross_stack_reference_strength(strength)

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the “deadly embrace” problem without changing the app-wide default.

Parameters:

strength (ReferenceStrength) –

  • The reference strength to use for this resource.

Return type:

None

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy)

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

with_(*mixins)

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

mixins (IMixin)

Return type:

IConstruct

Attributes

PROPERTY_INJECTION_ID = '@aws-cdk.aws-glue-alpha.Catalog'
catalog_arn

(experimental) The ARN of the catalog.

Stability:

experimental

catalog_id

(experimental) The id of the catalog (for the account-wide catalog, the AWS account id).

Stability:

experimental

catalog_ref

(experimental) A reference to a Catalog resource.

Stability:

experimental

connection_password_key

(experimental) The customer-managed KMS key used to encrypt connection passwords, if one was configured.

Undefined when password encryption uses an AWS-managed key or is not configured. Grant access to it via KeyGrants, e.g. if (catalog.connectionPasswordKey) { KeyGrants.fromKey(catalog.connectionPasswordKey).encrypt(grantee); }.

Stability:

experimental

encryption_key

(experimental) The customer-managed KMS key used for the catalog’s encryption at rest, if one was configured.

Undefined when encryption is disabled or an AWS-managed key is used. Grant access to it via KeyGrants, e.g. if (catalog.encryptionKey) { KeyGrants.fromKey(catalog.encryptionKey).encrypt(grantee); }.

Stability:

experimental

env

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

node

The tree node.

stack

The stack in which this resource is defined.

Static Methods

classmethod encrypt_account(scope, *, connection_password_encryption=None, encryption_at_rest=None)

(experimental) Configure Data Catalog encryption for the implicit, account-wide catalog and return it.

The account catalog’s encryption is an account/region-wide setting, managed through the singleton PutDataCatalogEncryptionSettings API. Because encryption is fixed at construction, it must be configured before the account catalog is first used in the stack: calling this after the account catalog has already been materialized (for example by Catalog.forAccount, or by a Database that uses the account catalog) throws.

Configure it in exactly one stack. Configuring it from multiple stacks in the same account and region makes those stacks overwrite one another at deploy time, and the result is order-dependent. Unlike duplicate settings within a single stack (which CloudFormation rejects), this cross-stack conflict is not caught at synthesis time, because each stack synthesizes to its own template.

Parameters:
  • scope (Construct)

  • connection_password_encryption (Union[ConnectionPasswordEncryption, Dict[str, Any], None]) – (experimental) Connection-password encryption configuration for the catalog. Default: - connection-password encryption is not managed by CDK

  • encryption_at_rest (Optional[DataCatalogEncryptionAtRest]) – (experimental) Encryption-at-rest configuration for the catalog. Default: - encryption at rest is not managed by CDK (the catalog default applies)

Stability:

experimental

Return type:

ICatalog

classmethod for_account(scope)

(experimental) Obtain the implicit, account-wide Data Catalog.

The account catalog is not a CloudFormation resource; it always exists. This returns a stack-scoped singleton, so repeated calls within the same stack return the same instance.

This returns the account catalog without managing its encryption. To configure Data Catalog encryption for the account, use Catalog.encryptAccount(scope, options) instead - it must be called before the account catalog is first used in the stack.

Parameters:

scope (Construct)

Stability:

experimental

Return type:

ICatalog

classmethod from_catalog_arn(scope, id, catalog_arn)

(experimental) Import an existing catalog by its ARN.

The ARN must be a Glue catalog ARN, either the account-wide catalog (arn:aws:glue:<region>:<account>:catalog, whose id is the account) or a named catalog (arn:aws:glue:<region>:<account>:catalog/<name>, whose id is the name).

The imported catalog is a pure identity handle and does not manage the catalog’s encryption. To manage an existing catalog’s Data Catalog encryption, add a CfnDataCatalogEncryptionSettings resource targeting its id.

Parameters:
  • scope (Construct)

  • id (str)

  • catalog_arn (str)

Stability:

experimental

Return type:

ICatalog

classmethod from_catalog_id(scope, id, catalog_id)

(experimental) Import an existing catalog by its id.

The imported catalog is a pure identity handle and does not manage the catalog’s encryption. To manage an existing catalog’s Data Catalog encryption, add a CfnDataCatalogEncryptionSettings resource targeting its id.

Parameters:
  • scope (Construct)

  • id (str)

  • catalog_id (str)

Stability:

experimental

Return type:

ICatalog

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod is_owned_resource(construct)

Returns true if the construct was created by CDK, and false otherwise.

Parameters:

construct (IConstruct)

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct)

Return type:

bool