Use this data source to get the list of the Fastly services.
data "fastly_services" "services" {}
output "fastly_services_all" {
value = data.fastly_services.services
}
output "fastly_services_filtered" {
# get the service with the name "Example Service"
value = one([for service in data.fastly_services.services.details : service.id if service.name == "Example Service"])
}
details
(Set of Object) A detailed list of Fastly services in your account. This is limited to the services the API token can read. (see below for nested schema)id
(String) The ID of this resource.ids
(Set of String) A list of service IDs in your account. This is limited to the services the API token can read.details
Read-Only:
comment
(String)created_at
(String)customer_id
(String)id
(String)name
(String)type
(String)updated_at
(String)version
(Number)