# TODO (ayurchuk) Refactor the get_* functions to use filters
# TODO (ayurchuk) Refactor the get_* functions to use filters
# TODO (bburns) Parameterize this for multiple cluster per project
# TODO (bburns) Parameterize this for multiple cluster per project
function get_instance_ids {
python -c"import json,sys; lst = [str(instance['InstanceId']) for reservation in json.load(sys.stdin)['Reservations'] for instance in reservation['Instances'] for tag in instance.get('Tags', []) if tag['Value'].startswith('${MASTER_TAG}') or tag['Value'].startswith('${MINION_TAG}')]; print ' '.join(lst)"
}
function get_vpc_id {
function get_vpc_id {
python -c'import json,sys; lst = [str(vpc["VpcId"]) for vpc in json.load(sys.stdin)["Vpcs"] for tag in vpc.get("Tags", []) if tag["Value"] == "kubernetes-vpc"]; print "".join(lst)'
$AWS_CMD--output text describe-vpcs \
--filtersName=tag:Name,Values=kubernetes-vpc \
Name=tag:KubernetesCluster,Values=${CLUSTER_ID}\
--query Vpcs[].VpcId
}
}
function get_subnet_id {
function get_subnet_id {
...
@@ -69,7 +69,9 @@ function expect_instance_states {
...
@@ -69,7 +69,9 @@ function expect_instance_states {