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

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

commit 794723f7f5b422d21797fcf14f9485946d721767
Author: leonidfrolov <[email protected]>
AuthorDate: Wed Apr 1 14:37:51 2020 +0300

    [DLAB-1664]: added resource block to destroy AMIs per endpoint during 
endpoint termination
---
 .../terraform/aws/endpoint/main/ami.tf             | 28 ++++++++++++++++++++++
 .../terraform/aws/endpoint/main/variables.tf       |  5 ++++
 2 files changed, 33 insertions(+)

diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf
new file mode 100644
index 0000000..007afb1
--- /dev/null
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/ami.tf
@@ -0,0 +1,28 @@
+# *****************************************************************************
+ #
+ # 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.
+ #
+ # 
******************************************************************************
+
+ resource "aws_ami" "shared_notebook_ami" {
+   for_each = var.application_name
+   name = 
"${var.service_base_name}-${var.endpoint_id}-${var.application_name}-notebook-image"
+   virtualization_type = "hvm"
+   root_device_name    = "/dev/sda1"
+   force_destroy = true
+ }
\ No newline at end of file
diff --git 
a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf 
b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
index 8dc3d77..a6ffbbb 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
@@ -80,4 +80,9 @@ variable "additional_tag" {
 
 variable "tag_resource_id" {
   default = "user:tag"
+}
+
+variable "application_name" {
+  type    = list(string)
+  default = ["jupyterlab", "jupyter", "rstudio", "tensor", "zeppelin", 
"deeplearning", "tensor-rstudio", "superset"]
 }
\ No newline at end of file


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

Reply via email to