mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-18 23:06:10 -05:00
* chore: rename structures file * fix: create volume migrators * fix: move service migrators * fix: move network migrators * fix: rename container migrators * chore: move label migrators and helpers * chore: move container structures * chore: move network structures * fix: move container extrahosts flattener * fix: move container ulimits flattener * fix: move container devices flattener * chore: move service mappers to structures file * chore: move image helper funcs * chore: add constants for network refresher funcs * chore: move plugin crud funcs to the top * chore: move registry image funcs to the top * chore: add resfresh func constants for volume * chore: extract ipam config flatten func
115 lines
2.1 KiB
Go
115 lines
2.1 KiB
Go
package provider
|
|
|
|
import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
|
|
func resourceDockerNetworkV0() *schema.Resource {
|
|
return &schema.Resource{
|
|
// This is only used for state migration, so the CRUD
|
|
// callbacks are no longer relevant
|
|
Schema: map[string]*schema.Schema{
|
|
"name": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"labels": {
|
|
Type: schema.TypeMap,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"check_duplicate": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"driver": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
Default: "bridge",
|
|
},
|
|
|
|
"options": {
|
|
Type: schema.TypeMap,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
Computed: true,
|
|
},
|
|
|
|
"internal": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Computed: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"attachable": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"ingress": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"ipv6": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"ipam_driver": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
Default: "default",
|
|
},
|
|
|
|
"ipam_config": {
|
|
Type: schema.TypeSet,
|
|
Optional: true,
|
|
Computed: true,
|
|
ForceNew: true,
|
|
// DiffSuppressFunc: suppressIfIPAMConfigWithIpv6Changes(),
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"subnet": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"ip_range": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"gateway": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
|
|
"aux_address": {
|
|
Type: schema.TypeMap,
|
|
Optional: true,
|
|
ForceNew: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
"scope": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
},
|
|
}
|
|
}
|