Skip to content
v2.274.0

CfnCrawler L1 construct ​

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 .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';

declare const tags: any;
const cfnCrawler = new glue.CfnCrawler(this, 'MyCfnCrawler', {
  role: 'role',
  targets: {
    catalogTargets: [{
      connectionName: 'connectionName',
      databaseName: 'databaseName',
      dlqEventQueueArn: 'dlqEventQueueArn',
      eventQueueArn: 'eventQueueArn',
      tables: ['tables'],
    }],
    deltaTargets: [{
      connectionName: 'connectionName',
      createNativeDeltaTable: false,
      deltaTables: ['deltaTables'],
      writeManifest: false,
    }],
    dynamoDbTargets: [{
      path: 'path',
      scanAll: false,
      scanRate: 123,
    }],
    hudiTargets: [{
      connectionName: 'connectionName',
      exclusions: ['exclusions'],
      maximumTraversalDepth: 123,
      paths: ['paths'],
    }],
    icebergTargets: [{
      connectionName: 'connectionName',
      exclusions: ['exclusions'],
      maximumTraversalDepth: 123,
      paths: ['paths'],
    }],
    jdbcTargets: [{
      connectionName: 'connectionName',
      enableAdditionalMetadata: ['enableAdditionalMetadata'],
      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',
  lakeFormationConfiguration: {
    accountId: 'accountId',
    useLakeFormationCredentials: false,
  },
  name: 'name',
  recrawlPolicy: {
    recrawlBehavior: 'recrawlBehavior',
  },
  schedule: {
    scheduleExpression: 'scheduleExpression',
  },
  schemaChangePolicy: {
    deleteBehavior: 'deleteBehavior',
    updateBehavior: 'updateBehavior',
  },
  tablePrefix: 'tablePrefix',
  tags: tags,
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_glue as glue

# tags: Any

cfn_crawler = glue.CfnCrawler(self, "MyCfnCrawler",
    role="role",
    targets=glue.CfnCrawler.TargetsProperty(
        catalog_targets=[glue.CfnCrawler.CatalogTargetProperty(
            connection_name="connectionName",
            database_name="databaseName",
            dlq_event_queue_arn="dlqEventQueueArn",
            event_queue_arn="eventQueueArn",
            tables=["tables"]
        )],
        delta_targets=[glue.CfnCrawler.DeltaTargetProperty(
            connection_name="connectionName",
            create_native_delta_table=False,
            delta_tables=["deltaTables"],
            write_manifest=False
        )],
        dynamo_db_targets=[glue.CfnCrawler.DynamoDBTargetProperty(
            path="path",
            scan_all=False,
            scan_rate=123
        )],
        hudi_targets=[glue.CfnCrawler.HudiTargetProperty(
            connection_name="connectionName",
            exclusions=["exclusions"],
            maximum_traversal_depth=123,
            paths=["paths"]
        )],
        iceberg_targets=[glue.CfnCrawler.IcebergTargetProperty(
            connection_name="connectionName",
            exclusions=["exclusions"],
            maximum_traversal_depth=123,
            paths=["paths"]
        )],
        jdbc_targets=[glue.CfnCrawler.JdbcTargetProperty(
            connection_name="connectionName",
            enable_additional_metadata=["enableAdditionalMetadata"],
            exclusions=["exclusions"],
            path="path"
        )],
        mongo_db_targets=[glue.CfnCrawler.MongoDBTargetProperty(
            connection_name="connectionName",
            path="path"
        )],
        s3_targets=[glue.CfnCrawler.S3TargetProperty(
            connection_name="connectionName",
            dlq_event_queue_arn="dlqEventQueueArn",
            event_queue_arn="eventQueueArn",
            exclusions=["exclusions"],
            path="path",
            sample_size=123
        )]
    ),

    # the properties below are optional
    classifiers=["classifiers"],
    configuration="configuration",
    crawler_security_configuration="crawlerSecurityConfiguration",
    database_name="databaseName",
    description="description",
    lake_formation_configuration=glue.CfnCrawler.LakeFormationConfigurationProperty(
        account_id="accountId",
        use_lake_formation_credentials=False
    ),
    name="name",
    recrawl_policy=glue.CfnCrawler.RecrawlPolicyProperty(
        recrawl_behavior="recrawlBehavior"
    ),
    schedule=glue.CfnCrawler.ScheduleProperty(
        schedule_expression="scheduleExpression"
    ),
    schema_change_policy=glue.CfnCrawler.SchemaChangePolicyProperty(
        delete_behavior="deleteBehavior",
        update_behavior="updateBehavior"
    ),
    table_prefix="tablePrefix",
    tags=tags
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.glue.*;

Object tags;

CfnCrawler cfnCrawler = CfnCrawler.Builder.create(this, "MyCfnCrawler")
        .role("role")
        .targets(TargetsProperty.builder()
                .catalogTargets(List.of(CatalogTargetProperty.builder()
                        .connectionName("connectionName")
                        .databaseName("databaseName")
                        .dlqEventQueueArn("dlqEventQueueArn")
                        .eventQueueArn("eventQueueArn")
                        .tables(List.of("tables"))
                        .build()))
                .deltaTargets(List.of(DeltaTargetProperty.builder()
                        .connectionName("connectionName")
                        .createNativeDeltaTable(false)
                        .deltaTables(List.of("deltaTables"))
                        .writeManifest(false)
                        .build()))
                .dynamoDbTargets(List.of(DynamoDBTargetProperty.builder()
                        .path("path")
                        .scanAll(false)
                        .scanRate(123)
                        .build()))
                .hudiTargets(List.of(HudiTargetProperty.builder()
                        .connectionName("connectionName")
                        .exclusions(List.of("exclusions"))
                        .maximumTraversalDepth(123)
                        .paths(List.of("paths"))
                        .build()))
                .icebergTargets(List.of(IcebergTargetProperty.builder()
                        .connectionName("connectionName")
                        .exclusions(List.of("exclusions"))
                        .maximumTraversalDepth(123)
                        .paths(List.of("paths"))
                        .build()))
                .jdbcTargets(List.of(JdbcTargetProperty.builder()
                        .connectionName("connectionName")
                        .enableAdditionalMetadata(List.of("enableAdditionalMetadata"))
                        .exclusions(List.of("exclusions"))
                        .path("path")
                        .build()))
                .mongoDbTargets(List.of(MongoDBTargetProperty.builder()
                        .connectionName("connectionName")
                        .path("path")
                        .build()))
                .s3Targets(List.of(S3TargetProperty.builder()
                        .connectionName("connectionName")
                        .dlqEventQueueArn("dlqEventQueueArn")
                        .eventQueueArn("eventQueueArn")
                        .exclusions(List.of("exclusions"))
                        .path("path")
                        .sampleSize(123)
                        .build()))
                .build())

        // the properties below are optional
        .classifiers(List.of("classifiers"))
        .configuration("configuration")
        .crawlerSecurityConfiguration("crawlerSecurityConfiguration")
        .databaseName("databaseName")
        .description("description")
        .lakeFormationConfiguration(LakeFormationConfigurationProperty.builder()
                .accountId("accountId")
                .useLakeFormationCredentials(false)
                .build())
        .name("name")
        .recrawlPolicy(RecrawlPolicyProperty.builder()
                .recrawlBehavior("recrawlBehavior")
                .build())
        .schedule(ScheduleProperty.builder()
                .scheduleExpression("scheduleExpression")
                .build())
        .schemaChangePolicy(SchemaChangePolicyProperty.builder()
                .deleteBehavior("deleteBehavior")
                .updateBehavior("updateBehavior")
                .build())
        .tablePrefix("tablePrefix")
        .tags(tags)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue;

var tags;

var cfnCrawler = new CfnCrawler(this, "MyCfnCrawler", new CfnCrawlerProps {
    Role = "role",
    Targets = new TargetsProperty {
        CatalogTargets = new [] { new CatalogTargetProperty {
            ConnectionName = "connectionName",
            DatabaseName = "databaseName",
            DlqEventQueueArn = "dlqEventQueueArn",
            EventQueueArn = "eventQueueArn",
            Tables = new [] { "tables" }
        } },
        DeltaTargets = new [] { new DeltaTargetProperty {
            ConnectionName = "connectionName",
            CreateNativeDeltaTable = false,
            DeltaTables = new [] { "deltaTables" },
            WriteManifest = false
        } },
        DynamoDbTargets = new [] { new DynamoDBTargetProperty {
            Path = "path",
            ScanAll = false,
            ScanRate = 123
        } },
        HudiTargets = new [] { new HudiTargetProperty {
            ConnectionName = "connectionName",
            Exclusions = new [] { "exclusions" },
            MaximumTraversalDepth = 123,
            Paths = new [] { "paths" }
        } },
        IcebergTargets = new [] { new IcebergTargetProperty {
            ConnectionName = "connectionName",
            Exclusions = new [] { "exclusions" },
            MaximumTraversalDepth = 123,
            Paths = new [] { "paths" }
        } },
        JdbcTargets = new [] { new JdbcTargetProperty {
            ConnectionName = "connectionName",
            EnableAdditionalMetadata = new [] { "enableAdditionalMetadata" },
            Exclusions = new [] { "exclusions" },
            Path = "path"
        } },
        MongoDbTargets = new [] { new MongoDBTargetProperty {
            ConnectionName = "connectionName",
            Path = "path"
        } },
        S3Targets = new [] { new S3TargetProperty {
            ConnectionName = "connectionName",
            DlqEventQueueArn = "dlqEventQueueArn",
            EventQueueArn = "eventQueueArn",
            Exclusions = new [] { "exclusions" },
            Path = "path",
            SampleSize = 123
        } }
    },

    // the properties below are optional
    Classifiers = new [] { "classifiers" },
    Configuration = "configuration",
    CrawlerSecurityConfiguration = "crawlerSecurityConfiguration",
    DatabaseName = "databaseName",
    Description = "description",
    LakeFormationConfiguration = new LakeFormationConfigurationProperty {
        AccountId = "accountId",
        UseLakeFormationCredentials = false
    },
    Name = "name",
    RecrawlPolicy = new RecrawlPolicyProperty {
        RecrawlBehavior = "recrawlBehavior"
    },
    Schedule = new ScheduleProperty {
        ScheduleExpression = "scheduleExpression"
    },
    SchemaChangePolicy = new SchemaChangePolicyProperty {
        DeleteBehavior = "deleteBehavior",
        UpdateBehavior = "updateBehavior"
    },
    TablePrefix = "tablePrefix",
    Tags = tags
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var tags interface{}

cfnCrawler := awscdk.Aws_glue.NewCfnCrawler(this, jsii.String("MyCfnCrawler"), &CfnCrawlerProps{
	Role: jsii.String("role"),
	Targets: &TargetsProperty{
		CatalogTargets: []interface{}{
			&CatalogTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				DatabaseName: jsii.String("databaseName"),
				DlqEventQueueArn: jsii.String("dlqEventQueueArn"),
				EventQueueArn: jsii.String("eventQueueArn"),
				Tables: []*string{
					jsii.String("tables"),
				},
			},
		},
		DeltaTargets: []interface{}{
			&DeltaTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				CreateNativeDeltaTable: jsii.Boolean(false),
				DeltaTables: []*string{
					jsii.String("deltaTables"),
				},
				WriteManifest: jsii.Boolean(false),
			},
		},
		DynamoDbTargets: []interface{}{
			&DynamoDBTargetProperty{
				Path: jsii.String("path"),
				ScanAll: jsii.Boolean(false),
				ScanRate: jsii.Number(123),
			},
		},
		HudiTargets: []interface{}{
			&HudiTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				Exclusions: []*string{
					jsii.String("exclusions"),
				},
				MaximumTraversalDepth: jsii.Number(123),
				Paths: []*string{
					jsii.String("paths"),
				},
			},
		},
		IcebergTargets: []interface{}{
			&IcebergTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				Exclusions: []*string{
					jsii.String("exclusions"),
				},
				MaximumTraversalDepth: jsii.Number(123),
				Paths: []*string{
					jsii.String("paths"),
				},
			},
		},
		JdbcTargets: []interface{}{
			&JdbcTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				EnableAdditionalMetadata: []*string{
					jsii.String("enableAdditionalMetadata"),
				},
				Exclusions: []*string{
					jsii.String("exclusions"),
				},
				Path: jsii.String("path"),
			},
		},
		MongoDbTargets: []interface{}{
			&MongoDBTargetProperty{
				ConnectionName: jsii.String("connectionName"),
				Path: jsii.String("path"),
			},
		},
		S3Targets: []interface{}{
			&S3TargetProperty{
				ConnectionName: jsii.String("connectionName"),
				DlqEventQueueArn: jsii.String("dlqEventQueueArn"),
				EventQueueArn: jsii.String("eventQueueArn"),
				Exclusions: []*string{
					jsii.String("exclusions"),
				},
				Path: jsii.String("path"),
				SampleSize: jsii.Number(123),
			},
		},
	},

	// the properties below are optional
	Classifiers: []*string{
		jsii.String("classifiers"),
	},
	Configuration: jsii.String("configuration"),
	CrawlerSecurityConfiguration: jsii.String("crawlerSecurityConfiguration"),
	DatabaseName: jsii.String("databaseName"),
	Description: jsii.String("description"),
	LakeFormationConfiguration: &LakeFormationConfigurationProperty{
		AccountId: jsii.String("accountId"),
		UseLakeFormationCredentials: jsii.Boolean(false),
	},
	Name: jsii.String("name"),
	RecrawlPolicy: &RecrawlPolicyProperty{
		RecrawlBehavior: jsii.String("recrawlBehavior"),
	},
	Schedule: &ScheduleProperty{
		ScheduleExpression: jsii.String("scheduleExpression"),
	},
	SchemaChangePolicy: &SchemaChangePolicyProperty{
		DeleteBehavior: jsii.String("deleteBehavior"),
		UpdateBehavior: jsii.String("updateBehavior"),
	},
	TablePrefix: jsii.String("tablePrefix"),
	Tags: tags,
})

Initializer ​

ts
new CfnCrawler(scope: Construct, id: string, props: CfnCrawlerProps)
python
CfnCrawler(scope: Construct, id: str, props: CfnCrawlerProps)
java
new CfnCrawler(Construct scope, String id, CfnCrawlerProps props)
csharp
new CfnCrawler(Construct scope, string id, CfnCrawlerProps props)
go
NewCfnCrawler(Scope Construct, Id *string, Props CfnCrawlerProps)

Construct Props ​

classifiersoptionalstring[]classifiersoptionaltyping.List[str]classifiersoptionalList<String>Classifiersoptionalstring[]Classifiersoptional*[]*string#
A list of UTF-8 strings that specify the names of custom classifiers that are associated with the crawler.
configurationoptionalstringconfigurationoptionalstrconfigurationoptionalStringConfigurationoptionalstringConfigurationoptional*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 .

crawlerSecurityConfigurationoptionalstringcrawler_security_configurationoptionalstrcrawlerSecurityConfigurationoptionalStringCrawlerSecurityConfigurationoptionalstringCrawlerSecurityConfigurationoptional*string#
The name of the `SecurityConfiguration` structure to be used by this crawler.
databaseNameoptionalstring | IBucketRefdatabase_nameoptionaltyping.Union[str, IBucketRef]databaseNameoptionalStringDatabaseNameoptionalstringDatabaseNameoptionalinterface{}#
The name of the database in which the crawler's output is stored.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
A description of the crawler.
lakeFormationConfigurationoptionalIResolvable | CfnCrawler.LakeFormationConfigurationPropertylake_formation_configurationoptionaltyping.Union[IResolvable, LakeFormationConfigurationProperty]lakeFormationConfigurationoptionalIResolvableLakeFormationConfigurationoptionalIResolvableLakeFormationConfigurationoptionalinterface{}#
Specifies whether the crawler should use AWS Lake Formation credentials for the crawler instead of the IAM role credentials.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string#
The name of the crawler.
recrawlPolicyoptionalIResolvable | CfnCrawler.RecrawlPolicyPropertyrecrawl_policyoptionaltyping.Union[IResolvable, RecrawlPolicyProperty]recrawlPolicyoptionalIResolvableRecrawlPolicyoptionalIResolvableRecrawlPolicyoptionalinterface{}#
A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.
rolestring | IRoleRefroletyping.Union[str, IRoleRef]roleStringRolestringRoleinterface{}required#
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.
scheduleoptionalIResolvable | CfnCrawler.SchedulePropertyscheduleoptionaltyping.Union[IResolvable, ScheduleProperty]scheduleoptionalIResolvableScheduleoptionalIResolvableScheduleoptionalinterface{}#
For scheduled crawlers, the schedule when the crawler runs.
schemaChangePolicyoptionalIResolvable | CfnCrawler.SchemaChangePolicyPropertyschema_change_policyoptionaltyping.Union[IResolvable, SchemaChangePolicyProperty]schemaChangePolicyoptionalIResolvableSchemaChangePolicyoptionalIResolvableSchemaChangePolicyoptionalinterface{}#
The policy that specifies update and delete behaviors for the crawler.
notes

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 .

tablePrefixoptionalstringtable_prefixoptionalstrtablePrefixoptionalStringTablePrefixoptionalstringTablePrefixoptional*string#
The prefix added to the names of tables that are created.
tagsoptionalanytagsoptionalAnytagsoptionalObjectTagsoptionalobjectTagsoptionalinterface{}#
The tags to use with this crawler.
targetsIResolvable | CfnCrawler.TargetsPropertytargetstyping.Union[IResolvable, TargetsProperty]targetsIResolvableTargetsIResolvableTargetsinterface{}required#
A collection of targets to crawl.

Properties ​

CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringstatic#
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*string#
AWS resource type.
classifiersmay be undefinedstring[]classifiersmay be undefinedtyping.List[str]classifiersmay be undefinedList<String>Classifiersmay be undefinedstring[]Classifiersmay be undefined*[]*string#
A list of UTF-8 strings that specify the names of custom classifiers that are associated with the crawler.
configurationmay be undefinedstringconfigurationmay be undefinedstrconfigurationmay be undefinedStringConfigurationmay be undefinedstringConfigurationmay be undefined*string#
Crawler configuration information.
A reference to a Crawler resource.
crawlerSecurityConfigurationmay be undefinedstringcrawler_security_configurationmay be undefinedstrcrawlerSecurityConfigurationmay be undefinedStringCrawlerSecurityConfigurationmay be undefinedstringCrawlerSecurityConfigurationmay be undefined*string#
The name of the `SecurityConfiguration` structure to be used by this crawler.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*string#
databaseNamemay be undefinedstringdatabase_namemay be undefinedstrdatabaseNamemay be undefinedStringDatabaseNamemay be undefinedstringDatabaseNamemay be undefined*string#
The name of the database in which the crawler's output is stored.
descriptionmay be undefinedstringdescriptionmay be undefinedstrdescriptionmay be undefinedStringDescriptionmay be undefinedstringDescriptionmay be undefined*string#
A description of the crawler.
lakeFormationConfigurationmay be undefinedIResolvable | CfnCrawler.LakeFormationConfigurationPropertylake_formation_configurationmay be undefinedtyping.Union[IResolvable, LakeFormationConfigurationProperty]lakeFormationConfigurationmay be undefinedIResolvableLakeFormationConfigurationmay be undefinedIResolvableLakeFormationConfigurationmay be undefinedinterface{}#
Specifies whether the crawler should use AWS Lake Formation credentials for the crawler instead of the IAM role credentials.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*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).

namemay be undefinedstringnamemay be undefinedstrnamemay be undefinedStringNamemay be undefinedstringNamemay be undefined*string#
The name of the crawler.
nodeNodenodeNodenodeNodeNodeNodeNodeNode#
The tree node.
recrawlPolicymay be undefinedIResolvable | CfnCrawler.RecrawlPolicyPropertyrecrawl_policymay be undefinedtyping.Union[IResolvable, RecrawlPolicyProperty]recrawlPolicymay be undefinedIResolvableRecrawlPolicymay be undefinedIResolvableRecrawlPolicymay be undefinedinterface{}#
A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.
refstringrefstrrefStringRefstringRef*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 }).

