You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/how-to-setup-applesilicon-server-with-terraform/index.mdx
+77-60Lines changed: 77 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
meta:
3
-
title: Automating Apple silicon server creation: A step-by-step guide using Terraform
3
+
title: Automating Apple silicon server creation using Terraform
4
4
description: Explore two powerful approaches to automating Apple silicon server deployment with Terraform
5
5
content:
6
-
h1: Automating Apple silicon server creation: A step-by-step guide using Terraform
6
+
h1: Automating Apple silicon server creation using Terraform
7
7
description: Explore two powerful approaches to automating Apple silicon server deployment with Terraform
8
8
categories:
9
9
- apple-silicon
@@ -35,10 +35,10 @@ Both Terraform and OpenTofu offer the same core functionality for provisioning a
35
35
36
36
2. Create a directory for your Terraform project. Open your terminal and run the following command:
37
37
38
-
```shell
39
-
mkdir apple_silicon_server_terraform
40
-
cd apple_silicon_server_terraform
41
-
```
38
+
```shell
39
+
mkdir apple_silicon_server_terraform
40
+
cd apple_silicon_server_terraform
41
+
```
42
42
43
43
3. Create a Terraform configuration file. Inside the directory, create a file named `resources.tf`:
44
44
@@ -48,83 +48,86 @@ cd apple_silicon_server_terraform
48
48
49
49
4. Define the required providers. Open the `resources.tf` file and add the following configuration to define the Scaleway provider and set the required Terraform version:
50
50
51
-
```shell
52
-
terraform {
53
-
required_providers {
54
-
scaleway = {
55
-
source = "scaleway/scaleway"
51
+
```shell
52
+
terraform {
53
+
required_providers {
54
+
scaleway = {
55
+
source = "scaleway/scaleway"
56
+
}
57
+
}
58
+
required_version = ">=0.13"
56
59
}
57
-
}
58
-
required_version = ">=0.13"
59
-
}
60
60
61
-
```
61
+
```
62
62
63
63
5. Define the Apple silicon server. Add the following code to define your Apple silicon server (M2-M type) in the same `resources.tf` file:
6. Run the following commands in your terminal to apply the configuration:
75
74
76
-
```shell
77
-
#Initialize Terraform
78
-
terraform init
79
-
#Plan the deployment
80
-
terraform plan
81
-
#Create the server
82
-
terraform apply
83
-
```
75
+
```shell
76
+
#Initialize Terraform
77
+
terraform init
78
+
#Plan the deployment
79
+
terraform plan
80
+
#Create the server
81
+
terraform apply
82
+
```
84
83
85
84
When prompted, type **yes** to confirm the creation of the resources.
86
85
87
86
7. Enable Virtual Private Cloud (VPC) and a Private Network. To enhance the network setup, you can update the configuration to enable the VPC option and attach a Private Network to your Apple silicon server. Update your `resources.tf` file with the following:
8. Run the following command to apply the changes and update the server configuration:
111
111
112
-
```shell
113
-
terraform apply
114
-
```
112
+
```shell
113
+
terraform apply
114
+
```
115
+
116
+
This will apply the new settings, ensuring that the server is launched within the specified VPC and connected to the Private Network.
115
117
116
-
This will apply the new settings, ensuring that the server is launched within the specified VPC and connected to the Private Network.
118
+
<Messagetype="tip">
119
+
You can log in to the [Scaleway console](https://console.scaleway.com/asaas/servers) to view the Apple silicon server you just created.
120
+
</Message>
117
121
118
122
## Retrieve server information
119
123
120
-
You can retrieve your server information after the creation by using the terraform output command. To do so, you need to define output variables in your resources.tf. For example:
124
+
You can retrieve your server information after the creation by using the terraform output command. To do so, you need to define output variables in your `resources.tf`. For example:
0 commit comments