Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

Loading...

CfnCrawler

A CloudFormation AWS::Glue::Crawler.

The AWS::Glue::Crawler resource specifies an AWS Glue crawler. For more information, see Cataloging Tables with a Crawler and Crawler Structure in the AWS Glue Developer Guide .

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as glue from '@aws-cdk/aws-glue';
declare const tags: any;
const cfnCrawler = new glue.CfnCrawler(this, 'MyCfnCrawler', {
role: 'role',
targets: {
catalogTargets: [{
databaseName: 'databaseName',
tables: ['tables'],
}],
dynamoDbTargets: [{
path: 'path',
}],
jdbcTargets: [{
connectionName: 'connectionName',
exclusions: ['exclusions'],
path: 'path',
}],
mongoDbTargets: [{
connectionName: 'connectionName',
path: 'path',
}],
s3Targets: [{
connectionName: 'connectionName',
dlqEventQueueArn: 'dlqEventQueueArn',
eventQueueArn: 'eventQueueArn',
exclusions: ['exclusions'],
path: 'path',
sampleSize: 123,
}],
},
// the properties below are optional
classifiers: ['classifiers'],
configuration: 'configuration',
crawlerSecurityConfiguration: 'crawlerSecurityConfiguration',
databaseName: 'databaseName',
description: 'description',
name: 'name',
recrawlPolicy: {
recrawlBehavior: 'recrawlBehavior',
},
schedule: {
scheduleExpression: 'scheduleExpression',
},
schemaChangePolicy: {
deleteBehavior: 'deleteBehavior',
updateBehavior: 'updateBehavior',
},
tablePrefix: 'tablePrefix',
tags: tags,
});

Initializers

import { CfnCrawler } from '@aws-cdk/aws-glue'
new CfnCrawler(scope: Construct, id: string, props: CfnCrawlerProps)
NameTypeDescription
scopeConstruct- scope in which this resource is defined.
idstring- scoped id of the resource.
propsCfnCrawlerProps- resource properties.
scopeRequired

scope in which this resource is defined.

idRequired
  • Type: string

scoped id of the resource.

propsRequired

resource properties.

Methods

NameDescription
toStringReturns a string representation of this construct.
overrideLogicalIdOverrides the auto-generated logical ID with a specific ID.
addDeletionOverrideSyntactic sugar for addOverride(path, undefined).
addDependsOnIndicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadataAdd a value to the CloudFormation Resource Metadata.
addOverrideAdds an override to the synthesized CloudFormation resource.
addPropertyDeletionOverrideAdds an override that deletes the value of a property from the resource definition.
addPropertyOverrideAdds an override to a resource property.
applyRemovalPolicySets the deletion policy of the resource based on the removal policy specified.
getAttReturns a token for an runtime attribute of this resource.
getMetadataRetrieve a value value from the CloudFormation Resource Metadata.
inspectExamines the CloudFormation resource and discloses attributes.
toString
public toString(): string

Returns a string representation of this construct.

overrideLogicalId
public overrideLogicalId(newLogicalId: string): void

Overrides the auto-generated logical ID with a specific ID.

newLogicalIdRequired
  • Type: string

The new logical ID to use for this stack element.

addDeletionOverride
public addDeletionOverride(path: string): void

Syntactic sugar for addOverride(path, undefined).

pathRequired
  • Type: string

The path of the value to delete.

addDependsOn
public addDependsOn(target: CfnResource): void

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

targetRequired
addMetadata
public addMetadata(key: string, value: any): void

Add a value to the CloudFormation Resource Metadata.

[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)

keyRequired
  • Type: string
valueRequired
  • Type: any
addOverride
public addOverride(path: string, value: any): void

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

pathRequired
  • Type: string

The path of the property, you can use dot notation to override values in complex types.

Any intermdediate keys will be created as needed.

valueRequired
  • Type: any

The value.

Could be primitive or complex.

addPropertyDeletionOverride
public addPropertyDeletionOverride(propertyPath: string): void

Adds an override that deletes the value of a property from the resource definition.

propertyPathRequired
  • Type: string

The path to the property.

addPropertyOverride
public addPropertyOverride(propertyPath: string, value: any): void

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

propertyPathRequired
  • Type: string

The path of the property.

valueRequired
  • Type: any

The value.

applyRemovalPolicy
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void

Sets the deletion policy of the resource based on the removal policy specified.

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).

policyOptional
optionsOptional
getAtt
public getAtt(attributeName: string): Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

attributeNameRequired
  • Type: string

The name of the attribute.

getMetadata
public getMetadata(key: string): any

Retrieve a value value from the CloudFormation Resource Metadata.

[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)

keyRequired
  • Type: string
inspect
public inspect(inspector: TreeInspector): void

Examines the CloudFormation resource and discloses attributes.

inspectorRequired

tree inspector to collect and process attributes.

Static Functions

NameDescription
isConstructReturn whether the given object is a Construct.
isCfnElementReturns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).
isCfnResourceCheck whether the given construct is a CfnResource.
isConstruct
import { CfnCrawler } from '@aws-cdk/aws-glue'
CfnCrawler.isConstruct(x: any)

Return whether the given object is a Construct.

xRequired
  • Type: any
isCfnElement
import { CfnCrawler } from '@aws-cdk/aws-glue'
CfnCrawler.isCfnElement(x: any)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

xRequired
  • Type: any
isCfnResource
import { CfnCrawler } from '@aws-cdk/aws-glue'
CfnCrawler.isCfnResource(construct: IConstruct)

Check whether the given construct is a CfnResource.

constructRequired

Properties

NameTypeDescription
nodeConstructNodeThe construct tree node associated with this construct.
creationStackstring[]No description.
logicalIdstringThe logical ID for this CloudFormation stack element.
stackStackThe stack in which this element is defined.
refstringReturn a string that will be resolved to a CloudFormation { Ref } for this element.
cfnOptionsICfnResourceOptionsOptions for this resource, such as condition, update policy etc.
cfnResourceTypestringAWS resource type.
tagsTagManagerThe tags to use with this crawler.
rolestringThe Amazon Resource Name (ARN) of an IAM role that's used to access customer resources, such as Amazon Simple Storage Service (Amazon S3) data.
targetsIResolvable | TargetsPropertyA collection of targets to crawl.
classifiersstring[]A list of UTF-8 strings that specify the names of custom classifiers that are associated with the crawler.
configurationstringCrawler configuration information.
crawlerSecurityConfigurationstringThe name of the SecurityConfiguration structure to be used by this crawler.
databaseNamestringThe name of the database in which the crawler's output is stored.
descriptionstringA description of the crawler.
namestringThe name of the crawler.
recrawlPolicyIResolvable | RecrawlPolicyPropertyA policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.
scheduleIResolvable | SchedulePropertyFor scheduled crawlers, the schedule when the crawler runs.
schemaChangePolicyIResolvable | SchemaChangePolicyPropertyThe policy that specifies update and delete behaviors for the crawler.
tablePrefixstringThe prefix added to the names of tables that are created.
nodeRequired
public readonly node: ConstructNode;

The construct tree node associated with this construct.

creationStackRequired
public readonly creationStack: string[];
  • Type: string[]
logicalIdRequired
public readonly logicalId: string;
  • Type: string

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

stackRequired
public readonly stack: Stack;

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

refRequired
public readonly ref: string;
  • Type: string

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

cfnOptionsRequired
public readonly cfnOptions: ICfnResourceOptions;

Options for this resource, such as condition, update policy etc.

cfnResourceTypeRequired
public readonly cfnResourceType: string;
  • Type: string

AWS resource type.

tagsRequired
public readonly tags: TagManager;

The tags to use with this crawler.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-tags

roleRequired
public readonly role: string;
  • Type: string

The Amazon Resource Name (ARN) of an IAM role that's used to access customer resources, such as Amazon Simple Storage Service (Amazon S3) data.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-role

targetsRequired
public readonly targets: IResolvable | TargetsProperty;

A collection of targets to crawl.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-targets

classifiersOptional
public readonly classifiers: string[];
  • Type: string[]

A list of UTF-8 strings that specify the names of custom classifiers that are associated with the crawler.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-classifiers

configurationOptional
public readonly configuration: string;
  • Type: string

Crawler configuration information.

This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see Configuring a Crawler .

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-configuration

crawlerSecurityConfigurationOptional
public readonly crawlerSecurityConfiguration: string;
  • Type: string

The name of the SecurityConfiguration structure to be used by this crawler.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-crawlersecurityconfiguration

databaseNameOptional
public readonly databaseName: string;
  • Type: string

The name of the database in which the crawler's output is stored.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-databasename

descriptionOptional
public readonly description: string;
  • Type: string

A description of the crawler.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-description

nameOptional
public readonly name: string;
  • Type: string

The name of the crawler.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-name

recrawlPolicyOptional
public readonly recrawlPolicy: IResolvable | RecrawlPolicyProperty;

A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-recrawlpolicy

scheduleOptional
public readonly schedule: IResolvable | ScheduleProperty;

For scheduled crawlers, the schedule when the crawler runs.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-schedule

schemaChangePolicyOptional
public readonly schemaChangePolicy: IResolvable | SchemaChangePolicyProperty;

The policy that specifies update and delete behaviors for the crawler.

The policy tells the crawler what to do in the event that it detects a change in a table that already exists in the customer's database at the time of the crawl. The SchemaChangePolicy does not affect whether or how new tables and partitions are added. New tables and partitions are always created regardless of the SchemaChangePolicy on a crawler.

The SchemaChangePolicy consists of two components, UpdateBehavior and DeleteBehavior .

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-schemachangepolicy

tablePrefixOptional
public readonly tablePrefix: string;
  • Type: string

The prefix added to the names of tables that are created.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-crawler.html#cfn-glue-crawler-tableprefix

Constants

NameTypeDescription
CFN_RESOURCE_TYPE_NAMEstringThe CloudFormation resource type name for this resource class.
CFN_RESOURCE_TYPE_NAMERequired
public readonly CFN_RESOURCE_TYPE_NAME: string;
  • Type: string

The CloudFormation resource type name for this resource class.