2021-03-18 03:30:54 -04:00
package provider
2020-03-24 10:34:14 -04:00
import (
2021-03-18 03:30:54 -04:00
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
2020-03-24 10:34:14 -04:00
)
func resourceDockerRegistryImage ( ) * schema . Resource {
return & schema . Resource {
2023-01-13 07:11:51 -05:00
Description : "Manages the lifecycle of docker image in a registry. You can upload images to a registry (= `docker push`) and also delete them again" ,
2021-05-21 08:30:56 -04:00
2021-03-18 03:30:54 -04:00
CreateContext : resourceDockerRegistryImageCreate ,
ReadContext : resourceDockerRegistryImageRead ,
DeleteContext : resourceDockerRegistryImageDelete ,
UpdateContext : resourceDockerRegistryImageUpdate ,
2020-03-24 10:34:14 -04:00
Schema : map [ string ] * schema . Schema {
"name" : {
2021-05-21 08:30:56 -04:00
Type : schema . TypeString ,
Description : "The name of the Docker image." ,
Required : true ,
ForceNew : true ,
2020-03-24 10:34:14 -04:00
} ,
"keep_remotely" : {
2021-05-21 08:30:56 -04:00
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 ,
2020-03-24 10:34:14 -04:00
} ,
2021-05-31 03:11:49 -04:00
"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 ,
} ,
2022-12-22 13:48:04 -05:00
"triggers" : {
2023-01-05 07:27:40 -05:00
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" ,
2022-12-22 13:48:04 -05:00
Type : schema . TypeMap ,
Optional : true ,
ForceNew : true ,
} ,
2020-03-24 10:34:14 -04:00
"sha256_digest" : {
2021-05-21 08:30:56 -04:00
Type : schema . TypeString ,
Description : "The sha256 digest of the image." ,
Computed : true ,
2020-03-24 10:34:14 -04:00
} ,
2025-04-18 11:16:05 -04:00
"auth_config" : {
Type : schema . TypeList ,
Description : "Authentication configuration for the Docker registry. It is only used for this resource." ,
Optional : true ,
MaxItems : 1 ,
Elem : & schema . Resource {
Schema : map [ string ] * schema . Schema {
"address" : {
Type : schema . TypeString ,
Description : "The address of the Docker registry." ,
Required : true ,
} ,
"username" : {
Type : schema . TypeString ,
Description : "The username for the Docker registry." ,
Required : true ,
} ,
"password" : {
Type : schema . TypeString ,
Description : "The password for the Docker registry." ,
Required : true ,
Sensitive : true ,
} ,
} ,
} ,
} ,
2020-03-24 10:34:14 -04:00
} ,
}
}