Skip to content
v2.278.0

CfnDatabaseProps Struct ​

Properties for defining a CfnDatabase.

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 parameters: any;
const cfnDatabaseProps: glue.CfnDatabaseProps = {
  catalogId: 'catalogId',
  databaseInput: {
    createTableDefaultPermissions: [{
      permissions: ['permissions'],
      principal: {
        dataLakePrincipalIdentifier: 'dataLakePrincipalIdentifier',
      },
    }],
    description: 'description',
    federatedDatabase: {
      connectionName: 'connectionName',
      identifier: 'identifier',
    },
    locationUri: 'locationUri',
    name: 'name',
    parameters: parameters,
    targetDatabase: {
      catalogId: 'catalogId',
      databaseName: 'databaseName',
      region: 'region',
    },
  },

  // the properties below are optional
  databaseName: 'databaseName',
};
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

# parameters: Any

cfn_database_props = glue.CfnDatabaseProps(
    catalog_id="catalogId",
    database_input=glue.CfnDatabase.DatabaseInputProperty(
        create_table_default_permissions=[glue.CfnDatabase.PrincipalPrivilegesProperty(
            permissions=["permissions"],
            principal=glue.CfnDatabase.DataLakePrincipalProperty(
                data_lake_principal_identifier="dataLakePrincipalIdentifier"
            )
        )],
        description="description",
        federated_database=glue.CfnDatabase.FederatedDatabaseProperty(
            connection_name="connectionName",
            identifier="identifier"
        ),
        location_uri="locationUri",
        name="name",
        parameters=parameters,
        target_database=glue.CfnDatabase.DatabaseIdentifierProperty(
            catalog_id="catalogId",
            database_name="databaseName",
            region="region"
        )
    ),

    # the properties below are optional
    database_name="databaseName"
)
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 parameters;

CfnDatabaseProps cfnDatabaseProps = CfnDatabaseProps.builder()
        .catalogId("catalogId")
        .databaseInput(DatabaseInputProperty.builder()
                .createTableDefaultPermissions(List.of(PrincipalPrivilegesProperty.builder()
                        .permissions(List.of("permissions"))
                        .principal(DataLakePrincipalProperty.builder()
                                .dataLakePrincipalIdentifier("dataLakePrincipalIdentifier")
                                .build())
                        .build()))
                .description("description")
                .federatedDatabase(FederatedDatabaseProperty.builder()
                        .connectionName("connectionName")
                        .identifier("identifier")
                        .build())
                .locationUri("locationUri")
                .name("name")
                .parameters(parameters)
                .targetDatabase(DatabaseIdentifierProperty.builder()
                        .catalogId("catalogId")
                        .databaseName("databaseName")
                        .region("region")
                        .build())
                .build())

        // the properties below are optional
        .databaseName("databaseName")
        .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 parameters;

var cfnDatabaseProps = new CfnDatabaseProps {
    CatalogId = "catalogId",
    DatabaseInput = new DatabaseInputProperty {
        CreateTableDefaultPermissions = new [] { new PrincipalPrivilegesProperty {
            Permissions = new [] { "permissions" },
            Principal = new DataLakePrincipalProperty {
                DataLakePrincipalIdentifier = "dataLakePrincipalIdentifier"
            }
        } },
        Description = "description",
        FederatedDatabase = new FederatedDatabaseProperty {
            ConnectionName = "connectionName",
            Identifier = "identifier"
        },
        LocationUri = "locationUri",
        Name = "name",
        Parameters = parameters,
        TargetDatabase = new DatabaseIdentifierProperty {
            CatalogId = "catalogId",
            DatabaseName = "databaseName",
            Region = "region"
        }
    },

    // the properties below are optional
    DatabaseName = "databaseName"
};
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 parameters interface{}

cfnDatabaseProps := &CfnDatabaseProps{
	CatalogId: jsii.String("catalogId"),
	DatabaseInput: &DatabaseInputProperty{
		CreateTableDefaultPermissions: []interface{}{
			&PrincipalPrivilegesProperty{
				Permissions: []*string{
					jsii.String("permissions"),
				},
				Principal: &DataLakePrincipalProperty{
					DataLakePrincipalIdentifier: jsii.String("dataLakePrincipalIdentifier"),
				},
			},
		},
		Description: jsii.String("description"),
		FederatedDatabase: &FederatedDatabaseProperty{
			ConnectionName: jsii.String("connectionName"),
			Identifier: jsii.String("identifier"),
		},
		LocationUri: jsii.String("locationUri"),
		Name: jsii.String("name"),
		Parameters: parameters,
		TargetDatabase: &DatabaseIdentifierProperty{
			CatalogId: jsii.String("catalogId"),
			DatabaseName: jsii.String("databaseName"),
			Region: jsii.String("region"),
		},
	},

	// the properties below are optional
	DatabaseName: jsii.String("databaseName"),
}

Properties ​

catalogIdstringcatalog_idstrcatalogIdStringCatalogIdstringCatalogId*string required #
The AWS account ID for the account in which to create the catalog object.

To specify the account ID, you can use the Ref intrinsic function with the AWS::AccountId pseudo parameter. For example: !Ref AWS::AccountId

databaseInputIResolvable | CfnDatabase.DatabaseInputPropertydatabase_inputtyping.Union[IResolvable, DatabaseInputProperty]databaseInputIResolvableDatabaseInputIResolvableDatabaseInputinterface{} required #
The metadata for the database.
databaseNameoptionalstringdatabase_nameoptionalstrdatabaseNameoptionalStringDatabaseNameoptionalstringDatabaseNameoptional*string #
The name of the catalog database.