rolestringrolestrroleStringRolestringRole*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.
schedulemay be undefinedIResolvable | CfnCrawler.SchedulePropertyschedulemay be undefinedtyping.Union[IResolvable, ScheduleProperty]schedulemay be undefinedIResolvableSchedulemay be undefinedIResolvableSchedulemay be undefinedinterface{}#
For scheduled crawlers, the schedule when the crawler runs.
schemaChangePolicymay be undefinedIResolvable | CfnCrawler.SchemaChangePolicyPropertyschema_change_policymay be undefinedtyping.Union[IResolvable, SchemaChangePolicyProperty]schemaChangePolicymay be undefinedIResolvableSchemaChangePolicymay be undefinedIResolvableSchemaChangePolicymay be undefinedinterface{}#
The policy that specifies update and delete behaviors for the crawler.
stackStackstackStackstackStackStackStackStackStack#
The stack in which this element is defined.

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

tablePrefixmay be undefinedstringtable_prefixmay be undefinedstrtablePrefixmay be undefinedStringTablePrefixmay be undefinedstringTablePrefixmay be undefined*string#
The prefix added to the names of tables that are created.
Tag Manager which manages the tags for this resource.
tagsRawanytags_rawAnytagsRawObjectTagsRawobjectTagsRawinterface{}#
The tags to use with this crawler.
targetsIResolvable | CfnCrawler.TargetsPropertytargetstyping.Union[IResolvable, TargetsProperty]targetsIResolvableTargetsIResolvableTargetsinterface{}#
A collection of targets to crawl.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#
Use `addResourceDependency` instead.
notes

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

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

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,

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

