diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4835285 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: ruby +rvm: + - 2.3 +script: + - gem install cfhighlander --prerelease + - if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then cfhighlander cfcompile ; else cfhighlander cfcompile --validate; fi \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ee222bb --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +![build-status](https://travis-ci.com/theonestack/hl-component-bastion.svg?branch=master) + +### Cfhighlander bastion component + +```bash + +# install highlander gem +$ gem install cfhighlander + +# build and validate standalone component +$ cfhighlander cfcompile --validate bastion + +``` + +### Parameters + +TBD + +### Configuration options + +TBD + +### Outputs + +TBD \ No newline at end of file diff --git a/bastion.cfhighlander.rb b/bastion.cfhighlander.rb new file mode 100644 index 0000000..cf317e7 --- /dev/null +++ b/bastion.cfhighlander.rb @@ -0,0 +1,28 @@ +CfhighlanderTemplate do + DependsOn 'vpc@1.2.0' + Parameters do + ComponentParam 'EnvironmentName', 'dev', isGlobal: true + ComponentParam 'EnvironmentType', 'development', isGlobal: true + ComponentParam 'Ami', type: 'AWS::EC2::Image::Id' + MappingParam('InstanceType') do + map 'EnvironmentType' + attribute 'BastionInstanceType' + end + MappingParam('KeyName') do + map 'AccountId' + attribute 'KeyName' + end + MappingParam('DnsDomain') do + map 'AccountId' + attribute 'DnsDomain' + end + + maximum_availability_zones.times do |az| + ComponentParam "SubnetPublic#{az}" + end + + ComponentParam 'VPCId', type: 'AWS::EC2::VPC::Id' + ComponentParam 'SecurityGroupDev', type: 'AWS::EC2::SecurityGroup::Id' + ComponentParam 'SecurityGroupOps', type: 'AWS::EC2::SecurityGroup::Id' + end +end diff --git a/bastion.highlander.rb b/bastion.highlander.rb deleted file mode 100644 index c37be04..0000000 --- a/bastion.highlander.rb +++ /dev/null @@ -1,24 +0,0 @@ -HighlanderComponent do - DependsOn 'vpc@1.0.4' - Parameters do - StackParam 'EnvironmentName', 'dev', isGlobal: true - StackParam 'EnvironmentType', 'development', isGlobal: true - StackParam 'Ami' - MappingParam('InstanceType') do - map 'EnvironmentType' - attribute 'BastionInstanceType' - end - MappingParam('KeyName') do - map 'AccountId' - attribute 'KeyName' - end - MappingParam('DnsDomain') do - map 'AccountId' - attribute 'DnsDomain' - end - subnet_parameters({'public'=>{'name'=>'Public'}}, maximum_availability_zones) - OutputParam component: 'vpc', name: "VPCId" - OutputParam component: 'vpc', name: 'SecurityGroupDev' - OutputParam component: 'vpc', name: 'SecurityGroupOps' - end -end