Skip to content

Commit

Permalink
making topology use config type and adding alb to topology
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Singer committed Jan 30, 2023
1 parent 587aa1c commit 3756657
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions pkg/core/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ var DiagramEntityToImgPath = TopoMap{
{Kind: PubSubKind}: "generic/blank/blank.png",

// Use AWS as the ultimate fallback for the Kind, so don't specify Provider.
{Kind: GatewayKind, Provider: ProviderAWS}: "aws/network/api-gateway.png",
{Kind: GatewayKind, Provider: ProviderAWS, Type: "apigateway"}: "aws/network/api-gateway.png",
{Kind: GatewayKind, Provider: ProviderAWS, Type: "alb"}: "aws/network/elb-application-load-balancer.png",
{Kind: ExecutionUnitKind, Provider: ProviderAWS}: "aws/compute/lambda.png",
{Kind: string(PersistKVKind), Provider: ProviderAWS}: "aws/database/dynamodb.png",
{Kind: string(PersistFileKind), Provider: ProviderAWS}: "aws/compute/simple-storage-service-s3.png",
Expand Down Expand Up @@ -109,7 +110,9 @@ var DiagramEntityToCode = TopoMap{
{Kind: PubSubKind}: `generic_blank.Blank("%s")`,

// Use AWS as the ultimate fallback for the Kind, so don't specify Provider.
{Kind: GatewayKind, Provider: ProviderAWS}: `aws_network.APIGateway("%s")`,
{Kind: GatewayKind, Provider: ProviderAWS, Type: "apigateway"}: `aws_network.APIGateway("%s")`,
{Kind: GatewayKind, Provider: ProviderAWS, Type: "alb"}: `aws_network.ElbNetworkLoadBalancer("%s")`,

{Kind: ExecutionUnitKind, Provider: ProviderAWS}: `aws_compute.Lambda("%s")`,
{Kind: string(PersistKVKind), Provider: ProviderAWS}: `aws_database.Dynamodb("%s")`,
{Kind: string(PersistFileKind), Provider: ProviderAWS}: `aws_storage.S3("%s")`,
Expand Down
7 changes: 5 additions & 2 deletions pkg/infra/pulumi_aws/iac/load_balancing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ export class LoadBalancerPlugin {
type: 'fixed-response',
fixedResponse: {
contentType: 'application/json',
statusCode: '4XX',
statusCode: '404',
},
},
],
})
}

this.createListenerRule(this.lib.name, route.execUnitName + route.path, {
this.createListenerRule(this.lib.name, route.execUnitName + route.path + route.verb, {
listenerArn: listener!.arn,
actions: [
{
Expand All @@ -139,6 +139,9 @@ export class LoadBalancerPlugin {
pathPattern: {
values: [route.path],
},
httpRequestMethod: {
values: [route.verb],
},
},
],
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/topology/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (p Plugin) generateIconsAndEdges(resource core.CloudResource, dependencies
Title: resource.Key().Name,
Image: p.getImagePath(resource),
Kind: resource.Key().Kind,
Type: resource.Type(),
Type: p.Config.GetResourceType(resource),
})

for _, dependency := range dependencies {
Expand Down

0 comments on commit 3756657

Please sign in to comment.