would add the overrides

json
"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.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#
Adds an override to a resource property.

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

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

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

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#
Sets the deletion policy of the resource based on the removal policy specified.
notes

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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForCrawler(resource: ICrawlerRef): string@staticmethod def arn_for_crawler(resource: ICrawlerRef) -> strpublic static String arnForCrawler(ICrawlerRef resource)public static string ArnForCrawler(ICrawlerRef resource)func ArnForCrawler(Resource ICrawlerRef) *stringstatic#
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#
fromCrawlerName(scope: Construct, id: string, crawlerName: string): ICrawlerRef@staticmethod def from_crawler_name(scope: Construct, id: str, crawler_name: str) -> ICrawlerRefpublic static ICrawlerRef fromCrawlerName(Construct scope, String id, String crawlerName)public static ICrawlerRef FromCrawlerName(Construct scope, string id, string crawlerName)func FromCrawlerName(Scope Construct, Id *string, CrawlerName *string) ICrawlerRefstatic#
Creates a new ICrawlerRef from a crawlerName.
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) 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.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnCrawler(x: any): boolean@staticmethod def is_cfn_crawler(x: Any) -> boolpublic static Boolean isCfnCrawler(Object x)public static bool IsCfnCrawler(object x)func IsCfnCrawler(X interface{}) *boolstatic#
Checks whether the given object is a CfnCrawler.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#
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.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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

  • xxxxX — Any object.

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

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
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.