From 4a7d4dcf6ca989aaf251b5468f0d8c1d6879498a Mon Sep 17 00:00:00 2001 From: uid10804 Date: Fri, 4 Nov 2022 13:37:42 +0100 Subject: [PATCH 1/7] feat(internal-apigateway): add new properties to adjust internal api gateway BREAKING CHANGE: extend internal api gateway configuration --- API.md | 26 +++++ src/internal-apigateway.ts | 29 +++-- src/internal-service.ts | 30 +++-- test/apigateway.test.ts | 208 ++++++++++++++++++---------------- test/internal-service.test.ts | 48 ++++---- yarn.lock | 103 ++++++++++++++++- 6 files changed, 289 insertions(+), 155 deletions(-) diff --git a/API.md b/API.md index 0ac3430..791f493 100644 --- a/API.md +++ b/API.md @@ -235,6 +235,8 @@ const internalApiGatewayProps: InternalApiGatewayProps = { ... } | stage | string | Stage name used for all cloudformation resource names and internal aws resource names. | | vpcEndpoint | aws-cdk-lib.aws_ec2.IInterfaceVpcEndpoint | VPC endpoint id of execute-api vpc endpoint. | | apiBasePathMappingPath | string | Path for custom domain base path mapping that will be attached to the api gateway. | +| binaryMediaTypes | string[] | Binary media types for the internal api gateway. | +| minimumCompressionSize | number | minimum compression size for the internal api gateway. | --- @@ -288,6 +290,30 @@ Path for custom domain base path mapping that will be attached to the api gatewa --- +##### `binaryMediaTypes`Optional + +```typescript +public readonly binaryMediaTypes: string[]; +``` + +- *Type:* string[] + +Binary media types for the internal api gateway. + +--- + +##### `minimumCompressionSize`Optional + +```typescript +public readonly minimumCompressionSize: number; +``` + +- *Type:* number + +minimum compression size for the internal api gateway. + +--- + ### InternalServiceProps Properties for InternalService. diff --git a/src/internal-apigateway.ts b/src/internal-apigateway.ts index f4e3eaa..4d5bac5 100644 --- a/src/internal-apigateway.ts +++ b/src/internal-apigateway.ts @@ -1,7 +1,6 @@ import { aws_apigateway as apigateway, aws_iam as iam, - Names, } from 'aws-cdk-lib'; import { IInterfaceVpcEndpoint } from 'aws-cdk-lib/aws-ec2'; import { Construct } from 'constructs'; @@ -30,6 +29,16 @@ export interface InternalApiGatewayProps { * Path for custom domain base path mapping that will be attached to the api gateway */ readonly apiBasePathMappingPath?: string; + + /** + * Binary media types for the internal api gateway + */ + readonly binaryMediaTypes?: string[] | undefined; + + /** + * minimum compression size for the internal api gateway + */ + readonly minimumCompressionSize?: number | undefined; } export abstract class InternalApiGateway extends Construct { @@ -41,10 +50,10 @@ export abstract class InternalApiGateway extends Construct { * It is not exposed to the internet. * It is only accessible from the load balancer`s target group. */ - protected readonly internalApiGateway: apigateway.LambdaRestApi; + protected readonly apiGateway: apigateway.LambdaRestApi; constructor(scope: Construct, id: string, props: InternalApiGatewayProps) { super(scope, id); - const uid: string = Names.uniqueId(scope); + const apiResourcePolicy = new iam.PolicyDocument({ statements: [ new iam.PolicyStatement({ @@ -72,11 +81,11 @@ export abstract class InternalApiGateway extends Construct { ], }); - this.internalApiGateway = new apigateway.RestApi( + this.apiGateway = new apigateway.RestApi( this, - `Gateway-${uid}`, + `Gateway-${id}`, { - restApiName: `gateway-${uid}`, + restApiName: `gateway-${id}`, description: 'This service serves an internal api gateway', endpointConfiguration: { types: [apigateway.EndpointType.PRIVATE], @@ -86,8 +95,8 @@ export abstract class InternalApiGateway extends Construct { deployOptions: { stageName: props.stage, }, - binaryMediaTypes: ['*/*'], - minimumCompressionSize: 1000, + binaryMediaTypes: props.binaryMediaTypes, + minimumCompressionSize: props.minimumCompressionSize, }, ); @@ -97,8 +106,8 @@ export abstract class InternalApiGateway extends Construct { `-${domainItem}`, { domainName: domainItem, - restApi: this.internalApiGateway, - stage: this.internalApiGateway.deploymentStage, + restApi: this.apiGateway, + stage: this.apiGateway.deploymentStage, basePath: props.apiBasePathMappingPath ? props.apiBasePathMappingPath : '', }, ); diff --git a/src/internal-service.ts b/src/internal-service.ts index c9d22ed..08b4c18 100644 --- a/src/internal-service.ts +++ b/src/internal-service.ts @@ -7,7 +7,6 @@ import { aws_route53 as route53, aws_route53_targets as targets, CfnOutput, - Names, } from 'aws-cdk-lib'; import { IVpc, SubnetSelection } from 'aws-cdk-lib/aws-ec2'; import { Construct } from 'constructs'; @@ -56,16 +55,14 @@ export class InternalService extends Construct { constructor(scope: Construct, id: string, props: InternalServiceProps) { super(scope, id); - const uid: string = Names.uniqueId(scope); - const domainName = `${props.subDomain}.${props.hostedZoneName}`; - const hostedZone = route53.HostedZone.fromLookup(this, `HostedZone-${uid}`, { + const hostedZone = route53.HostedZone.fromLookup(this, `HostedZone-${id}`, { domainName: `${props.hostedZoneName}`, privateZone: true, vpcId: props.vpc.vpcId, }); - const certificate = new certificatemanager.Certificate(this, `SSLCertificate-${uid}`, { + const certificate = new certificatemanager.Certificate(this, `SSLCertificate-${id}`, { domainName: domainName, subjectAlternativeNames: props.subjectAlternativeNames, validation: certificatemanager.CertificateValidation.fromDnsMultiZone({ @@ -73,18 +70,19 @@ export class InternalService extends Construct { }), }); - const domain = new apigateway.DomainName(this, `ApiGatewayCustomDomain-${uid}`, { + const domain = new apigateway.DomainName(this, `ApiGatewayCustomDomain-${id}`, { domainName: `${props.subDomain}.${props.hostedZoneName}`, certificate: certificate, endpointType: apigateway.EndpointType.REGIONAL, securityPolicy: apigateway.SecurityPolicy.TLS_1_2, }); + this.domains = [domain]; for (const domainItem of props.subjectAlternativeNames) { const sanDomain = new apigateway.DomainName( this, - `Domain-${domainItem}-${uid}`, + `Domain-${domainItem}-${id}`, { domainName: domainItem, certificate: certificate, @@ -97,7 +95,7 @@ export class InternalService extends Construct { const loadBalancerSecurityGroup = new ec2.SecurityGroup( this, - `LoadBalancerSecurityGroup-${uid}`, + `LoadBalancerSecurityGroup-${id}`, { securityGroupName: '-lb-sg', vpc: props.vpc, @@ -114,7 +112,7 @@ export class InternalService extends Construct { const applicationLoadBalancer = new elb.ApplicationLoadBalancer( this, - `ApplicationLoadBalancer-${uid}`, + `ApplicationLoadBalancer-${id}`, { vpc: props.vpc, vpcSubnets: { @@ -122,14 +120,14 @@ export class InternalService extends Construct { }, internetFacing: false, securityGroup: loadBalancerSecurityGroup, - loadBalancerName: `lb-${uid}`, + loadBalancerName: `lb-${id}`, }, ); // Add http-to-https redirect applicationLoadBalancer.addRedirect(); - new route53.ARecord(this, `Route53Record-${uid}`, { + new route53.ARecord(this, `Route53Record-${id}`, { zone: hostedZone, target: route53.RecordTarget.fromAlias( new targets.LoadBalancerTarget(applicationLoadBalancer), @@ -143,25 +141,25 @@ export class InternalService extends Construct { targetGroupTargets.push(new elasticloadbalancingv2targets.IpTarget(ip)); } - const targetGroup = new elb.ApplicationTargetGroup(this, `TargetGroup-${uid}`, { + const targetGroup = new elb.ApplicationTargetGroup(this, `TargetGroup-${id}`, { port: 443, vpc: props.vpc, protocol: elb.ApplicationProtocol.HTTPS, targetType: elb.TargetType.IP, targets: targetGroupTargets, - targetGroupName: `tg-${uid}`, + targetGroupName: `tg-${id}`, }); - const listener = applicationLoadBalancer.addListener(`Listener-${uid}`, { + const listener = applicationLoadBalancer.addListener(`Listener-${id}`, { port: 443, certificates: [certificate], }); - listener.addTargetGroups(`TargetGroupAttachment-${uid}`, { + listener.addTargetGroups(`TargetGroupAttachment-${id}`, { targetGroups: [targetGroup], }); - new CfnOutput(this, `DomainUrl-${uid}`, { + new CfnOutput(this, `DomainUrl-${id}`, { value: `https://${domainName}`, description: 'service url', exportName: '-DomainUrl', diff --git a/test/apigateway.test.ts b/test/apigateway.test.ts index ee90d57..a947140 100644 --- a/test/apigateway.test.ts +++ b/test/apigateway.test.ts @@ -1,40 +1,29 @@ import { App, aws_ec2 as ec2, Stack } from 'aws-cdk-lib'; import { Match, Template } from 'aws-cdk-lib/assertions'; -import { MockIntegration, PassthroughBehavior } from 'aws-cdk-lib/aws-apigateway'; import { Construct } from 'constructs'; import { InternalApiGateway, InternalApiGatewayProps, InternalService } from '../src'; export class ApiGatewayStackTest extends InternalApiGateway { - internalApiGateway: any; constructor(scope: Construct, id: string, props: InternalApiGatewayProps) { super(scope, id, props); - this.internalApiGateway.root.addMethod('GET', new MockIntegration( - { - integrationResponses: [ - { - statusCode: '200', - }, - ], - passthroughBehavior: PassthroughBehavior.WHEN_NO_MATCH, - requestTemplates: { - 'application/json': '{"statusCode": 200}', - }, - }, - )); + this.apiGateway.root.addMethod('GET', undefined); } } - -let app = new App(); +let app: App; +let stack: Stack; let internalServiceStack: InternalService; -const stack = new Stack(app, 'test', { - env: { - account: '123456789012', - region: 'us-east-1', - }, -}); +let vpcEndpointId: ec2.IInterfaceVpcEndpoint; -beforeAll(() => { +beforeEach(() => { + app = new App(); + internalServiceStack: InternalService; + stack = new Stack(app, 'test', { + env: { + account: '123456789012', + region: 'us-east-1', + }, + }); const vpc = ec2.Vpc.fromLookup(stack, 'vpc', { vpcId: 'vpc-1234567' }); const internalSubnetIds = ['subnet-1234567890', 'subnet-1234567890']; @@ -50,12 +39,7 @@ beforeAll(() => { hostedZoneName: 'test.aws1234.com', subDomain: 'internalservice-dev', }); - -}); - - -test('Api Gateway Stack provider', () => { - const vpcEndpointId = + vpcEndpointId = ec2.InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes( stack, 'vpcEndpoint', @@ -64,6 +48,10 @@ test('Api Gateway Stack provider', () => { vpcEndpointId: 'vpce-1234567890', }, ); +}); + + +test('Api Gateway Stack provider - set default values', () => { new ApiGatewayStackTest(stack, 'apiGatewayStack', { stage: 'dev', @@ -71,7 +59,6 @@ test('Api Gateway Stack provider', () => { vpcEndpoint: vpcEndpointId, }); - const template = Template.fromStack(stack); template.hasResourceProperties('AWS::ApiGateway::RestApi', Match.objectLike({ EndpointConfiguration: { @@ -81,6 +68,12 @@ test('Api Gateway Stack provider', () => { }, }, )); + + template.hasResourceProperties('AWS::ApiGateway::BasePathMapping', Match.objectLike({ + BasePath: '', + }, + )); + template.hasResourceProperties('AWS::ApiGateway::RestApi', Match.objectLike({ Policy: { Statement: [ @@ -119,14 +112,14 @@ test('Api Gateway Stack provider', () => { expect(template).toMatchInlineSnapshot(` Object { "Outputs": Object { - "apiGatewayStackGatewaytestEndpointDBCBAA9A": Object { + "apiGatewayStackGatewayapiGatewayStackEndpointD06AFED4": Object { "Value": Object { "Fn::Join": Array [ "", Array [ "https://", Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, ".execute-api.us-east-1.", Object { @@ -134,14 +127,14 @@ Object { }, "/", Object { - "Ref": "apiGatewayStackGatewaytestDeploymentStagedev417B627A", + "Ref": "apiGatewayStackGatewayapiGatewayStackDeploymentStagedevF51461BA", }, "/", ], ], }, }, - "internalServiceStackDomainUrltest2935E3B3": Object { + "internalServiceStackDomainUrlinternalServiceStackB921B240": Object { "Description": "service url", "Export": Object { "Name": "-DomainUrl", @@ -157,15 +150,15 @@ Object { }, }, "Resources": Object { - "apiGatewayStackGatewaytestAccount62BFF2F7": Object { + "apiGatewayStackGatewayapiGatewayStackAccount7F19EDD7": Object { "DeletionPolicy": "Retain", "DependsOn": Array [ - "apiGatewayStackGatewaytestB21206F6", + "apiGatewayStackGatewayapiGatewayStackC685BA6E", ], "Properties": Object { "CloudWatchRoleArn": Object { "Fn::GetAtt": Array [ - "apiGatewayStackGatewaytestCloudWatchRoleA79896DE", + "apiGatewayStackGatewayapiGatewayStackCloudWatchRole492310A9", "Arn", ], }, @@ -173,11 +166,8 @@ Object { "Type": "AWS::ApiGateway::Account", "UpdateReplacePolicy": "Retain", }, - "apiGatewayStackGatewaytestB21206F6": Object { + "apiGatewayStackGatewayapiGatewayStackC685BA6E": Object { "Properties": Object { - "BinaryMediaTypes": Array [ - "*/*", - ], "Description": "This service serves an internal api gateway", "EndpointConfiguration": Object { "Types": Array [ @@ -187,8 +177,7 @@ Object { "vpce-1234567890", ], }, - "MinimumCompressionSize": 1000, - "Name": "gateway-test", + "Name": "gateway-apiGatewayStack", "Policy": Object { "Statement": Array [ Object { @@ -223,7 +212,7 @@ Object { }, "Type": "AWS::ApiGateway::RestApi", }, - "apiGatewayStackGatewaytestCloudWatchRoleA79896DE": Object { + "apiGatewayStackGatewayapiGatewayStackCloudWatchRole492310A9": Object { "DeletionPolicy": "Retain", "Properties": Object { "AssumeRolePolicyDocument": Object { @@ -256,107 +245,98 @@ Object { "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "apiGatewayStackGatewaytestDeployment476DB131ece923dbf5d8c9cdacaf528a759f2763": Object { + "apiGatewayStackGatewayapiGatewayStackDeployment62F75EF65a7060afb32f6c45f7e741ade92eab17": Object { "DependsOn": Array [ - "apiGatewayStackGatewaytestGET54FBF6E8", + "apiGatewayStackGatewayapiGatewayStackGETF8D24D55", ], "Properties": Object { "Description": "This service serves an internal api gateway", "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, }, "Type": "AWS::ApiGateway::Deployment", }, - "apiGatewayStackGatewaytestDeploymentStagedev417B627A": Object { + "apiGatewayStackGatewayapiGatewayStackDeploymentStagedevF51461BA": Object { "DependsOn": Array [ - "apiGatewayStackGatewaytestAccount62BFF2F7", + "apiGatewayStackGatewayapiGatewayStackAccount7F19EDD7", ], "Properties": Object { "DeploymentId": Object { - "Ref": "apiGatewayStackGatewaytestDeployment476DB131ece923dbf5d8c9cdacaf528a759f2763", + "Ref": "apiGatewayStackGatewayapiGatewayStackDeployment62F75EF65a7060afb32f6c45f7e741ade92eab17", }, "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, "StageName": "dev", }, "Type": "AWS::ApiGateway::Stage", }, - "apiGatewayStackGatewaytestGET54FBF6E8": Object { + "apiGatewayStackGatewayapiGatewayStackGETF8D24D55": Object { "Properties": Object { "AuthorizationType": "NONE", "HttpMethod": "GET", "Integration": Object { - "IntegrationResponses": Array [ - Object { - "StatusCode": "200", - }, - ], - "PassthroughBehavior": "WHEN_NO_MATCH", - "RequestTemplates": Object { - "application/json": "{\\"statusCode\\": 200}", - }, "Type": "MOCK", }, "ResourceId": Object { "Fn::GetAtt": Array [ - "apiGatewayStackGatewaytestB21206F6", + "apiGatewayStackGatewayapiGatewayStackC685BA6E", "RootResourceId", ], }, "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, }, "Type": "AWS::ApiGateway::Method", }, - "apiGatewayStacktestinternalServiceStackApiGatewayCustomDomaintest5FD0C666": Object { + "apiGatewayStacktestinternalServiceStackApiGatewayCustomDomaininternalServiceStack4041A8F9": Object { "Properties": Object { "BasePath": "", "DomainName": Object { - "Ref": "internalServiceStackApiGatewayCustomDomaintest813BB8C2", + "Ref": "internalServiceStackApiGatewayCustomDomaininternalServiceStack836326F5", }, "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, "Stage": Object { - "Ref": "apiGatewayStackGatewaytestDeploymentStagedev417B627A", + "Ref": "apiGatewayStackGatewayapiGatewayStackDeploymentStagedevF51461BA", }, }, "Type": "AWS::ApiGateway::BasePathMapping", }, - "apiGatewayStacktestinternalServiceStackDomaininternalservicedevtest2comtest2D55BBDF": Object { + "apiGatewayStacktestinternalServiceStackDomaininternalservicedevtest2cominternalServiceStackBE72A12C": Object { "Properties": Object { "BasePath": "", "DomainName": Object { - "Ref": "internalServiceStackDomaininternalservicedevtest2comtestCB38E02B", + "Ref": "internalServiceStackDomaininternalservicedevtest2cominternalServiceStack5EFB1D61", }, "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, "Stage": Object { - "Ref": "apiGatewayStackGatewaytestDeploymentStagedev417B627A", + "Ref": "apiGatewayStackGatewayapiGatewayStackDeploymentStagedevF51461BA", }, }, "Type": "AWS::ApiGateway::BasePathMapping", }, - "apiGatewayStacktestinternalServiceStackDomaininternalservicedevtestcomtestD3261655": Object { + "apiGatewayStacktestinternalServiceStackDomaininternalservicedevtestcominternalServiceStack5EFA7076": Object { "Properties": Object { "BasePath": "", "DomainName": Object { - "Ref": "internalServiceStackDomaininternalservicedevtestcomtest2CE9FA76", + "Ref": "internalServiceStackDomaininternalservicedevtestcominternalServiceStackB6868874", }, "RestApiId": Object { - "Ref": "apiGatewayStackGatewaytestB21206F6", + "Ref": "apiGatewayStackGatewayapiGatewayStackC685BA6E", }, "Stage": Object { - "Ref": "apiGatewayStackGatewaytestDeploymentStagedev417B627A", + "Ref": "apiGatewayStackGatewayapiGatewayStackDeploymentStagedevF51461BA", }, }, "Type": "AWS::ApiGateway::BasePathMapping", }, - "internalServiceStackApiGatewayCustomDomaintest813BB8C2": Object { + "internalServiceStackApiGatewayCustomDomaininternalServiceStack836326F5": Object { "Properties": Object { "DomainName": "internalservice-dev.test.aws1234.com", "EndpointConfiguration": Object { @@ -365,13 +345,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackApplicationLoadBalancertestF81D1559": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3": Object { "Properties": Object { "LoadBalancerAttributes": Array [ Object { @@ -379,12 +359,12 @@ Object { "Value": "false", }, ], - "Name": "lb-test", + "Name": "lb-internalServiceStack", "Scheme": "internal", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ - "internalServiceStackLoadBalancerSecurityGrouptestC15E9D39", + "internalServiceStackLoadBalancerSecurityGroupinternalServiceStackB6066852", "GroupId", ], }, @@ -397,32 +377,32 @@ Object { }, "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", }, - "internalServiceStackApplicationLoadBalancertestListenertestAB9280FB": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackListenerinternalServiceStackAC542223": Object { "Properties": Object { "Certificates": Array [ Object { "CertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, }, ], "DefaultActions": Array [ Object { "TargetGroupArn": Object { - "Ref": "internalServiceStackTargetGrouptestB800F1B7", + "Ref": "internalServiceStackTargetGroupinternalServiceStackB131C63B", }, "Type": "forward", }, ], "LoadBalancerArn": Object { - "Ref": "internalServiceStackApplicationLoadBalancertestF81D1559", + "Ref": "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", }, "Port": 443, "Protocol": "HTTPS", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", }, - "internalServiceStackApplicationLoadBalancertestRedirect80To443AC430414": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackRedirect80To4439382502D": Object { "Properties": Object { "DefaultActions": Array [ Object { @@ -435,14 +415,14 @@ Object { }, ], "LoadBalancerArn": Object { - "Ref": "internalServiceStackApplicationLoadBalancertestF81D1559", + "Ref": "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", }, "Port": 80, "Protocol": "HTTP", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", }, - "internalServiceStackDomaininternalservicedevtest2comtestCB38E02B": Object { + "internalServiceStackDomaininternalservicedevtest2cominternalServiceStack5EFB1D61": Object { "Properties": Object { "DomainName": "internalservice-dev.test2.com", "EndpointConfiguration": Object { @@ -451,13 +431,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackDomaininternalservicedevtestcomtest2CE9FA76": Object { + "internalServiceStackDomaininternalservicedevtestcominternalServiceStackB6868874": Object { "Properties": Object { "DomainName": "internalservice-dev.test.com", "EndpointConfiguration": Object { @@ -466,13 +446,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackLoadBalancerSecurityGrouptestC15E9D39": Object { + "internalServiceStackLoadBalancerSecurityGroupinternalServiceStackB6066852": Object { "Properties": Object { "GroupDescription": "security group for a load balancer", "GroupName": "-lb-sg", @@ -503,7 +483,7 @@ Object { }, "Type": "AWS::EC2::SecurityGroup", }, - "internalServiceStackRoute53Recordtest42769C99": Object { + "internalServiceStackRoute53RecordinternalServiceStack0A03BF43": Object { "Properties": Object { "AliasTarget": Object { "DNSName": Object { @@ -513,7 +493,7 @@ Object { "dualstack.", Object { "Fn::GetAtt": Array [ - "internalServiceStackApplicationLoadBalancertestF81D1559", + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", "DNSName", ], }, @@ -522,7 +502,7 @@ Object { }, "HostedZoneId": Object { "Fn::GetAtt": Array [ - "internalServiceStackApplicationLoadBalancertestF81D1559", + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", "CanonicalHostedZoneID", ], }, @@ -533,7 +513,7 @@ Object { }, "Type": "AWS::Route53::RecordSet", }, - "internalServiceStackSSLCertificatetest1C36642E": Object { + "internalServiceStackSSLCertificateinternalServiceStack283B9A17": Object { "Properties": Object { "DomainName": "internalservice-dev.test.aws1234.com", "SubjectAlternativeNames": Array [ @@ -543,16 +523,16 @@ Object { "Tags": Array [ Object { "Key": "Name", - "Value": "test/internalServiceStack/SSLCertificate-test", + "Value": "test/internalServiceStack/SSLCertificate-internalServiceStack", }, ], "ValidationMethod": "DNS", }, "Type": "AWS::CertificateManager::Certificate", }, - "internalServiceStackTargetGrouptestB800F1B7": Object { + "internalServiceStackTargetGroupinternalServiceStackB131C63B": Object { "Properties": Object { - "Name": "tg-test", + "Name": "tg-internalServiceStack", "Port": 443, "Protocol": "HTTPS", "TargetGroupAttributes": Array [ @@ -606,3 +586,33 @@ Object { `); }); +test('Api Gateway Stack provider - set optional parameters', () => { + + new ApiGatewayStackTest(stack, 'apiGatewayStackOptionalParameters', { + stage: 'dev', + domains: internalServiceStack.domains, + vpcEndpoint: vpcEndpointId, + minimumCompressionSize: 1024, + binaryMediaTypes: ['application/octet-stream'], + apiBasePathMappingPath: 'test', + }); + + const template = Template.fromStack(stack); + template.hasResourceProperties('AWS::ApiGateway::RestApi', Match.objectLike({ + MinimumCompressionSize: 1024, + }, + )); + + template.hasResourceProperties('AWS::ApiGateway::RestApi', Match.objectLike({ + BinaryMediaTypes: [ + 'application/octet-stream', + ], + }, + )); + + template.hasResourceProperties('AWS::ApiGateway::BasePathMapping', Match.objectLike({ + BasePath: 'test', + }, + )); +}); + diff --git a/test/internal-service.test.ts b/test/internal-service.test.ts index 4304b0d..2d25861 100644 --- a/test/internal-service.test.ts +++ b/test/internal-service.test.ts @@ -29,7 +29,7 @@ test('Internal Service provider', () => { expect(template).toMatchInlineSnapshot(` Object { "Outputs": Object { - "internalServiceStackDomainUrltest2935E3B3": Object { + "internalServiceStackDomainUrlinternalServiceStackB921B240": Object { "Description": "service url", "Export": Object { "Name": "-DomainUrl", @@ -45,7 +45,7 @@ Object { }, }, "Resources": Object { - "internalServiceStackApiGatewayCustomDomaintest813BB8C2": Object { + "internalServiceStackApiGatewayCustomDomaininternalServiceStack836326F5": Object { "Properties": Object { "DomainName": "internalservice-dev.test.aws1234.com", "EndpointConfiguration": Object { @@ -54,13 +54,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackApplicationLoadBalancertestF81D1559": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3": Object { "Properties": Object { "LoadBalancerAttributes": Array [ Object { @@ -68,12 +68,12 @@ Object { "Value": "false", }, ], - "Name": "lb-test", + "Name": "lb-internalServiceStack", "Scheme": "internal", "SecurityGroups": Array [ Object { "Fn::GetAtt": Array [ - "internalServiceStackLoadBalancerSecurityGrouptestC15E9D39", + "internalServiceStackLoadBalancerSecurityGroupinternalServiceStackB6066852", "GroupId", ], }, @@ -86,32 +86,32 @@ Object { }, "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", }, - "internalServiceStackApplicationLoadBalancertestListenertestAB9280FB": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackListenerinternalServiceStackAC542223": Object { "Properties": Object { "Certificates": Array [ Object { "CertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, }, ], "DefaultActions": Array [ Object { "TargetGroupArn": Object { - "Ref": "internalServiceStackTargetGrouptestB800F1B7", + "Ref": "internalServiceStackTargetGroupinternalServiceStackB131C63B", }, "Type": "forward", }, ], "LoadBalancerArn": Object { - "Ref": "internalServiceStackApplicationLoadBalancertestF81D1559", + "Ref": "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", }, "Port": 443, "Protocol": "HTTPS", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", }, - "internalServiceStackApplicationLoadBalancertestRedirect80To443AC430414": Object { + "internalServiceStackApplicationLoadBalancerinternalServiceStackRedirect80To4439382502D": Object { "Properties": Object { "DefaultActions": Array [ Object { @@ -124,14 +124,14 @@ Object { }, ], "LoadBalancerArn": Object { - "Ref": "internalServiceStackApplicationLoadBalancertestF81D1559", + "Ref": "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", }, "Port": 80, "Protocol": "HTTP", }, "Type": "AWS::ElasticLoadBalancingV2::Listener", }, - "internalServiceStackDomaininternalservicedevtest2comtestCB38E02B": Object { + "internalServiceStackDomaininternalservicedevtest2cominternalServiceStack5EFB1D61": Object { "Properties": Object { "DomainName": "internalservice-dev.test2.com", "EndpointConfiguration": Object { @@ -140,13 +140,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackDomaininternalservicedevtestcomtest2CE9FA76": Object { + "internalServiceStackDomaininternalservicedevtestcominternalServiceStackB6868874": Object { "Properties": Object { "DomainName": "internalservice-dev.test.com", "EndpointConfiguration": Object { @@ -155,13 +155,13 @@ Object { ], }, "RegionalCertificateArn": Object { - "Ref": "internalServiceStackSSLCertificatetest1C36642E", + "Ref": "internalServiceStackSSLCertificateinternalServiceStack283B9A17", }, "SecurityPolicy": "TLS_1_2", }, "Type": "AWS::ApiGateway::DomainName", }, - "internalServiceStackLoadBalancerSecurityGrouptestC15E9D39": Object { + "internalServiceStackLoadBalancerSecurityGroupinternalServiceStackB6066852": Object { "Properties": Object { "GroupDescription": "security group for a load balancer", "GroupName": "-lb-sg", @@ -192,7 +192,7 @@ Object { }, "Type": "AWS::EC2::SecurityGroup", }, - "internalServiceStackRoute53Recordtest42769C99": Object { + "internalServiceStackRoute53RecordinternalServiceStack0A03BF43": Object { "Properties": Object { "AliasTarget": Object { "DNSName": Object { @@ -202,7 +202,7 @@ Object { "dualstack.", Object { "Fn::GetAtt": Array [ - "internalServiceStackApplicationLoadBalancertestF81D1559", + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", "DNSName", ], }, @@ -211,7 +211,7 @@ Object { }, "HostedZoneId": Object { "Fn::GetAtt": Array [ - "internalServiceStackApplicationLoadBalancertestF81D1559", + "internalServiceStackApplicationLoadBalancerinternalServiceStackA9484EF3", "CanonicalHostedZoneID", ], }, @@ -222,7 +222,7 @@ Object { }, "Type": "AWS::Route53::RecordSet", }, - "internalServiceStackSSLCertificatetest1C36642E": Object { + "internalServiceStackSSLCertificateinternalServiceStack283B9A17": Object { "Properties": Object { "DomainName": "internalservice-dev.test.aws1234.com", "SubjectAlternativeNames": Array [ @@ -232,16 +232,16 @@ Object { "Tags": Array [ Object { "Key": "Name", - "Value": "test/internalServiceStack/SSLCertificate-test", + "Value": "test/internalServiceStack/SSLCertificate-internalServiceStack", }, ], "ValidationMethod": "DNS", }, "Type": "AWS::CertificateManager::Certificate", }, - "internalServiceStackTargetGrouptestB800F1B7": Object { + "internalServiceStackTargetGroupinternalServiceStackB131C63B": Object { "Properties": Object { - "Name": "tg-test", + "Name": "tg-internalServiceStack", "Port": 443, "Protocol": "HTTPS", "TargetGroupAttributes": Array [ diff --git a/yarn.lock b/yarn.lock index 5b014dd..58d49a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -295,6 +295,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@eslint/eslintrc@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" @@ -546,7 +553,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -561,6 +568,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" @@ -774,6 +789,26 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -911,7 +946,7 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== -"@types/responselike@*", "@types/responselike@^1.0.0": +"@types/responselike@*", "@types/responselike@1.0.0", "@types/responselike@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== @@ -1064,12 +1099,17 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.8.0: +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.8.0: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -1192,6 +1232,11 @@ are-we-there-yet@^3.0.0: delegates "^1.0.0" readable-stream "^3.6.0" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1265,6 +1310,13 @@ aws-cdk-lib@2.46.0: semver "^7.3.8" yaml "1.10.2" +aws-cdk@^2: + version "2.50.0" + resolved "https://registry.yarnpkg.com/aws-cdk/-/aws-cdk-2.50.0.tgz#6c6d723ba66b24245f58c363071ce20a17eabbed" + integrity sha512-55vmKTf2DZRqioumVfXn+S0H9oAbpRK3HFHY8EjZ5ykR5tq2+XiMWEZkYduX2HJhVAeHJJIS6h+Okk3smZjeqw== + optionalDependencies: + fsevents "2.3.2" + babel-jest@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" @@ -1897,6 +1949,11 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2083,6 +2140,11 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2656,7 +2718,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.3.2: +fsevents@2.3.2, fsevents@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -2889,7 +2951,7 @@ globrex@^0.1.2: resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== -got@^12.1.0: +got@12.3.1, got@^12.1.0: version "12.3.1" resolved "https://registry.yarnpkg.com/got/-/got-12.3.1.tgz#79d6ebc0cb8358c424165698ddb828be56e74684" integrity sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw== @@ -4257,7 +4319,7 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -5955,6 +6017,25 @@ ts-jest@^27: semver "7.x" yargs-parser "20.x" +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" @@ -6181,6 +6262,11 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" @@ -6426,6 +6512,11 @@ yargs@^16.0.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 200214402f327e81d46565794b00278d4d29b771 Mon Sep 17 00:00:00 2001 From: uid10804 Date: Fri, 4 Nov 2022 14:00:11 +0100 Subject: [PATCH 2/7] refactor(internal-service): change parameter to inject hostedZone --- API.md | 10 +++++----- src/internal-service.ts | 17 ++++++----------- test/apigateway.test.ts | 10 ++++++++-- test/internal-service.test.ts | 19 +++++++++++++------ 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/API.md b/API.md index 791f493..250cff4 100644 --- a/API.md +++ b/API.md @@ -330,7 +330,7 @@ const internalServiceProps: InternalServiceProps = { ... } | **Name** | **Type** | **Description** | | --- | --- | --- | -| hostedZoneName | string | Name of hosted zone that will be used for the custom domain. | +| hostedZone | aws-cdk-lib.aws_route53.IHostedZone | Hosted zone that will be used for the custom domain. | | subDomain | string | Subdomain attached to hosted zone name. | | subjectAlternativeNames | string[] | List of alternative domains attached to the solution. | | subnetSelection | aws-cdk-lib.aws_ec2.SubnetSelection | Subnets attached to the application load balancer. | @@ -339,15 +339,15 @@ const internalServiceProps: InternalServiceProps = { ... } --- -##### `hostedZoneName`Required +##### `hostedZone`Required ```typescript -public readonly hostedZoneName: string; +public readonly hostedZone: IHostedZone; ``` -- *Type:* string +- *Type:* aws-cdk-lib.aws_route53.IHostedZone -Name of hosted zone that will be used for the custom domain. +Hosted zone that will be used for the custom domain. --- diff --git a/src/internal-service.ts b/src/internal-service.ts index 08b4c18..51a91d6 100644 --- a/src/internal-service.ts +++ b/src/internal-service.ts @@ -41,9 +41,9 @@ export interface InternalServiceProps { readonly subDomain: string; /** - * Name of hosted zone that will be used for the custom domain. + * Hosted zone that will be used for the custom domain. */ - readonly hostedZoneName: string; + readonly hostedZone: route53.IHostedZone; } export class InternalService extends Construct { @@ -55,23 +55,18 @@ export class InternalService extends Construct { constructor(scope: Construct, id: string, props: InternalServiceProps) { super(scope, id); - const domainName = `${props.subDomain}.${props.hostedZoneName}`; - const hostedZone = route53.HostedZone.fromLookup(this, `HostedZone-${id}`, { - domainName: `${props.hostedZoneName}`, - privateZone: true, - vpcId: props.vpc.vpcId, - }); + const domainName = `${props.subDomain}.${props.hostedZone.zoneName}`; const certificate = new certificatemanager.Certificate(this, `SSLCertificate-${id}`, { domainName: domainName, subjectAlternativeNames: props.subjectAlternativeNames, validation: certificatemanager.CertificateValidation.fromDnsMultiZone({ - domainName: hostedZone, + domainName: props.hostedZone, }), }); const domain = new apigateway.DomainName(this, `ApiGatewayCustomDomain-${id}`, { - domainName: `${props.subDomain}.${props.hostedZoneName}`, + domainName: `${props.subDomain}.${props.hostedZone.zoneName}`, certificate: certificate, endpointType: apigateway.EndpointType.REGIONAL, securityPolicy: apigateway.SecurityPolicy.TLS_1_2, @@ -128,7 +123,7 @@ export class InternalService extends Construct { applicationLoadBalancer.addRedirect(); new route53.ARecord(this, `Route53Record-${id}`, { - zone: hostedZone, + zone: props.hostedZone, target: route53.RecordTarget.fromAlias( new targets.LoadBalancerTarget(applicationLoadBalancer), ), diff --git a/test/apigateway.test.ts b/test/apigateway.test.ts index a947140..0ca2bdf 100644 --- a/test/apigateway.test.ts +++ b/test/apigateway.test.ts @@ -1,4 +1,4 @@ -import { App, aws_ec2 as ec2, Stack } from 'aws-cdk-lib'; +import { App, aws_ec2 as ec2, aws_route53 as route53, Stack } from 'aws-cdk-lib'; import { Match, Template } from 'aws-cdk-lib/assertions'; import { Construct } from 'constructs'; import { InternalApiGateway, InternalApiGatewayProps, InternalService } from '../src'; @@ -27,6 +27,12 @@ beforeEach(() => { const vpc = ec2.Vpc.fromLookup(stack, 'vpc', { vpcId: 'vpc-1234567' }); const internalSubnetIds = ['subnet-1234567890', 'subnet-1234567890']; + const hostedZone = route53.HostedZone.fromLookup(stack, 'hostedzone', { + domainName: 'test.aws1234.com', + privateZone: true, + vpcId: vpc.vpcId, + }); + internalServiceStack = new InternalService(stack, 'internalServiceStack', { vpc: vpc, subnetSelection: { @@ -36,7 +42,7 @@ beforeEach(() => { }, vpcEndpointIPAddresses: ['192.168.2.1', '192.168.2.2'], subjectAlternativeNames: ['internalservice-dev.test.com', 'internalservice-dev.test2.com'], - hostedZoneName: 'test.aws1234.com', + hostedZone: hostedZone, subDomain: 'internalservice-dev', }); vpcEndpointId = diff --git a/test/internal-service.test.ts b/test/internal-service.test.ts index 2d25861..04f7f11 100644 --- a/test/internal-service.test.ts +++ b/test/internal-service.test.ts @@ -1,27 +1,34 @@ -import * as cdk from 'aws-cdk-lib'; +import { App, aws_ec2 as ec2, aws_route53 as route53, Stack } from 'aws-cdk-lib'; import { Template } from 'aws-cdk-lib/assertions'; import { InternalService } from '../src'; test('Internal Service provider', () => { - const app = new cdk.App();; - const stack = new cdk.Stack(app, 'test', { + const app = new App();; + const stack = new Stack(app, 'test', { env: { account: '123456789012', region: 'us-east-1', }, }); - const vpc = cdk.aws_ec2.Vpc.fromLookup(stack, 'vpc', { vpcId: 'vpc-1234567' }); + const vpc = ec2.Vpc.fromLookup(stack, 'vpc', { vpcId: 'vpc-1234567' }); const internalSubnetIds = ['subnet-1234567890', 'subnet-1234567890']; + const hostedZone = route53.HostedZone.fromLookup(stack, 'hostedzone', { + domainName: 'test.aws1234.com', + privateZone: true, + vpcId: vpc.vpcId, + }); + + new InternalService(stack, 'internalServiceStack', { vpc: vpc, subnetSelection: { subnets: internalSubnetIds.map((ip, index) => - cdk.aws_ec2.Subnet.fromSubnetId(stack, `Subnet${index}`, ip), + ec2.Subnet.fromSubnetId(stack, `Subnet${index}`, ip), ), }, vpcEndpointIPAddresses: ['192.168.2.1', '192.168.2.2'], subjectAlternativeNames: ['internalservice-dev.test.com', 'internalservice-dev.test2.com'], - hostedZoneName: 'test.aws1234.com', + hostedZone: hostedZone, subDomain: 'internalservice-dev', }); From c1d4233a6b366d29f0455245beec9726b102190c Mon Sep 17 00:00:00 2001 From: uid10804 Date: Fri, 4 Nov 2022 14:56:22 +0100 Subject: [PATCH 3/7] docs(readme): restructure documentation --- README.md | 209 +++++++++++++++++++++++++++++------------------------- 1 file changed, 112 insertions(+), 97 deletions(-) diff --git a/README.md b/README.md index 22d25a3..19fb03e 100644 --- a/README.md +++ b/README.md @@ -1,132 +1,147 @@ # CDK Internal Gateway -This CDK construct is used to create internal serverless applications and websites. +This CDK construct simplifies the setup of **internal serverless applications** for large companies and enterprises. -By default the aws api gateway endpoints are public and accessible from the internet. -Even in times of zero trust, for larger companies it`s not a bad idea to have an additional security layer for internal applications. -But it is still a huge of effort to configure and implement all aws components in a secure manner. +## Features -This construct tries to simplify the setup. +- creates all aws components needed to allow only access from the internal network of your company +- modularized into separate constructs + - add multiple api gateways to the same internal service -## Features +----------- -- no traffic will be routed over the internet -- restricts access to the internal network of your company -- create and attach custom domains and certificates -- create your internal websites and backends using api gateway integrations (see samples folder) +### Technical Details + +- creates an internal loadbalancer + - forwards traffic to VPC endpoints +- provides a securely configured apigateway resource out of the box + - attach your aws components to the internal apigateway resource + - sets api gateway to PRIVATE mode + - sets resource policies to only allow traffic from vpc endpoint +- generates and attaches custom domains to the API Gateway +- generates and attaches certificates to the the API Gateway and the loadbalancer ## Requirements -- CDK V2 -- VPC -- VPC Endpoint for execute-api +- CDK V2 (2.46.0) +- A VPC +- A VPC Endpoint for execute-api +- A Hosted Zone +- Internally accessible subnets (for the load balancer) ## Installation +Using Typescript for aws cdk + ```bash -npm i +npm i cdk-internal-gateway ``` ## Architecture -![cdk internal gateway](cdk-internal-gateway.drawio.png ) +![cdk-internal-gateway-architecture](cdk-internal-gateway.drawio.png ) -## How to use it ? +## Usage -Let`s assume we want to create a simple internal api for our company. +> Let`s assume we create a simple internal api for our company and start with a single lambda function... 1. Create a file called `/lib/my-new-stack.ts` -```typescript -import { aws_apigateway as apigateway, aws_ec2 as ec2, aws_lambda as lambda, Stack, StackProps } from 'aws-cdk-lib'; -import { HttpMethod } from 'aws-cdk-lib/aws-events'; -import { InternalApiGatewayStack, InternalApiGatewayStackProps, InternalServiceStack } from 'cdk-internal-gateway'; -import { Construct } from 'constructs'; -import * as path from 'path'; - - -// Create a new stack that inherits from the InternalApiGateway Construct -// Attach your lambda function to the internalApiGateway (member variable) -export class ServerlessStack extends InternalApiGatewayStack { - constructor(scope: Construct, id: string, props: InternalApiGatewayStackProps) { - super(scope, id, props); - this.internalApiGateway.root; - const defaultLambdaJavascript = this.internalApiGateway.root.resourceForPath("hey-js"); - const defaultHandlerJavascript = new lambda.Function( - this, - `backendLambdaJavascript`, - { - functionName: `js-lambda`, - runtime: lambda.Runtime.NODEJS_14_X, - handler: "index.handler", - code: lambda.Code.fromAsset(path.join(__dirname, "../src")), - } - ); - - defaultLambdaJavascript.addMethod( - HttpMethod.GET, - new apigateway.LambdaIntegration(defaultHandlerJavascript) - ); + ```typescript + import { aws_apigateway as apigateway, aws_ec2 as ec2, aws_lambda as lambda, Stack, StackProps } from 'aws-cdk-lib'; + import { HttpMethod } from 'aws-cdk-lib/aws-events'; + import { InternalApiGatewayStack, InternalApiGatewayStackProps, InternalServiceStack } from 'cdk-internal-gateway'; + import { Construct } from 'constructs'; + import * as path from 'path'; + + + // Create a new stack that inherits from the InternalApiGateway Construct + export class ServerlessStack extends InternalApiGatewayStack { + constructor(scope: Construct, id: string, props: InternalApiGatewayStackProps) { + super(scope, id, props); + + // The internal api gateway is available as member variable + // Attach your lambda function to the this.internalApiGateway + const defaultLambdaJavascript = this.internalApiGateway.root.resourceForPath("hey-js"); + const defaultHandlerJavascript = new lambda.Function( + this, + `backendLambdaJavascript`, + { + functionName: `js-lambda`, + runtime: lambda.Runtime.NODEJS_14_X, + handler: "index.handler", + code: lambda.Code.fromAsset(path.join(__dirname, "../src")), + } + ); + + defaultLambdaJavascript.addMethod( + HttpMethod.GET, + new apigateway.LambdaIntegration(defaultHandlerJavascript) + ); + } } -} - -// Create a new stack that contains the whole service with all nested stacks -export class ServiceStack extends Stack { - constructor(scope: Construct, id: string, props: StackProps) { - super(scope, id, props); - - // get all parameters to create the internal service stack - const vpc = ec2.Vpc.fromLookup(this, 'vpcLookup', { vpcId: 'vpc-1234567890' }); - const internalSubnetIds = ['subnet-0b1e1c6c7d8e9f0a2', 'subnet-0b1e1c6c7d8e9f0a3']; - const subnetSelection = { - subnets: internalSubnetIds.map((ip, index) => - ec2.Subnet.fromSubnetId(this, `Subnet${index}`, ip), - ), - }; - - // create the internal service stack - const internalServiceStack = new InternalServiceStack(this, 'InternalServiceStack', { - hostedZoneName: 'example.com', - subnetSelection: subnetSelection, - vpcEndpointId: 'vpce-1234567890', - vpcEndpointIPAddresses: ['192.168.2.1', '192.168.2.2'], - vpc: vpc, - subjectAlternativeNames: ['internal.example.com'], - subDomain: "internal-service" - }) - - // create your stack that inherits from the InternalApiGatewayStack - new ServerlessStack(this, 'MyProjectStack', { - domains: serviceStack.domains, - stage: "dev", - vpcEndpointId: serviceStack.vpcEndpointId, - }) + + // Create a new stack that contains the whole service with all nested stacks + export class ServiceStack extends Stack { + constructor(scope: Construct, id: string, props: StackProps) { + super(scope, id, props); + + // get all parameters to create the internal service stack + const vpc = ec2.Vpc.fromLookup(this, 'vpcLookup', { vpcId: 'vpc-1234567890' }); + const internalSubnetIds = ['subnet-0b1e1c6c7d8e9f0a2', 'subnet-0b1e1c6c7d8e9f0a3']; + const subnetSelection = { + subnets: internalSubnetIds.map((ip, index) => + ec2.Subnet.fromSubnetId(this, `Subnet${index}`, ip), + ), + }; + + // create the internal service stack + const internalServiceStack = new InternalServiceStack(this, 'InternalServiceStack', { + hostedZoneName: 'example.com', + subnetSelection: subnetSelection, + vpcEndpointId: 'vpce-1234567890', + vpcEndpointIPAddresses: ['192.168.2.1', '192.168.2.2'], + vpc: vpc, + subjectAlternativeNames: ['internal.example.com'], + subDomain: "internal-service" + }) + + // create your stack that inherits from the InternalApiGatewayStack + new ServerlessStack(this, 'MyProjectStack', { + domains: serviceStack.domains, + stage: "dev", + vpcEndpointId: serviceStack.vpcEndpointId, + }) + } } -} -``` + ``` -2. Reference the newly created `ServiceStack` in the default `/bin/{project}.ts` file e.g. like this +1. Reference the newly created `ServiceStack` in the default `/bin/{project}.ts` file e.g. like this -```typescript -new ServiceStack(app, 'MyProjectStack', { - env: - { - account: process.env.CDK_DEPLOY_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, - region: process.env.CDK_DEPLOY_REGION || process.env.CDK_DEFAULT_REGION - } -``` + ```typescript + new ServiceStack(app, 'MyProjectStack', { + env: + { + account: process.env.CDK_DEPLOY_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEPLOY_REGION || process.env.CDK_DEFAULT_REGION + } + ``` + +## Background + +By default the aws api gateway endpoints are public and accessible from the internet. + +Even in times of zero trust, for larger companies with a lof of engineering teams it makes sense to have an additional network security layer for internal applications to reduce the attack surface. + +It is still a huge effort to configure and implement all aws components in a secure manner and this is why I created this construct. ## Costs You have to expect basic infra costs for 2 components in this setup: -| Count | Type | Estimated Costs | +| Count | Type | Estimated Costs | |---|---|---| -|1 x| application load balancer | 20 $ | +|1 x| application load balancer | 20 $ | |2 x| network interfaces for the vpc endpoint | 16 $ | A shared vpc can lower the costs as vpc endpoint and their network interfaces can be used together... - - - - From fbac2eb5b95c5df3168de2abf6dd93f3d7388c3e Mon Sep 17 00:00:00 2001 From: uid10804 Date: Fri, 4 Nov 2022 15:16:35 +0100 Subject: [PATCH 4/7] test(apigateway): update inline snapshot --- test/apigateway.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/apigateway.test.ts b/test/apigateway.test.ts index 0ca2bdf..6380e26 100644 --- a/test/apigateway.test.ts +++ b/test/apigateway.test.ts @@ -17,7 +17,6 @@ let vpcEndpointId: ec2.IInterfaceVpcEndpoint; beforeEach(() => { app = new App(); - internalServiceStack: InternalService; stack = new Stack(app, 'test', { env: { account: '123456789012', From 831a860acdf2db529de583a179ae0f595d0a74a0 Mon Sep 17 00:00:00 2001 From: uid10804 Date: Fri, 4 Nov 2022 15:16:57 +0100 Subject: [PATCH 5/7] docs(readme): restructure documentation --- README.md | 57 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 19fb03e..eb14805 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,11 @@ This CDK construct simplifies the setup of **internal serverless applications** ## Features -- creates all aws components needed to allow only access from the internal network of your company -- modularized into separate constructs - - add multiple api gateways to the same internal service +- creates all aws components needed to allow access only from the internal network of your company in a secure manner +- modularized approach with separate constructs + - add multiple internal api gateways to the same internal service to save costs and keep flexibility ------------ - -### Technical Details - -- creates an internal loadbalancer - - forwards traffic to VPC endpoints -- provides a securely configured apigateway resource out of the box - - attach your aws components to the internal apigateway resource - - sets api gateway to PRIVATE mode - - sets resource policies to only allow traffic from vpc endpoint -- generates and attaches custom domains to the API Gateway -- generates and attaches certificates to the the API Gateway and the loadbalancer +--- ## Requirements @@ -41,6 +30,20 @@ npm i cdk-internal-gateway ![cdk-internal-gateway-architecture](cdk-internal-gateway.drawio.png ) +### Technical Details + +- creates an internal application loadbalancer + - forwards traffic to VPC endpoint for execute-api + - redirect http to https +- provides a securely configured apigateway resource out of the box + - attach your aws components to the internal apigateway resource + - sets api gateway to PRIVATE mode + - sets resource policies to only allow traffic from vpc endpoint +- generates and attaches custom domains to the API Gateway +- generates and attaches certificates to the the API Gateway and the loadbalancer + +--- + ## Usage > Let`s assume we create a simple internal api for our company and start with a single lambda function... @@ -88,18 +91,30 @@ npm i cdk-internal-gateway // get all parameters to create the internal service stack const vpc = ec2.Vpc.fromLookup(this, 'vpcLookup', { vpcId: 'vpc-1234567890' }); - const internalSubnetIds = ['subnet-0b1e1c6c7d8e9f0a2', 'subnet-0b1e1c6c7d8e9f0a3']; const subnetSelection = { - subnets: internalSubnetIds.map((ip, index) => + subnets: ['subnet-0b1e1c6c7d8e9f0a2', 'subnet-0b1e1c6c7d8e9f0a3'].map((ip, index) => ec2.Subnet.fromSubnetId(this, `Subnet${index}`, ip), ), }; + const hostedZone = route53.HostedZone.fromLookup(stack, 'hostedzone', { + domainName: 'test.aws1234.com', + privateZone: true, + vpcId: vpc.vpcId, + }); + const vpcEndpoint = + ec2.InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes( + stack, + 'vpcEndpoint', + { + port: 443, + vpcEndpointId: 'vpce-1234567890', + }, + ); // create the internal service stack const internalServiceStack = new InternalServiceStack(this, 'InternalServiceStack', { - hostedZoneName: 'example.com', + hostedZone: hostedZone, subnetSelection: subnetSelection, - vpcEndpointId: 'vpce-1234567890', vpcEndpointIPAddresses: ['192.168.2.1', '192.168.2.2'], vpc: vpc, subjectAlternativeNames: ['internal.example.com'], @@ -110,7 +125,7 @@ npm i cdk-internal-gateway new ServerlessStack(this, 'MyProjectStack', { domains: serviceStack.domains, stage: "dev", - vpcEndpointId: serviceStack.vpcEndpointId, + vpcEndpoint: vpcEndpoint, }) } } @@ -127,6 +142,8 @@ npm i cdk-internal-gateway } ``` +--- + ## Background By default the aws api gateway endpoints are public and accessible from the internet. From 13e2e5794436a558ab1b23eb2963888e7d7afaa6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 4 Nov 2022 14:21:13 +0000 Subject: [PATCH 6/7] chore: self mutation Signed-off-by: github-actions --- yarn.lock | 118 +++++------------------------------------------------- 1 file changed, 11 insertions(+), 107 deletions(-) diff --git a/yarn.lock b/yarn.lock index bb02b85..e5a33f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -295,13 +295,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@eslint/eslintrc@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" @@ -553,7 +546,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -568,14 +561,6 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" @@ -789,26 +774,6 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" - integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== - "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -929,13 +894,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== -"@types/responselike@*", "@types/responselike@1.0.0", "@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - "@types/semver@^7.3.12": version "7.3.13" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" @@ -1082,17 +1040,12 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.8.0: +acorn@^8.2.4, acorn@^8.8.0: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== @@ -1215,11 +1168,6 @@ are-we-there-yet@^3.0.0: delegates "^1.0.0" readable-stream "^3.6.0" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1293,13 +1241,6 @@ aws-cdk-lib@2.46.0: semver "^7.3.8" yaml "1.10.2" -aws-cdk@^2: - version "2.50.0" - resolved "https://registry.yarnpkg.com/aws-cdk/-/aws-cdk-2.50.0.tgz#6c6d723ba66b24245f58c363071ce20a17eabbed" - integrity sha512-55vmKTf2DZRqioumVfXn+S0H9oAbpRK3HFHY8EjZ5ykR5tq2+XiMWEZkYduX2HJhVAeHJJIS6h+Okk3smZjeqw== - optionalDependencies: - fsevents "2.3.2" - babel-jest@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.5.1.tgz#a1bf8d61928edfefd21da27eb86a695bfd691444" @@ -1925,11 +1866,6 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2116,11 +2052,6 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2687,7 +2618,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@2.3.2, fsevents@^2.3.2: +fsevents@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -2913,22 +2844,24 @@ globrex@^0.1.2: resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== -got@12.3.1, got@^12.1.0: +got@^12.1.0: version "12.3.1" resolved "https://registry.yarnpkg.com/got/-/got-12.3.1.tgz#79d6ebc0cb8358c424165698ddb828be56e74684" integrity sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw== dependencies: "@sindresorhus/is" "^5.2.0" "@szmarczak/http-timer" "^5.0.1" - cacheable-lookup "^7.0.0" - cacheable-request "^10.2.1" + "@types/cacheable-request" "^6.0.2" + "@types/responselike" "^1.0.0" + cacheable-lookup "^6.0.4" + cacheable-request "^7.0.2" decompress-response "^6.0.0" - form-data-encoder "^2.1.2" + form-data-encoder "^2.0.1" get-stream "^6.0.1" http2-wrapper "^2.1.10" lowercase-keys "^3.0.0" p-cancelable "^3.0.0" - responselike "^3.0.0" + responselike "^2.0.0" graceful-fs@4.2.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" @@ -4274,7 +4207,7 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x, make-error@^1.1.1: +make-error@1.x: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -5964,25 +5897,6 @@ ts-jest@^27: semver "7.x" yargs-parser "20.x" -ts-node@^10.9.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" @@ -6209,11 +6123,6 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - v8-to-istanbul@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz#77b752fd3975e31bbcef938f85e9bd1c7a8d60ed" @@ -6459,11 +6368,6 @@ yargs@^16.0.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 71235ab18afc495eff094a15f76b0659457ff632 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 4 Nov 2022 14:24:14 +0000 Subject: [PATCH 7/7] chore: self mutation Signed-off-by: github-actions --- yarn.lock | 128 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 93 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index e5a33f3..1bb787d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -807,6 +807,16 @@ dependencies: "@babel/types" "^7.3.0" +"@types/cacheable-request@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" + integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "*" + "@types/node" "*" + "@types/responselike" "*" + "@types/glob@*": version "8.0.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.0.0.tgz#321607e9cbaec54f687a0792b2d1d370739455d2" @@ -822,7 +832,7 @@ dependencies: "@types/node" "*" -"@types/http-cache-semantics@^4.0.1": +"@types/http-cache-semantics@*": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== @@ -864,6 +874,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/keyv@*": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-4.2.0.tgz#65b97868ab757906f2dbb653590d7167ad023fa0" + integrity sha512-xoBtGl5R9jeKUhc8ZqeYaRDx04qqJ10yhhXYGmJ4Jr8qKpvMsDQQrNUvF/wUJ4klOtmJeJM+p2Xo3zp9uaC3tw== + dependencies: + keyv "*" + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -894,6 +911,13 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== +"@types/responselike@*", "@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/semver@^7.3.12": version "7.3.13" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" @@ -1428,23 +1452,23 @@ cacache@^17.0.0: tar "^6.1.11" unique-filename "^3.0.0" -cacheable-lookup@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz#3476a8215d046e5a3202a9209dd13fec1f933a27" - integrity sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w== +cacheable-lookup@^6.0.4: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-6.1.0.tgz#0330a543471c61faa4e9035db583aad753b36385" + integrity sha512-KJ/Dmo1lDDhmW2XDPMo+9oiy/CeqosPguPCrgcVzKyZrL6pM1gU2GmPY/xo6OQPTUaA/c0kwHuywB4E6nmT9ww== -cacheable-request@^10.2.1: - version "10.2.2" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-10.2.2.tgz#07c3d5afcaa2de2e9f66959bacb3ff78da3735fd" - integrity sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q== - dependencies: - "@types/http-cache-semantics" "^4.0.1" - get-stream "^6.0.1" - http-cache-semantics "^4.1.0" - keyv "^4.5.0" - mimic-response "^4.0.0" - normalize-url "^7.2.0" - responselike "^3.0.0" +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" @@ -1561,6 +1585,13 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +clone-response@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + dependencies: + mimic-response "^1.0.0" + clone@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" @@ -2134,6 +2165,13 @@ encoding@^0.1.13: dependencies: iconv-lite "^0.6.2" +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + enhanced-resolve@^5.10.0: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" @@ -2559,7 +2597,7 @@ flatted@^3.1.0, flatted@^3.2.7: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== -form-data-encoder@^2.1.2: +form-data-encoder@^2.0.1: version "2.1.3" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.3.tgz#682cd821a8423605093992ff895e6b2ed5a9d429" integrity sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ== @@ -2696,6 +2734,13 @@ get-stdin@^8.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -2972,7 +3017,7 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-cache-semantics@^4.1.0: +http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== @@ -4057,7 +4102,7 @@ jsonschema@^1.4.1: resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== -keyv@^4.5.0: +keyv@*, keyv@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.0.tgz#dbce9ade79610b6e641a9a65f2f6499ba06b9bc6" integrity sha512-2YvuMsA+jnFGtBareKqgANOEKe1mk3HKiXu2fRmAfyxG0MJAywNhi5ttWA3PMjl4NmpyjZNbFifR2vNjW1znfA== @@ -4183,6 +4228,11 @@ log4js@^6.7.0: rfdc "^1.3.0" streamroller "^3.1.3" +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + lowercase-keys@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" @@ -4308,16 +4358,16 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + mimic-response@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== -mimic-response@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-4.0.0.tgz#35468b19e7c75d10f5165ea25e75a5ceea7cf70f" - integrity sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg== - min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -4526,10 +4576,10 @@ normalize-path@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-7.2.0.tgz#5317f78cff95f5fa1e76cc0b5e33245c43781e11" - integrity sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA== +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== npm-bundled@^1.1.1: version "1.1.2" @@ -4686,7 +4736,7 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== @@ -5039,6 +5089,14 @@ psl@^1.1.33: resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" @@ -5284,12 +5342,12 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -responselike@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-3.0.0.tgz#20decb6c298aff0dbee1c355ca95461d42823626" - integrity sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg== +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== dependencies: - lowercase-keys "^3.0.0" + lowercase-keys "^2.0.0" retry@^0.12.0: version "0.12.0"