[incubator-dlab] branch DLAB-terraform updated: fixed issue with billing service

2019-08-14 Thread omartushevskyi
This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch DLAB-terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-terraform by this push:
 new 13e2dc8  fixed issue with billing service
13e2dc8 is described below

commit 13e2dc8e7496eb8cebe4323e982994a60881e9ac
Author: Oleh Martushevskyi 
AuthorDate: Wed Aug 14 15:46:14 2019 +0300

fixed issue with billing service
---
 .../main/dlab-billing-chart/templates/configmap-billing-conf.yaml   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
index f8fc9a5..1bdf52b 100644
--- 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
+++ 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
@@ -80,7 +80,7 @@ data:
 skipLines: 1
 columnMapping: >-
   dlab_id={{ .Values.billing.dlab_id }};usage_date={{ 
.Values.billing.usage_date }};product={{ .Values.billing.product }};
-  usage_type={{ .Values.billing.usage_type 
}}billing_usage_type;usage={{ .Values.billing.usage }};cost={{ 
.Values.billing.cost }};
+  usage_type={{ .Values.billing.usage_type }};usage={{ 
.Values.billing.usage }};cost={{ .Values.billing.cost }};
   resource_id={{ .Values.billing.resource_id }};tags={{ 
.Values.billing.tags }}
 aggregate: day
 


-
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org



[incubator-dlab] branch DLAB-terraform updated: fixed issue with billing service

2019-08-14 Thread omartushevskyi
This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch DLAB-terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-terraform by this push:
 new 19e2d80  fixed issue with billing service
19e2d80 is described below

commit 19e2d80aad92863089863c199e406ac9e389d7c9
Author: Oleh Martushevskyi 
AuthorDate: Wed Aug 14 14:04:02 2019 +0300

fixed issue with billing service
---
 infrastructure-provisioning/terraform/bin/dlab.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/infrastructure-provisioning/terraform/bin/dlab.py 
b/infrastructure-provisioning/terraform/bin/dlab.py
index 693733a..8d59e6e 100644
--- a/infrastructure-provisioning/terraform/bin/dlab.py
+++ b/infrastructure-provisioning/terraform/bin/dlab.py
@@ -539,6 +539,7 @@ class AWSK8sSourceBuilder(AbstractDeployBuilder):
   'Column name in report file that contains tags',
   
default='line_item_operation,line_item_line_item_description',
   group='helm_charts')
+ .add_str('--billing_tag', 'Billing tag', default='dlab', 
group='helm_charts')
  )
 return params.build()
 


-
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org



[incubator-dlab] branch DLAB-terraform updated: fixed issue with billing service

2019-08-14 Thread omartushevskyi
This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch DLAB-terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-terraform by this push:
 new 81af4f9  fixed issue with billing service
81af4f9 is described below

commit 81af4f912374fa98132571b8fe48975208eebe15
Author: Oleh Martushevskyi 
AuthorDate: Wed Aug 14 14:01:13 2019 +0300

fixed issue with billing service
---
 .../terraform/aws/endpoint/main/iam.tf |  2 +-
 .../terraform/aws/endpoint/main/instance.tf|  2 +-
 .../terraform/aws/endpoint/main/network.tf | 10 ++---
 .../terraform/aws/endpoint/main/variables.tf   |  2 +-
 .../templates/configmap-billing-conf.yaml  | 16 +++
 .../main/dlab-billing-chart/values.yaml| 15 ++-
 .../aws/ssn-helm-charts/main/dlab-billing.tf   | 25 ---
 .../aws/ssn-helm-charts/main/variables.tf  | 51 ++
 .../aws/ssn-k8s/main/auto_scaling_groups.tf|  8 ++--
 .../aws/ssn-k8s/main/files/ssn-policy.json.tpl | 51 ++
 .../terraform/aws/ssn-k8s/main/lb.tf   | 10 ++---
 .../terraform/aws/ssn-k8s/main/role_policy.tf  |  5 +--
 .../terraform/aws/ssn-k8s/main/s3.tf   | 15 ++-
 .../terraform/aws/ssn-k8s/main/security_groups.tf  |  2 +-
 .../terraform/aws/ssn-k8s/main/variables.tf|  2 +-
 .../terraform/aws/ssn-k8s/main/vpc.tf  | 18 
 infrastructure-provisioning/terraform/bin/dlab.py  | 46 +++
 17 files changed, 205 insertions(+), 75 deletions(-)

diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/iam.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/iam.tf
index 4c12baf..348a44c 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/iam.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/iam.tf
@@ -34,7 +34,7 @@ resource "aws_iam_role" "endpoint_role" {
   assume_role_policy = file("./files/assume-policy.json")
   tags = {
 Name = "${local.endpoint_role_name}"
-"${local.billing_tag[0]}" = local.billing_tag[1]
+"${local.additional_tag[0]}" = local.additional_tag[1]
 "${var.tag_resource_id}" = 
"${var.service_base_name}:${local.endpoint_role_name}"
 "${var.service_base_name}-Tag" = local.endpoint_role_name
   }
diff --git 
a/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
index 1643753..20a7016 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
@@ -37,7 +37,7 @@ resource "aws_instance" "endpoint" {
   }
   tags = {
 Name   = local.endpoint_instance_name
-"${local.billing_tag[0]}"  = local.billing_tag[1]
+"${local.additional_tag[0]}"  = local.additional_tag[1]
 "${var.tag_resource_id}"   = 
"${var.service_base_name}:${local.endpoint_instance_name}"
 "${var.service_base_name}-Tag" = local.endpoint_instance_name
   }
diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
index c7b1d38..d3b47ce 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
@@ -23,7 +23,7 @@ locals {
   endpoint_subnet_name   = "${var.service_base_name}-subnet"
   endpoint_sg_name   = "${var.service_base_name}-sg"
   endpoint_vpc_name = "${var.service_base_name}-endpoint-vpc"
-  billing_tag   = split(":", var.billing_tag)
+  additional_tag   = split(":", var.additional_tag)
   endpoint_igw_name = "${var.service_base_name}-endpoint-igw"
 }
 
@@ -36,7 +36,7 @@ resource "aws_vpc" "vpc_create" {
   enable_dns_support   = true
   tags = {
 Name   = local.endpoint_vpc_name
-"${local.billing_tag[0]}"  = local.billing_tag[1]
+"${local.additional_tag[0]}"  = local.additional_tag[1]
 "${var.tag_resource_id}"   = 
"${var.service_base_name}:${local.endpoint_vpc_name}"
 "${var.service_base_name}-Tag" = local.endpoint_vpc_name
   }
@@ -51,7 +51,7 @@ resource "aws_internet_gateway" "gw" {
   count  = var.vpc_id == "" ? 1 : 0
   tags   = {
 Name   = local.endpoint_igw_name
-"${local.billing_tag[0]}"  = local.billing_tag[1]
+"${local.additional_tag[0]}"  = local.additional_tag[1]
 "${var.tag_resource_id}"   = 
"${var.service_base_name}:${local.endpoint_igw_name}"
 "${var.service_base_name}-Tag" = local.endpoint_igw_name
   }
@@ -63,7 +63,7 @@ resource "aws_subnet" "endpoint_subnet" {
   availability_zone = "${var.region}${var.zone}"
   tags  = {
 Name  

[incubator-dlab] branch DLAB-terraform updated: fixed issue with billing service

2019-08-13 Thread omartushevskyi
This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch DLAB-terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-terraform by this push:
 new 6493fe5  fixed issue with billing service
6493fe5 is described below

commit 6493fe520dd91967c68598f9e0792f8743434148
Author: Oleh Martushevskyi 
AuthorDate: Tue Aug 13 18:50:27 2019 +0300

fixed issue with billing service
---
 .../dlab-billing-chart/templates/configmap-billing-conf.yaml   |  4 ++--
 .../aws/ssn-helm-charts/main/dlab-billing-chart/values.yaml|  4 +++-
 .../terraform/aws/ssn-helm-charts/main/dlab-billing.tf | 10 ++
 .../terraform/aws/ssn-helm-charts/main/variables.tf|  2 ++
 infrastructure-provisioning/terraform/aws/ssn-k8s/main/main.tf |  4 
 infrastructure-provisioning/terraform/bin/dlab.py  |  2 ++
 6 files changed, 19 insertions(+), 7 deletions(-)

diff --git 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
index 6317446..8d6c1c1 100644
--- 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
+++ 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/templates/configmap-billing-conf.yaml
@@ -69,8 +69,8 @@ data:
 filter:
   - type: aws
 currencyCode: USD
-columnDlabTag: user:user:tag
-serviceBaseName: dem5-k8s
+columnDlabTag: user:{{ .Values.billing.tag_resource_id }}
+serviceBaseName: {{ .Values.billing.service_base_name }}
 
 
 # Parser of source data to common format.
diff --git 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/values.yaml
 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/values.yaml
index 6ac6769..44a4e65 100644
--- 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/values.yaml
+++ 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing-chart/values.yaml
@@ -58,4 +58,6 @@ billing:
 host: ${mongo_service_name}
 port: ${mongo_port}
 username: ${mongo_user}
-db_name: ${mongo_db_name}
\ No newline at end of file
+db_name: ${mongo_db_name}
+  service_base_name: ${service_base_name}
+  tag_resource_id: ${tag_resource_id}
\ No newline at end of file
diff --git 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing.tf
 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing.tf
index 4b42232..4324cd5 100644
--- 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing.tf
+++ 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/dlab-billing.tf
@@ -22,10 +22,12 @@
 data "template_file" "dlab_billing_values" {
   template = file("./dlab-billing-chart/values.yaml")
   vars = {
-  mongo_db_name   = var.mongo_dbname
-  mongo_user  = var.mongo_db_username
-  mongo_port  = var.mongo_service_port
-  mongo_service_name  = var.mongo_service_name
+mongo_db_name   = var.mongo_dbname
+mongo_user  = var.mongo_db_username
+mongo_port  = var.mongo_service_port
+mongo_service_name  = var.mongo_service_name
+service_base_name   = var.service_base_name
+tag_resource_id = var.tag_resource_id
   }
 }
 
diff --git 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
index ef52c8c..ebba169 100644
--- 
a/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
+++ 
b/infrastructure-provisioning/terraform/aws/ssn-helm-charts/main/variables.tf
@@ -120,6 +120,8 @@ variable "env_os" {}
 
 variable "ssn_k8s_masters_shape" {}
 
+variable "tag_resource_id" {}
+
 //variable "nginx_http_port" {
 //default = "31080"
 //description = "Sets the nodePort that maps to the Ingress' port 80"
diff --git a/infrastructure-provisioning/terraform/aws/ssn-k8s/main/main.tf 
b/infrastructure-provisioning/terraform/aws/ssn-k8s/main/main.tf
index 6da25f8..b86f075 100644
--- a/infrastructure-provisioning/terraform/aws/ssn-k8s/main/main.tf
+++ b/infrastructure-provisioning/terraform/aws/ssn-k8s/main/main.tf
@@ -89,4 +89,8 @@ output "ssn_k8s_masters_shape" {
 
 output "zone" {
   value = var.zone
+}
+
+output "tag_resource_id" {
+  value = var.tag_resource_id
 }
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/bin/dlab.py 
b/infrastructure-provisioning/terraform/bin/dlab.py
index d1b56aa..cb4e4cf 100644
--- a/infrastructure-provisioning/terraform/bin/dlab.py
+++ b/infrastructure-provisioning