Skip to content

Commit

Permalink
Merge branch 'theonestack:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dupontz authored Jan 9, 2024
2 parents 1b7749b + 98a3aac commit 8ca5620
Show file tree
Hide file tree
Showing 13 changed files with 1,972 additions and 1,766 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/rspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: cftest

on: [push, pull_request]

jobs:
rspec:
uses: theonestack/shared-workflows/.github/workflows/rspec.yaml@main
secrets: inherit
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ip_blocks:
### VPC Gateway Endpoints
A S3 VPC Gateway Endpoint is always created and added to all route tables.
S3 and DynamoDB VPC Gateway Endpoints are always created and added to all route tables.
### VPC Interface Endpoints
Expand Down Expand Up @@ -298,6 +298,19 @@ To set the Amazon side Asn for the VpnGateway set the following config with the
vgw_asn: 64512
```

### Private VPC

A Private VPC is a vpc without its own access to the internet, it does not require an InternetGateway or NAT Gateway's/Instances.

Configure the NAT type as `disabled` as outlined [here](#nat)

By default an internet gateway is created and attached to the VPC, with a route out to the internet configured within the public route table.
This can be disabled by setting the following config to remove the `InternetGateway`,`VPCGatewayAttachment` and `Route` resources from the template.

```yaml
enable_internet_gateway: false
```

## Outputs/Exports

| Name | Value | Exported |
Expand Down
5 changes: 5 additions & 0 deletions dnszone.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dns_domain:
Fn::Join:
- '.'
- - Ref: EnvironmentName
- Fn::Sub: ${DnsDomain}.
68 changes: 68 additions & 0 deletions spec/custom_routes_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
require 'yaml'
require 'spec_helper'

describe 'compiled component' do

context 'cftest' do
it 'compiles test' do
expect(system("cfhighlander cftest #{@validate} --tests tests/custom_routes.test.yaml")).to be_truthy
end
end

let(:template) { YAML.load_file("#{File.dirname(__FILE__)}/../out/tests/custom_routes/vpc-v2.compiled.yaml") }

context 'Resource CustomRoute00' do

let(:properties) { template["Resources"]["CustomRoute00"]["Properties"] }

it 'has property RouteTableId' do
expect(properties["RouteTableId"]).to eq({"Ref"=>"RouteTablePrivate0"})
end

it 'has property DestinationCidrBlock' do
expect(properties["DestinationCidrBlock"]).to eq("192.168.1.0/24")
end

it 'has property TransitGatewayId' do
expect(properties["TransitGatewayId"]).to eq("tgw-0a9c82d1928fce121")
end

end

context 'Resource CustomRoute01' do

let(:properties) { template["Resources"]["CustomRoute11"]["Properties"] }

it 'has property RouteTableId' do
expect(properties["RouteTableId"]).to eq({"Ref"=>"RouteTablePrivate1"})
end

it 'has property DestinationCidrBlock' do
expect(properties["DestinationCidrBlock"]).to eq("10.8.0.0/16")
end

it 'has property TransitGatewayId' do
expect(properties["VpcPeeringConnectionId"]).to eq("pcx-1c1f309b02067137e")
end

end

context 'Resource CustomRoute05' do

let(:properties) { template["Resources"]["CustomRoute05"]["Properties"] }

it 'has property RouteTableId' do
expect(properties["RouteTableId"]).to eq({"Ref"=>"RouteTablePrivate0"})
end

it 'has property DestinationCidrBlock' do
expect(properties["DestinationCidrBlock"]).to eq("192.168.65.0/22")
end

it 'has property TransitGatewayId' do
expect(properties["TransitGatewayId"]).to eq({"Ref" => "TransitGateway"})
end

end

end
Loading

0 comments on commit 8ca5620

Please sign in to comment.