diff --git a/.gitignore b/.gitignore index 2612c561..7525aee2 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,22 @@ test/integ/ondemand-googleanalytics4-to-s3.integ.snapshot/manifest.json test/integ/ondemand-googleanalytics4-to-s3.integ.snapshot/**/manifest.json test/integ/ondemand-googleanalytics4-to-s3.integ.snapshot/tree.json test/integ/ondemand-googleanalytics4-to-s3.integ.snapshot/**/tree.json +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/asset.* +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/**/asset.* +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/cdk.out +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/**/cdk.out +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/manifest.json +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/**/manifest.json +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/tree.json +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/**/tree.json +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/asset.* +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/**/asset.* +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/cdk.out +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/**/cdk.out +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/manifest.json +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/**/manifest.json +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/tree.json +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/**/tree.json test/integ/ondemand-microsoftdynamics365-to-s3.integ.snapshot/asset.* test/integ/ondemand-microsoftdynamics365-to-s3.integ.snapshot/**/asset.* test/integ/ondemand-microsoftdynamics365-to-s3.integ.snapshot/cdk.out diff --git a/.npmignore b/.npmignore index 14bdfd5c..7b7315e8 100644 --- a/.npmignore +++ b/.npmignore @@ -24,6 +24,8 @@ tsconfig.tsbuildinfo !.jsii !/assets/ test/integ/ondemand-googleanalytics4-to-s3.integ.snapshot +test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot +test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot test/integ/ondemand-microsoftdynamics365-to-s3.integ.snapshot test/integ/ondemand-microsoftsharepointonline-to-s3.integ.snapshot test/integ/ondemand-s3-to-snowflake.integ.snapshot diff --git a/.projen/deps.json b/.projen/deps.json index 3a91cdb6..b6e7ac3b 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -125,17 +125,17 @@ }, { "name": "@aws-cdk/aws-glue-alpha", - "version": "2.110.1-alpha.0", + "version": "2.116.1-alpha.0", "type": "peer" }, { "name": "@aws-cdk/aws-redshift-alpha", - "version": "2.110.1-alpha.0", + "version": "2.116.1-alpha.0", "type": "peer" }, { "name": "aws-cdk-lib", - "version": "^2.110.1", + "version": "^2.116.1", "type": "peer" }, { diff --git a/.projen/tasks.json b/.projen/tasks.json index 662eae73..1306ca01 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -249,6 +249,132 @@ } ] }, + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:assert": { + "name": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:assert", + "description": "assert the snapshot of integration test 'ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql'", + "steps": [ + { + "exec": "[ -d \"test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot\" ] || (echo \"No snapshot available for integration test 'ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql'. Run 'projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:deploy' to capture.\" && exit 1)" + }, + { + "exec": "cdk synth --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/assert.cdk.out > /dev/null" + }, + { + "exec": "diff -r -x asset.* -x cdk.out -x manifest.json -x tree.json test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/ test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/assert.cdk.out/" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:deploy": { + "name": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:deploy", + "description": "deploy integration test 'ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql' and capture snapshot", + "steps": [ + { + "exec": "rm -fr test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/deploy.cdk.out" + }, + { + "exec": "cdk deploy --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata '**' --require-approval=never -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/deploy.cdk.out" + }, + { + "exec": "rm -fr test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot" + }, + { + "exec": "mv test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/deploy.cdk.out test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot" + }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:destroy" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:destroy": { + "name": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:destroy", + "description": "destroy integration test 'ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql'", + "steps": [ + { + "exec": "cdk destroy --app test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot '**' --no-version-reporting" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:snapshot": { + "name": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:snapshot", + "description": "update snapshot for integration test \"ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql\"", + "steps": [ + { + "exec": "cdk synth --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata -o test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot > /dev/null" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:watch": { + "name": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:watch", + "description": "watch integration test 'ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql' (without updating snapshots)", + "steps": [ + { + "exec": "cdk watch --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata '**' -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ/deploy.cdk.out" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-s3:assert": { + "name": "integ:ondemand-jdbcsmalldatascale-to-s3:assert", + "description": "assert the snapshot of integration test 'ondemand-jdbcsmalldatascale-to-s3'", + "steps": [ + { + "exec": "[ -d \"test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot\" ] || (echo \"No snapshot available for integration test 'ondemand-jdbcsmalldatascale-to-s3'. Run 'projen integ:ondemand-jdbcsmalldatascale-to-s3:deploy' to capture.\" && exit 1)" + }, + { + "exec": "cdk synth --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/assert.cdk.out > /dev/null" + }, + { + "exec": "diff -r -x asset.* -x cdk.out -x manifest.json -x tree.json test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/ test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/assert.cdk.out/" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-s3:deploy": { + "name": "integ:ondemand-jdbcsmalldatascale-to-s3:deploy", + "description": "deploy integration test 'ondemand-jdbcsmalldatascale-to-s3' and capture snapshot", + "steps": [ + { + "exec": "rm -fr test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/deploy.cdk.out" + }, + { + "exec": "cdk deploy --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata '**' --require-approval=never -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/deploy.cdk.out" + }, + { + "exec": "rm -fr test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot" + }, + { + "exec": "mv test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/deploy.cdk.out test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot" + }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-s3:destroy" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-s3:destroy": { + "name": "integ:ondemand-jdbcsmalldatascale-to-s3:destroy", + "description": "destroy integration test 'ondemand-jdbcsmalldatascale-to-s3'", + "steps": [ + { + "exec": "cdk destroy --app test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot '**' --no-version-reporting" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-s3:snapshot": { + "name": "integ:ondemand-jdbcsmalldatascale-to-s3:snapshot", + "description": "update snapshot for integration test \"ondemand-jdbcsmalldatascale-to-s3\"", + "steps": [ + { + "exec": "cdk synth --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata -o test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot > /dev/null" + } + ] + }, + "integ:ondemand-jdbcsmalldatascale-to-s3:watch": { + "name": "integ:ondemand-jdbcsmalldatascale-to-s3:watch", + "description": "watch integration test 'ondemand-jdbcsmalldatascale-to-s3' (without updating snapshots)", + "steps": [ + { + "exec": "cdk watch --app \"ts-node -P tsconfig.dev.json test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts\" --no-notices --no-version-reporting --no-asset-metadata --no-path-metadata '**' -o test/integ/.tmp/ondemand-jdbcsmalldatascale-to-s3.integ/deploy.cdk.out" + } + ] + }, "integ:ondemand-microsoftdynamics365-to-s3:assert": { "name": "integ:ondemand-microsoftdynamics365-to-s3:assert", "description": "assert the snapshot of integration test 'ondemand-microsoftdynamics365-to-s3'", @@ -886,6 +1012,12 @@ { "spawn": "integ:ondemand-googleanalytics4-to-s3:snapshot" }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:snapshot" + }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-s3:snapshot" + }, { "spawn": "integ:ondemand-microsoftdynamics365-to-s3:snapshot" }, @@ -1075,6 +1207,12 @@ { "spawn": "integ:ondemand-googleanalytics4-to-s3:assert" }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:assert" + }, + { + "spawn": "integ:ondemand-jdbcsmalldatascale-to-s3:assert" + }, { "spawn": "integ:ondemand-microsoftdynamics365-to-s3:assert" }, diff --git a/.projenrc.ts b/.projenrc.ts index d9a0cdf0..ef3f7ab5 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 import { CdklabsConstructLibrary } from 'cdklabs-projen-project-types'; import { Stability } from 'projen/lib/cdk'; -const cdkVersion = '2.110.1'; +const cdkVersion = '2.116.1'; const project = new CdklabsConstructLibrary({ name: '@cdklabs/cdk-appflow', author: 'Amazon Web Services', diff --git a/API.md b/API.md index eccb92de..106fbade 100644 --- a/API.md +++ b/API.md @@ -226,6 +226,306 @@ Amazon AppFlow is an account-bound and a regional service. With this it is invur ## Constructs +### AmazonRdsForPostgreSqlConnectorProfile + +The connector profile for the Amazon RDS for PostgreSQL connector. + +#### Initializers + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +new AmazonRdsForPostgreSqlConnectorProfile(scope: Construct, id: string, props: AmazonRdsForPostgreSqlConnectorProfileProps) +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| scope | constructs.Construct | the Construct scope for this connector profile. | +| id | string | the id of this connector profile. | +| props | AmazonRdsForPostgreSqlConnectorProfileProps | properties to use when instantiating this connector profile. | + +--- + +##### `scope`Required + +- *Type:* constructs.Construct + +the Construct scope for this connector profile. + +--- + +##### `id`Required + +- *Type:* string + +the id of this connector profile. + +--- + +##### `props`Required + +- *Type:* AmazonRdsForPostgreSqlConnectorProfileProps + +properties to use when instantiating this connector profile. + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| toString | Returns a string representation of this construct. | +| applyRemovalPolicy | Apply the given removal policy to this resource. | + +--- + +##### `toString` + +```typescript +public toString(): string +``` + +Returns a string representation of this construct. + +##### `applyRemovalPolicy` + +```typescript +public applyRemovalPolicy(policy: RemovalPolicy): void +``` + +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`). + +###### `policy`Required + +- *Type:* aws-cdk-lib.RemovalPolicy + +--- + +#### Static Functions + +| **Name** | **Description** | +| --- | --- | +| isConstruct | Checks if `x` is a construct. | +| isOwnedResource | Returns true if the construct was created by CDK, and false otherwise. | +| isResource | Check whether the given construct is a Resource. | +| fromConnectionProfileArn | Imports an existing AmazonRdsForPostgreSqlConnectorProfile. | +| fromConnectionProfileName | Imports an existing AmazonRdsForPostgreSqlConnectorProfile. | + +--- + +##### ~~`isConstruct`~~ + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +AmazonRdsForPostgreSqlConnectorProfile.isConstruct(x: any) +``` + +Checks if `x` is a construct. + +###### `x`Required + +- *Type:* any + +Any object. + +--- + +##### `isOwnedResource` + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +AmazonRdsForPostgreSqlConnectorProfile.isOwnedResource(construct: IConstruct) +``` + +Returns true if the construct was created by CDK, and false otherwise. + +###### `construct`Required + +- *Type:* constructs.IConstruct + +--- + +##### `isResource` + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +AmazonRdsForPostgreSqlConnectorProfile.isResource(construct: IConstruct) +``` + +Check whether the given construct is a Resource. + +###### `construct`Required + +- *Type:* constructs.IConstruct + +--- + +##### `fromConnectionProfileArn` + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +AmazonRdsForPostgreSqlConnectorProfile.fromConnectionProfileArn(scope: Construct, id: string, arn: string) +``` + +Imports an existing AmazonRdsForPostgreSqlConnectorProfile. + +###### `scope`Required + +- *Type:* constructs.Construct + +the scope for the connector profile. + +--- + +###### `id`Required + +- *Type:* string + +the connector profile's ID. + +--- + +###### `arn`Required + +- *Type:* string + +the ARN for the existing connector profile. + +--- + +##### `fromConnectionProfileName` + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfile } from '@cdklabs/cdk-appflow' + +AmazonRdsForPostgreSqlConnectorProfile.fromConnectionProfileName(scope: Construct, id: string, name: string) +``` + +Imports an existing AmazonRdsForPostgreSqlConnectorProfile. + +###### `scope`Required + +- *Type:* constructs.Construct + +the scope for the connector profile. + +--- + +###### `id`Required + +- *Type:* string + +the connector profile's ID. + +--- + +###### `name`Required + +- *Type:* string + +the name for the existing connector profile. + +--- + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| node | constructs.Node | The tree node. | +| env | aws-cdk-lib.ResourceEnvironment | The environment this resource belongs to. | +| stack | aws-cdk-lib.Stack | The stack in which this resource is defined. | +| arn | string | *No description.* | +| name | string | *No description.* | +| credentials | aws-cdk-lib.aws_secretsmanager.ISecret | *No description.* | + +--- + +##### `node`Required + +```typescript +public readonly node: Node; +``` + +- *Type:* constructs.Node + +The tree node. + +--- + +##### `env`Required + +```typescript +public readonly env: ResourceEnvironment; +``` + +- *Type:* aws-cdk-lib.ResourceEnvironment + +The environment this resource belongs to. + +For resources that are created and managed by the CDK +(generally, those created by creating new class instances like Role, Bucket, etc.), +this is always the same as the environment of the stack they belong to; +however, for imported resources +(those obtained from static methods like fromRoleArn, fromBucketName, etc.), +that might be different than the stack they were imported into. + +--- + +##### `stack`Required + +```typescript +public readonly stack: Stack; +``` + +- *Type:* aws-cdk-lib.Stack + +The stack in which this resource is defined. + +--- + +##### `arn`Required + +```typescript +public readonly arn: string; +``` + +- *Type:* string + +--- + +##### `name`Required + +```typescript +public readonly name: string; +``` + +- *Type:* string + +--- + +##### `credentials`Optional + +```typescript +public readonly credentials: ISecret; +``` + +- *Type:* aws-cdk-lib.aws_secretsmanager.ISecret + +--- + + ### ConnectorProfileBase - *Implements:* IConnectorProfile @@ -1104,39 +1404,47 @@ public readonly credentials: ISecret; --- -### MarketoConnectorProfile +### JdbcSmallDataScaleConnectorProfile -#### Initializers +The connector profile for the JDBC connector. + +#### Initializers ```typescript -import { MarketoConnectorProfile } from '@cdklabs/cdk-appflow' +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' -new MarketoConnectorProfile(scope: Construct, id: string, props: MarketoConnectorProfileProps) +new JdbcSmallDataScaleConnectorProfile(scope: Construct, id: string, props: JdbcSmallDataScaleConnectorProfileProps) ``` | **Name** | **Type** | **Description** | | --- | --- | --- | -| scope | constructs.Construct | *No description.* | -| id | string | *No description.* | -| props | MarketoConnectorProfileProps | *No description.* | +| scope | constructs.Construct | the Construct scope for this connector profile. | +| id | string | the id of this connector profile. | +| props | JdbcSmallDataScaleConnectorProfileProps | properties to use when instantiating this connector profile. | --- -##### `scope`Required +##### `scope`Required - *Type:* constructs.Construct +the Construct scope for this connector profile. + --- -##### `id`Required +##### `id`Required - *Type:* string +the id of this connector profile. + --- -##### `props`Required +##### `props`Required -- *Type:* MarketoConnectorProfileProps +- *Type:* JdbcSmallDataScaleConnectorProfileProps + +properties to use when instantiating this connector profile. --- @@ -1144,12 +1452,12 @@ new MarketoConnectorProfile(scope: Construct, id: string, props: MarketoConnecto | **Name** | **Description** | | --- | --- | -| toString | Returns a string representation of this construct. | -| applyRemovalPolicy | Apply the given removal policy to this resource. | +| toString | Returns a string representation of this construct. | +| applyRemovalPolicy | Apply the given removal policy to this resource. | --- -##### `toString` +##### `toString` ```typescript public toString(): string @@ -1157,7 +1465,7 @@ public toString(): string Returns a string representation of this construct. -##### `applyRemovalPolicy` +##### `applyRemovalPolicy` ```typescript public applyRemovalPolicy(policy: RemovalPolicy): void @@ -1173,7 +1481,7 @@ to be replaced. The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). -###### `policy`Required +###### `policy`Required - *Type:* aws-cdk-lib.RemovalPolicy @@ -1183,11 +1491,303 @@ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). | **Name** | **Description** | | --- | --- | -| isConstruct | Checks if `x` is a construct. | -| isOwnedResource | Returns true if the construct was created by CDK, and false otherwise. | -| isResource | Check whether the given construct is a Resource. | -| fromConnectionProfileArn | *No description.* | -| fromConnectionProfileName | *No description.* | +| isConstruct | Checks if `x` is a construct. | +| isOwnedResource | Returns true if the construct was created by CDK, and false otherwise. | +| isResource | Check whether the given construct is a Resource. | +| fromConnectionProfileArn | Imports an existing JdbcSmallDataScaleConnectorProfile. | +| fromConnectionProfileName | Imports an existing JdbcSmallDataScaleConnectorProfile. | + +--- + +##### ~~`isConstruct`~~ + +```typescript +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' + +JdbcSmallDataScaleConnectorProfile.isConstruct(x: any) +``` + +Checks if `x` is a construct. + +###### `x`Required + +- *Type:* any + +Any object. + +--- + +##### `isOwnedResource` + +```typescript +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' + +JdbcSmallDataScaleConnectorProfile.isOwnedResource(construct: IConstruct) +``` + +Returns true if the construct was created by CDK, and false otherwise. + +###### `construct`Required + +- *Type:* constructs.IConstruct + +--- + +##### `isResource` + +```typescript +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' + +JdbcSmallDataScaleConnectorProfile.isResource(construct: IConstruct) +``` + +Check whether the given construct is a Resource. + +###### `construct`Required + +- *Type:* constructs.IConstruct + +--- + +##### `fromConnectionProfileArn` + +```typescript +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' + +JdbcSmallDataScaleConnectorProfile.fromConnectionProfileArn(scope: Construct, id: string, arn: string) +``` + +Imports an existing JdbcSmallDataScaleConnectorProfile. + +###### `scope`Required + +- *Type:* constructs.Construct + +the scope for the connector profile. + +--- + +###### `id`Required + +- *Type:* string + +the connector profile's ID. + +--- + +###### `arn`Required + +- *Type:* string + +the ARN for the existing connector profile. + +--- + +##### `fromConnectionProfileName` + +```typescript +import { JdbcSmallDataScaleConnectorProfile } from '@cdklabs/cdk-appflow' + +JdbcSmallDataScaleConnectorProfile.fromConnectionProfileName(scope: Construct, id: string, name: string) +``` + +Imports an existing JdbcSmallDataScaleConnectorProfile. + +###### `scope`Required + +- *Type:* constructs.Construct + +the scope for the connector profile. + +--- + +###### `id`Required + +- *Type:* string + +the connector profile's ID. + +--- + +###### `name`Required + +- *Type:* string + +the name for the existing connector profile. + +--- + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| node | constructs.Node | The tree node. | +| env | aws-cdk-lib.ResourceEnvironment | The environment this resource belongs to. | +| stack | aws-cdk-lib.Stack | The stack in which this resource is defined. | +| arn | string | *No description.* | +| name | string | *No description.* | +| credentials | aws-cdk-lib.aws_secretsmanager.ISecret | *No description.* | + +--- + +##### `node`Required + +```typescript +public readonly node: Node; +``` + +- *Type:* constructs.Node + +The tree node. + +--- + +##### `env`Required + +```typescript +public readonly env: ResourceEnvironment; +``` + +- *Type:* aws-cdk-lib.ResourceEnvironment + +The environment this resource belongs to. + +For resources that are created and managed by the CDK +(generally, those created by creating new class instances like Role, Bucket, etc.), +this is always the same as the environment of the stack they belong to; +however, for imported resources +(those obtained from static methods like fromRoleArn, fromBucketName, etc.), +that might be different than the stack they were imported into. + +--- + +##### `stack`Required + +```typescript +public readonly stack: Stack; +``` + +- *Type:* aws-cdk-lib.Stack + +The stack in which this resource is defined. + +--- + +##### `arn`Required + +```typescript +public readonly arn: string; +``` + +- *Type:* string + +--- + +##### `name`Required + +```typescript +public readonly name: string; +``` + +- *Type:* string + +--- + +##### `credentials`Optional + +```typescript +public readonly credentials: ISecret; +``` + +- *Type:* aws-cdk-lib.aws_secretsmanager.ISecret + +--- + + +### MarketoConnectorProfile + +#### Initializers + +```typescript +import { MarketoConnectorProfile } from '@cdklabs/cdk-appflow' + +new MarketoConnectorProfile(scope: Construct, id: string, props: MarketoConnectorProfileProps) +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| scope | constructs.Construct | *No description.* | +| id | string | *No description.* | +| props | MarketoConnectorProfileProps | *No description.* | + +--- + +##### `scope`Required + +- *Type:* constructs.Construct + +--- + +##### `id`Required + +- *Type:* string + +--- + +##### `props`Required + +- *Type:* MarketoConnectorProfileProps + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| toString | Returns a string representation of this construct. | +| applyRemovalPolicy | Apply the given removal policy to this resource. | + +--- + +##### `toString` + +```typescript +public toString(): string +``` + +Returns a string representation of this construct. + +##### `applyRemovalPolicy` + +```typescript +public applyRemovalPolicy(policy: RemovalPolicy): void +``` + +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`). + +###### `policy`Required + +- *Type:* aws-cdk-lib.RemovalPolicy + +--- + +#### Static Functions + +| **Name** | **Description** | +| --- | --- | +| isConstruct | Checks if `x` is a construct. | +| isOwnedResource | Returns true if the construct was created by CDK, and false otherwise. | +| isResource | Check whether the given construct is a Resource. | +| fromConnectionProfileArn | *No description.* | +| fromConnectionProfileName | *No description.* | --- @@ -5727,26 +6327,284 @@ public readonly credentials: ISecret; ## Structs -### ConnectorProfileProps +### AmazonRdsForPostgreSqlBasicAuthSettings -#### Initializer +Basic authentication settings for the AmazonRdsForPostgreSqlConnectorProfile. + +#### Initializer ```typescript -import { ConnectorProfileProps } from '@cdklabs/cdk-appflow' +import { AmazonRdsForPostgreSqlBasicAuthSettings } from '@cdklabs/cdk-appflow' -const connectorProfileProps: ConnectorProfileProps = { ... } +const amazonRdsForPostgreSqlBasicAuthSettings: AmazonRdsForPostgreSqlBasicAuthSettings = { ... } ``` #### Properties | **Name** | **Type** | **Description** | | --- | --- | --- | -| key | aws-cdk-lib.aws_kms.IKey | TODO: think if this should be here as not all connector profiles have that. | -| name | string | *No description.* | +| password | aws-cdk-lib.SecretValue | The password of the identity used for interacting with the Amazon RDS for PostgreSQL. | +| username | string | The username of the identity used for interacting with the Amazon RDS for PostgreSQL. | --- -##### `key`Optional +##### `password`Required + +```typescript +public readonly password: SecretValue; +``` + +- *Type:* aws-cdk-lib.SecretValue + +The password of the identity used for interacting with the Amazon RDS for PostgreSQL. + +--- + +##### `username`Required + +```typescript +public readonly username: string; +``` + +- *Type:* string + +The username of the identity used for interacting with the Amazon RDS for PostgreSQL. + +--- + +### AmazonRdsForPostgreSqlConnectorProfileProps + +Properties of the AmazonRdsForPostgreSqlConnectorProfile. + +#### Initializer + +```typescript +import { AmazonRdsForPostgreSqlConnectorProfileProps } from '@cdklabs/cdk-appflow' + +const amazonRdsForPostgreSqlConnectorProfileProps: AmazonRdsForPostgreSqlConnectorProfileProps = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| key | aws-cdk-lib.aws_kms.IKey | TODO: think if this should be here as not all connector profiles have that. | +| name | string | *No description.* | +| basicAuth | AmazonRdsForPostgreSqlBasicAuthSettings | The auth settings for the profile. | +| database | string | The name of the PostgreSQL database. | +| hostname | string | The PostgreSQL hostname. | +| port | number | The PostgreSQL communication port. | + +--- + +##### `key`Optional + +```typescript +public readonly key: IKey; +``` + +- *Type:* aws-cdk-lib.aws_kms.IKey + +TODO: think if this should be here as not all connector profiles have that. + +--- + +##### `name`Optional + +```typescript +public readonly name: string; +``` + +- *Type:* string + +--- + +##### `basicAuth`Required + +```typescript +public readonly basicAuth: AmazonRdsForPostgreSqlBasicAuthSettings; +``` + +- *Type:* AmazonRdsForPostgreSqlBasicAuthSettings + +The auth settings for the profile. + +--- + +##### `database`Required + +```typescript +public readonly database: string; +``` + +- *Type:* string + +The name of the PostgreSQL database. + +--- + +##### `hostname`Required + +```typescript +public readonly hostname: string; +``` + +- *Type:* string + +The PostgreSQL hostname. + +--- + +##### `port`Optional + +```typescript +public readonly port: number; +``` + +- *Type:* number + +The PostgreSQL communication port. + +--- + +### AmazonRdsForPostgreSqlDestinationProps + +Properties of the AmazonRdsForPostgreSqlDestination. + +#### Initializer + +```typescript +import { AmazonRdsForPostgreSqlDestinationProps } from '@cdklabs/cdk-appflow' + +const amazonRdsForPostgreSqlDestinationProps: AmazonRdsForPostgreSqlDestinationProps = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| object | AmazonRdsForPostgreSqlObject | The destination object table to write to. | +| profile | AmazonRdsForPostgreSqlConnectorProfile | The profile to use with the destination. | +| apiVersion | string | The Amazon AppFlow Api Version. | +| errorHandling | ErrorHandlingConfiguration | The settings that determine how Amazon AppFlow handles an error when placing data in the destination. | + +--- + +##### `object`Required + +```typescript +public readonly object: AmazonRdsForPostgreSqlObject; +``` + +- *Type:* AmazonRdsForPostgreSqlObject + +The destination object table to write to. + +--- + +##### `profile`Required + +```typescript +public readonly profile: AmazonRdsForPostgreSqlConnectorProfile; +``` + +- *Type:* AmazonRdsForPostgreSqlConnectorProfile + +The profile to use with the destination. + +--- + +##### `apiVersion`Optional + +```typescript +public readonly apiVersion: string; +``` + +- *Type:* string + +The Amazon AppFlow Api Version. + +--- + +##### `errorHandling`Optional + +```typescript +public readonly errorHandling: ErrorHandlingConfiguration; +``` + +- *Type:* ErrorHandlingConfiguration + +The settings that determine how Amazon AppFlow handles an error when placing data in the destination. + +For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. + +--- + +### AmazonRdsForPostgreSqlObject + +The definition of the Amazon AppFlow object for Amazon RDS for PostgreSQL. + +#### Initializer + +```typescript +import { AmazonRdsForPostgreSqlObject } from '@cdklabs/cdk-appflow' + +const amazonRdsForPostgreSqlObject: AmazonRdsForPostgreSqlObject = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| schema | string | PostgreSQL schema name of the table. | +| table | string | PostgreSQL table name. | + +--- + +##### `schema`Required + +```typescript +public readonly schema: string; +``` + +- *Type:* string + +PostgreSQL schema name of the table. + +--- + +##### `table`Required + +```typescript +public readonly table: string; +``` + +- *Type:* string + +PostgreSQL table name. + +--- + +### ConnectorProfileProps + +#### Initializer + +```typescript +import { ConnectorProfileProps } from '@cdklabs/cdk-appflow' + +const connectorProfileProps: ConnectorProfileProps = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| key | aws-cdk-lib.aws_kms.IKey | TODO: think if this should be here as not all connector profiles have that. | +| name | string | *No description.* | + +--- + +##### `key`Optional ```typescript public readonly key: IKey; @@ -6243,254 +7101,498 @@ public readonly name: string; public readonly oAuth: GoogleAnalytics4OAuthSettings; ``` -- *Type:* GoogleAnalytics4OAuthSettings +- *Type:* GoogleAnalytics4OAuthSettings + +--- + +### GoogleAnalytics4OAuthEndpoints + +Google's OAuth token and authorization endpoints. + +#### Initializer + +```typescript +import { GoogleAnalytics4OAuthEndpoints } from '@cdklabs/cdk-appflow' + +const googleAnalytics4OAuthEndpoints: GoogleAnalytics4OAuthEndpoints = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| authorization | string | The OAuth authorization endpoint URI. | +| token | string | The OAuth token endpoint URI. | + +--- + +##### `authorization`Optional + +```typescript +public readonly authorization: string; +``` + +- *Type:* string + +The OAuth authorization endpoint URI. + +--- + +##### `token`Optional + +```typescript +public readonly token: string; +``` + +- *Type:* string + +The OAuth token endpoint URI. + +--- + +### GoogleAnalytics4OAuthFlow + +Represents the OAuth flow enabled for the GA4. + +#### Initializer + +```typescript +import { GoogleAnalytics4OAuthFlow } from '@cdklabs/cdk-appflow' + +const googleAnalytics4OAuthFlow: GoogleAnalytics4OAuthFlow = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| refreshTokenGrant | GoogleAnalytics4RefreshTokenGrantFlow | The details required for executing the refresh token grant flow. | + +--- + +##### `refreshTokenGrant`Required + +```typescript +public readonly refreshTokenGrant: GoogleAnalytics4RefreshTokenGrantFlow; +``` + +- *Type:* GoogleAnalytics4RefreshTokenGrantFlow + +The details required for executing the refresh token grant flow. + +--- + +### GoogleAnalytics4OAuthSettings + +#### Initializer + +```typescript +import { GoogleAnalytics4OAuthSettings } from '@cdklabs/cdk-appflow' + +const googleAnalytics4OAuthSettings: GoogleAnalytics4OAuthSettings = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| accessToken | aws-cdk-lib.SecretValue | The access token to be used when interacting with Google Analytics 4. | +| endpoints | GoogleAnalytics4OAuthEndpoints | The OAuth token and authorization endpoints. | +| flow | GoogleAnalytics4OAuthFlow | The OAuth flow used for obtaining a new accessToken when the old is not present or expired. | + +--- + +##### `accessToken`Optional + +```typescript +public readonly accessToken: SecretValue; +``` + +- *Type:* aws-cdk-lib.SecretValue +- *Default:* Retrieves a fresh accessToken with the information in the [flow property]{@link GoogleAnalytics4OAuthSettings#flow} + +The access token to be used when interacting with Google Analytics 4. + +Note that if only the access token is provided AppFlow is not able to retrieve a fresh access token when the current one is expired + +--- + +##### `endpoints`Optional + +```typescript +public readonly endpoints: GoogleAnalytics4OAuthEndpoints; +``` + +- *Type:* GoogleAnalytics4OAuthEndpoints + +The OAuth token and authorization endpoints. + +--- + +##### `flow`Optional + +```typescript +public readonly flow: GoogleAnalytics4OAuthFlow; +``` + +- *Type:* GoogleAnalytics4OAuthFlow +- *Default:* undefined. AppFlow will not request any new accessToken after expiry. + +The OAuth flow used for obtaining a new accessToken when the old is not present or expired. + +--- + +### GoogleAnalytics4RefreshTokenGrantFlow + +The OAuth elements required for the execution of the refresh token grant flow. + +#### Initializer + +```typescript +import { GoogleAnalytics4RefreshTokenGrantFlow } from '@cdklabs/cdk-appflow' + +const googleAnalytics4RefreshTokenGrantFlow: GoogleAnalytics4RefreshTokenGrantFlow = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| clientId | aws-cdk-lib.SecretValue | The id of the client app. | +| clientSecret | aws-cdk-lib.SecretValue | The secret of the client app. | +| refreshToken | aws-cdk-lib.SecretValue | A non-expired refresh token. | + +--- + +##### `clientId`Optional + +```typescript +public readonly clientId: SecretValue; +``` + +- *Type:* aws-cdk-lib.SecretValue + +The id of the client app. + +--- + +##### `clientSecret`Optional + +```typescript +public readonly clientSecret: SecretValue; +``` + +- *Type:* aws-cdk-lib.SecretValue + +The secret of the client app. + +--- + +##### `refreshToken`Optional + +```typescript +public readonly refreshToken: SecretValue; +``` + +- *Type:* aws-cdk-lib.SecretValue + +A non-expired refresh token. + +--- + +### GoogleAnalytics4SourceProps + +Properties of a Google Analytics v4 Source. + +#### Initializer + +```typescript +import { GoogleAnalytics4SourceProps } from '@cdklabs/cdk-appflow' + +const googleAnalytics4SourceProps: GoogleAnalytics4SourceProps = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| apiVersion | string | *No description.* | +| object | string | *No description.* | +| profile | GoogleAnalytics4ConnectorProfile | *No description.* | + +--- + +##### `apiVersion`Required + +```typescript +public readonly apiVersion: string; +``` + +- *Type:* string + +--- + +##### `object`Required + +```typescript +public readonly object: string; +``` + +- *Type:* string + +--- + +##### `profile`Required + +```typescript +public readonly profile: GoogleAnalytics4ConnectorProfile; +``` + +- *Type:* GoogleAnalytics4ConnectorProfile --- -### GoogleAnalytics4OAuthEndpoints +### JdbcSmallDataScaleBasicAuthSettings -Google's OAuth token and authorization endpoints. +Basic authentication settings for the JdbcSmallDataScaleConnectorProfile. -#### Initializer +#### Initializer ```typescript -import { GoogleAnalytics4OAuthEndpoints } from '@cdklabs/cdk-appflow' +import { JdbcSmallDataScaleBasicAuthSettings } from '@cdklabs/cdk-appflow' -const googleAnalytics4OAuthEndpoints: GoogleAnalytics4OAuthEndpoints = { ... } +const jdbcSmallDataScaleBasicAuthSettings: JdbcSmallDataScaleBasicAuthSettings = { ... } ``` #### Properties | **Name** | **Type** | **Description** | | --- | --- | --- | -| authorization | string | The OAuth authorization endpoint URI. | -| token | string | The OAuth token endpoint URI. | +| password | aws-cdk-lib.SecretValue | The password of the identity used for interacting with the database. | +| username | string | The username of the identity used for interacting with the database. | --- -##### `authorization`Optional +##### `password`Required ```typescript -public readonly authorization: string; +public readonly password: SecretValue; ``` -- *Type:* string +- *Type:* aws-cdk-lib.SecretValue -The OAuth authorization endpoint URI. +The password of the identity used for interacting with the database. --- -##### `token`Optional +##### `username`Required ```typescript -public readonly token: string; +public readonly username: string; ``` - *Type:* string -The OAuth token endpoint URI. +The username of the identity used for interacting with the database. --- -### GoogleAnalytics4OAuthFlow +### JdbcSmallDataScaleConnectorProfileProps -Represents the OAuth flow enabled for the GA4. +Properties for the JdbcSmallDataScaleConnectorProfile. -#### Initializer +#### Initializer ```typescript -import { GoogleAnalytics4OAuthFlow } from '@cdklabs/cdk-appflow' +import { JdbcSmallDataScaleConnectorProfileProps } from '@cdklabs/cdk-appflow' -const googleAnalytics4OAuthFlow: GoogleAnalytics4OAuthFlow = { ... } +const jdbcSmallDataScaleConnectorProfileProps: JdbcSmallDataScaleConnectorProfileProps = { ... } ``` #### Properties | **Name** | **Type** | **Description** | | --- | --- | --- | -| refreshTokenGrant | GoogleAnalytics4RefreshTokenGrantFlow | The details required for executing the refresh token grant flow. | +| key | aws-cdk-lib.aws_kms.IKey | TODO: think if this should be here as not all connector profiles have that. | +| name | string | *No description.* | +| basicAuth | JdbcSmallDataScaleBasicAuthSettings | The auth settings for the profile. | +| database | string | The name of the database. | +| driver | JdbcDriver | The driver for the database. | +| hostname | string | The hostname of the database to interact with. | +| port | number | The database communication port. | --- -##### `refreshTokenGrant`Required +##### `key`Optional ```typescript -public readonly refreshTokenGrant: GoogleAnalytics4RefreshTokenGrantFlow; +public readonly key: IKey; ``` -- *Type:* GoogleAnalytics4RefreshTokenGrantFlow +- *Type:* aws-cdk-lib.aws_kms.IKey -The details required for executing the refresh token grant flow. +TODO: think if this should be here as not all connector profiles have that. --- -### GoogleAnalytics4OAuthSettings - -#### Initializer +##### `name`Optional ```typescript -import { GoogleAnalytics4OAuthSettings } from '@cdklabs/cdk-appflow' - -const googleAnalytics4OAuthSettings: GoogleAnalytics4OAuthSettings = { ... } +public readonly name: string; ``` -#### Properties - -| **Name** | **Type** | **Description** | -| --- | --- | --- | -| accessToken | aws-cdk-lib.SecretValue | The access token to be used when interacting with Google Analytics 4. | -| endpoints | GoogleAnalytics4OAuthEndpoints | The OAuth token and authorization endpoints. | -| flow | GoogleAnalytics4OAuthFlow | The OAuth flow used for obtaining a new accessToken when the old is not present or expired. | +- *Type:* string --- -##### `accessToken`Optional +##### `basicAuth`Required ```typescript -public readonly accessToken: SecretValue; +public readonly basicAuth: JdbcSmallDataScaleBasicAuthSettings; ``` -- *Type:* aws-cdk-lib.SecretValue -- *Default:* Retrieves a fresh accessToken with the information in the [flow property]{@link GoogleAnalytics4OAuthSettings#flow} - -The access token to be used when interacting with Google Analytics 4. +- *Type:* JdbcSmallDataScaleBasicAuthSettings -Note that if only the access token is provided AppFlow is not able to retrieve a fresh access token when the current one is expired +The auth settings for the profile. --- -##### `endpoints`Optional +##### `database`Required ```typescript -public readonly endpoints: GoogleAnalytics4OAuthEndpoints; +public readonly database: string; ``` -- *Type:* GoogleAnalytics4OAuthEndpoints +- *Type:* string -The OAuth token and authorization endpoints. +The name of the database. --- -##### `flow`Optional +##### `driver`Required ```typescript -public readonly flow: GoogleAnalytics4OAuthFlow; +public readonly driver: JdbcDriver; ``` -- *Type:* GoogleAnalytics4OAuthFlow -- *Default:* undefined. AppFlow will not request any new accessToken after expiry. - -The OAuth flow used for obtaining a new accessToken when the old is not present or expired. +- *Type:* JdbcDriver ---- +The driver for the database. -### GoogleAnalytics4RefreshTokenGrantFlow +Effectively specifies the type of database. -The OAuth elements required for the execution of the refresh token grant flow. +--- -#### Initializer +##### `hostname`Required ```typescript -import { GoogleAnalytics4RefreshTokenGrantFlow } from '@cdklabs/cdk-appflow' - -const googleAnalytics4RefreshTokenGrantFlow: GoogleAnalytics4RefreshTokenGrantFlow = { ... } +public readonly hostname: string; ``` -#### Properties +- *Type:* string -| **Name** | **Type** | **Description** | -| --- | --- | --- | -| clientId | aws-cdk-lib.SecretValue | The id of the client app. | -| clientSecret | aws-cdk-lib.SecretValue | The secret of the client app. | -| refreshToken | aws-cdk-lib.SecretValue | A non-expired refresh token. | +The hostname of the database to interact with. --- -##### `clientId`Optional +##### `port`Required ```typescript -public readonly clientId: SecretValue; +public readonly port: number; ``` -- *Type:* aws-cdk-lib.SecretValue +- *Type:* number -The id of the client app. +The database communication port. --- -##### `clientSecret`Optional +### JdbcSmallDataScaleObject + +#### Initializer ```typescript -public readonly clientSecret: SecretValue; +import { JdbcSmallDataScaleObject } from '@cdklabs/cdk-appflow' + +const jdbcSmallDataScaleObject: JdbcSmallDataScaleObject = { ... } ``` -- *Type:* aws-cdk-lib.SecretValue +#### Properties -The secret of the client app. +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| schema | string | *No description.* | +| table | string | *No description.* | --- -##### `refreshToken`Optional +##### `schema`Required ```typescript -public readonly refreshToken: SecretValue; +public readonly schema: string; ``` -- *Type:* aws-cdk-lib.SecretValue - -A non-expired refresh token. +- *Type:* string --- -### GoogleAnalytics4SourceProps +##### `table`Required -Properties of a Google Analytics v4 Source. +```typescript +public readonly table: string; +``` -#### Initializer +- *Type:* string + +--- + +### JdbcSmallDataScaleSourceProps + +#### Initializer ```typescript -import { GoogleAnalytics4SourceProps } from '@cdklabs/cdk-appflow' +import { JdbcSmallDataScaleSourceProps } from '@cdklabs/cdk-appflow' -const googleAnalytics4SourceProps: GoogleAnalytics4SourceProps = { ... } +const jdbcSmallDataScaleSourceProps: JdbcSmallDataScaleSourceProps = { ... } ``` #### Properties | **Name** | **Type** | **Description** | | --- | --- | --- | -| apiVersion | string | *No description.* | -| object | string | *No description.* | -| profile | GoogleAnalytics4ConnectorProfile | *No description.* | +| object | JdbcSmallDataScaleObject | *No description.* | +| profile | JdbcSmallDataScaleConnectorProfile | *No description.* | +| apiVersion | string | *No description.* | --- -##### `apiVersion`Required +##### `object`Required ```typescript -public readonly apiVersion: string; +public readonly object: JdbcSmallDataScaleObject; ``` -- *Type:* string +- *Type:* JdbcSmallDataScaleObject --- -##### `object`Required +##### `profile`Required ```typescript -public readonly object: string; +public readonly profile: JdbcSmallDataScaleConnectorProfile; ``` -- *Type:* string +- *Type:* JdbcSmallDataScaleConnectorProfile --- -##### `profile`Required +##### `apiVersion`Optional ```typescript -public readonly profile: GoogleAnalytics4ConnectorProfile; +public readonly apiVersion: string; ``` -- *Type:* GoogleAnalytics4ConnectorProfile +- *Type:* string --- @@ -10633,6 +11735,76 @@ public readonly apiVersion: string; ## Classes +### AmazonRdsForPostgreSqlDestination + +- *Implements:* IDestination + +Represents a destination for the Amazon RDS for PostgreSQL connector. + +#### Initializers + +```typescript +import { AmazonRdsForPostgreSqlDestination } from '@cdklabs/cdk-appflow' + +new AmazonRdsForPostgreSqlDestination(props: AmazonRdsForPostgreSqlDestinationProps) +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| props | AmazonRdsForPostgreSqlDestinationProps | - properties of the destination. | + +--- + +##### `props`Required + +- *Type:* AmazonRdsForPostgreSqlDestinationProps + +properties of the destination. + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| bind | *No description.* | + +--- + +##### `bind` + +```typescript +public bind(flow: IFlow): DestinationFlowConfigProperty +``` + +###### `flow`Required + +- *Type:* IFlow + +--- + + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| connectorType | ConnectorType | The AppFlow type of the connector that this source is implemented for. | + +--- + +##### `connectorType`Required + +```typescript +public readonly connectorType: ConnectorType; +``` + +- *Type:* ConnectorType + +The AppFlow type of the connector that this source is implemented for. + +--- + + ### ConnectorType #### Initializers @@ -11492,6 +12664,72 @@ The AppFlow type of the connector that this source is implemented for. --- +### JdbcSmallDataScaleSource + +- *Implements:* ISource + +#### Initializers + +```typescript +import { JdbcSmallDataScaleSource } from '@cdklabs/cdk-appflow' + +new JdbcSmallDataScaleSource(props: JdbcSmallDataScaleSourceProps) +``` + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| props | JdbcSmallDataScaleSourceProps | *No description.* | + +--- + +##### `props`Required + +- *Type:* JdbcSmallDataScaleSourceProps + +--- + +#### Methods + +| **Name** | **Description** | +| --- | --- | +| bind | *No description.* | + +--- + +##### `bind` + +```typescript +public bind(flow: IFlow): SourceFlowConfigProperty +``` + +###### `flow`Required + +- *Type:* IFlow + +--- + + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| connectorType | ConnectorType | The AppFlow type of the connector that this source is implemented for. | + +--- + +##### `connectorType`Required + +```typescript +public readonly connectorType: ConnectorType; +``` + +- *Type:* ConnectorType + +The AppFlow type of the connector that this source is implemented for. + +--- + + ### Mapping - *Implements:* IMapping @@ -13833,7 +15071,7 @@ The AppFlow type of the connector that this source is implemented for. - *Extends:* aws-cdk-lib.IResource -- *Implemented By:* ConnectorProfileBase, GoogleAnalytics4ConnectorProfile, MarketoConnectorProfile, MicrosoftDynamics365ConnectorProfile, MicrosoftSharepointOnlineConnectorProfile, RedshiftConnectorProfile, SAPOdataConnectorProfile, SalesforceConnectorProfile, SalesforceMarketingCloudConnectorProfile, ServiceNowConnectorProfile, SlackConnectorProfile, SnowflakeConnectorProfile, ZendeskConnectorProfile, IConnectorProfile +- *Implemented By:* AmazonRdsForPostgreSqlConnectorProfile, ConnectorProfileBase, GoogleAnalytics4ConnectorProfile, JdbcSmallDataScaleConnectorProfile, MarketoConnectorProfile, MicrosoftDynamics365ConnectorProfile, MicrosoftSharepointOnlineConnectorProfile, RedshiftConnectorProfile, SAPOdataConnectorProfile, SalesforceConnectorProfile, SalesforceMarketingCloudConnectorProfile, ServiceNowConnectorProfile, SlackConnectorProfile, SnowflakeConnectorProfile, ZendeskConnectorProfile, IConnectorProfile #### Properties @@ -13926,7 +15164,7 @@ public readonly credentials: ISecret; - *Extends:* IVertex -- *Implemented By:* EventBridgeDestination, RedshiftDestination, S3Destination, SAPOdataDestination, SalesforceDestination, SnowflakeDestination, IDestination +- *Implemented By:* AmazonRdsForPostgreSqlDestination, EventBridgeDestination, RedshiftDestination, S3Destination, SAPOdataDestination, SalesforceDestination, SnowflakeDestination, IDestination A destination of an AppFlow flow. @@ -14235,7 +15473,7 @@ public bind(flow: IFlow, source: ISource): TaskProperty[] - *Extends:* IVertex -- *Implemented By:* GoogleAnalytics4Source, MarketoSource, MicrosoftDynamics365Source, MicrosoftSharepointOnlineSource, S3Source, SAPOdataSource, SalesforceMarketingCloudSource, SalesforceSource, ServiceNowSource, SlackSource, ZendeskSource, ISource +- *Implemented By:* GoogleAnalytics4Source, JdbcSmallDataScaleSource, MarketoSource, MicrosoftDynamics365Source, MicrosoftSharepointOnlineSource, S3Source, SAPOdataSource, SalesforceMarketingCloudSource, SalesforceSource, ServiceNowSource, SlackSource, ZendeskSource, ISource A source of an AppFlow flow. @@ -14334,7 +15572,7 @@ A representation of a validation operation, that is an operation testing records ### IVertex -- *Implemented By:* EventBridgeDestination, GoogleAnalytics4Source, MarketoSource, MicrosoftDynamics365Source, MicrosoftSharepointOnlineSource, RedshiftDestination, S3Destination, S3Source, SAPOdataDestination, SAPOdataSource, SalesforceDestination, SalesforceMarketingCloudSource, SalesforceSource, ServiceNowSource, SlackSource, SnowflakeDestination, ZendeskSource, IDestination, ISource, IVertex +- *Implemented By:* AmazonRdsForPostgreSqlDestination, EventBridgeDestination, GoogleAnalytics4Source, JdbcSmallDataScaleSource, MarketoSource, MicrosoftDynamics365Source, MicrosoftSharepointOnlineSource, RedshiftDestination, S3Destination, S3Source, SAPOdataDestination, SAPOdataSource, SalesforceDestination, SalesforceMarketingCloudSource, SalesforceSource, ServiceNowSource, SlackSource, SnowflakeDestination, ZendeskSource, IDestination, ISource, IVertex An interface representing a vertex, i.e. a source or a destination of an AppFlow flow. @@ -14499,6 +15737,27 @@ The AppFlow type of the connector that this source is implemented for. --- +### JdbcDriver + +#### Members + +| **Name** | **Description** | +| --- | --- | +| POSTGRES | *No description.* | +| MYSQL | *No description.* | + +--- + +##### `POSTGRES` + +--- + + +##### `MYSQL` + +--- + + ### MicrosoftDynamics365ApiVersion An enum representing the Microsoft Dynamics 365 API versions. diff --git a/package.json b/package.json index f94ffdbd..973d48f7 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,16 @@ "integ:ondemand-googleanalytics4-to-s3:destroy": "npx projen integ:ondemand-googleanalytics4-to-s3:destroy", "integ:ondemand-googleanalytics4-to-s3:snapshot": "npx projen integ:ondemand-googleanalytics4-to-s3:snapshot", "integ:ondemand-googleanalytics4-to-s3:watch": "npx projen integ:ondemand-googleanalytics4-to-s3:watch", + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:assert": "npx projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:assert", + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:deploy": "npx projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:deploy", + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:destroy": "npx projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:destroy", + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:snapshot": "npx projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:snapshot", + "integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:watch": "npx projen integ:ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql:watch", + "integ:ondemand-jdbcsmalldatascale-to-s3:assert": "npx projen integ:ondemand-jdbcsmalldatascale-to-s3:assert", + "integ:ondemand-jdbcsmalldatascale-to-s3:deploy": "npx projen integ:ondemand-jdbcsmalldatascale-to-s3:deploy", + "integ:ondemand-jdbcsmalldatascale-to-s3:destroy": "npx projen integ:ondemand-jdbcsmalldatascale-to-s3:destroy", + "integ:ondemand-jdbcsmalldatascale-to-s3:snapshot": "npx projen integ:ondemand-jdbcsmalldatascale-to-s3:snapshot", + "integ:ondemand-jdbcsmalldatascale-to-s3:watch": "npx projen integ:ondemand-jdbcsmalldatascale-to-s3:watch", "integ:ondemand-microsoftdynamics365-to-s3:assert": "npx projen integ:ondemand-microsoftdynamics365-to-s3:assert", "integ:ondemand-microsoftdynamics365-to-s3:deploy": "npx projen integ:ondemand-microsoftdynamics365-to-s3:deploy", "integ:ondemand-microsoftdynamics365-to-s3:destroy": "npx projen integ:ondemand-microsoftdynamics365-to-s3:destroy", @@ -102,8 +112,8 @@ "organization": true }, "devDependencies": { - "@aws-cdk/aws-glue-alpha": "2.110.1-alpha.0", - "@aws-cdk/aws-redshift-alpha": "2.110.1-alpha.0", + "@aws-cdk/aws-glue-alpha": "2.116.1-alpha.0", + "@aws-cdk/aws-redshift-alpha": "2.116.1-alpha.0", "@aws-cdk/integ-runner": "latest", "@aws-cdk/integ-tests-alpha": "latest", "@types/jest": "^27", @@ -111,7 +121,7 @@ "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", "aws-cdk": "^2", - "aws-cdk-lib": "2.110.1", + "aws-cdk-lib": "2.116.1", "cdklabs-projen-project-types": "^0.1.182", "constructs": "10.0.5", "esbuild": "^0.19.9", @@ -132,9 +142,9 @@ "typescript": "^5.2.2" }, "peerDependencies": { - "@aws-cdk/aws-glue-alpha": "2.110.1-alpha.0", - "@aws-cdk/aws-redshift-alpha": "2.110.1-alpha.0", - "aws-cdk-lib": "^2.110.1", + "@aws-cdk/aws-glue-alpha": "2.116.1-alpha.0", + "@aws-cdk/aws-redshift-alpha": "2.116.1-alpha.0", + "aws-cdk-lib": "^2.116.1", "constructs": "^10.0.5" }, "dependencies": { diff --git a/src/amazonrdsforpostgresql/destination.ts b/src/amazonrdsforpostgresql/destination.ts new file mode 100644 index 00000000..daba3cd9 --- /dev/null +++ b/src/amazonrdsforpostgresql/destination.ts @@ -0,0 +1,105 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { CfnFlow } from 'aws-cdk-lib/aws-appflow'; +import { IConstruct } from 'constructs'; +import { AmazonRdsForPostgreSqlConnectorProfile } from './profile'; +import { AmazonRdsForPostgreSqlConnectorType } from './type'; +import { AppFlowPermissionsManager } from '../core/appflow-permissions-manager'; +import { ConnectorType } from '../core/connectors/connector-type'; +import { ErrorHandlingConfiguration } from '../core/error-handling'; +import { IFlow } from '../core/flows'; +import { IDestination } from '../core/vertices/destination'; +import { WriteOperationType } from '../core/write-operation'; + +/** + * The definition of the Amazon AppFlow object for Amazon RDS for PostgreSQL + */ +export interface AmazonRdsForPostgreSqlObject { + /** + * PostgreSQL schema name of the table + */ + readonly schema: string; + + /** + * PostgreSQL table name + */ + readonly table: string; +} + +/** + * Properties of the AmazonRdsForPostgreSqlDestination + */ +export interface AmazonRdsForPostgreSqlDestinationProps { + + /** + * The profile to use with the destination + */ + readonly profile: AmazonRdsForPostgreSqlConnectorProfile; + + /** + * The Amazon AppFlow Api Version + */ + readonly apiVersion?: string; + + /** + * The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. + */ + readonly errorHandling?: ErrorHandlingConfiguration; + + /** + * The destination object table to write to + */ + readonly object: AmazonRdsForPostgreSqlObject; +} + +/** + * Represents a destination for the Amazon RDS for PostgreSQL connector + */ +export class AmazonRdsForPostgreSqlDestination implements IDestination { + + private static readonly defaultApiVersion = '1.0'; + + public readonly connectorType: ConnectorType = AmazonRdsForPostgreSqlConnectorType.instance; + + /** + * Creates a new instance of the AmazonRdsForPostgreSqlDestination + * @param props - properties of the destination + */ + constructor(private readonly props: AmazonRdsForPostgreSqlDestinationProps) { } + + bind(flow: IFlow): CfnFlow.DestinationFlowConfigProperty { + + this.tryAddNodeDependency(flow, this.props.errorHandling?.errorLocation?.bucket); + AppFlowPermissionsManager.instance().grantBucketWrite(this.props.errorHandling?.errorLocation?.bucket); + this.tryAddNodeDependency(flow, this.props.profile); + + return { + connectorType: this.connectorType.asProfileConnectorType, + apiVersion: this.props.apiVersion ?? AmazonRdsForPostgreSqlDestination.defaultApiVersion, + connectorProfileName: this.props.profile.name, + destinationConnectorProperties: this.buildDestinationConnectorProperties(), + }; + } + + private buildDestinationConnectorProperties(): CfnFlow.DestinationConnectorPropertiesProperty { + return { + customConnector: { + entityName: `${this.props.object.schema}.${this.props.object.table}`, + errorHandlingConfig: this.props.errorHandling && { + bucketName: this.props.errorHandling?.errorLocation?.bucket.bucketName, + bucketPrefix: this.props.errorHandling?.errorLocation?.prefix, + failOnFirstError: this.props.errorHandling.failOnFirstError, + }, + writeOperationType: WriteOperationType.INSERT, + }, + }; + } + + private tryAddNodeDependency(scope: IConstruct, resource?: IConstruct | string): void { + if (resource && typeof resource !== 'string') { + scope.node.addDependency(resource); + } + } +} \ No newline at end of file diff --git a/src/amazonrdsforpostgresql/index.ts b/src/amazonrdsforpostgresql/index.ts new file mode 100644 index 00000000..1c39308b --- /dev/null +++ b/src/amazonrdsforpostgresql/index.ts @@ -0,0 +1,7 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +export * from './type'; +export * from './profile'; +export * from './destination'; \ No newline at end of file diff --git a/src/amazonrdsforpostgresql/profile.ts b/src/amazonrdsforpostgresql/profile.ts new file mode 100644 index 00000000..4a7fbca3 --- /dev/null +++ b/src/amazonrdsforpostgresql/profile.ts @@ -0,0 +1,116 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { SecretValue } from 'aws-cdk-lib'; +import { CfnConnectorProfile } from 'aws-cdk-lib/aws-appflow'; +import { Construct } from 'constructs'; +import { AmazonRdsForPostgreSqlConnectorType } from './type'; +import { ConnectorAuthenticationType } from '../core'; +import { ConnectorProfileBase, ConnectorProfileProps } from '../core/connectors/connector-profile'; + +/** + * Properties of the AmazonRdsForPostgreSqlConnectorProfile + */ +export interface AmazonRdsForPostgreSqlConnectorProfileProps extends ConnectorProfileProps { + /** + * The auth settings for the profile + */ + readonly basicAuth: AmazonRdsForPostgreSqlBasicAuthSettings; + /** + * The PostgreSQL hostname + */ + readonly hostname: string; + /** + * The PostgreSQL communication port + */ + readonly port?: number; + + /** + * The name of the PostgreSQL database + */ + readonly database: string; +} + +/** + * Basic authentication settings for the AmazonRdsForPostgreSqlConnectorProfile + */ +export interface AmazonRdsForPostgreSqlBasicAuthSettings { + /** + * The username of the identity used for interacting with the Amazon RDS for PostgreSQL + */ + readonly username: string; + + /** + * The password of the identity used for interacting with the Amazon RDS for PostgreSQL + */ + readonly password: SecretValue; +} + +/** + * The connector profile for the Amazon RDS for PostgreSQL connector + */ +export class AmazonRdsForPostgreSqlConnectorProfile extends ConnectorProfileBase { + + /** + * Imports an existing AmazonRdsForPostgreSqlConnectorProfile + * @param scope the scope for the connector profile + * @param id the connector profile's ID + * @param arn the ARN for the existing connector profile + * @returns An instance of the AmazonRdsForPostreSqlConnectorProfile + */ + public static fromConnectionProfileArn(scope: Construct, id: string, arn: string) { + return this._fromConnectorProfileAttributes(scope, id, { arn }) as AmazonRdsForPostgreSqlConnectorProfile; + } + + /** + * Imports an existing AmazonRdsForPostgreSqlConnectorProfile + * @param scope the scope for the connector profile + * @param id the connector profile's ID + * @param name the name for the existing connector profile + * @returns An instance of the AmazonRdsForPostreSqlConnectorProfile + */ + public static fromConnectionProfileName(scope: Construct, id: string, name: string) { + return this._fromConnectorProfileAttributes(scope, id, { name }) as AmazonRdsForPostgreSqlConnectorProfile; + } + + private static readonly defaultPort: number = 5432; + + /** + * Creates a new instance of the AmazonRdsForPostgreSqlConnectorProfile + * @param scope the Construct scope for this connector profile + * @param id the id of this connector profile + * @param props properties to use when instantiating this connector profile + */ + constructor(scope: Construct, id: string, props: AmazonRdsForPostgreSqlConnectorProfileProps) { + super(scope, id, props, AmazonRdsForPostgreSqlConnectorType.instance); + } + + protected buildConnectorProfileProperties(_props: ConnectorProfileProps): CfnConnectorProfile.ConnectorProfilePropertiesProperty { + return { + customConnector: { + profileProperties: {}, + }, + }; + } + + protected buildConnectorProfileCredentials(props: ConnectorProfileProps): CfnConnectorProfile.ConnectorProfileCredentialsProperty { + const properties = (props as AmazonRdsForPostgreSqlConnectorProfileProps); + return { + customConnector: { + authenticationType: ConnectorAuthenticationType.CUSTOM, + custom: { + credentialsMap: { + username: properties.basicAuth.username, + password: properties.basicAuth.password.unsafeUnwrap(), + driver: 'postgresql', + hostname: properties.hostname, + port: properties.port ? `${properties.port}` : AmazonRdsForPostgreSqlConnectorProfile.defaultPort.toString(), + database: properties.database, + }, + customAuthenticationType: 'CUSTOM', + }, + }, + }; + } +} \ No newline at end of file diff --git a/src/amazonrdsforpostgresql/type.ts b/src/amazonrdsforpostgresql/type.ts new file mode 100644 index 00000000..6d882db9 --- /dev/null +++ b/src/amazonrdsforpostgresql/type.ts @@ -0,0 +1,24 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { ConnectorType } from '../core/connectors/connector-type'; + +/** + * @internal + */ +export class AmazonRdsForPostgreSqlConnectorType extends ConnectorType { + + public static get instance(): ConnectorType { + if (!AmazonRdsForPostgreSqlConnectorType.actualInstance) { + AmazonRdsForPostgreSqlConnectorType.actualInstance = new AmazonRdsForPostgreSqlConnectorType(); + } + return AmazonRdsForPostgreSqlConnectorType.actualInstance; + } + + private static actualInstance: ConnectorType; + + constructor() { + super('AmazonRDSPostgreSQL', true); + } +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index f8ff2795..fc225883 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,8 +3,11 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ export * from './core'; + +export * from './amazonrdsforpostgresql'; export * from './eventbridge'; export * from './googleanalytics4'; +export * from './jdbcsmalldatascale'; export * from './marketo'; export * from './microsoftdynamics365'; export * from './microsoftsharepointonline'; diff --git a/src/jdbcsmalldatascale/destination.ts b/src/jdbcsmalldatascale/destination.ts new file mode 100644 index 00000000..6eef0035 --- /dev/null +++ b/src/jdbcsmalldatascale/destination.ts @@ -0,0 +1,105 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { CfnFlow } from 'aws-cdk-lib/aws-appflow'; +import { IConstruct } from 'constructs'; +import { JdbcSmallDataScaleConnectorProfile } from './profile'; +import { JdbcSmallDataScaleConnectorType } from './type'; +import { AppFlowPermissionsManager } from '../core/appflow-permissions-manager'; +import { ConnectorType } from '../core/connectors/connector-type'; +import { ErrorHandlingConfiguration } from '../core/error-handling'; +import { IFlow } from '../core/flows'; +import { IDestination } from '../core/vertices/destination'; +import { WriteOperationType } from '../core/write-operation'; + +/** + * The definition of the Amazon AppFlow object for JdbcSmallDestination + */ +export interface JdbcSmallDataScaleObject { + /** + * Database schema name of the table + */ + readonly schema: string; + + /** + * Database table name + */ + readonly table: string; +} + +/** + * Properties of the JdbcSmallDataScaleDestination + */ +export interface JdbcSmallDataScaleDestinationProps { + + /** + * The profile to use with the destination + */ + readonly profile: JdbcSmallDataScaleConnectorProfile; + + /** + * The Amazon AppFlow Api Version + */ + readonly apiVersion?: string; + + /** + * The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. + */ + readonly errorHandling?: ErrorHandlingConfiguration; + + /** + * The destination object table to write to + */ + readonly object: JdbcSmallDataScaleObject; +} + +/** + * Represents a destination for the JDBC connector + */ +export class JdbcSmallDataScaleDestination implements IDestination { + + private static readonly defaultApiVersion = 'V1'; + + public readonly connectorType: ConnectorType = JdbcSmallDataScaleConnectorType.instance; + + /** + * Creates a new instance of the JdbcSmallDataScaleDestination + * @param props - properties of the destination + */ + constructor(private readonly props: JdbcSmallDataScaleDestinationProps) { } + + bind(flow: IFlow): CfnFlow.DestinationFlowConfigProperty { + + this.tryAddNodeDependency(flow, this.props.errorHandling?.errorLocation?.bucket); + AppFlowPermissionsManager.instance().grantBucketWrite(this.props.errorHandling?.errorLocation?.bucket); + this.tryAddNodeDependency(flow, this.props.profile); + + return { + connectorType: this.connectorType.asProfileConnectorType, + apiVersion: this.props.apiVersion ?? JdbcSmallDataScaleDestination.defaultApiVersion, + connectorProfileName: this.props.profile.name, + destinationConnectorProperties: this.buildDestinationConnectorProperties(), + }; + } + + private buildDestinationConnectorProperties(): CfnFlow.DestinationConnectorPropertiesProperty { + return { + customConnector: { + entityName: `${this.props.object.schema}.${this.props.object.table}`, + errorHandlingConfig: this.props.errorHandling && { + bucketName: this.props.errorHandling?.errorLocation?.bucket.bucketName, + bucketPrefix: this.props.errorHandling?.errorLocation?.prefix, + failOnFirstError: this.props.errorHandling.failOnFirstError, + }, + writeOperationType: WriteOperationType.INSERT, + }, + }; + } + + private tryAddNodeDependency(scope: IConstruct, resource?: IConstruct | string): void { + if (resource && typeof resource !== 'string') { + scope.node.addDependency(resource); + } + } +} \ No newline at end of file diff --git a/src/jdbcsmalldatascale/driver.ts b/src/jdbcsmalldatascale/driver.ts new file mode 100644 index 00000000..015f7c6c --- /dev/null +++ b/src/jdbcsmalldatascale/driver.ts @@ -0,0 +1,4 @@ +export enum JdbcDriver { + POSTGRES = 'postgresql', + MYSQL = 'mysql' +} diff --git a/src/jdbcsmalldatascale/index.ts b/src/jdbcsmalldatascale/index.ts new file mode 100644 index 00000000..585cb37b --- /dev/null +++ b/src/jdbcsmalldatascale/index.ts @@ -0,0 +1,8 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +export * from './type'; +export * from './driver'; +export * from './profile'; +export * from './source'; \ No newline at end of file diff --git a/src/jdbcsmalldatascale/profile.ts b/src/jdbcsmalldatascale/profile.ts new file mode 100644 index 00000000..b0b40578 --- /dev/null +++ b/src/jdbcsmalldatascale/profile.ts @@ -0,0 +1,122 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { SecretValue } from 'aws-cdk-lib'; +import { CfnConnectorProfile } from 'aws-cdk-lib/aws-appflow'; +import { Construct } from 'constructs'; +import { JdbcDriver } from './driver'; +import { JdbcSmallDataScaleConnectorType } from './type'; +import { ConnectorAuthenticationType } from '../core'; +import { ConnectorProfileBase, ConnectorProfileProps } from '../core/connectors/connector-profile'; + +/** + * Properties for the JdbcSmallDataScaleConnectorProfile + */ +export interface JdbcSmallDataScaleConnectorProfileProps extends ConnectorProfileProps { + /** + * The auth settings for the profile + */ + readonly basicAuth: JdbcSmallDataScaleBasicAuthSettings; + + /** + * The hostname of the database to interact with + */ + readonly hostname: string; + + /** + * The database communication port + */ + readonly port: number; + + /** + * The name of the database + */ + readonly database: string; + + /** + * The driver for the database. Effectively specifies the type of database. + */ + readonly driver: JdbcDriver; +} + +/** + * Basic authentication settings for the JdbcSmallDataScaleConnectorProfile + */ +export interface JdbcSmallDataScaleBasicAuthSettings { + /** + * The username of the identity used for interacting with the database + */ + readonly username: string; + + /** + * The password of the identity used for interacting with the database + */ + readonly password: SecretValue; +} + +/** + * The connector profile for the JDBC connector + */ +export class JdbcSmallDataScaleConnectorProfile extends ConnectorProfileBase { + + /** + * Imports an existing JdbcSmallDataScaleConnectorProfile + * @param scope the scope for the connector profile + * @param id the connector profile's ID + * @param arn the ARN for the existing connector profile + * @returns An instance of the JdbcSmallDataScaleConnectorProfile + */ + public static fromConnectionProfileArn(scope: Construct, id: string, arn: string) { + return this._fromConnectorProfileAttributes(scope, id, { arn }) as JdbcSmallDataScaleConnectorProfile; + } + + /** + * Imports an existing JdbcSmallDataScaleConnectorProfile + * @param scope the scope for the connector profile + * @param id the connector profile's ID + * @param name the name for the existing connector profile + * @returns An instance of the JdbcSmallDataScaleConnectorProfile + */ + public static fromConnectionProfileName(scope: Construct, id: string, name: string) { + return this._fromConnectorProfileAttributes(scope, id, { name }) as JdbcSmallDataScaleConnectorProfile; + } + + /** + * Creates a new instance of the JdbcSmallDataScaleConnectorProfile + * @param scope the Construct scope for this connector profile + * @param id the id of this connector profile + * @param props properties to use when instantiating this connector profile + */ + constructor(scope: Construct, id: string, props: JdbcSmallDataScaleConnectorProfileProps) { + super(scope, id, props, JdbcSmallDataScaleConnectorType.instance); + } + + protected buildConnectorProfileProperties(_props: ConnectorProfileProps): CfnConnectorProfile.ConnectorProfilePropertiesProperty { + return { + customConnector: { + profileProperties: {}, + }, + }; + } + + protected buildConnectorProfileCredentials(props: ConnectorProfileProps): CfnConnectorProfile.ConnectorProfileCredentialsProperty { + const properties = (props as JdbcSmallDataScaleConnectorProfileProps); + return { + customConnector: { + authenticationType: ConnectorAuthenticationType.CUSTOM, + custom: { + credentialsMap: { + username: properties.basicAuth.username, + password: properties.basicAuth.password.unsafeUnwrap(), + driver: properties.driver, + hostname: properties.hostname, + port: `${properties.port}`, + database: properties.database, + }, + customAuthenticationType: 'CUSTOM', + }, + }, + }; + } +} \ No newline at end of file diff --git a/src/jdbcsmalldatascale/source.ts b/src/jdbcsmalldatascale/source.ts new file mode 100644 index 00000000..5c70af12 --- /dev/null +++ b/src/jdbcsmalldatascale/source.ts @@ -0,0 +1,57 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { CfnFlow } from 'aws-cdk-lib/aws-appflow'; +import { IConstruct } from 'constructs'; +import { JdbcSmallDataScaleConnectorProfile } from './profile'; +import { JdbcSmallDataScaleConnectorType } from './type'; +import { ConnectorType } from '../core/connectors/connector-type'; +import { IFlow } from '../core/flows'; +import { ISource } from '../core/vertices/source'; + +export interface JdbcSmallDataScaleObject { + readonly schema: string; + readonly table: string; +} + +export interface JdbcSmallDataScaleSourceProps { + readonly profile: JdbcSmallDataScaleConnectorProfile; + readonly object: JdbcSmallDataScaleObject; + readonly apiVersion?: string; +} + +export class JdbcSmallDataScaleSource implements ISource { + + private static readonly defaultApiVersion = 'V1'; + + public readonly connectorType: ConnectorType = JdbcSmallDataScaleConnectorType.instance; + + constructor(private readonly props: JdbcSmallDataScaleSourceProps) { } + + bind(flow: IFlow): CfnFlow.SourceFlowConfigProperty { + + this.tryAddNodeDependency(flow, this.props.profile); + + return { + connectorType: this.connectorType.asProfileConnectorType, + apiVersion: this.props.apiVersion ?? JdbcSmallDataScaleSource.defaultApiVersion, + connectorProfileName: this.props.profile.name, + sourceConnectorProperties: this.buildSourceConnectorProperties(), + }; + } + + private buildSourceConnectorProperties(): CfnFlow.SourceConnectorPropertiesProperty { + return { + customConnector: { + entityName: `${this.props.object.schema}.${this.props.object.table}`, + }, + }; + } + + private tryAddNodeDependency(scope: IConstruct, resource?: IConstruct | string): void { + if (resource && typeof resource !== 'string') { + scope.node.addDependency(resource); + } + } +} \ No newline at end of file diff --git a/src/jdbcsmalldatascale/type.ts b/src/jdbcsmalldatascale/type.ts new file mode 100644 index 00000000..6d93f29b --- /dev/null +++ b/src/jdbcsmalldatascale/type.ts @@ -0,0 +1,24 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { ConnectorType } from '../core/connectors/connector-type'; + +/** + * @internal + */ +export class JdbcSmallDataScaleConnectorType extends ConnectorType { + + public static get instance(): ConnectorType { + if (!JdbcSmallDataScaleConnectorType.actualInstance) { + JdbcSmallDataScaleConnectorType.actualInstance = new JdbcSmallDataScaleConnectorType(); + } + return JdbcSmallDataScaleConnectorType.actualInstance; + } + + private static actualInstance: ConnectorType; + + constructor() { + super('JDBCsmall', true); + } +} \ No newline at end of file diff --git a/src/salesforce/destination.ts b/src/salesforce/destination.ts index db324088..ab588105 100644 --- a/src/salesforce/destination.ts +++ b/src/salesforce/destination.ts @@ -14,7 +14,6 @@ import { IFlow } from '../core/flows'; import { IDestination } from '../core/vertices/destination'; import { WriteOperation } from '../core/write-operation'; - export interface SalesforceDestinationProps { readonly profile: SalesforceConnectorProfile; diff --git a/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.assets.json b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.assets.json new file mode 100644 index 00000000..c596202b --- /dev/null +++ b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "32.0.0", + "files": { + "57ce1be8e51f8f48dd339fadf0f4391c0dc7b4e9e109e23327a9c2a959428eaf": { + "source": { + "path": "TestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "57ce1be8e51f8f48dd339fadf0f4391c0dc7b4e9e109e23327a9c2a959428eaf.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.template.json b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.template.json new file mode 100644 index 00000000..40fc88d1 --- /dev/null +++ b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/TestStack.template.json @@ -0,0 +1,165 @@ +{ + "Resources": { + "TestConnectorProfileD7470107": { + "Type": "AWS::AppFlow::ConnectorProfile", + "Properties": { + "ConnectionMode": "Public", + "ConnectorProfileName": "TestConnectorProfile", + "ConnectorType": "CustomConnector", + "ConnectorLabel": "AmazonRDSPostgreSQL", + "ConnectorProfileConfig": { + "ConnectorProfileCredentials": { + "CustomConnector": { + "AuthenticationType": "CUSTOM", + "Custom": { + "CredentialsMap": { + "username": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:username::}}" + ] + ] + }, + "password": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:password::}}" + ] + ] + }, + "driver": "postgresql", + "hostname": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:hostname::}}" + ] + ] + }, + "port": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:port::}}" + ] + ] + }, + "database": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:database::}}" + ] + ] + } + }, + "CustomAuthenticationType": "CUSTOM" + } + } + }, + "ConnectorProfileProperties": { + "CustomConnector": { + "ProfileProperties": {} + } + } + } + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/cdk.out b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/cdk.out new file mode 100644 index 00000000..f0b901e7 --- /dev/null +++ b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"32.0.0"} \ No newline at end of file diff --git a/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/manifest.json b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/manifest.json new file mode 100644 index 00000000..658329c1 --- /dev/null +++ b/test/integ/ondemand-amazonrdsforpostgresql-to-s3.integ.snapshot/manifest.json @@ -0,0 +1,58 @@ +{ + "version": "32.0.0", + "artifacts": { + "TestStack.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "TestStack.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "TestStack": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "TestStack.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/57ce1be8e51f8f48dd339fadf0f4391c0dc7b4e9e109e23327a9c2a959428eaf.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "TestStack.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "TestStack.assets" + ], + "metadata": { + "/TestStack/TestConnectorProfile/TestConnectorProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "TestConnectorProfileD7470107" + } + ], + "/TestStack/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/TestStack/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "TestStack" + } + } +} \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.assets.json b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.assets.json new file mode 100644 index 00000000..6d9faff5 --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.assets.json @@ -0,0 +1,19 @@ +{ + "version": "35.0.0", + "files": { + "6861d545ce03a23ba70eed7607eb9d7591a85a706ff66d03d5aad22687d28078": { + "source": { + "path": "TestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "6861d545ce03a23ba70eed7607eb9d7591a85a706ff66d03d5aad22687d28078.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.template.json b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.template.json new file mode 100644 index 00000000..5723df98 --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.snapshot/TestStack.template.json @@ -0,0 +1,467 @@ +{ + "Resources": { + "JdbcSmallTestConnectorProfileD137BC4A": { + "Type": "AWS::AppFlow::ConnectorProfile", + "Properties": { + "ConnectionMode": "Public", + "ConnectorLabel": "JDBCsmall", + "ConnectorProfileConfig": { + "ConnectorProfileCredentials": { + "CustomConnector": { + "AuthenticationType": "CUSTOM", + "Custom": { + "CredentialsMap": { + "username": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:username::}}" + ] + ] + }, + "password": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:password::}}" + ] + ] + }, + "driver": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:driver::}}" + ] + ] + }, + "hostname": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:hostname::}}" + ] + ] + }, + "port": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:port::}}" + ] + ] + }, + "database": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:database::}}" + ] + ] + } + }, + "CustomAuthenticationType": "CUSTOM" + } + } + }, + "ConnectorProfileProperties": { + "CustomConnector": { + "ProfileProperties": {} + } + } + }, + "ConnectorProfileName": "JdbcSmallTestConnectorProfile", + "ConnectorType": "CustomConnector" + } + }, + "AmazonRdsTestConnectorProfileDA7BF797": { + "Type": "AWS::AppFlow::ConnectorProfile", + "Properties": { + "ConnectionMode": "Public", + "ConnectorLabel": "AmazonRDSPostgreSQL", + "ConnectorProfileConfig": { + "ConnectorProfileCredentials": { + "CustomConnector": { + "AuthenticationType": "CUSTOM", + "Custom": { + "CredentialsMap": { + "username": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:username::}}" + ] + ] + }, + "password": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:password::}}" + ] + ] + }, + "driver": "postgresql", + "hostname": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:hostname::}}" + ] + ] + }, + "port": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:port::}}" + ] + ] + }, + "database": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:database::}}" + ] + ] + } + }, + "CustomAuthenticationType": "CUSTOM" + } + } + }, + "ConnectorProfileProperties": { + "CustomConnector": { + "ProfileProperties": {} + } + } + }, + "ConnectorProfileName": "AmazonRdsTestConnectorProfile", + "ConnectorType": "CustomConnector" + } + }, + "OnDemandFlow4ECA54C5": { + "Type": "AWS::AppFlow::Flow", + "Properties": { + "DestinationFlowConfigList": [ + { + "ApiVersion": "1.0", + "ConnectorProfileName": "AmazonRdsTestConnectorProfile", + "ConnectorType": "CustomConnector", + "DestinationConnectorProperties": { + "CustomConnector": { + "EntityName": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:schema::}}.{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:table::}}" + ] + ] + }, + "WriteOperationType": "INSERT" + } + } + } + ], + "FlowName": "OnDemandFlow", + "SourceFlowConfig": { + "ApiVersion": "V1", + "ConnectorProfileName": "JdbcSmallTestConnectorProfile", + "ConnectorType": "CustomConnector", + "SourceConnectorProperties": { + "CustomConnector": { + "EntityName": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:schema::}}.{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:table::}}" + ] + ] + } + } + } + }, + "Tasks": [ + { + "ConnectorOperator": { + "CustomConnector": "PROJECTION" + }, + "SourceFields": [ + "username", + "password", + "created_on", + "email" + ], + "TaskType": "Filter" + }, + { + "ConnectorOperator": { + "CustomConnector": "NO_OP" + }, + "DestinationField": "username", + "SourceFields": [ + "username" + ], + "TaskProperties": [], + "TaskType": "Map" + }, + { + "ConnectorOperator": { + "CustomConnector": "NO_OP" + }, + "DestinationField": "password", + "SourceFields": [ + "password" + ], + "TaskProperties": [], + "TaskType": "Map" + }, + { + "ConnectorOperator": { + "CustomConnector": "NO_OP" + }, + "DestinationField": "created_on", + "SourceFields": [ + "created_on" + ], + "TaskProperties": [], + "TaskType": "Map" + }, + { + "ConnectorOperator": { + "CustomConnector": "NO_OP" + }, + "DestinationField": "email", + "SourceFields": [ + "email" + ], + "TaskProperties": [], + "TaskType": "Map" + } + ], + "TriggerConfig": { + "TriggerType": "OnDemand" + } + }, + "DependsOn": [ + "AmazonRdsTestConnectorProfileDA7BF797", + "JdbcSmallTestConnectorProfileD137BC4A" + ] + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts new file mode 100644 index 00000000..558f5217 --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-amazonrdsforpostgresql.integ.ts @@ -0,0 +1,73 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { App, Stack, Token } from 'aws-cdk-lib'; +import { Secret } from 'aws-cdk-lib/aws-secretsmanager'; +import { + AmazonRdsForPostgreSqlConnectorProfile, + AmazonRdsForPostgreSqlDestination, + JdbcDriver, + JdbcSmallDataScaleConnectorProfile, + JdbcSmallDataScaleSource, + Mapping, + OnDemandFlow, +} from '../../src'; + +const app = new App({ + treeMetadata: false, +}); + +const stack = new Stack(app, 'TestStack'); + +const secret = Secret.fromSecretNameV2(stack, 'TestSecret', 'appflow/rdspostgres'); + +const profile = new JdbcSmallDataScaleConnectorProfile(stack, 'JdbcSmallTestConnectorProfile', { + basicAuth: { + username: secret.secretValueFromJson('username').toString(), + password: secret.secretValueFromJson('password'), + }, + hostname: secret.secretValueFromJson('hostname').toString(), + port: Token.asNumber(secret.secretValueFromJson('port').toString()), + database: secret.secretValueFromJson('database').toString(), + driver: secret.secretValueFromJson('driver').toString() as JdbcDriver, +}); + +const source = new JdbcSmallDataScaleSource({ + profile, + object: { + schema: secret.secretValueFromJson('schema').toString(), + table: secret.secretValueFromJson('table').toString(), + }, +}); + +const destProfile = new AmazonRdsForPostgreSqlConnectorProfile(stack, 'AmazonRdsTestConnectorProfile', { + basicAuth: { + username: secret.secretValueFromJson('username').toString(), + password: secret.secretValueFromJson('password'), + }, + hostname: secret.secretValueFromJson('hostname').toString(), + port: Token.asNumber(secret.secretValueFromJson('port').toString()), + database: secret.secretValueFromJson('database').toString(), +}); + +const destination = new AmazonRdsForPostgreSqlDestination({ + profile: destProfile, + object: { + schema: secret.secretValueFromJson('schema').toString(), + table: secret.secretValueFromJson('table').toString(), + }, +}); + +new OnDemandFlow(stack, 'OnDemandFlow', { + source: source, + destination: destination, + mappings: [ + Mapping.map({ name: 'username' }, { name: 'username' }), + Mapping.map({ name: 'password' }, { name: 'password' }), + Mapping.map({ name: 'created_on' }, { name: 'created_on' }), + Mapping.map({ name: 'email' }, { name: 'email' }), + ], +}); + +app.synth(); \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.assets.json b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.assets.json new file mode 100644 index 00000000..2959cbfa --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.assets.json @@ -0,0 +1,32 @@ +{ + "version": "35.0.0", + "files": { + "b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6": { + "source": { + "path": "asset.b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "85e6c489b6ba6b249b35b568479083f37b5159ea1c2713c1812dfda7f164f585": { + "source": { + "path": "TestStack.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "85e6c489b6ba6b249b35b568479083f37b5159ea1c2713c1812dfda7f164f585.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.template.json b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.template.json new file mode 100644 index 00000000..3fc06986 --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.snapshot/TestStack.template.json @@ -0,0 +1,452 @@ +{ + "Resources": { + "TestConnectorProfileD7470107": { + "Type": "AWS::AppFlow::ConnectorProfile", + "Properties": { + "ConnectionMode": "Public", + "ConnectorLabel": "JDBCsmall", + "ConnectorProfileConfig": { + "ConnectorProfileCredentials": { + "CustomConnector": { + "AuthenticationType": "CUSTOM", + "Custom": { + "CredentialsMap": { + "username": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:username::}}" + ] + ] + }, + "password": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:password::}}" + ] + ] + }, + "driver": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:driver::}}" + ] + ] + }, + "hostname": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:hostname::}}" + ] + ] + }, + "port": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:port::}}" + ] + ] + }, + "database": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:database::}}" + ] + ] + } + }, + "CustomAuthenticationType": "CUSTOM" + } + } + }, + "ConnectorProfileProperties": { + "CustomConnector": { + "ProfileProperties": {} + } + } + }, + "ConnectorProfileName": "TestConnectorProfile", + "ConnectorType": "CustomConnector" + } + }, + "TestBucket560B80BC": { + "Type": "AWS::S3::Bucket", + "Properties": { + "Tags": [ + { + "Key": "aws-cdk:auto-delete-objects", + "Value": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TestBucketPolicyBA12ED38": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "TestBucket560B80BC" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:PutBucketPolicy", + "s3:GetBucket*", + "s3:List*", + "s3:DeleteObject*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TestBucket560B80BC", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestBucket560B80BC", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:PutObject", + "s3:AbortMultipartUpload", + "s3:ListMultipartUploadParts", + "s3:ListBucketMultipartUploads", + "s3:GetBucketAcl", + "s3:PutObjectAcl" + ], + "Condition": { + "StringEquals": { + "aws:SourceAccount": { + "Ref": "AWS::AccountId" + } + } + }, + "Effect": "Allow", + "Principal": { + "Service": "appflow.amazonaws.com" + }, + "Resource": [ + { + "Fn::GetAtt": [ + "TestBucket560B80BC", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TestBucket560B80BC", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "TestBucketAutoDeleteObjectsCustomResource8FEAABD5": { + "Type": "Custom::S3AutoDeleteObjects", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", + "Arn" + ] + }, + "BucketName": { + "Ref": "TestBucket560B80BC" + } + }, + "DependsOn": [ + "TestBucketPolicyBA12ED38" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ] + } + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Description": { + "Fn::Join": [ + "", + [ + "Lambda function for auto-deleting objects in ", + { + "Ref": "TestBucket560B80BC" + }, + " S3 bucket." + ] + ] + } + }, + "DependsOn": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + ] + }, + "OnDemandFlow4ECA54C5": { + "Type": "AWS::AppFlow::Flow", + "Properties": { + "DestinationFlowConfigList": [ + { + "ConnectorType": "S3", + "DestinationConnectorProperties": { + "S3": { + "BucketName": { + "Ref": "TestBucket560B80BC" + } + } + } + } + ], + "FlowName": "OnDemandFlow", + "SourceFlowConfig": { + "ApiVersion": "V1", + "ConnectorProfileName": "TestConnectorProfile", + "ConnectorType": "CustomConnector", + "SourceConnectorProperties": { + "CustomConnector": { + "EntityName": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:schema::}}.{{resolve:secretsmanager:arn:", + { + "Ref": "AWS::Partition" + }, + ":secretsmanager:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":secret:appflow/rdspostgres:SecretString:table::}}" + ] + ] + } + } + } + }, + "Tasks": [ + { + "ConnectorOperator": { + "CustomConnector": "NO_OP" + }, + "SourceFields": [], + "TaskProperties": [ + { + "Key": "EXCLUDE_SOURCE_FIELDS_LIST", + "Value": "[]" + } + ], + "TaskType": "Map_all" + } + ], + "TriggerConfig": { + "TriggerType": "OnDemand" + } + }, + "DependsOn": [ + "TestBucketAutoDeleteObjectsCustomResource8FEAABD5", + "TestBucketPolicyBA12ED38", + "TestBucket560B80BC", + "TestConnectorProfileD7470107" + ] + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts new file mode 100644 index 00000000..1b90f7b1 --- /dev/null +++ b/test/integ/ondemand-jdbcsmalldatascale-to-s3.integ.ts @@ -0,0 +1,54 @@ +/* +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 +*/ +import { App, RemovalPolicy, Stack, Token } from 'aws-cdk-lib'; +import { Bucket } from 'aws-cdk-lib/aws-s3'; +import { Secret } from 'aws-cdk-lib/aws-secretsmanager'; +import { + JdbcSmallDataScaleConnectorProfile, JdbcDriver, JdbcSmallDataScaleSource, S3Destination, OnDemandFlow, Mapping, +} from '../../src'; + +const app = new App({ + treeMetadata: false, +}); + +const stack = new Stack(app, 'TestStack'); + +const secret = Secret.fromSecretNameV2(stack, 'TestSecret', 'appflow/rdspostgres'); + +const profile = new JdbcSmallDataScaleConnectorProfile(stack, 'TestConnectorProfile', { + basicAuth: { + username: secret.secretValueFromJson('username').toString(), + password: secret.secretValueFromJson('password'), + }, + hostname: secret.secretValueFromJson('hostname').toString(), + port: Token.asNumber(secret.secretValueFromJson('port').toString()), + database: secret.secretValueFromJson('database').toString(), + driver: secret.secretValueFromJson('driver').toString() as JdbcDriver, +}); + +const source = new JdbcSmallDataScaleSource({ + profile, + object: { + schema: secret.secretValueFromJson('schema').toString(), + table: secret.secretValueFromJson('table').toString(), + }, +}); + +const bucket = new Bucket(stack, 'TestBucket', { + autoDeleteObjects: true, + removalPolicy: RemovalPolicy.DESTROY, +}); + +const destination = new S3Destination({ + location: { bucket }, +}); + +new OnDemandFlow(stack, 'OnDemandFlow', { + source: source, + destination: destination, + mappings: [Mapping.mapAll()], +}); + +app.synth(); \ No newline at end of file diff --git a/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.assets.json b/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.assets.json index 9f6e2290..c26b3f3b 100644 --- a/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.assets.json +++ b/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.assets.json @@ -27,15 +27,15 @@ } } }, - "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0": { + "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00": { "source": { - "path": "asset.0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0", + "path": "asset.e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip", + "objectKey": "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "6b314178348156ca204a2adc894442cc326c2ab12b0744df3aa051a654b94da5": { + "95e8ce4a546f3d6512ae5d9ecbad91a3b733ee750d900cd891ecb02c5fb39bc2": { "source": { "path": "TestStack.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "6b314178348156ca204a2adc894442cc326c2ab12b0744df3aa051a654b94da5.json", + "objectKey": "95e8ce4a546f3d6512ae5d9ecbad91a3b733ee750d900cd891ecb02c5fb39bc2.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.template.json b/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.template.json index b0341207..f64bde59 100644 --- a/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.template.json +++ b/test/integ/ondemand-s3-to-snowflake.integ.snapshot/TestStack.template.json @@ -358,7 +358,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip" + "S3Key": "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00.zip" }, "Environment": { "Variables": { diff --git a/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.assets.json b/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.assets.json index 86c094c8..8ec931e7 100644 --- a/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.assets.json +++ b/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.assets.json @@ -14,15 +14,15 @@ } } }, - "e275fde8d2a03c793e28878ff6a48e84af45d2655f0c79418b5b86f2add826f7": { + "cfac6ca3a4e2d5bd3b1972146b75664796ce0dc75ee0af8a149b3029ad745b3d": { "source": { - "path": "asset.e275fde8d2a03c793e28878ff6a48e84af45d2655f0c79418b5b86f2add826f7", + "path": "asset.cfac6ca3a4e2d5bd3b1972146b75664796ce0dc75ee0af8a149b3029ad745b3d", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "e275fde8d2a03c793e28878ff6a48e84af45d2655f0c79418b5b86f2add826f7.zip", + "objectKey": "cfac6ca3a4e2d5bd3b1972146b75664796ce0dc75ee0af8a149b3029ad745b3d.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -53,7 +53,7 @@ } } }, - "0da302d4fbe59ffb575aa17a9b5080bb9c7f912a8974ea89500f04d3d57788b2": { + "05538986ff9dd0b7f69751036b284217af71accf2c69f766facbfb9617a2afb9": { "source": { "path": "TestStack.template.json", "packaging": "file" @@ -61,7 +61,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0da302d4fbe59ffb575aa17a9b5080bb9c7f912a8974ea89500f04d3d57788b2.json", + "objectKey": "05538986ff9dd0b7f69751036b284217af71accf2c69f766facbfb9617a2afb9.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.template.json b/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.template.json index 4b72be1f..82267515 100644 --- a/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.template.json +++ b/test/integ/ondemand-salesforce-to-redshift.integ.snapshot/TestStack.template.json @@ -959,7 +959,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "e275fde8d2a03c793e28878ff6a48e84af45d2655f0c79418b5b86f2add826f7.zip" + "S3Key": "cfac6ca3a4e2d5bd3b1972146b75664796ce0dc75ee0af8a149b3029ad745b3d.zip" }, "Handler": "index.handler", "Role": { diff --git a/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.assets.json b/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.assets.json index 6d51437d..512bdad9 100644 --- a/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.assets.json +++ b/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.assets.json @@ -27,15 +27,15 @@ } } }, - "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0": { + "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00": { "source": { - "path": "asset.0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0", + "path": "asset.e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip", + "objectKey": "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } @@ -79,7 +79,7 @@ } } }, - "ff40c15fceb7f7d7cd19aba8d53e37d71f4f864bf51e8c89a73d4ce0f84786b5": { + "0c137355a8cc43952221ec33107bd9a4227440a32cb15451bc70a1bc0da92e3e": { "source": { "path": "TestStack.template.json", "packaging": "file" @@ -87,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ff40c15fceb7f7d7cd19aba8d53e37d71f4f864bf51e8c89a73d4ce0f84786b5.json", + "objectKey": "0c137355a8cc43952221ec33107bd9a4227440a32cb15451bc70a1bc0da92e3e.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.template.json b/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.template.json index 467f8376..4fad729e 100644 --- a/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.template.json +++ b/test/integ/onschedule-s3-to-salesforce.integ.snapshot/TestStack.template.json @@ -358,7 +358,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "0b1f5aa55d045066ed91316b823a808060c12737e0575ab7cefe2335324108b0.zip" + "S3Key": "e976a796f036a5efbf44b99e44cfb5a961df08d8dbf7cd37e60bf216fb982a00.zip" }, "Environment": { "Variables": { diff --git a/yarn.lock b/yarn.lock index ec92dfea..a37abb62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,15 +30,15 @@ resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.0.1.tgz#6dc9b7cdb22ff622a7176141197962360c33e9ac" integrity sha512-DDt4SLdLOwWCjGtltH4VCST7hpOI5DzieuhGZsBpZ+AgJdSI2GCjklCXm0GCTwJG/SolkL5dtQXyUKgg9luBDg== -"@aws-cdk/aws-glue-alpha@2.110.1-alpha.0": - version "2.110.1-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-glue-alpha/-/aws-glue-alpha-2.110.1-alpha.0.tgz#5c711d0e6c0ed8ef78d8eb5c9eab7118ed0faa65" - integrity sha512-JH0li0znIAPw9ScZPxyxvKVSrQEYch6ALsVC447pIM3ILWkqK52J709OASc+bOzfMYeUU0+4ruK3whQO2weFMg== +"@aws-cdk/aws-glue-alpha@2.116.1-alpha.0": + version "2.116.1-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-glue-alpha/-/aws-glue-alpha-2.116.1-alpha.0.tgz#9ea440b0e90b172d5c97a9afddef0206f4174142" + integrity sha512-U0BawxewRqmBgm03NTEtDkPiSO5GpuLG0xW+g78DudDnzdW6qcJmO/oOz6qoUEbR24VK8oqYqOXXoYzaHVWvyw== -"@aws-cdk/aws-redshift-alpha@2.110.1-alpha.0": - version "2.110.1-alpha.0" - resolved "https://registry.yarnpkg.com/@aws-cdk/aws-redshift-alpha/-/aws-redshift-alpha-2.110.1-alpha.0.tgz#3c17d5b9855f20d543bbeab4fa4ccd67912c1060" - integrity sha512-dqDuryFbAXCaGUfaH0dlgehs0gdrdh105Fg4ApQ/dIY00RZh9egrB9naI1Vv07DktuepcGMmBcO+MWeNoustAA== +"@aws-cdk/aws-redshift-alpha@2.116.1-alpha.0": + version "2.116.1-alpha.0" + resolved "https://registry.yarnpkg.com/@aws-cdk/aws-redshift-alpha/-/aws-redshift-alpha-2.116.1-alpha.0.tgz#1b67d00893e43c8e1cc212db67e2c0f5bfe0bf64" + integrity sha512-/jG35//7U5CQx3pTzeWbls3bbZ0ilPaBqPgfFSBz/WMi9ToLkYth4eHBeFfhMzeBs5sLKUSB4OBlqFJYXsoWeg== "@aws-cdk/aws-service-spec@0.0.29": version "0.0.29" @@ -1346,18 +1346,18 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -aws-cdk-lib@2.110.1: - version "2.110.1" - resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.110.1.tgz#3bbe61ec03b73da390ae5718060385c26333749d" - integrity sha512-Z+42Jc/KSKFdBOpEv4LK9tz6kQUdVvUBquIYhLajam3aGblkonM0/FgexvAqy8iGwUaVEIpVyBTZUP2/VUMalg== +aws-cdk-lib@2.116.1: + version "2.116.1" + resolved "https://registry.yarnpkg.com/aws-cdk-lib/-/aws-cdk-lib-2.116.1.tgz#4810ae231b1b87332a158b0b15a7d85dd5bc9b02" + integrity sha512-3j9kUHZFp/Jl79utnsBB2xW2u+sNfjpliQtTPQlW0i7J12oxjD2rHU4AJV741cKMxnA9VrHnRyJF9NTryji8yw== dependencies: "@aws-cdk/asset-awscli-v1" "^2.2.201" "@aws-cdk/asset-kubectl-v20" "^2.1.2" "@aws-cdk/asset-node-proxy-agent-v6" "^2.0.1" "@balena/dockerignore" "^1.0.2" case "1.6.3" - fs-extra "^11.1.1" - ignore "^5.2.4" + fs-extra "^11.2.0" + ignore "^5.3.0" jsonschema "^1.4.1" minimatch "^3.1.2" punycode "^2.3.1" @@ -2576,10 +2576,10 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" - integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== +fs-extra@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -2931,7 +2931,7 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ignore@^5.2.0, ignore@^5.2.4: +ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==