diff --git a/API.md b/API.md index 4b5d6888..54757394 100644 --- a/API.md +++ b/API.md @@ -657,9 +657,9 @@ Check whether the given construct is a Resource. | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -714,6 +714,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -724,6 +726,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -734,6 +738,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- @@ -1766,9 +1772,9 @@ Check whether the given construct is a Resource. | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -1823,6 +1829,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -1833,6 +1841,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -1843,6 +1853,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- @@ -2085,9 +2097,9 @@ Check whether the given construct is a Resource. | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -2142,6 +2154,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -2152,6 +2166,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -2162,6 +2178,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- @@ -2385,9 +2403,9 @@ Check whether the given construct is a Resource. | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -2442,6 +2460,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -2452,6 +2472,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -2462,6 +2484,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- @@ -4125,12 +4149,14 @@ public readonly credentials: ISecret; - *Implements:* IFlow +A base class for triggered flows. + #### Initializers ```typescript import { TriggeredFlowBase } from '@cdklabs/cdk-appflow' -new TriggeredFlowBase(scope: Construct, id: string, props: FlowBaseProps, autoActivate?: boolean) +new TriggeredFlowBase(scope: Construct, id: string, props: FlowBaseProps) ``` | **Name** | **Type** | **Description** | @@ -4138,7 +4164,6 @@ new TriggeredFlowBase(scope: Construct, id: string, props: FlowBaseProps, autoAc | scope | constructs.Construct | *No description.* | | id | string | *No description.* | | props | FlowBaseProps | *No description.* | -| autoActivate | boolean | *No description.* | --- @@ -4160,12 +4185,6 @@ new TriggeredFlowBase(scope: Construct, id: string, props: FlowBaseProps, autoAc --- -##### `autoActivate`Optional - -- *Type:* boolean - ---- - #### Methods | **Name** | **Description** | @@ -4348,9 +4367,9 @@ Check whether the given construct is a Resource. | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -4405,6 +4424,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -4415,6 +4436,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -4425,6 +4448,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- @@ -4931,6 +4956,7 @@ const flowBaseProps: FlowBaseProps = { ... } | transforms | ITransform[] | *No description.* | | validations | IValidation[] | *No description.* | | type | FlowType | *No description.* | +| status | FlowStatus | *No description.* | | triggerConfig | TriggerConfig | *No description.* | --- @@ -5035,6 +5061,16 @@ public readonly type: FlowType; --- +##### `status`Optional + +```typescript +public readonly status: FlowStatus; +``` + +- *Type:* FlowStatus + +--- + ##### `triggerConfig`Optional ```typescript @@ -6089,6 +6125,7 @@ const onEventFlowProps: OnEventFlowProps = { ... } | transforms | ITransform[] | *No description.* | | validations | IValidation[] | *No description.* | | autoActivate | boolean | *No description.* | +| status | FlowStatus | The status to set on the flow. | --- @@ -6182,7 +6219,9 @@ public readonly validations: IValidation[]; --- -##### `autoActivate`Optional +##### ~~`autoActivate`~~Optional + +- *Deprecated:* . This property is deprecated and will be removed in a future release. Use {@link status} instead ```typescript public readonly autoActivate: boolean; @@ -6192,6 +6231,20 @@ public readonly autoActivate: boolean; --- +##### `status`Optional + +```typescript +public readonly status: FlowStatus; +``` + +- *Type:* FlowStatus + +The status to set on the flow. + +Use this over {@link autoActivate}. + +--- + ### OnScheduleFlowProps #### Initializer @@ -6216,6 +6269,7 @@ const onScheduleFlowProps: OnScheduleFlowProps = { ... } | transforms | ITransform[] | *No description.* | | validations | IValidation[] | *No description.* | | autoActivate | boolean | *No description.* | +| status | FlowStatus | The status to set on the flow. | | pullConfig | DataPullConfig | *No description.* | | schedule | aws-cdk-lib.aws_events.Schedule | *No description.* | | scheduleProperties | ScheduleProperties | *No description.* | @@ -6312,7 +6366,9 @@ public readonly validations: IValidation[]; --- -##### `autoActivate`Optional +##### ~~`autoActivate`~~Optional + +- *Deprecated:* . This property is deprecated and will be removed in a future release. Use {@link status} instead ```typescript public readonly autoActivate: boolean; @@ -6322,6 +6378,20 @@ public readonly autoActivate: boolean; --- +##### `status`Optional + +```typescript +public readonly status: FlowStatus; +``` + +- *Type:* FlowStatus + +The status to set on the flow. + +Use this over {@link autoActivate}. + +--- + ##### `pullConfig`Required ```typescript @@ -8501,6 +8571,7 @@ const triggeredFlowBaseProps: TriggeredFlowBaseProps = { ... } | transforms | ITransform[] | *No description.* | | validations | IValidation[] | *No description.* | | autoActivate | boolean | *No description.* | +| status | FlowStatus | The status to set on the flow. | --- @@ -8594,7 +8665,9 @@ public readonly validations: IValidation[]; --- -##### `autoActivate`Optional +##### ~~`autoActivate`~~Optional + +- *Deprecated:* . This property is deprecated and will be removed in a future release. Use {@link status} instead ```typescript public readonly autoActivate: boolean; @@ -8604,6 +8677,20 @@ public readonly autoActivate: boolean; --- +##### `status`Optional + +```typescript +public readonly status: FlowStatus; +``` + +- *Type:* FlowStatus + +The status to set on the flow. + +Use this over {@link autoActivate}. + +--- + ### TriggerProperties #### Initializer @@ -12013,9 +12100,9 @@ public onRunStarted(id: string, options?: OnEventOptions): Rule | 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.* | -| type | FlowType | *No description.* | +| arn | string | The ARN of the flow. | +| name | string | The name of the flow. | +| type | FlowType | The type of the flow. | --- @@ -12070,6 +12157,8 @@ public readonly arn: string; - *Type:* string +The ARN of the flow. + --- ##### `name`Required @@ -12080,6 +12169,8 @@ public readonly name: string; - *Type:* string +The name of the flow. + --- ##### `type`Required @@ -12090,6 +12181,8 @@ public readonly type: FlowType; - *Type:* FlowType +The type of the flow. + --- ### IMapping @@ -12340,6 +12433,27 @@ The AppFlow type of the connector that this source is implemented for. --- +### FlowStatus + +#### Members + +| **Name** | **Description** | +| --- | --- | +| ACTIVE | *No description.* | +| SUSPENDED | *No description.* | + +--- + +##### `ACTIVE` + +--- + + +##### `SUSPENDED` + +--- + + ### FlowType #### Members diff --git a/src/core/flows/flow-base.ts b/src/core/flows/flow-base.ts index 6ae62563..26abd661 100644 --- a/src/core/flows/flow-base.ts +++ b/src/core/flows/flow-base.ts @@ -16,29 +16,45 @@ import { IDestination } from '../vertices/destination'; import { ISource } from '../vertices/source'; export interface IFlow extends IResource { + /** + * The ARN of the flow. + */ readonly arn: string; + + /** + * The name of the flow + */ readonly name: string; + + /** + * The type of the flow. + */ readonly type: FlowType; onRunStarted(id: string, options?: OnEventOptions): Rule; onRunCompleted(id: string, options?: OnEventOptions): Rule; + /** * @internal */ _addMapping(mapping: IMapping): IFlow; + /** * @internal */ _addValidation(validator: IValidation): IFlow; + /** * @internal */ _addTransform(transform: ITransform): IFlow; + /** * @internal */ _addFilter(filter: IFilter): IFlow; + /** * @internal */ @@ -51,6 +67,11 @@ export enum FlowType { SCHEDULED = 'Scheduled' } +export enum FlowStatus { + ACTIVE = 'Active', + SUSPENDED = 'Suspended' +} + export enum DataPullMode { COMPLETE = 'Complete', INCREMENTAL = 'Incremental' @@ -103,13 +124,24 @@ export interface FlowProps { export interface FlowBaseProps extends FlowProps { readonly type: FlowType; readonly triggerConfig?: TriggerConfig; + readonly status?: FlowStatus; } export abstract class FlowBase extends Resource implements IFlow { + /** + * The ARN of the flow. + */ public readonly arn: string; + + /** + * The type of the flow. + */ public readonly type: FlowType; + /** + * The name of the flow. + */ public readonly name: string; private readonly mappings: CfnFlow.TaskProperty[] = []; @@ -133,6 +165,7 @@ export abstract class FlowBase extends Resource implements IFlow { this.name = props.name || id; const resource = new CfnFlow(this, id, { flowName: this.name, + flowStatus: props.status, triggerConfig: { triggerType: props.type, triggerProperties: props.triggerConfig diff --git a/src/core/flows/on-event-flow.ts b/src/core/flows/on-event-flow.ts index 447fbf22..0dccc4ec 100644 --- a/src/core/flows/on-event-flow.ts +++ b/src/core/flows/on-event-flow.ts @@ -15,7 +15,8 @@ export class OnEventFlow extends TriggeredFlowBase implements IFlow { super(scope, id, { ...props, type: FlowType.EVENT, - }, props.autoActivate); + status: TriggeredFlowBase.setStatus(props.autoActivate, props.status), + }); } public onDeactivated(id: string, options: OnEventOptions = {}) { diff --git a/src/core/flows/on-schedule-flow.ts b/src/core/flows/on-schedule-flow.ts index a1fccb5d..013183a4 100644 --- a/src/core/flows/on-schedule-flow.ts +++ b/src/core/flows/on-schedule-flow.ts @@ -18,6 +18,7 @@ export class OnScheduleFlow extends TriggeredFlowBase implements IFlow { super(scope, id, { ...props, type: FlowType.SCHEDULED, + status: TriggeredFlowBase.setStatus(props.autoActivate, props.status), triggerConfig: { properties: { schedule: props.schedule, @@ -25,7 +26,7 @@ export class OnScheduleFlow extends TriggeredFlowBase implements IFlow { properties: props.scheduleProperties, }, }, - }, props.autoActivate); + }); } public onDeactivated(id: string, options: OnEventOptions = {}) { diff --git a/src/core/flows/triggered-flow-base.ts b/src/core/flows/triggered-flow-base.ts index 76d0aa39..a9e152af 100644 --- a/src/core/flows/triggered-flow-base.ts +++ b/src/core/flows/triggered-flow-base.ts @@ -3,47 +3,50 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ import { OnEventOptions, Rule } from 'aws-cdk-lib/aws-events'; -import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from 'aws-cdk-lib/custom-resources'; import { Construct } from 'constructs'; -import { FlowBase, FlowBaseProps, FlowProps, IFlow } from './flow-base'; +import { FlowBase, FlowBaseProps, FlowProps, FlowStatus, IFlow } from './flow-base'; export interface TriggeredFlowBaseProps extends FlowProps { + /** + * The status to set on the flow. Use this over {@link autoActivate}. + */ + readonly status?: FlowStatus; + /** + * @deprecated. This property is deprecated and will be removed in a future release. Use {@link status} instead + */ readonly autoActivate?: boolean; } +/** + * A base class for triggered flows. + */ export abstract class TriggeredFlowBase extends FlowBase implements IFlow { - constructor(scope: Construct, id: string, props: FlowBaseProps, autoActivate?: boolean) { - super(scope, id, props); - - if (autoActivate) { - const activatorId = `${id}Activator`; - - // TODO: this is too basic. test it more to identify any potential errors/issues - const activator = new AwsCustomResource(scope, activatorId, { - onCreate: { - service: 'Appflow', - action: 'startFlow', - parameters: { - flowName: this.name, - }, - physicalResourceId: PhysicalResourceId.of(activatorId), - }, - onDelete: { - service: 'Appflow', - action: 'stopFlow', - parameters: { - flowName: this.name, - }, - }, - policy: AwsCustomResourcePolicy.fromSdkCalls({ - resources: AwsCustomResourcePolicy.ANY_RESOURCE, - }), - }); - - activator.node.addDependency(this); + /** + * + * @param autoActivate - a boolean value indicating whether to automatically activate the flow. + * @param status - a {@link FlowStatus} value indicating the status to set on the flow. + * @returns + */ + protected static setStatus(autoActivate?: boolean, status?: FlowStatus): FlowStatus | undefined { + if (autoActivate !== undefined && status !== undefined) { + throw new Error('Cannot specify both autoActivate and status'); } + + return autoActivate !== undefined ? + (autoActivate ? FlowStatus.ACTIVE : FlowStatus.SUSPENDED) : + (status !== undefined ? status : undefined); + } + /** + * + * @param scope + * @param id + * @param props + */ + constructor(scope: Construct, id: string, props: FlowBaseProps) { + super(scope, id, props); } public abstract onDeactivated(id: string, options?: OnEventOptions): Rule; + } diff --git a/test/core/flows/on-event-flow.test.ts b/test/core/flows/on-event-flow.test.ts index 6decfc84..a63d8cfa 100644 --- a/test/core/flows/on-event-flow.test.ts +++ b/test/core/flows/on-event-flow.test.ts @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 import { Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { Bucket } from 'aws-cdk-lib/aws-s3'; -import { OnEventFlow, SalesforceSource, EventBridgeDestination, EventSources, Mapping, SalesforceConnectorProfile } from '../../../src'; +import { OnEventFlow, SalesforceSource, EventBridgeDestination, EventSources, Mapping, SalesforceConnectorProfile, FlowStatus } from '../../../src'; describe('OnEventFlow', () => { test.each([{ @@ -30,7 +30,7 @@ describe('OnEventFlow', () => { source: source, destination: destination, mappings: [Mapping.mapAll()], - autoActivate: true, + status: FlowStatus.ACTIVE, }); flow.onDeactivated('OnDeactivated', namedRules ? { @@ -72,6 +72,7 @@ describe('OnEventFlow', () => { }, ], FlowName: 'OnEventFlow', + FlowStatus: 'Active', SourceFlowConfig: { ConnectorProfileName: 'appflow-tester', ConnectorType: 'Salesforce', @@ -148,20 +149,6 @@ describe('OnEventFlow', () => { }, State: 'ENABLED', }); - - template.resourceCountIs('Custom::AWS', 1); - - template.hasResourceProperties('Custom::AWS', { - ServiceToken: { - 'Fn::GetAtt': [ - 'AWS679f53fac002430cb0da5b7982bd22872D164C4C', - 'Arn', - ], - }, - Create: '{"service":"Appflow","action":"startFlow","parameters":{"flowName":"OnEventFlow"},"physicalResourceId":{"id":"OnEventFlowActivator"}}', - Delete: '{"service":"Appflow","action":"stopFlow","parameters":{"flowName":"OnEventFlow"}}', - InstallLatestAwsSdk: true, - }); }); test('autoactivated flow without status and deactivation listeners renders flow definition only', () => { @@ -182,13 +169,14 @@ describe('OnEventFlow', () => { source: source, destination: destination, mappings: [Mapping.mapAll()], - autoActivate: false, + status: FlowStatus.SUSPENDED, }); const template = Template.fromStack(stack); template.hasResource('AWS::AppFlow::Flow', { Properties: { + FlowStatus: 'Suspended', DestinationFlowConfigList: [ { ConnectorType: 'EventBridge', 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 2f4eb3ea..08bfac60 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 @@ -79,20 +79,7 @@ } } }, - "f9346b940b724b094a16ca051c017799995fa93df6da38a0539bf7c000fee50a": { - "source": { - "path": "asset.f9346b940b724b094a16ca051c017799995fa93df6da38a0539bf7c000fee50a", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "f9346b940b724b094a16ca051c017799995fa93df6da38a0539bf7c000fee50a.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "70e9e81a17e28b416e6cddd53c6f664013051489338e6fb4049fc03220fd5b32": { + "593c27ba9998e04fb75a5b15e6f87386ea622fd825ad3003bc96380f0567da22": { "source": { "path": "TestStack.template.json", "packaging": "file" @@ -100,7 +87,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "70e9e81a17e28b416e6cddd53c6f664013051489338e6fb4049fc03220fd5b32.json", + "objectKey": "593c27ba9998e04fb75a5b15e6f87386ea622fd825ad3003bc96380f0567da22.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 6666a02e..a849c369 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 @@ -576,7 +576,8 @@ } }, "TriggerType": "Scheduled" - } + }, + "FlowStatus": "Active" }, "DependsOn": [ "OnScheduleFlowUpdater39178314", @@ -831,121 +832,6 @@ "comamazonawscdkcustomresourcesflowtimeproviderframeworkonEventServiceRoleDefaultPolicyDE524CE6", "comamazonawscdkcustomresourcesflowtimeproviderframeworkonEventServiceRole2DC53640" ] - }, - "OnScheduleFlowActivatorEF04E46F": { - "Type": "Custom::AWS", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd22872D164C4C", - "Arn" - ] - }, - "Create": "{\"service\":\"Appflow\",\"action\":\"startFlow\",\"parameters\":{\"flowName\":\"OnScheduleFlow\"},\"physicalResourceId\":{\"id\":\"OnScheduleFlowActivator\"}}", - "Delete": "{\"service\":\"Appflow\",\"action\":\"stopFlow\",\"parameters\":{\"flowName\":\"OnScheduleFlow\"}}", - "InstallLatestAwsSdk": true - }, - "DependsOn": [ - "OnScheduleFlowcaptureOnDeactivatedF7603006", - "OnScheduleFlowcaptureOnRunCompletedB9E179F4", - "OnScheduleFlow9A474F3B", - "OnScheduleFlowActivatorCustomResourcePolicyEE06504E" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "OnScheduleFlowActivatorCustomResourcePolicyEE06504E": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "appflow:StartFlow", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "appflow:StopFlow", - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "OnScheduleFlowActivatorCustomResourcePolicyEE06504E", - "Roles": [ - { - "Ref": "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - } - ] - }, - "DependsOn": [ - "OnScheduleFlowcaptureOnDeactivatedF7603006", - "OnScheduleFlowcaptureOnRunCompletedB9E179F4", - "OnScheduleFlow9A474F3B" - ] - }, - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "AWS679f53fac002430cb0da5b7982bd22872D164C4C": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "f9346b940b724b094a16ca051c017799995fa93df6da38a0539bf7c000fee50a.zip" - }, - "Role": { - "Fn::GetAtt": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": { - "Fn::FindInMap": [ - "DefaultCrNodeVersionMap", - { - "Ref": "AWS::Region" - }, - "value" - ] - }, - "Timeout": 120 - }, - "DependsOn": [ - "AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2" - ] } }, "Mappings": { diff --git a/test/integ/onschedule-s3-to-salesforce.integ.ts b/test/integ/onschedule-s3-to-salesforce.integ.ts index 65675076..2e5a357b 100644 --- a/test/integ/onschedule-s3-to-salesforce.integ.ts +++ b/test/integ/onschedule-s3-to-salesforce.integ.ts @@ -20,6 +20,7 @@ import { Transform, WriteOperation, SalesforceConnectorProfile, + FlowStatus, } from '../../src'; const app = new App({ @@ -83,7 +84,7 @@ const flow = new OnScheduleFlow(stack, 'OnScheduleFlow', { scheduleProperties: { startTime: new Date(Date.parse('2024-01-01')), }, - autoActivate: true, + status: FlowStatus.ACTIVE, }); flow.node.addDependency(deployment);