1
1
import { randomUUID } from 'crypto' ;
2
2
import * as path from 'path' ;
3
- import { Construct } from 'constructs' ;
3
+ import { Construct , IConstruct } from 'constructs' ;
4
4
import { ISourceApiAssociation } from './source-api-association' ;
5
5
import { PolicyStatement , Effect } from '../../aws-iam' ;
6
6
import { Runtime , Function } from '../../aws-lambda/lib' ;
7
7
import { NodejsFunction } from '../../aws-lambda-nodejs' ;
8
- import { CfnResource , CustomResource , Duration , Resource } from '../../core' ;
8
+ import { CfnResource , CustomResource , Duration } from '../../core' ;
9
9
import { Provider } from '../../custom-resources/lib/provider-framework' ;
10
10
11
- export interface ISourceApiAssociationMergeOperationProvider {
11
+ /**
12
+ * This interface for the provider of the custom resource that will be used to initiate a merge operation during Cloudformation update.
13
+ */
14
+ export interface ISourceApiAssociationMergeOperationProvider extends IConstruct {
12
15
13
16
/**
14
17
* Service token which is used for identifying the handler used for the merge operation custom resource.
@@ -23,7 +26,11 @@ export interface ISourceApiAssociationMergeOperationProvider {
23
26
associateSourceApiAssociation ( sourceApiAssociation : ISourceApiAssociation ) : void ;
24
27
}
25
28
26
- export class SourceApiAssociationMergeOperationProvider extends Resource implements ISourceApiAssociationMergeOperationProvider {
29
+ /**
30
+ * SourceApiAssociationMergeProvider class is responsible for constructing the custom resource that will be used for initiating the
31
+ * source API merge during a Cloudformation update.
32
+ */
33
+ export class SourceApiAssociationMergeOperationProvider extends Construct implements ISourceApiAssociationMergeOperationProvider {
27
34
28
35
/**
29
36
* Service token for the resource provider.
@@ -92,21 +99,24 @@ export interface SourceApiAssociationMergeOperationProps {
92
99
readonly sourceApiAssociation : ISourceApiAssociation ;
93
100
94
101
/**
95
- *
102
+ * The merge operation provider construct which is responsible for configuring the Lambda resource that will be invoked during
103
+ * Cloudformation update.
96
104
*/
97
105
readonly mergeOperationProvider : ISourceApiAssociationMergeOperationProvider ;
98
106
99
107
/**
100
108
* The version identifier for the schema merge operation. Any change to the version identifier will trigger a merge on the next
101
109
* update. Use the version identifier property to control when the source API metadata is merged.
110
+ *
111
+ * @default null
102
112
*/
103
113
readonly versionIdentifier ?: string ;
104
114
105
115
/**
106
116
* Flag indicating whether the source api should be merged on every CFN update or not.
107
117
* If set to true and there are no changes to the source API, this will result in a no-op merge operation.
108
118
*
109
- * @default - False
119
+ * @default False
110
120
*/
111
121
readonly alwaysMergeOnStackUpdate ?: boolean ;
112
122
}
@@ -148,7 +158,7 @@ type MergeResourceProperties = {
148
158
* This can be used to propagate changes from the source API to the Merged API when the association is using type MANUAL_MERGE.
149
159
* If the merge operation fails, it will fail the Cloudformation update and rollback the stack.
150
160
*/
151
- export class SourceApiAssociationMergeOperation extends Resource {
161
+ export class SourceApiAssociationMergeOperation extends Construct {
152
162
153
163
constructor ( scope : Construct , id : string , props : SourceApiAssociationMergeOperationProps ) {
154
164
super ( scope , id ) ;
0 commit comments