awspec 0.64.0 → 0.65.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/_resource_types/s3_bucket.md +14 -0
- data/doc/resource_types.md +15 -0
- data/lib/awspec/helper/finder/s3.rb +6 -0
- data/lib/awspec/type/s3_bucket.rb +11 -0
- data/lib/awspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7911fec1674e43a9b4d63b649c79a8e9ab947f1
|
4
|
+
data.tar.gz: 2106723c99932cc802a6d0c24395b5a1303ce181
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed58c94454f933395d0c25883e4c4612365e29548db81371e4f912373c97b7e906c4f9d1c6327c2532ddb41766d01de935f725140bd8a7e85def01440fb4688f
|
7
|
+
data.tar.gz: 3d6e0a8ac2c860aa0c6340c373780286a1512434f8371f575cd66b737e2dc40cac9f90aa5635422e5044d6609fed5bba23820d9d84f964fcbd71097f99897c96
|
@@ -71,6 +71,20 @@ describe s3_bucket('my-bucket') do
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
+
### have_lifecycle_rule
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
describe s3_bucket('my-bucket') do
|
78
|
+
it do
|
79
|
+
should have_lifecycle_rule(
|
80
|
+
id: 'MyRuleName',
|
81
|
+
noncurrent_version_expiration: { noncurrent_days: 1 },
|
82
|
+
status: 'Enabled'
|
83
|
+
)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
```
|
87
|
+
|
74
88
|
### have_logging_enabled
|
75
89
|
|
76
90
|
```ruby
|
data/doc/resource_types.md
CHANGED
@@ -1613,6 +1613,21 @@ end
|
|
1613
1613
|
```
|
1614
1614
|
|
1615
1615
|
|
1616
|
+
### have_lifecycle_rule
|
1617
|
+
|
1618
|
+
```ruby
|
1619
|
+
describe s3_bucket('my-bucket') do
|
1620
|
+
it do
|
1621
|
+
should have_lifecycle_rule(
|
1622
|
+
id: 'MyRuleName',
|
1623
|
+
noncurrent_version_expiration: { noncurrent_days: 1 },
|
1624
|
+
status: 'Enabled'
|
1625
|
+
)
|
1626
|
+
end
|
1627
|
+
end
|
1628
|
+
```
|
1629
|
+
|
1630
|
+
|
1616
1631
|
### have_logging_enabled
|
1617
1632
|
|
1618
1633
|
```ruby
|
@@ -38,6 +38,12 @@ module Awspec::Helper
|
|
38
38
|
nil
|
39
39
|
end
|
40
40
|
|
41
|
+
def find_bucket_lifecycle_configuration(id)
|
42
|
+
s3_client.get_bucket_lifecycle_configuration(bucket: id)
|
43
|
+
rescue Aws::S3::Errors::ServiceError
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
41
47
|
def select_all_buckets
|
42
48
|
s3_client.list_buckets.buckets
|
43
49
|
end
|
@@ -80,6 +80,12 @@ module Awspec::Type
|
|
80
80
|
bv ? (bv.status == 'Enabled') : false
|
81
81
|
end
|
82
82
|
|
83
|
+
def has_lifecycle_rule?(rule)
|
84
|
+
lifecycle_configuration_rules.any? do |lc_rule|
|
85
|
+
rule.each { |key, value| lc_rule[key] == value }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
83
89
|
def has_mfa_delete_enabled?
|
84
90
|
bv = find_bucket_versioning(id)
|
85
91
|
bv ? (bv.mfa_delete == 'Enabled') : false
|
@@ -91,5 +97,10 @@ module Awspec::Type
|
|
91
97
|
cors = find_bucket_cors(id)
|
92
98
|
cors ? cors.cors_rules : []
|
93
99
|
end
|
100
|
+
|
101
|
+
def lifecycle_configuration_rules
|
102
|
+
blc = find_bucket_lifecycle_configuration(id)
|
103
|
+
blc ? blc.rules : []
|
104
|
+
end
|
94
105
|
end
|
95
106
|
end
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.65.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|