Skip to content

Commit

Permalink
Add proxy_uri and assume_role, add required validtors
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 15, 2019
1 parent 13a8aac commit ecbbb4b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
42 changes: 38 additions & 4 deletions app/models/manageiq/providers/amazon/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,44 @@ def self.params_for_create
{
:title => "Configure AWS",
:fields => [
{:component => "text-field", :name => "role", :type => "hidden", :initialValue => "ec2"},
{:component => "text-field", :name => "region", :label => "Region"},
{:component => "text-field", :name => "access_key", :label => "Access Key"},
{:component => "text-field", :name => "secret_access_key", :label => "Secret Key", :type => "password"}
{
:component => "text-field",
:name => "role",
:type => "hidden",
:initialValue => "ec2"
},
{
:component => "text-field",
:name => "region",
:label => "Region",
:isRequired => true,
:validate => [{:type => "required-validator"}]
},
{
:component => "text-field",
:name => "access_key",
:label => "Access Key",
:isRequired => true,
:validate => [{:type => "required-validator"}]
},
{
:component => "text-field",
:name => "secret_access_key",
:label => "Secret Key",
:type => "password",
:isRequired => true,
:validate => [{:type => "required-validator"}]
},
{
:component => "text-field",
:name => "proxy_uri",
:label => "Proxy URI"
},
{
:component => "text-field",
:name => "assume_role",
:label => "Assume Role"
}
]
}
end
Expand Down
3 changes: 2 additions & 1 deletion app/models/manageiq/providers/amazon/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ module ClassMethods
# "secret_access_key" => ""
# }
def validate_credentials(args)
raw_connect(args["access_key"], args["secret_access_key"], "ec2", args["region"])
raw_connect(args["access_key"], args["secret_access_key"], "ec2",
args["region"], args["proxy_uri"], assume_role: args["assume_role"])
end

def raw_connect(access_key_id, secret_access_key, service, region,
Expand Down

0 comments on commit ecbbb4b

Please sign in to comment.