terraform-provider-docker/internal/provider/resource_docker_registry_image.go
Martin 646d3aa154
feat: Prepare v3 release (#503)
* feat: Remove deprecated docker_container attributes.

* feat: Remove deprecated docker_service atttribute.

* feat: Remove deprecated `build` attribute from docker_registry_image.

* feat: Remove deprecated attributes of docker_image.

* docs: Generate and update documentation.

* fix: Add MigrateState for docker_container again.

* docs: Fix docs linting errors.

* docs: Fix tf formatting in docs.
2023-01-13 13:11:51 +01:00

52 lines
1.7 KiB
Go

package provider
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func resourceDockerRegistryImage() *schema.Resource {
return &schema.Resource{
Description: "Manages the lifecycle of docker image in a registry. You can upload images to a registry (= `docker push`) and also delete them again",
CreateContext: resourceDockerRegistryImageCreate,
ReadContext: resourceDockerRegistryImageRead,
DeleteContext: resourceDockerRegistryImageDelete,
UpdateContext: resourceDockerRegistryImageUpdate,
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "The name of the Docker image.",
Required: true,
ForceNew: true,
},
"keep_remotely": {
Type: schema.TypeBool,
Description: "If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker registry on destroy operation. Defaults to `false`",
Default: false,
Optional: true,
},
"insecure_skip_verify": {
Type: schema.TypeBool,
Description: "If `true`, the verification of TLS certificates of the server/registry is disabled. Defaults to `false`",
Optional: true,
Default: false,
},
"triggers": {
Description: "A map of arbitrary strings that, when changed, will force the `docker_registry_image` resource to be replaced. This can be used to repush a local image",
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
},
"sha256_digest": {
Type: schema.TypeString,
Description: "The sha256 digest of the image.",
Computed: true,
},
},
}
}