skip to Main Content

I can’t find more information in the Terraform provider documentation, neither can I find any open issues in github.

https://www.terraform.io/registry/providers/docs

https://github.com/hashicorp/terraform/issues?q=is%3Aissue+is%3Aopen+provider+attribute+deprecated

Terraform code:

terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 2.13.0"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name         = "nginx:latest"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.latest
  name  = "nginx"
  ports {
    internal = 80
    external = 8000
  }
}

Deprecation:

enter image description here

2

Answers


  1. Refer to the provider documentation, not Terraform. The provider is kreuzwerker/docker and issues for it would be on its own Github page.

    Login or Signup to reply.
  2. According to the kreuzwerker documentation, you need to change the version in your required_providers block:

    version = "~> 2.21.0"
    

    And also, change the way how you’re setting the image in the docker_container:

    image = docker_image.nginx.image_id
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search