Module tests.aws_test_utils

aws_test_utils module.

Copyright: ycookjp

Functions

def create_db_cluster(db_cluster_id, engine_name, username, password, region_name)

RDS DB クラスターのインスタンスを起動します。

Args

db_cluster_id : str
DBクラスター ID
engine_name : str
データベース エンジンの名前
username : str
データベース ユーザー名
password : str
データベース ユーザーのパスワード
region_name : str
リージョン名

Returns

RDS DB クラスターのインスタンスを返します。

def create_db_instance(db_instance_id, resource_type, engine_name, username, password, region_name)

RDS DB インスタンスを起動します。

Args

db_instance_id : str
DBインスタンス ID
resource_type : str
DBインスタンスのリソース タイプ。db.t2.micro など。
engine_name : str
データベース エンジンの名前
username : str
データベース ユーザー名
password : str
データベース ユーザーのパスワード
region_name : str
リージョン名

Returns

RDS DB インスタンスを返します。

def dump_yaml(config, script_path)

Saves YAML configuration file.

Configuration file should be located at same directory of this script, and name should be base name of this script except for extension is '.yml'.

Args

config : dict
configuration data.
script_path : str
script path which using config file.
def list_files_in_dir(dir_path: str)

Crate file lists which exists under the directory.

Args

dir_path : str
directory path.

Returns

str
Returns list of relative file path from specified directory.
def list_s3keys_in_bucket(s3objects)

S3のバケットに格納されているオブジェクトの Key のリストを取得する。

Args

s3objects : obj
バケット名を指定して、s3 clientの list_objects 関数を

呼び出いた戻り値を指定する。

Returns

S3オブジェクトの Key のリストを返す。

def load_yaml(script_path)

Loads YAML configuration file.

Configuration file should be located at same directory of this script, and name should be base name of this script except for extension is '.yml'.

Args

script_path : str
script path which using config file.

Returns

Dictionary
Returns key-value information.
def run_instances(ami_id, region_name, count=1)

EC2インスタンスを起動します。

Args

ami_id : str
AMI ID を指定します
regopm_name : str
リージョン名を指定します

count (:obj:int, optional): 作成するEC2の個数を指定します

Retunrs

Instanceオブジェクトの配列を返します