Skip to content

Commit d5238e8

Browse files
feat(batch): add Firelens configuration support for AWS Batch Job Definition
1 parent 9f6b949 commit d5238e8

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

packages/aws-cdk-lib/aws-apigateway/lib/integration.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,24 @@ export interface IntegrationOptions {
132132
* The VpcLink used for the integration.
133133
* Required if connectionType is VPC_LINK
134134
*
135-
* @deprecated Use `vpcLinkV2` for VPC Link V2 integrations with ALB/NLB
135+
* Use this for NLB integrations. For ALB integrations, use `vpcLinkV2` instead.
136136
*/
137137
readonly vpcLink?: IVpcLink;
138138

139139
/**
140140
* The VPC Link V2 used for the integration.
141141
*
142-
* VPC Links V2 enable private integrations that connect your REST API directly to Application Load Balancers or Network Load Balancers.
142+
* VPC Links V2 enable private integrations that connect your REST API directly to Application Load Balancers.
143143
*
144-
* When using `vpcLinkV2`, you must also specify `integrationTarget` with the ARN of the ALB or NLB.
144+
* When using `vpcLinkV2`, you must also specify `integrationTarget` with the ARN of the ALB.
145145
*
146146
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-vpc-links-v2.html
147147
* @default - No VPC Link V2
148148
*/
149149
readonly vpcLinkV2?: apigwv2.IVpcLink;
150150

151151
/**
152-
* The ALB or NLB ARN to send the request to.
152+
* The ALB ARN to send the request to.
153153
*
154154
* Only supported for private integrations that use VPC links V2.
155155
* When using this property, you must also specify `vpcLinkV2`.
@@ -233,11 +233,12 @@ export interface IntegrationConfig {
233233
readonly integrationHttpMethod?: string;
234234

235235
/**
236-
* This value is included in computing the Deployment's fingerprint. When the fingerprint
237-
* changes, a new deployment is triggered.
236+
* This value is included in computing the Deployment's fingerprint.
237+
* When the fingerprint changes, a new deployment is triggered.
238238
* This property should contain values associated with the Integration that upon changing
239239
* should trigger a fresh the Deployment needs to be refreshed.
240-
* @default undefined deployments are not triggered for any change to this integration.
240+
*
241+
* @default undefined - deployments are not triggered for any change to this integration.
241242
*/
242243
readonly deploymentToken?: string;
243244
}

packages/aws-cdk-lib/aws-apigateway/lib/integrations/alb.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as apigwv2 from '../../../aws-apigatewayv2';
22
import * as ec2 from '../../../aws-ec2';
33
import * as elbv2 from '../../../aws-elasticloadbalancingv2';
4-
import { Names, Token } from '../../../core';
4+
import { Token } from '../../../core';
55
import { ValidationError } from '../../../core/lib/errors';
66
import { ConnectionType, Integration, IntegrationConfig, IntegrationOptions, IntegrationType } from '../integration';
77
import { Method } from '../method';
@@ -39,8 +39,7 @@ export interface AlbIntegrationProps {
3939
/**
4040
* Integration options, such as request/response mapping, content handling, etc.
4141
*
42-
* Note: `vpcLinkV2` and `integrationTarget` options are automatically configured
43-
* and should not be specified here.
42+
* `vpcLinkV2` and `integrationTarget` options are automatically configured and should not be specified here.
4443
*
4544
* @default - No additional options
4645
*/
@@ -70,9 +69,9 @@ export class AlbIntegration extends Integration {
7069

7170
super({
7271
type: proxy ? IntegrationType.HTTP_PROXY : IntegrationType.HTTP,
73-
// integrationHttpMethod will be set in bind() if not provided
72+
// integrationHttpMethod will be updated in bind() if not provided
7473
integrationHttpMethod: props.httpMethod ?? 'ANY',
75-
// uri is required for HTTP integrations, will be set in bind()
74+
// uri is required for HTTP integrations, will be updated in bind()
7675
uri: 'http://placeholder.internal',
7776
options: props.options,
7877
});
@@ -131,12 +130,14 @@ export class AlbIntegration extends Integration {
131130
}
132131

133132
/**
134-
* Creates a new VPC Link for the ALB's VPC.
133+
* Creates a new VPC Link for the VPC, or returns an existing one if already created.
134+
*
135+
* VPC Links are shared per VPC, similar to the API Gateway V2 implementation.
135136
*/
136137
private createVpcLink(method: Method, vpc: ec2.IVpc): apigwv2.VpcLink {
137-
const id = `VpcLink-${Names.nodeUniqueId(this.alb.node)}`;
138+
const id = `VpcLink-${vpc.node.id}`;
138139

139-
// Check if a VPC link already exists in the API's scope
140+
// Check if a VPC link already exists in the API's scope for this VPC
140141
const existingVpcLink = method.api.node.tryFindChild(id) as apigwv2.VpcLink | undefined;
141142
if (existingVpcLink) {
142143
return existingVpcLink;

0 commit comments

Comments
 (0)