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: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
15
15
- docs(templates/guides): add a guide for adding a versionless domain to a service using a wildcard tls subscription ([#1194](https://github.com/fastly/terraform-provider-fastly/pull/1194))
16
16
- docs(templates/guides): add a guide for using versionless domains with a Certainly subscription to a new devlivery service ([#1195](https://github.com/fastly/terraform-provider-fastly/pull/1195))
17
-
- docs(templates/guides): add a guide for migrating delivery service classic domain to a versionless domain ([#1196](https://github.com/fastly/terraform-provider-fastly/pull/1196))
17
+
- docs(templates/guides): add a guide for migrating delivery service classic domain to a versionless domain ([#1202](https://github.com/fastly/terraform-provider-fastly/pull/1202))
18
18
- docs(templates/guides): add a guide for linking versionless domains to a service when the domains are not managed in Terraform ([#1199](https://github.com/fastly/terraform-provider-fastly/pull/1199))
19
19
- docs(templates/guides): add a guide for migrating from the deprecated 'fastly_domain_v1' and 'fastly_domain_v1_service_link' resources and data sources ([#1200](https://github.com/fastly/terraform-provider-fastly/pull/1200))
20
20
- docs(ngwaf/rules): updated list of supported values for the 'operator' field for NGWAF WAF rule conditions ([#1201](https://github.com/fastly/terraform-provider-fastly/pull/1201))
Copy file name to clipboardExpand all lines: docs/guides/versionless_domain_migration.md
+81-22Lines changed: 81 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,38 +5,31 @@ subcategory: "Guides"
5
5
6
6
## Migrate a Delivery service with a classic domain to a versionless domain
7
7
8
-
Before migrating, your HCL will look something like this, with a domain block inside of your service.
8
+
Before migrating, your HCL will look something like this, with a domain block inside of your service and a TLS subscription.
9
9
10
10
```
11
11
resource "fastly_service_vcl" "vcl_example" {
12
12
name = "versionlessdomainexample"
13
+
backend {
14
+
address = "127.0.0.1"
15
+
name = "localhost"
16
+
}
13
17
domain {
14
18
name = "demo.example.com"
15
19
comment = "demo"
16
20
}
17
-
force_destroy = true
18
21
}
19
-
```
20
-
21
-
Once you [use the control panel to migrate this domain to a versionless domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/migrating-classic-domains/), you will need to update your HCL to match the pattern below.
22
-
You can find the documentation on versionless domain patterns here: https://registry.terraform.io/providers/fastly/fastly/latest/docs/resources/domain. Do not apply your changes before running the import in the next step, as that will result in an error.
Before making other changes you will need to import domain using terraform. The Domain ID can using [the Fastly CLI](https://www.fastly.com/documentation/reference/tools/cli/) by running `fastly domain list --fqdn=foo.example.com` and using the Domain ID from the record.
29
+
Before making other changes you will need to import your domain(s) using Terraform. We'll need to run the following import command for each domain:
The Domain ID can be obtained by using [the Fastly CLI](https://www.fastly.com/documentation/reference/tools/cli/) by running `fastly domain list --fqdn=foo.example.com` and then using the Domain ID from the record.
40
33
41
34
Terraform should produce a message similar to the following.
42
35
@@ -52,18 +45,84 @@ The resources that were imported are shown above. These resources are now in
52
45
your Terraform state and will henceforth be managed by Terraform.
53
46
```
54
47
55
-
After importing, running `terraform plan` should result in no changes.
48
+
You'll then need to add a `fastly_domain` resource, associating your service, as seen below.
49
+
_You can find the documentation on versionless domain patterns here: https://registry.terraform.io/providers/fastly/fastly/latest/docs/resources/domain._
50
+
> **Do not apply your changes before running the import in the next step, as that will result in an error.**
Once you have added the necessary `fastly_domain` blocks , you can proceed with a `terraform plan` / `terraform apply`.
56
77
57
-
Once the import has run successfully, you can assign the domain to a service using the `service_id` field of the domain and then plan and apply.
78
+
You should excpect to see something like this from your `terraform plan` / `terraform apply` commands:
79
+
```
80
+
# fastly_domain.example will be updated in-place
81
+
~ resource "fastly_domain" "example" {
82
+
id = "3a2b3c4d5e"
83
+
+ service_id = "1a2b4c5d6e"
84
+
# (3 unchanged attributes hidden)
85
+
}
86
+
```
87
+
88
+
You now have associated the versionless domain with your service, but we'll still need to remove the classic domain from your HCL. The final step is to remove the `domain` attribute from your `fastly_service_vcl` block, as seen below.
Copy file name to clipboardExpand all lines: templates/guides/versionless_domain_migration.md
+81-22Lines changed: 81 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,38 +5,31 @@ subcategory: "Guides"
5
5
6
6
## Migrate a Delivery service with a classic domain to a versionless domain
7
7
8
-
Before migrating, your HCL will look something like this, with a domain block inside of your service.
8
+
Before migrating, your HCL will look something like this, with a domain block inside of your service and a TLS subscription.
9
9
10
10
```
11
11
resource "fastly_service_vcl" "vcl_example" {
12
12
name = "versionlessdomainexample"
13
+
backend {
14
+
address = "127.0.0.1"
15
+
name = "localhost"
16
+
}
13
17
domain {
14
18
name = "demo.example.com"
15
19
comment = "demo"
16
20
}
17
-
force_destroy = true
18
21
}
19
-
```
20
-
21
-
Once you [use the control panel to migrate this domain to a versionless domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/migrating-classic-domains/), you will need to update your HCL to match the pattern below.
22
-
You can find the documentation on versionless domain patterns here: https://registry.terraform.io/providers/fastly/fastly/latest/docs/resources/domain. Do not apply your changes before running the import in the next step, as that will result in an error.
Before making other changes you will need to import domain using terraform. The Domain ID can using [the Fastly CLI](https://www.fastly.com/documentation/reference/tools/cli/) by running `fastly domain list --fqdn=foo.example.com` and using the Domain ID from the record.
29
+
Before making other changes you will need to import your domain(s) using Terraform. We'll need to run the following import command for each domain:
The Domain ID can be obtained by using [the Fastly CLI](https://www.fastly.com/documentation/reference/tools/cli/) by running `fastly domain list --fqdn=foo.example.com` and then using the Domain ID from the record.
40
33
41
34
Terraform should produce a message similar to the following.
42
35
@@ -52,18 +45,84 @@ The resources that were imported are shown above. These resources are now in
52
45
your Terraform state and will henceforth be managed by Terraform.
53
46
```
54
47
55
-
After importing, running `terraform plan` should result in no changes.
48
+
You'll then need to add a `fastly_domain` resource, associating your service, as seen below.
49
+
_You can find the documentation on versionless domain patterns here: https://registry.terraform.io/providers/fastly/fastly/latest/docs/resources/domain._
50
+
> **Do not apply your changes before running the import in the next step, as that will result in an error.**
Once you have added the necessary `fastly_domain` blocks , you can proceed with a `terraform plan` / `terraform apply`.
56
77
57
-
Once the import has run successfully, you can assign the domain to a service using the `service_id` field of the domain and then plan and apply.
78
+
You should excpect to see something like this from your `terraform plan` / `terraform apply` commands:
79
+
```
80
+
# fastly_domain.example will be updated in-place
81
+
~ resource "fastly_domain" "example" {
82
+
id = "3a2b3c4d5e"
83
+
+ service_id = "1a2b4c5d6e"
84
+
# (3 unchanged attributes hidden)
85
+
}
86
+
```
87
+
88
+
You now have associated the versionless domain with your service, but we'll still need to remove the classic domain from your HCL. The final step is to remove the `domain` attribute from your `fastly_service_vcl` block, as seen below.
0 commit comments