Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for IPv6 #623

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/kitchen/driver/aws/instance_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def ec2_instance_data
if config[:security_group_ids]
i[:network_interfaces][0][:groups] = i.delete(:security_group_ids)
end
if config[:associate_ipv6]
i[:network_interfaces][0][:ipv_6_address_count] = 1
end
end
availability_zone = config[:availability_zone]
if availability_zone
Expand Down
1 change: 1 addition & 0 deletions lib/kitchen/driver/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Ec2 < Kitchen::Driver::Base
default_config :image_search, nil
default_config :username, nil
default_config :associate_public_ip, nil
default_config :associate_ipv6, nil
default_config :interface, nil
default_config :http_proxy, ENV["HTTPS_PROXY"] || ENV.fetch("HTTP_PROXY", nil)
default_config :retry_limit, 3
Expand Down
29 changes: 29 additions & 0 deletions spec/kitchen/driver/aws/instance_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,35 @@
)
end

context "and associate_ipv6 is provided" do
let(:config) do
{
region: "us-east-1",
associate_public_ip: true,
associate_ipv6: true,
}
end

it "adds a network_interfaces block" do
expect(generator.ec2_instance_data).to eq(
instance_type: nil,
ebs_optimized: nil,
image_id: nil,
key_name: nil,
subnet_id: nil,
private_ip_address: nil,
network_interfaces: [{
device_index: 0,
associate_public_ip_address: true,
ipv_6_address_count: 1,
delete_on_termination: true,
}],
max_count: 1,
min_count: 1
)
end
end

context "and subnet is provided" do
let(:config) do
{
Expand Down