This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/DLAB-1546 by this push:
     new 5f36ea7  [DLAB-1546]: added name convention changes
5f36ea7 is described below

commit 5f36ea71170e7103ad035bae7880793b01fe5e74
Author: Oleh Martushevskyi <[email protected]>
AuthorDate: Tue Mar 10 15:41:20 2020 +0200

    [DLAB-1546]: added name convention changes
---
 .../terraform/aws/endpoint/main/bucket.tf          | 37 +++++++++++++++
 .../terraform/azure/endpoint/main/bucket.tf        | 52 ++++++++++++++++++++++
 .../terraform/gcp/endpoint/main/bucket.tf          | 36 +++++++++++++++
 3 files changed, 125 insertions(+)

diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/bucket.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/bucket.tf
new file mode 100644
index 0000000..8a930e0
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/bucket.tf
@@ -0,0 +1,37 @@
+# *****************************************************************************
+ #
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ #   http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ #
+ # 
******************************************************************************
+
+ locals {
+   shared_s3_name = "${var.service_base_name}-${var.endpoint_id}-shared-bucket"
+ }
+
+ resource "aws_s3_bucket" "shared_bucket" {
+   bucket = local.shared_s3_name
+   acl    = "private"
+   tags   = {
+     Name                           = local.shared_s3_name
+     "${local.additional_tag[0]}"   = local.additional_tag[1]
+     "${var.tag_resource_id}"       = 
"${var.service_base_name}:${local.shared_s3_name}"
+     "${var.service_base_name}-tag" = local.shared_s3_name
+     "endpoint_tag"                 = var.endpoint_id
+   }
+   force_destroy = true
+ }
\ No newline at end of file
diff --git 
a/infrastructure-provisioning/terraform/azure/endpoint/main/bucket.tf 
b/infrastructure-provisioning/terraform/azure/endpoint/main/bucket.tf
new file mode 100644
index 0000000..1af9b90
--- /dev/null
+++ b/infrastructure-provisioning/terraform/azure/endpoint/main/bucket.tf
@@ -0,0 +1,52 @@
+# *****************************************************************************
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# 
******************************************************************************
+
+locals {
+ shared_bucket_name = 
"${var.service_base_name}-${var.endpoint_id}-shared-bucket"
+ additional_tag  = split(":", var.additional_tag)
+}
+
+resource "random_string" "shared_bucket_service_name" {
+  length = 10
+  special = false
+}
+
+resource "azurerm_storage_account" "shared-endpoint-storage-account" {
+  name                     = random_string.shared_bucket_service_name.result
+  resource_group_name      = 
data.azurerm_resource_group.data-endpoint-resource-group.name
+  location                 = 
data.azurerm_resource_group.data-endpoint-resource-group.location
+  account_tier             = "Standard"
+  account_replication_type = "LRS"
+  account_kind             = "BlobStorage"
+
+  tags = {
+    name                              = local.shared_bucket_name
+    "${local.additional_tag[0]}"      = local.additional_tag[1]
+    "${var.service_base_name}-tag"    = local.shared_bucket_name
+    "endpoint_tag"                    = var.endpoint_id
+  }
+}
+
+resource "azurerm_storage_container" "shared-endpoint-storage-container" {
+  name                  = local.shared_bucket_name
+  storage_account_name  = 
azurerm_storage_account.shared-endpoint-storage-account.name
+  container_access_type = "private"
+}
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/gcp/endpoint/main/bucket.tf 
b/infrastructure-provisioning/terraform/gcp/endpoint/main/bucket.tf
new file mode 100644
index 0000000..9551d65
--- /dev/null
+++ b/infrastructure-provisioning/terraform/gcp/endpoint/main/bucket.tf
@@ -0,0 +1,36 @@
+# *****************************************************************************
+ #
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ #   http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ #
+ # 
******************************************************************************
+
+ locals {
+   shared_bucket_name = 
"${var.service_base_name}-${var.endpoint_id}-shared-bucket"
+   additional_tag  = split(":", var.additional_tag)
+ }
+
+ resource "google_storage_bucket" "shared_bucket" {
+   name     = local.shared_bucket_name
+   force_destroy = true
+   labels = {
+     name                              = local.shared_bucket_name
+     "${local.additional_tag[0]}"      = local.additional_tag[1]
+     "${var.service_base_name}-tag"    = local.shared_bucket_name
+     "endpoint_tag"                    = var.endpoint_id
+   }
+ }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to