-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
run_piculet = proc do |*args| | ||
region = ENV['REGION'] || ENV['AWS_REGION'] || ENV['AWS_DEFAULT_REGION'] || 'ap-northeast-1' | ||
cmd = [*%w(piculet -a -f), "sg/#{region}/Groupfile", '-r', region, *args] | ||
p cmd | ||
exec *cmd | ||
end | ||
|
||
task :apply do | ||
run_piculet[] | ||
end | ||
|
||
task :noop do | ||
run_piculet['--dry-run'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
### kosendj-main | ||
ec2 "vpc-f43d9b91" do | ||
security_group "default" do | ||
description "default VPC security group" | ||
|
||
ingress do | ||
permission :any do | ||
groups( | ||
"default" | ||
) | ||
end | ||
|
||
permission :tcp, 22..22 do | ||
ip_ranges( | ||
"125.30.60.164/32", | ||
) | ||
end | ||
|
||
permission :tcp, 22982..22982 do | ||
ip_ranges( | ||
"0.0.0.0/0", | ||
) | ||
end | ||
end | ||
|
||
egress do | ||
permission :any do | ||
ip_ranges( | ||
"0.0.0.0/0" | ||
) | ||
end | ||
end | ||
end | ||
|
||
security_group "http-public" do | ||
description "open" | ||
|
||
ingress do | ||
permission :tcp, 80..80 do | ||
ip_ranges( | ||
"0.0.0.0/0", | ||
) | ||
end | ||
|
||
permission :tcp, 443..443 do | ||
ip_ranges( | ||
"0.0.0.0/0", | ||
) | ||
end | ||
end | ||
|
||
egress do | ||
permission :any do | ||
ip_ranges( | ||
"0.0.0.0/0" | ||
) | ||
end | ||
end | ||
end | ||
|
||
security_group "mysql" do | ||
description "open" | ||
|
||
ingress do | ||
permission :tcp, 3306..3306 do | ||
groups( | ||
"default", | ||
) | ||
end | ||
end | ||
|
||
egress do | ||
permission :any do | ||
ip_ranges( | ||
"0.0.0.0/0" | ||
) | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
### Default VPC | ||
ec2 "vpc-df48eeba" do | ||
security_group "default" do | ||
description "default VPC security group" | ||
|
||
ingress do | ||
permission :any do | ||
groups( | ||
"default" | ||
) | ||
end | ||
end | ||
|
||
egress do | ||
permission :any do | ||
ip_ranges( | ||
"0.0.0.0/0" | ||
) | ||
end | ||
end | ||
end | ||
end |