From 17a363a46735cb19db4be58b2632a5db6565e94a Mon Sep 17 00:00:00 2001 From: Ben Thompson Date: Mon, 22 Aug 2022 14:17:10 -0400 Subject: [PATCH] Image for clouddev. (#50) * instane type as variable in terraform config. * use image instead of dockerfile for clouddev devcontainer. --- .devcontainer/clouddev/devcontainer.json | 13 +++++++------ cloud/main.tf | 2 +- cloud/variables.tf | 8 +++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.devcontainer/clouddev/devcontainer.json b/.devcontainer/clouddev/devcontainer.json index d0a45fc3..37894334 100644 --- a/.devcontainer/clouddev/devcontainer.json +++ b/.devcontainer/clouddev/devcontainer.json @@ -2,12 +2,13 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu { "name": "clouddev", - "build": { - "dockerfile": "../../cloud/clouddev/Dockerfile", - // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 - // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. - "args": { "VARIANT": "ubuntu-22.04" } - }, + "image": "ghcr.io/confirm-solutions/clouddev:latest", + // "build": { + // "dockerfile": "../../cloud/clouddev/Dockerfile", + // // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 + // // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. + // "args": { "VARIANT": "ubuntu-22.04" } + // }, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], diff --git a/cloud/main.tf b/cloud/main.tf index 0362986d..671a6b3d 100644 --- a/cloud/main.tf +++ b/cloud/main.tf @@ -44,7 +44,7 @@ resource "aws_iam_instance_profile" "test_profile" { resource "aws_instance" "app" { ami = var.ami - instance_type = "t2.xlarge" + instance_type = var.instance_type key_name = var.key_name iam_instance_profile = aws_iam_instance_profile.test_profile.name diff --git a/cloud/variables.tf b/cloud/variables.tf index 2b90fa32..81d5a048 100644 --- a/cloud/variables.tf +++ b/cloud/variables.tf @@ -15,4 +15,10 @@ variable "image_name" { type = string default = "smalldev:latest" description = "Name of the docker image on ECR to use." -} \ No newline at end of file +} + +variable "instance_type" { + type = string + default = "t2.xlarge" + description = "description" +}