Discussion:
How to create a VPC subnet in a particular AZ...
NCT
2013-06-21 08:55:01 UTC
Permalink
I'm trying to create a subnet in a particular AWS AZ using something like
the following:
Fog::Compute[:aws].subnets.create(:vpc_id => vpc.id, :cidr_block =>
'10.0.0.0/24', 'AvailabilityZone' => 'us-east-1c')

What I'm seeing in the response, is that the AZ appears to be chosen by AWS
automatically so I end up seeing 'us-east-1a', for example.
This would be expected behavior from AWS if no AZ is provided when a
create_subnet request is sent.

Being new to Fog, I'm not sure if the syntax is correct for the expression
that sets the AZ.
Can anyone let me know if the syntax I'm using to set the AZ is correct?
If not, how should the call be made?

Thanks.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-06-24 15:48:22 UTC
Permalink
It would appear that you have found a bug. The model implementation doesn't
appear to pass anything but id/cidr, see:
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/subnet.rb#L46

You should be able to do it the direct way though, for now:

Fog::Compute[:aws].create_subnet(vpc.id, '10.0.0.0/24', 'AvailabilityZone'
=> 'us-east-1c')

A pull request to fix the other thing would also be great if you get a
chance.

Thanks!
wes
Post by NCT
I'm trying to create a subnet in a particular AWS AZ using something like
Fog::Compute[:aws].subnets.create(:vpc_id => vpc.id, :cidr_block => '
10.0.0.0/24', 'AvailabilityZone' => 'us-east-1c')
What I'm seeing in the response, is that the AZ appears to be chosen by
AWS automatically so I end up seeing 'us-east-1a', for example.
This would be expected behavior from AWS if no AZ is provided when a
create_subnet request is sent.
Being new to Fog, I'm not sure if the syntax is correct for the expression
that sets the AZ.
Can anyone let me know if the syntax I'm using to set the AZ is correct?
If not, how should the call be made?
Thanks.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
NCT
2013-06-26 16:18:58 UTC
Permalink
Works a treat, thanks.
Post by geemus (Wesley Beary)
It would appear that you have found a bug. The model implementation
https://github.com/fog/fog/blob/master/lib/fog/aws/models/compute/subnet.rb#L46
Fog::Compute[:aws].create_subnet(vpc.id, '10.0.0.0/24',
'AvailabilityZone' => 'us-east-1c')
A pull request to fix the other thing would also be great if you get a
chance.
Thanks!
wes
Post by NCT
I'm trying to create a subnet in a particular AWS AZ using something like
Fog::Compute[:aws].subnets.create(:vpc_id => vpc.id, :cidr_block => '
10.0.0.0/24', 'AvailabilityZone' => 'us-east-1c')
What I'm seeing in the response, is that the AZ appears to be chosen by
AWS automatically so I end up seeing 'us-east-1a', for example.
This would be expected behavior from AWS if no AZ is provided when a
create_subnet request is sent.
Being new to Fog, I'm not sure if the syntax is correct for the
expression that sets the AZ.
Can anyone let me know if the syntax I'm using to set the AZ is correct?
If not, how should the call be made?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...