File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
2+ require 'bundler/inline'
3+ gemfile do
4+ source 'https://rubygems.org'
5+ gem 'aws-sdk-rds'
6+ gem 'aws-sdk-s3'
7+ gem 'rexml'
8+ end
29require 'thread'
310require 'socket'
4- require 'aws-sdk-rds'
511require 'open-uri'
6- EP = 'kea.cluster-ckdkc1trpp8e.ap-northeast-1.rds.amazonaws.com'
12+ require 'json'
13+
14+ EP = begin
15+ Aws ::S3 ::Client . new ( region : 'ap-northeast-1' ) . get_object ( bucket : 'rk-infra' , key : 'terraform/nw-dhcp.tfstate' )
16+ . then { JSON . parse ( _1 . body . read ) }
17+ . then { _1 . fetch ( 'outputs' ) . fetch ( 'rds_endpoint' ) . fetch ( 'value' ) }
18+ end
719BASTION = 'bastion.rubykaigi.net'
820USER = 'rk'
921CA_BUNDLE = 'https://truststore.pki.rds.amazonaws.com/ap-northeast-1/ap-northeast-1-bundle.pem'
Original file line number Diff line number Diff line change @@ -78,3 +78,7 @@ resource "aws_route53_record" "kea1-db-apne1-rubykaigi-net" {
7878 " ${ aws_rds_cluster . kea . endpoint } ." ,
7979 ]
8080}
81+
82+ output "rds_endpoint" {
83+ value = aws_rds_cluster. kea . endpoint
84+ }
You can’t perform that action at this time.
0 commit comments