terraspace_plugin_aws 0.3.3 → 0.3.4
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 +4 -0
- data/lib/terraspace_plugin_aws/clients/options.rb +4 -6
- data/lib/terraspace_plugin_aws/clients.rb +5 -0
- data/lib/terraspace_plugin_aws/interfaces/backend/setup.rb +15 -0
- data/lib/terraspace_plugin_aws/interfaces/backend.rb +1 -0
- data/lib/terraspace_plugin_aws/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a734d60b2713b55bfaf56b012c3f9a496524ea91e9d929de9390c50748cb6eac
|
|
4
|
+
data.tar.gz: 7e7ff81c606f4dab49c37bb217efc676c58c522ceb49a6b95e7b06e398040687
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99a83edd45b95fbafbce17c2c7a992524176d1335754404716d1d2546ac311baf5010a8e5e3204fd0153e1d718374dda895834947d3d1fb064581e5396df260b
|
|
7
|
+
data.tar.gz: b0f16167fbf2cfa375b487993540072e757c17cbfe1781e4476f6a680fa69c8757e501adc67aea9099e32b4c0e1bfab3352c72c0162592479c3c11ef3c694fda
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
|
6
|
+
## [0.3.4] - 2021-12-30
|
|
7
|
+
- [#13](https://github.com/boltops-tools/terraspace_plugin_aws/pull/13) check aws setup and provide friendly message
|
|
8
|
+
- [#14](https://github.com/boltops-tools/terraspace_plugin_aws/pull/14) fix aws_secret helper
|
|
9
|
+
|
|
6
10
|
## [0.3.3] - 2021-12-14
|
|
7
11
|
- [#10](https://github.com/boltops-tools/terraspace_plugin_aws/pull/10) implement expand_string? to not expand aws arn values
|
|
8
12
|
|
|
@@ -2,8 +2,9 @@ module TerraspacePluginAws::Clients
|
|
|
2
2
|
module Options
|
|
3
3
|
private
|
|
4
4
|
def client_options
|
|
5
|
+
return {} unless @info # aws_secret helper wont have @info
|
|
5
6
|
if @info['role_arn']
|
|
6
|
-
|
|
7
|
+
client_assume_role_options
|
|
7
8
|
else
|
|
8
9
|
client_default_options
|
|
9
10
|
end
|
|
@@ -31,7 +32,7 @@ module TerraspacePluginAws::Clients
|
|
|
31
32
|
# :external_id (String)
|
|
32
33
|
# :client (STS::Client)
|
|
33
34
|
#
|
|
34
|
-
def
|
|
35
|
+
def client_assume_role_options
|
|
35
36
|
whitelist = %w[
|
|
36
37
|
assume_role_duration_seconds
|
|
37
38
|
assume_role_policy
|
|
@@ -59,10 +60,7 @@ module TerraspacePluginAws::Clients
|
|
|
59
60
|
end
|
|
60
61
|
assume_role_config.symbolize_keys! # ruby sdk expects symbols for keys
|
|
61
62
|
assume_role_config[:role_session_name] ||= [ENV['C9_USER'] || ENV['USER'], 'session'].compact.join('-') # session name is required for the ruby sdk
|
|
62
|
-
|
|
63
|
-
options = {}
|
|
64
|
-
options.merge!(assume_role_config)
|
|
65
|
-
role_credentials = Aws::AssumeRoleCredentials.new(options)
|
|
63
|
+
role_credentials = Aws::AssumeRoleCredentials.new(assume_role_config)
|
|
66
64
|
{credentials: role_credentials}
|
|
67
65
|
end
|
|
68
66
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class TerraspacePluginAws::Interfaces::Backend
|
|
2
|
+
class Setup < Base
|
|
3
|
+
def check!
|
|
4
|
+
sts.get_caller_identity
|
|
5
|
+
rescue Aws::Errors::MissingCredentialsError => e
|
|
6
|
+
logger.info "ERROR: #{e.class}: #{e.message}".color(:red)
|
|
7
|
+
logger.info <<~EOL
|
|
8
|
+
It doesnt look like AWS credentials and access has been setup.
|
|
9
|
+
Please double check the AWS credentials setup.
|
|
10
|
+
IE: ~/.aws/config and the AWS_PROFILE env variable.
|
|
11
|
+
EOL
|
|
12
|
+
exit 1
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: terraspace_plugin_aws
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tung Nguyen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-12-
|
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-dynamodb
|
|
@@ -172,6 +172,7 @@ files:
|
|
|
172
172
|
- lib/terraspace_plugin_aws/interfaces/backend/base.rb
|
|
173
173
|
- lib/terraspace_plugin_aws/interfaces/backend/bucket.rb
|
|
174
174
|
- lib/terraspace_plugin_aws/interfaces/backend/bucket/secure.rb
|
|
175
|
+
- lib/terraspace_plugin_aws/interfaces/backend/setup.rb
|
|
175
176
|
- lib/terraspace_plugin_aws/interfaces/backend/table.rb
|
|
176
177
|
- lib/terraspace_plugin_aws/interfaces/config.rb
|
|
177
178
|
- lib/terraspace_plugin_aws/interfaces/decorator.rb
|