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
## EC2のインスタンス一覧が欲しい | |
export AWS_PROFILE=hoge | |
export AWS_REGION=ap-northeast-1 | |
aws --output table ec2 describe-instances --region $AWS_REGION --profile $AWS_PROFILE \ | |
--query 'Reservations[].Instances[].[PrivateIpAddress,Tags[?Key==`Name`].Value|[0],InstanceId]' |
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
module "test" { | |
# この"count"はmoduleに渡されるcountになる? | |
# workspaceで実行を切り替えたい | |
count = "${terraform.workspace ? 1 : 0}" | |
source = "module/test" | |
} |
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
class ClosedRange | |
attr_reader :lower_endpoint, :upper_endpoint | |
def initialize(lower_endpoint, upper_endpoint) | |
raise IllegalRangeError if lower_endpoint > upper_endpoint | |
@lower_endpoint = lower_endpoint | |
@upper_endpoint = upper_endpoint | |
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
[1,2,3].each do |n| | |
puts n | |
end |