Slide 79
Slide 79 text
"84$%,"1*(BUFXBZߏங෦
const api = new apig.RestApi(scope, 'GreetingApi', {
restApiName: global.getApiName('Greeting'),
endpointTypes: [apig.EndpointType.REGIONAL],
deployOptions: {
stageName:’v1’,
},
});
const helloLink = new VpcLink(scope, 'VpcLink', {
targets: [
NetworkLoadBalancer.fromNetworkLoadBalancerAttributes(
scope, ‘GreetingNlb', {
loadBalancerArn:
‘arn:aws:elasticloadbalancing:ap-northeast-1:xxxxxx:loadbalancer/net/Bonjo-Ec2Se-xfsda/12234567890',
},
),
],
});
const helloResource = api.root.addResource('helo');
helloResource.addMethod(
'GET',
new apig.Integration({
type: IntegrationType.HTTP_PROXY,
integrationHttpMethod: ‘GET',
url: ‘http://abxyfskeladk.elb.ap-northeast-1.amazonaws.com’,
options: {
connectionType: ConnectionType.VPC_LINK,
vpcLink: helloLink,
},
}),
{ methodResponses: [{statusCode: ‘200'}] },