Skip to content

Commit f284047

Browse files
authored
use amazonlinux instead of suse for the sample app instance (#179)
1 parent 658ab5f commit f284047

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

terraform/ec2/amis.tf

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,12 @@ data "aws_ami" "selected" {
101101

102102

103103
# this ami is used to launch the emitter instance
104-
data "aws_ami" "suse" {
104+
data "aws_ami" "amazonlinux2" {
105105
most_recent = true
106106

107-
filter {
108-
name = "owner-alias"
109-
values = ["amazon"]
110-
}
111-
112107
filter {
113108
name = "name"
114-
values = ["suse-sles-15-sp1-v20200501-hvm-ssd-x86_64"]
109+
values = ["amzn2-ami-hvm*"]
115110
}
116111

117112
owners = ["amazon"] # Canonical

terraform/ec2/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ locals {
7474

7575
## launch a sidecar instance to install data emitter and the mocked server
7676
resource "aws_instance" "sidecar" {
77-
ami = data.aws_ami.suse.id
77+
ami = data.aws_ami.amazonlinux2.id
7878
instance_type = "m5.2xlarge"
7979
subnet_id = local.instance_subnet
8080
vpc_security_group_ids = [module.basic_components.aoc_security_group_id]
@@ -281,9 +281,11 @@ resource "null_resource" "setup_sample_app_and_mock_server" {
281281
}
282282
provisioner "remote-exec" {
283283
inline = [
284+
"sudo amazon-linux-extras install docker -y",
285+
"sudo service docker start",
286+
"sudo usermod -a -G docker ec2-user",
284287
"sudo curl -L 'https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64' -o /usr/local/bin/docker-compose",
285288
"sudo chmod +x /usr/local/bin/docker-compose",
286-
"sudo systemctl start docker",
287289
"sudo `aws ecr get-login --no-include-email --region ${var.region}`",
288290
"sleep 30", // sleep 30s to wait until dockerd is totally set up
289291
"sudo /usr/local/bin/docker-compose -f /tmp/docker-compose.yml up -d"

0 commit comments

Comments
 (0)