Skip to content
Start here

Images

ImagesV1

resource cloudflare_image

required Expand Collapse
id: String

An optional custom unique identifier for your image.

account_id: String

Account identifier tag.

optional Expand Collapse
file?: String

An image binary data. Only needed when type is uploading a file.

url?: String

A URL to fetch an image from origin. Only needed when type is uploading from a URL.

creator?: String

Can set the creator field with an internal user ID.

metadata?: JSON

User modifiable key-value store. Can use used for keeping references to another system of record for managing images.

require_signed_urls?: Bool

Indicates whether the image requires a signature token for the access.

computed Expand Collapse
filename: String

Image file name.

uploaded: Time

When the media item was uploaded.

variants: List[String]

Object specifying available variants for an image.

meta: JSON

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

cloudflare_image

resource "cloudflare_image" "example_image" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  id = "id"
  creator = "creator"
  file = "Example data"
  metadata = {

  }
  require_signed_urls = true
  url = "https://example.com/path/to/logo.png"
}

data cloudflare_image

required Expand Collapse
image_id: String

Image unique identifier.

account_id: String

Account identifier tag.

computed Expand Collapse
id: String

Image unique identifier.

creator: String

Can set the creator field with an internal user ID.

filename: String

Image file name.

require_signed_urls: Bool

Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image.

uploaded: Time

When the media item was uploaded.

variants: List[String]

Object specifying available variants for an image.

meta: JSON

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

cloudflare_image

data "cloudflare_image" "example_image" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  image_id = "image_id"
}

data cloudflare_images

required Expand Collapse
account_id: String

Account identifier tag.

optional Expand Collapse
creator?: String

Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

images: List[Attributes]
id: String

Image unique identifier.

creator: String

Can set the creator field with an internal user ID.

filename: String

Image file name.

meta: JSON

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

require_signed_urls: Bool

Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image.

uploaded: Time

When the media item was uploaded.

variants: List[String]

Object specifying available variants for an image.

cloudflare_images

data "cloudflare_images" "example_images" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  creator = "creator"
}

ImagesV1Variants

resource cloudflare_image_variant

required Expand Collapse
id: String
account_id: String

Account identifier tag.

options: Attributes

Allows you to define image resizing sizes for different use cases.

fit: String

The fit property describes how the width and height dimensions should be interpreted.

height: Float64

Maximum height in image pixels.

metadata: String

What EXIF data should be preserved in the output image.

width: Float64

Maximum width in image pixels.

optional Expand Collapse
never_require_signed_urls?: Bool

Indicates whether the variant can access an image without a signature, regardless of image access control.

computed Expand Collapse
variant: Attributes
id: String
options: Attributes

Allows you to define image resizing sizes for different use cases.

fit: String

The fit property describes how the width and height dimensions should be interpreted.

height: Float64

Maximum height in image pixels.

metadata: String

What EXIF data should be preserved in the output image.

width: Float64

Maximum width in image pixels.

never_require_signed_urls: Bool

Indicates whether the variant can access an image without a signature, regardless of image access control.

cloudflare_image_variant

resource "cloudflare_image_variant" "example_image_variant" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  id = "hero"
  options = {
    fit = "scale-down"
    height = 768
    metadata = "none"
    width = 1366
  }
  never_require_signed_urls = true
}

data cloudflare_image_variant

required Expand Collapse
variant_id: String
account_id: String

Account identifier tag.

computed Expand Collapse
id: String
variant: Attributes
id: String
options: Attributes

Allows you to define image resizing sizes for different use cases.

fit: String

The fit property describes how the width and height dimensions should be interpreted.

height: Float64

Maximum height in image pixels.

metadata: String

What EXIF data should be preserved in the output image.

width: Float64

Maximum width in image pixels.

never_require_signed_urls: Bool

Indicates whether the variant can access an image without a signature, regardless of image access control.

cloudflare_image_variant

data "cloudflare_image_variant" "example_image_variant" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  variant_id = "hero"
}