MCPcopy Create free account
hub / github.com/awslabs/llrt / createDistribution

Function createDistribution

example/infrastructure/src/index.ts:71–90  ·  view source on GitHub ↗
(route: string)

Source from the content-addressed store, hash-verified

69 );
70
71 const createDistribution = (route: string) => {
72 const id = route.substring(1).replace(/-\//g, "");
73 const distribution = new aws_cloudfront.Distribution(
74 stack,
75 `${id}Distribution`,
76 {
77 defaultBehavior: {
78 origin: new aws_cloudfront_origins.HttpOrigin(httpEndpointNoProto, {
79 protocolPolicy: aws_cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
80 originPath: route,
81 }),
82 allowedMethods: aws_cloudfront.AllowedMethods.ALLOW_ALL,
83 cachePolicy: aws_cloudfront.CachePolicy.CACHING_DISABLED,
84 },
85 }
86 );
87 new CfnOutput(stack, `DistributionOutput${id}`, {
88 value: distribution.distributionDomainName,
89 });
90 };
91
92 const addRoute = (lambda: aws_lambda.Function, routePath: string) => {
93 const integration = new aws_apigatewayv2_integrations.HttpLambdaIntegration(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected