Skip to content

Commit 80b10f8

Browse files
chore(apigatewayv2): remove usage of deprecated httpApiId (#13419)
remove usage of deprecated httpApiId ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent fe1c839 commit 80b10f8

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

packages/@aws-cdk/aws-apigatewayv2-integrations/lib/http/lambda.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class LambdaProxyIntegration implements IHttpRouteIntegration {
4141
principal: new ServicePrincipal('apigateway.amazonaws.com'),
4242
sourceArn: Stack.of(route).formatArn({
4343
service: 'execute-api',
44-
resource: route.httpApi.httpApiId,
44+
resource: route.httpApi.apiId,
4545
resourceName: `*/*${route.path ?? ''}`, // empty string in the case of the catch-all route $default
4646
}),
4747
});

packages/@aws-cdk/aws-apigatewayv2/lib/http/authorizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class HttpAuthorizer extends Resource implements IHttpAuthorizer {
112112

113113
const resource = new CfnAuthorizer(this, 'Resource', {
114114
name: props.authorizerName ?? id,
115-
apiId: props.httpApi.httpApiId,
115+
apiId: props.httpApi.apiId,
116116
authorizerType: props.type,
117117
identitySource: props.identitySource,
118118
jwtConfiguration: undefinedIfNoKeys({

packages/@aws-cdk/aws-apigatewayv2/lib/http/integration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class HttpIntegration extends Resource implements IHttpIntegration {
134134
constructor(scope: Construct, id: string, props: HttpIntegrationProps) {
135135
super(scope, id);
136136
const integ = new CfnIntegration(this, 'Resource', {
137-
apiId: props.httpApi.httpApiId,
137+
apiId: props.httpApi.apiId,
138138
integrationType: props.integrationType,
139139
integrationUri: props.integrationUri,
140140
integrationMethod: props.method,

packages/@aws-cdk/aws-apigatewayv2/lib/http/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class HttpRoute extends Resource implements IHttpRoute {
157157
}
158158

159159
const routeProps: CfnRouteProps = {
160-
apiId: props.httpApi.httpApiId,
160+
apiId: props.httpApi.apiId,
161161
routeKey: props.routeKey.key,
162162
target: `integrations/${integration.integrationId}`,
163163
authorizerId: authBindResult?.authorizerId,

packages/@aws-cdk/aws-apigatewayv2/test/http/authorizer.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('HttpAuthorizer', () => {
1818
});
1919

2020
expect(stack).toHaveResource('AWS::ApiGatewayV2::Authorizer', {
21-
ApiId: stack.resolve(httpApi.httpApiId),
21+
ApiId: stack.resolve(httpApi.apiId),
2222
Name: 'HttpAuthorizer',
2323
AuthorizerType: 'JWT',
2424
IdentitySource: ['identitysource.1', 'identitysource.2'],

packages/@aws-cdk/aws-apigatewayv2/test/http/route.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('HttpRoute', () => {
1717
});
1818

1919
expect(stack).toHaveResource('AWS::ApiGatewayV2::Route', {
20-
ApiId: stack.resolve(httpApi.httpApiId),
20+
ApiId: stack.resolve(httpApi.apiId),
2121
RouteKey: 'GET /books',
2222
Target: {
2323
'Fn::Join': [
@@ -33,7 +33,7 @@ describe('HttpRoute', () => {
3333
});
3434

3535
expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', {
36-
ApiId: stack.resolve(httpApi.httpApiId),
36+
ApiId: stack.resolve(httpApi.apiId),
3737
});
3838
});
3939

@@ -48,7 +48,7 @@ describe('HttpRoute', () => {
4848
});
4949

5050
expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', {
51-
ApiId: stack.resolve(httpApi.httpApiId),
51+
ApiId: stack.resolve(httpApi.apiId),
5252
IntegrationType: 'HTTP_PROXY',
5353
PayloadFormatVersion: '2.0',
5454
IntegrationUri: 'some-uri',
@@ -209,7 +209,7 @@ describe('HttpRoute', () => {
209209
});
210210

211211
expect(stack).toHaveResource('AWS::ApiGatewayV2::Integration', {
212-
ApiId: stack.resolve(httpApi.httpApiId),
212+
ApiId: stack.resolve(httpApi.apiId),
213213
IntegrationType: 'HTTP_PROXY',
214214
PayloadFormatVersion: '2.0',
215215
IntegrationUri: 'some-uri',

packages/@aws-cdk/aws-apigatewayv2/test/http/stage.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('HttpStage', () => {
1616
});
1717

1818
expect(stack).toHaveResource('AWS::ApiGatewayV2::Stage', {
19-
ApiId: stack.resolve(api.httpApiId),
19+
ApiId: stack.resolve(api.apiId),
2020
StageName: '$default',
2121
});
2222
});
@@ -69,7 +69,7 @@ describe('HttpStage', () => {
6969
});
7070
const metricName = '4xxError';
7171
const statistic = 'Sum';
72-
const apiId = api.httpApiId;
72+
const apiId = api.apiId;
7373

7474
// WHEN
7575
const countMetric = stage.metric(metricName, { statistic });
@@ -94,7 +94,7 @@ describe('HttpStage', () => {
9494
httpApi: api,
9595
});
9696
const color = '#00ff00';
97-
const apiId = api.httpApiId;
97+
const apiId = api.apiId;
9898

9999
// WHEN
100100
const metrics = new Array<Metric>();

0 commit comments

Comments
 (0)