-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Direct Connect Gateway stacks, tests, documentation - Simplification of some test cases and config parsing code
- Loading branch information
Showing
17 changed files
with
912 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import * as cdk from "aws-cdk-lib"; | ||
import { Construct } from "constructs"; | ||
import { | ||
IBuilderTgwStaticRoutes, | ||
IBuilderDxGw, | ||
IBuilderDxGwProps, | ||
ITgwAttachType, | ||
ITgwPropagateRouteAttachmentName, | ||
ssmParameterImport, | ||
ITgw, | ||
ITgwRouteTable, | ||
ITgwAttachment, | ||
} from "./types"; | ||
import * as ssm from "aws-cdk-lib/aws-ssm"; | ||
|
||
export abstract class BuilderDxGw extends cdk.Stack implements IBuilderDxGw { | ||
name: string; | ||
globalPrefix: string; | ||
// Always attached to a Transit Gateway | ||
withTgw: true; | ||
// Always false since this isn't VPC Based | ||
tgwCreateTgwSubnets: false; | ||
tgwAttachType: ITgwAttachType = "dxgw" | ||
tgw: ITgw; | ||
tgwRouteTable: ITgwRouteTable; | ||
tgwRouteTableSsm: ssmParameterImport; | ||
tgwAttachment: ITgwAttachment; | ||
tgwAttachmentSsm: ssmParameterImport; | ||
tgwPropagateRouteAttachmentNames: Array<ITgwPropagateRouteAttachmentName> = | ||
[]; | ||
// Blackhole CIDRs not applicable for an imported DxGw | ||
readonly tgwBlackHoleCidrs: []; | ||
tgwStaticRoutes: Array<IBuilderTgwStaticRoutes> = []; | ||
tgwDefaultRouteAttachmentName: ITgwPropagateRouteAttachmentName; | ||
props: IBuilderDxGwProps; | ||
|
||
protected constructor(scope: Construct, id: string, props: IBuilderDxGwProps) { | ||
super(scope, id, props); | ||
this.props = props; | ||
this.globalPrefix = props.globalPrefix.toLowerCase(); | ||
} | ||
|
||
// We only support imports, but this method is common to all stacks so needs to be present | ||
saveTgwRouteInformation() { | ||
} | ||
|
||
async init() {} | ||
|
||
createSsmParameters() { | ||
const prefix = | ||
`${this.props.ssmParameterPrefix}/networking/${this.globalPrefix}/dxgw/${this.name}`.toLowerCase(); | ||
|
||
this.tgwRouteTableSsm = { | ||
name: `${prefix}/tgwRouteId`, | ||
}; | ||
new ssm.StringParameter(this, `ssmDxGwTgwRouteTableSsm`, { | ||
parameterName: `${prefix}/tgwRouteId`, | ||
stringValue: this.tgwRouteTable.ref, | ||
}); | ||
|
||
this.tgwAttachmentSsm = { | ||
name: `${prefix}/tgwAttachId`, | ||
}; | ||
new ssm.StringParameter(this, `ssmDxGwTgwAttachIdSsm`, { | ||
parameterName: `${prefix}/tgwAttachId`, | ||
stringValue: this.tgwAttachment.attrId, | ||
}); | ||
} | ||
|
||
// We only support imports, but this method is common to all stacks so needs to be present | ||
attachToTGW() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.