sumomo 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7438e8125e7b38488797c60d301417efc9ffba234848ae101e25df6bd663d23c
4
- data.tar.gz: 2d0fa2741b9e03230d72a56e9b29dffeedf685792423606b2ec10cbe0743822c
3
+ metadata.gz: 5dff05436b85279bb6170d658fd097514523cb2166f824d378143fa71bff31b2
4
+ data.tar.gz: 2718be07694fee619ad404da887092c33b0ec9e30cce7db17aecb04973cada10
5
5
  SHA512:
6
- metadata.gz: 70f9ffcc5462638f922f862c7388c0347a649a2d384824438e05e7e2f4ae388c3ce521221a16b4935e80bcaaa0d1f29039eecc4ae6df77ae7468065acb1d7c51
7
- data.tar.gz: 346d98d824627a7dd7c66a766faffa38996663945f0a8488d7465fa87f4458b42f5d081e2b9be49f73ea093de7e77be2f414536e704c531aca8bb6b3777c0203
6
+ metadata.gz: 4f4f1340af06b597c2ddd8bfdfc5fdacfdc8954b1de7d517777f98ef5e3138ce78fab0f0e77879b37b70dca05ae26ccd15ea13794bf51a59b26d61220137d8bb
7
+ data.tar.gz: 4380be685d526763092cb9216eead4379c0ea5aef56f278b860f19881203a937fca97754ef2f862e9ed023aae2225300510a1996da14061399899b9e4c6cb68e
@@ -5,29 +5,47 @@ require 'hashie'
5
5
 
6
6
  module Sumomo
7
7
  module Stack
8
- def make_network(layers: [])
9
- zones = get_azs
10
-
11
- region = @region
12
-
13
- vpc = make 'AWS::EC2::VPC' do
8
+ def make_vpc
9
+ make 'AWS::EC2::VPC' do
14
10
  CidrBlock '10.0.0.0/16'
15
11
  EnableDnsSupport true
16
12
  EnableDnsHostnames true
17
13
  tag 'Name', call('Fn::Join', '-', [ref('AWS::StackName')])
18
14
  end
15
+ end
19
16
 
20
- gateway = make 'AWS::EC2::InternetGateway' do
17
+ def make_gateway
18
+ make 'AWS::EC2::InternetGateway' do
21
19
  tag 'Name', call('Fn::Join', '-', [ref('AWS::StackName')])
22
20
  end
21
+ end
23
22
 
24
- attachment = make 'AWS::EC2::VPCGatewayAttachment' do
25
- VpcId vpc
26
- InternetGatewayId gateway
23
+ def make_network(
24
+ layers: [],
25
+ use_vpc: nil,
26
+ use_gateway: nil
27
+ )
28
+ zones = get_azs
29
+
30
+ region = @region
31
+
32
+ vpc = use_vpc || make_vpc
33
+
34
+ gateway = use_gateway || make_gateway
35
+
36
+ attachment = nil
37
+
38
+ if !use_vpc && !use_gateway
39
+ attachment = make 'AWS::EC2::VPCGatewayAttachment' do
40
+ VpcId vpc
41
+ InternetGatewayId gateway
42
+ end
27
43
  end
28
44
 
29
45
  inet_route_table = make 'AWS::EC2::RouteTable' do
30
- depends_on attachment
46
+ if attachment
47
+ depends_on attachment
48
+ end
31
49
  VpcId vpc
32
50
  tag 'Name', call('Fn::Join', '-', ['public', ref('AWS::StackName')])
33
51
  end
data/lib/sumomo/stack.rb CHANGED
@@ -23,7 +23,7 @@ module Sumomo
23
23
  description: "Lambda Function in #{@bucket_name}",
24
24
  function_key: "cloudformation/lambda/function_#{name}",
25
25
  handler: 'index.handler',
26
- runtime: 'nodejs14.x',
26
+ runtime: 'nodejs18.x',
27
27
  env: {},
28
28
  memory_size: 128,
29
29
  timeout: 30,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sumomo
4
- VERSION = '0.10.2'
4
+ VERSION = '0.10.3'
5
5
  end
data/lib/sumomo.rb CHANGED
@@ -43,6 +43,7 @@ module Sumomo
43
43
  rescue Aws::S3::Errors::NotFound => e
44
44
  s3.create_bucket(bucket: name)
45
45
  rescue => e
46
+ puts "Error: #{e}"
46
47
  exit 1
47
48
  end
48
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-26 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -2593,7 +2593,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2593
2593
  - !ruby/object:Gem::Version
2594
2594
  version: '0'
2595
2595
  requirements: []
2596
- rubygems_version: 3.2.33
2596
+ rubygems_version: 3.1.2
2597
2597
  signing_key:
2598
2598
  specification_version: 4
2599
2599
  summary: An advanced infrastructure description language for AWS