ec2 describe ec2('my-ec2-tag-name') do it { should be_running } its(:instance_id) { should eq 'i-ec12345a' } its(:instance_type) { should eq ’t2.small' } its(:public_ip_address) { should eq '123.0.456.789' } it { should have_security_group('my-sg-name') } it { should belong_to_vpc('my-vpc') } it { should belong_to_subnet('subnet-1234a567') } it { should have_eip('123.0.456.789') } it { should be_disabled_api_termination } end 12 JAWS Festa 2016
route53_hosted_zone describe route53_hosted_zone('example.com.') do it { should exist } its(:resource_record_set_count) { should eq 5 } it { should have_record_set('example.com.').a('123.456.7.890') } it { should have_record_set('example.com.').mx('10 mail.example.com') } it { should have_record_set('mail.example.com.').a('123.456.7.890').ttl(3600) } ns = 'ns-123.awsdns-45.net. ns-6789.awsdns-01.org. ns-2345.awsdns-67.co.uk. ns-890.awsdns-12.com.' it { should have_record_set('example.com.').ns(ns) } it { should have_record_set('s3.example.com.').alias('s3-website-us- east-1.amazonaws.com.', 'Z2ABCDEFGHIJKL') } end 13 JAWS Festa 2016
Add tag matching support 44 JAWS Festa 2016 各リソースにおいて、タグの保持をテストするマッチ ャの追加 #119 PR by igorlg describe ec2('my-ec2') do it { should have_tag('Name').value('my-ec2') } end
Add ability to search for network interface by name 46 JAWS Festa 2016 Network Interfaceリソースでもタグの保持をできるよ うにする修正 #191 PR by mdolian describe network_interface(’eni-12ab3cde') do it { should have_tag('Name').value('my-eni') } end
Add opened_only matcher for security groups. JAWS Festa 2016 49 Security Groupの「このポートだけオープンしている こと」をテストするマッチャの追加 #121 PR by ceaess describe security_group('my-sg') do its(:outbound) do should be_opened_only(50_000) .protocol('tcp') .for(%w(100.456.789.012/32 200.567.890.123/32)) end end
Add ec2 `have_event()` and `have_events()` 52 JAWS Festa 2016 EC2にイベント(再起動イベントなど)があるか確認 するマッチャの追加 #131 PR by k1LoW describe ec2('my-ec2') do it { should have_event('system-reboot') } end describe ec2(’other-ec2') do it { should_not have_events } end
Add ec2 `have_classiclink_security_group()` 55 JAWS Festa 2016 EC2-ClassicがClassicLink先のSecurity Groupをもっ ているかどうかを確認するマッチャの追加 #150 PR by matsuzj describe ec2('my-classic-ec2') do it { should have_classiclink_security_group('sg-2a3b4cd5') } it { should have_classiclink_security_group('my-vpc-security- group-name') } end
Add CloudTrail support to check if logging is enabled. 58 JAWS Festa 2016 CloudTrailでロギングが有効になっているかをテストす るマッチャの追加 #164 PR by arimbun describe cloudtrail('my-trail') do it { should be_logging } end
Add shared_context to specify region by context 61 JAWS Festa 2016 複数のリージョンをまたいだテストができるようにす る修正 #187 PR by takaishi describe ec2('my-ec2’), region: 'us-east-1' do it { should exist } end
vpc describe vpc('vpc-ab123cde') do it { should exist } its(:resource) { should be_an_instance_of(Awspec::ResourceReader) } its('resource.route_tables.first.route_table_id') { should eq 'rtb-a12bcd34' } its('route_tables.first.route_table_id') { should eq 'rtb-a12bcd34' } end 82 JAWS Festa 2016