1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #2391 from jtopper/as_config_iam_instance_profile

Add IAMInstanceProfile support to launch configs
This commit is contained in:
Wesley Beary 2013-11-15 09:23:43 -08:00
commit 6d1106f77f
6 changed files with 15 additions and 5 deletions

View file

@ -9,6 +9,7 @@ module Fog
attribute :arn, :aliases => 'LaunchConfigurationARN'
attribute :block_device_mappings, :aliases => 'BlockDeviceMappings'
attribute :created_at, :aliases => 'CreatedTime'
attribute :iam_instance_profile, :aliases => 'IamInstanceProfile'
attribute :image_id, :aliases => 'ImageId'
#attribute :instance_monitoring, :aliases => 'InstanceMonitoring'
attribute :instance_monitoring, :aliases => 'InstanceMonitoring', :squash => 'Enabled'

View file

@ -31,7 +31,7 @@ module Fog
attribute :license_model, :aliases => 'LicenseModel'
attribute :db_subnet_group_name, :aliases => 'DBSubnetGroupName'
attribute :publicly_accessible, :aliases => 'PubliclyAccessible'
attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups'
attribute :vpc_security_groups, :aliases => 'VpcSecurityGroups', :type => :array
attr_accessor :password, :parameter_group_name, :security_group_names, :port
@ -123,7 +123,8 @@ module Fog
'MultiAZ' => multi_az,
'LicenseModel' => license_model,
'DBSubnetGroupName' => db_subnet_group_name,
'PubliclyAccessible' => publicly_accessible
'PubliclyAccessible' => publicly_accessible,
'VpcSecurityGroups' => vpc_security_groups,
}
options.delete_if {|key, value| value.nil?}

View file

@ -68,9 +68,10 @@ module Fog
@launch_configuration[name] = value
when 'KernelId', 'RamdiskId', 'UserData'
@launch_configuration[name] = value
when 'IamInstanceProfile'
@launch_configuration[name] = value
when 'SpotPrice'
@launch_configuration[name] = value.to_f
when 'BlockDeviceMappings'
@in_block_device_mappings = false
when 'LaunchConfigurations'

View file

@ -168,7 +168,7 @@ module Fog
@port = options[:port] || 443
@scheme = options[:scheme] || 'https'
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
@version = options[:version] || '2012-09-17' #'2011-04-01'
@version = options[:version] || '2013-05-15'
end
def owner_id

View file

@ -85,6 +85,7 @@ module Fog
self.data[:launch_configurations][launch_configuration_name] = {
'BlockDeviceMappings' => [],
'CreatedTime' => Time.now.utc,
'IamInstanceProfile' => nil,
'ImageId' => image_id,
'InstanceMonitoring' => {'Enabled' => true},
'InstanceType' => instance_type,

View file

@ -26,6 +26,7 @@ module Fog
# @param PreferredMaintenanceWindow [String] The weekly time range (in UTC) during which system maintenance can occur, which may result in an outage
# @param DBSubnetGroupName [String] The name, if any, of the VPC subnet for this RDS instance
# @param PubliclyAcccesible [Boolean] Whether an RDS instance inside of the VPC subnet should have a public-facing endpoint
# @param VpcSecurityGroups [Array] A list of VPC Security Groups to authorize on this DB instance
#
# @return [Excon::Response]:
# * body [Hash]:
@ -37,6 +38,10 @@ module Fog
options.merge!(Fog::AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
end
if vpc_security_groups = options.delete('VpcSecurityGroups')
options.merge!(Fog::AWS.indexed_param('VpcSecurityGroupIds.member.%d', [*vpc_security_groups]))
end
request({
'Action' => 'CreateDBInstance',
'DBInstanceIdentifier' => db_name,
@ -105,7 +110,8 @@ module Fog
# "LatestRestorableTime" => nil,
"AvailabilityZone" => options["AvailabilityZone"],
"DBSubnetGroupName" => options["DBSubnetGroupName"],
"PubliclyAccessible" => options["PubliclyAccessible"]
"PubliclyAccessible" => options["PubliclyAccessible"],
"VpcSecurityGroups" => options["VpcSecurityGroups"],
}