rubycfn 0.5.0 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -1
- data/CloudFormationResourceSpecification.json +64738 -14039
- data/Gemfile.lock +50 -47
- data/README.md +5 -6
- data/lib/rubycfn/version.rb +1 -1
- data/rubycfn.gemspec +1 -1
- data/templates/.gitignore +4 -0
- data/templates/.rubocop.yml +3 -0
- data/templates/README.md +2 -1
- data/templates/Rakefile +1 -1
- data/templates/config.yaml +3 -0
- data/templates/lib/aws_helper/compiler.rb +1 -1
- data/templates/lib/aws_helper/dependencies.rb +17 -7
- data/templates/lib/aws_helper/deploy.rb +0 -1
- data/templates/lib/aws_helper/upload_stack.rb +3 -10
- data/templates/lib/core/applications.rb +178 -32
- data/templates/lib/core/dependencies.rb +11 -4
- data/templates/lib/core/deploy.rb +3 -3
- data/templates/lib/core/init.rb +60 -12
- data/templates/lib/main.rb +1 -1
- data/templates/lib/shared_concerns/global_variables.rb +1 -1
- data/templates/lib/shared_concerns/shared_methods.rb +3 -1
- data/templates/lib/stacks/ecs_stack/ecs_cluster.rb +276 -276
- data/templates/lib/stacks/ecs_stack/lifecycle_hook.rb +162 -160
- data/templates/lib/stacks/ecs_stack/load_balancer.rb +52 -50
- data/templates/lib/stacks/ecs_stack/main.rb +2 -0
- data/templates/lib/stacks/ecs_stack/rollback.rb +77 -0
- metadata +10 -10
- data/templates/bootstrap/dependency_stack.rb +0 -49
@@ -1,12 +1,14 @@
|
|
1
1
|
module EcsStack
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
include Rubycfn
|
4
|
+
|
4
5
|
included do
|
5
6
|
include Concerns::GlobalVariables
|
6
7
|
include Concerns::SharedMethods
|
7
8
|
include EcsStack::EcsCluster
|
8
9
|
include EcsStack::LifecycleHook
|
9
10
|
include EcsStack::LoadBalancer
|
11
|
+
include EcsStack::Rollback
|
10
12
|
|
11
13
|
description generate_stack_description("EcsStack")
|
12
14
|
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module EcsStack
|
2
|
+
module Rollback
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
included do
|
5
|
+
resource :application_deployment_failure_rollback_lambda,
|
6
|
+
type: "AWS::Lambda::Function" do |r|
|
7
|
+
r.property(:code) do
|
8
|
+
{
|
9
|
+
"S3Bucket": "xebia-${AWS::Region}".fnsub,
|
10
|
+
"S3Key": "ecs-rollback-0.0.6.zip"
|
11
|
+
}
|
12
|
+
end
|
13
|
+
r.property(:handler) { "index.lambda_handler" }
|
14
|
+
r.property(:role) { :application_deployment_failure_rollback_lambda_role.ref(:arn) }
|
15
|
+
r.property(:runtime) { "ruby2.5" }
|
16
|
+
r.property(:timeout) { 500 }
|
17
|
+
end
|
18
|
+
|
19
|
+
resource :application_deployment_failure_rollback_lambda_role,
|
20
|
+
type: "AWS::IAM::Role" do |r|
|
21
|
+
r.property(:assume_role_policy_document) do
|
22
|
+
{
|
23
|
+
"Version": "2012-10-17",
|
24
|
+
"Statement": [
|
25
|
+
{
|
26
|
+
"Effect": "Allow",
|
27
|
+
"Principal": {
|
28
|
+
"Service": [
|
29
|
+
"lambda.amazonaws.com"
|
30
|
+
]
|
31
|
+
},
|
32
|
+
"Action": "sts:AssumeRole"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
r.property(:role_name) { "#{environment}-EcsApplicationFailureDetectionRole" }
|
38
|
+
end
|
39
|
+
|
40
|
+
resource :application_deployment_failure_rollback_lambda_policy,
|
41
|
+
type: "AWS::IAM::Policy" do |r|
|
42
|
+
r.property(:policy_document) do
|
43
|
+
{
|
44
|
+
"Version": "2012-10-17",
|
45
|
+
"Statement": [
|
46
|
+
{
|
47
|
+
"Effect": "Allow",
|
48
|
+
"Action": %w(logs:CreateLogGroup logs:CreateLogStream logs:PutLogEvents),
|
49
|
+
"Resource": [
|
50
|
+
"arn:aws:logs:*:*:*"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"Effect": "Allow",
|
55
|
+
"Action": [
|
56
|
+
"ecs:*"
|
57
|
+
],
|
58
|
+
"Resource": [
|
59
|
+
"*"
|
60
|
+
]
|
61
|
+
}
|
62
|
+
]
|
63
|
+
}
|
64
|
+
end
|
65
|
+
r.property(:policy_name) { "#{environment}-EcsApplicationFailureDetectionPolicy" }
|
66
|
+
r.property(:roles) do
|
67
|
+
[
|
68
|
+
:application_deployment_failure_rollback_lambda_role.ref
|
69
|
+
]
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
output :application_deployment_failure_rollback_function_arn,
|
74
|
+
value: :application_deployment_failure_rollback_lambda.ref(:arn)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycfn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Vink
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: neatjson
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activesupport
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- templates/.env.acceptance
|
277
277
|
- templates/.env.dependencies.rspec
|
278
278
|
- templates/.env.development
|
279
|
+
- templates/.env.private
|
279
280
|
- templates/.env.production
|
280
281
|
- templates/.env.rspec
|
281
282
|
- templates/.env.test
|
@@ -284,7 +285,6 @@ files:
|
|
284
285
|
- templates/Gemfile
|
285
286
|
- templates/README.md
|
286
287
|
- templates/Rakefile
|
287
|
-
- templates/bootstrap/dependency_stack.rb
|
288
288
|
- templates/config.yaml
|
289
289
|
- templates/lib/aws_helper/aws_sdk.rb
|
290
290
|
- templates/lib/aws_helper/compiler.rb
|
@@ -313,6 +313,7 @@ files:
|
|
313
313
|
- templates/lib/stacks/ecs_stack/lifecycle_hook.rb
|
314
314
|
- templates/lib/stacks/ecs_stack/load_balancer.rb
|
315
315
|
- templates/lib/stacks/ecs_stack/main.rb
|
316
|
+
- templates/lib/stacks/ecs_stack/rollback.rb
|
316
317
|
- templates/lib/stacks/parent_stack/main.rb
|
317
318
|
- templates/lib/stacks/parent_stack/parent.rb
|
318
319
|
- templates/lib/stacks/vpc_stack/infra_vpc.rb
|
@@ -323,7 +324,7 @@ homepage: https://github.com/dennisvink/rubycfn
|
|
323
324
|
licenses:
|
324
325
|
- MIT
|
325
326
|
metadata: {}
|
326
|
-
post_install_message:
|
327
|
+
post_install_message:
|
327
328
|
rdoc_options: []
|
328
329
|
require_paths:
|
329
330
|
- lib
|
@@ -338,9 +339,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
339
|
- !ruby/object:Gem::Version
|
339
340
|
version: '0'
|
340
341
|
requirements: []
|
341
|
-
|
342
|
-
|
343
|
-
signing_key:
|
342
|
+
rubygems_version: 3.1.2
|
343
|
+
signing_key:
|
344
344
|
specification_version: 4
|
345
345
|
summary: Rubycfn
|
346
346
|
test_files:
|
@@ -1,49 +0,0 @@
|
|
1
|
-
description "Dependency Stack"
|
2
|
-
|
3
|
-
parameter :environment,
|
4
|
-
description: "Environment name",
|
5
|
-
type: "String"
|
6
|
-
|
7
|
-
parameter :domain_name,
|
8
|
-
description: "Domain name",
|
9
|
-
type: "String"
|
10
|
-
|
11
|
-
condition :has_environment,
|
12
|
-
[["", :environment.ref].fnequals].fnnot
|
13
|
-
|
14
|
-
condition :has_domain_name,
|
15
|
-
[["", :domain_name.ref].fnequals].fnnot
|
16
|
-
|
17
|
-
%i(
|
18
|
-
artifact_bucket
|
19
|
-
cloudformation_bucket
|
20
|
-
lambda_bucket
|
21
|
-
logging_bucket
|
22
|
-
).each do |bucket|
|
23
|
-
resource bucket,
|
24
|
-
deletion_policy: "Retain",
|
25
|
-
update_replace_policy: "Retain",
|
26
|
-
type: "AWS::S3::Bucket"
|
27
|
-
|
28
|
-
output bucket,
|
29
|
-
value: bucket.ref
|
30
|
-
end
|
31
|
-
|
32
|
-
resource :hosted_zone,
|
33
|
-
condition: "HasDomainName",
|
34
|
-
type: "AWS::Route53::HostedZone" do |r|
|
35
|
-
r.property(:hosted_zone_config) do
|
36
|
-
{
|
37
|
-
"Comment": ["Hosted zone for ", ["HasEnvironment", [:environment.ref, "."].fnjoin, ""].fnif, :domain_name.ref].fnjoin
|
38
|
-
}
|
39
|
-
end
|
40
|
-
r.property(:name) { [["HasEnvironment", [:environment.ref, "."].fnjoin, ""].fnif, :domain_name.ref].fnjoin }
|
41
|
-
end
|
42
|
-
|
43
|
-
output :hosted_zone_id,
|
44
|
-
condition: "HasDomainName",
|
45
|
-
value: :hosted_zone.ref
|
46
|
-
|
47
|
-
output :hosted_zone_name,
|
48
|
-
condition: "HasDomainName",
|
49
|
-
value: [["HasEnvironment", [:environment.ref, "."].fnjoin, ""].fnif, :domain_name.ref].fnjoin
|