docs: update service.html.markdown (#281)

Updated documentation to reflect new block and argument syntax
This commit is contained in:
Grant Steuart 2020-08-02 10:36:04 -05:00 committed by GitHub
parent d0b7c03eb8
commit 1e6b6b7304
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,7 +88,7 @@ resource "docker_service" "foo" {
args = ["-las"]
hostname = "my-fancy-service"
env {
env = {
MYFOO = "BAR"
}
@ -108,18 +108,20 @@ resource "docker_service" "foo" {
read_only = true
mounts = [
{
target = "/mount/test"
source = "${docker_volume.test_volume.name}"
type = "volume"
read_only = true
mounts {
target = "/mount/test"
source = "${docker_volume.test_volume.name}"
type = "volume"
read_only = true
bind_options {
propagation = "private"
}
},
]
bind_options {
propagation = "private"
}
}
mounts {
# another mount
}
stop_signal = "SIGTERM"
stop_grace_period = "10s"
@ -142,24 +144,28 @@ resource "docker_service" "foo" {
options = ["timeout:3"]
}
secrets = [
{
secret_id = "${docker_secret.service_secret.id}"
secret_name = "${docker_secret.service_secret.name}"
file_name = "/secrets.json"
file_uid = "0"
file_gid = "0"
file_mode = 0777
},
]
secrets {
secret_id = "${docker_secret.service_secret.id}"
secret_name = "${docker_secret.service_secret.name}"
file_name = "/secrets.json"
file_uid = "0"
file_gid = "0"
file_mode = 0777
}
secrets {
# another secret
}
configs = [
{
config_id = "${docker_config.service_config.id}"
config_name = "${docker_config.service_config.name}"
file_name = "/configs.json"
},
]
configs {
config_id = "${docker_config.service_config.id}"
config_name = "${docker_config.service_config.name}"
file_name = "/configs.json"
}
configs {
# another config
}
}
resources {
@ -259,6 +265,10 @@ resource "docker_service" "foo" {
published_port = "8080"
publish_mode = "ingress"
}
ports {
# another port
}
}
}
```
@ -586,4 +596,4 @@ Docker service can be imported using the long id, e.g. for a service with the sh
```sh
$ terraform import docker_service.foo $(docker service inspect -f {{.ID}} 55b)
```
```