Skip to content

Instantly share code, notes, and snippets.

@okochang
Created February 5, 2013 15:51
Show Gist options
  • Save okochang/4715298 to your computer and use it in GitHub Desktop.
Save okochang/4715298 to your computer and use it in GitHub Desktop.
AWS SDK for Rubyでルーティングテーブルに設定したルートを削除する
# -*- coding: utf-8 -*-
require 'aws-sdk'
ACCESS_KEY = "set your access key id"
SECRET_KEY = "set your secret key"
REGION = 'ec2.ap-northeast-1.amazonaws.com'
ec2 = AWS::EC2.new(
:access_key_id => ACCESS_KEY,
:secret_access_key => SECRET_KEY,
:ec2_endpoint => REGION
).client
## ルートテーブル中のルーティングを削除する
ec2.delete_route(:route_table_id => "rtb-xxxxxxxx", :destination_cidr_block => "192.168.0.0/16")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment