Skip to content

Commit

Permalink
update(registry): terraform update with new registry for docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
jlecomte committed Apr 16, 2024
1 parent e8c374d commit 1c575ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions mnq/sns-instances-notification-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This repository contains the source code for the this tutorial: [Creating a noti

This example assumes that you are familiar with:

- how System Notification Service work. You can find out more in the [SNS Scaleway official documentation](https://www.scaleway.com/en/docs/serverless/messaging/quickstart/)
- how Instances work. If needed, you can visit the [Instances Quickstart documentation](https://www.scaleway.com/en/docs/compute/instances/quickstart/).
- how to create a SSH key. If not done already, you can follow the first 6 steps of [this walkthrough](https://www.scaleway.com/en/docs/identity-and-access-management/organizations-and-projects/how-to/create-ssh-key/#how-to-upload-the-public-ssh-key-to-the-scaleway-interface).
- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Set up authentication for the Terraform provider](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs#authentication)
- An [SSH key](/identity-and-access-management/organizations-and-projects/how-to/create-ssh-key/)
- [Set up the Scaleway CLI](/developer-tools/scaleway-cli/quickstart/)


## Context

Expand Down Expand Up @@ -38,4 +40,4 @@ terraform apply
- Then connect to the publisher Instance with that URL ```http://<your_subscriber_ip_address>:8081```
- Go to the home page of your publisher server: ```http://<your_publisher_ip_address>:8081```
- Click on a CPU behavior, and check the notification page of your subscriber server. A notification about the behavior should have appeared.
- Once you're done testing, you can apply `terraform destroy` to clean and remove the project.
- Once you're done testing, you can apply `terraform destroy` to clean and remove the project.
8 changes: 4 additions & 4 deletions mnq/sns-instances-notification-system/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ resource "scaleway_instance_server" "subscriber_sns_tuto_instance" {
apt-get update && apt-get install -y docker.io
systemctl start docker
systemctl enable docker
docker pull rg.fr-par.scw.cloud/sns-x-instance-tutorial/subscriber-server:1.0
docker pull rg.fr-par.scw.cloud/mnq-tutorials/sns-instances-subscriber-server:1.0
docker run -d --restart=always \
--name subscriber-server \
-p 8081:8081 \
rg.fr-par.scw.cloud/sns-x-instance-tutorial/subscriber-server:1.0
rg.fr-par.scw.cloud/mnq-tutorials/sns-instances-subscriber-server:1.0
EOF
}
}
Expand Down Expand Up @@ -173,7 +173,7 @@ resource "scaleway_instance_server" "publisher_sns_tuto_instance" {
- chmod +x /etc/profile.d/publisher-server_env.sh
# Using 'source' command doesn't work in cloud-init runcmd because each command runs in a separate shell.
# this is why environment variables will be passed directly in the docker run command
- docker pull rg.fr-par.scw.cloud/sns-x-instance-tutorial/publisher-server:1.0
- docker pull rg.fr-par.scw.cloud/mnq-tutorials/sns-instances-publisher-server:1.0
- |
. /etc/profile.d/publisher-server_env.sh
docker run -d --restart=always \
Expand All @@ -182,7 +182,7 @@ resource "scaleway_instance_server" "publisher_sns_tuto_instance" {
-e TOPIC_ARN=$TOPIC_ARN \
-e AWS_ACCESS_KEY=$AWS_ACCESS_KEY \
-e AWS_SECRET_KEY=$AWS_SECRET_KEY \
rg.fr-par.scw.cloud/sns-x-instance-tutorial/publisher-server:1.0
rg.fr-par.scw.cloud/mnq-tutorials/sns-instances-publisher-server:1.0
EOF
}
}

0 comments on commit 1c575ce

Please sign in to comment.