cloudflare.Image
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleImage = new cloudflare.Image("example_image", {
accountId: "023e105f4ecef8ad9ca31a8372d0c353",
file: {},
metadata: {},
requireSignedUrls: true,
url: "https://example.com/path/to/logo.png",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_image = cloudflare.Image("example_image",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
file={},
metadata={},
require_signed_urls=True,
url="https://example.com/path/to/logo.png")
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudflare.NewImage(ctx, "example_image", &cloudflare.ImageArgs{
AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
File: pulumi.String{},
Metadata: pulumi.String{},
RequireSignedUrls: pulumi.Bool(true),
Url: pulumi.String("https://example.com/path/to/logo.png"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleImage = new Cloudflare.Image("example_image", new()
{
AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
File = null,
Metadata = null,
RequireSignedUrls = true,
Url = "https://example.com/path/to/logo.png",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Image;
import com.pulumi.cloudflare.ImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleImage = new Image("exampleImage", ImageArgs.builder()
.accountId("023e105f4ecef8ad9ca31a8372d0c353")
.file(Map.ofEntries(
))
.metadata(Map.ofEntries(
))
.requireSignedUrls(true)
.url("https://example.com/path/to/logo.png")
.build());
}
}
resources:
exampleImage:
type: cloudflare:Image
name: example_image
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
file: {}
metadata: {}
requireSignedUrls: true
url: https://example.com/path/to/logo.png
Create Image Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);
@overload
def Image(resource_name: str,
args: ImageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Image(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
file: Optional[str] = None,
metadata: Optional[str] = None,
require_signed_urls: Optional[bool] = None,
url: Optional[str] = None)
func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)
type: cloudflare:Image
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ImageArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var imageResource = new Cloudflare.Image("imageResource", new()
{
AccountId = "string",
File = "string",
Metadata = "string",
RequireSignedUrls = false,
Url = "string",
});
example, err := cloudflare.NewImage(ctx, "imageResource", &cloudflare.ImageArgs{
AccountId: pulumi.String("string"),
File: pulumi.String("string"),
Metadata: pulumi.String("string"),
RequireSignedUrls: pulumi.Bool(false),
Url: pulumi.String("string"),
})
var imageResource = new Image("imageResource", ImageArgs.builder()
.accountId("string")
.file("string")
.metadata("string")
.requireSignedUrls(false)
.url("string")
.build());
image_resource = cloudflare.Image("imageResource",
account_id="string",
file="string",
metadata="string",
require_signed_urls=False,
url="string")
const imageResource = new cloudflare.Image("imageResource", {
accountId: "string",
file: "string",
metadata: "string",
requireSignedUrls: false,
url: "string",
});
type: cloudflare:Image
properties:
accountId: string
file: string
metadata: string
requireSignedUrls: false
url: string
Image Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Image resource accepts the following input properties:
- Account
Id string - Account identifier tag.
- File string
- An image binary data. Only needed when type is uploading a file.
- Metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- Require
Signed boolUrls - Indicates whether the image requires a signature token for the access.
- Url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- Account
Id string - Account identifier tag.
- File string
- An image binary data. Only needed when type is uploading a file.
- Metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- Require
Signed boolUrls - Indicates whether the image requires a signature token for the access.
- Url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- account
Id String - Account identifier tag.
- file String
- An image binary data. Only needed when type is uploading a file.
- metadata String
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed BooleanUrls - Indicates whether the image requires a signature token for the access.
- url String
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- account
Id string - Account identifier tag.
- file string
- An image binary data. Only needed when type is uploading a file.
- metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed booleanUrls - Indicates whether the image requires a signature token for the access.
- url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- account_
id str - Account identifier tag.
- file str
- An image binary data. Only needed when type is uploading a file.
- metadata str
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require_
signed_ boolurls - Indicates whether the image requires a signature token for the access.
- url str
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- account
Id String - Account identifier tag.
- file String
- An image binary data. Only needed when type is uploading a file.
- metadata String
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed BooleanUrls - Indicates whether the image requires a signature token for the access.
- url String
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
Outputs
All input properties are implicitly available as output properties. Additionally, the Image resource produces the following output properties:
- Filename string
- Image file name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Meta string
- 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.
- Uploaded string
- When the media item was uploaded.
- Variants List<string>
- Object specifying available variants for an image.
- Filename string
- Image file name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Meta string
- 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.
- Uploaded string
- When the media item was uploaded.
- Variants []string
- Object specifying available variants for an image.
- filename String
- Image file name.
- id String
- The provider-assigned unique ID for this managed resource.
- meta String
- 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.
- uploaded String
- When the media item was uploaded.
- variants List<String>
- Object specifying available variants for an image.
- filename string
- Image file name.
- id string
- The provider-assigned unique ID for this managed resource.
- meta string
- 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.
- uploaded string
- When the media item was uploaded.
- variants string[]
- Object specifying available variants for an image.
- filename str
- Image file name.
- id str
- The provider-assigned unique ID for this managed resource.
- meta str
- 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.
- uploaded str
- When the media item was uploaded.
- variants Sequence[str]
- Object specifying available variants for an image.
- filename String
- Image file name.
- id String
- The provider-assigned unique ID for this managed resource.
- meta String
- 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.
- uploaded String
- When the media item was uploaded.
- variants List<String>
- Object specifying available variants for an image.
Look up Existing Image Resource
Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ImageState, opts?: CustomResourceOptions): Image
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
file: Optional[str] = None,
filename: Optional[str] = None,
meta: Optional[str] = None,
metadata: Optional[str] = None,
require_signed_urls: Optional[bool] = None,
uploaded: Optional[str] = None,
url: Optional[str] = None,
variants: Optional[Sequence[str]] = None) -> Image
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)
resources: _: type: cloudflare:Image get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - Account identifier tag.
- File string
- An image binary data. Only needed when type is uploading a file.
- Filename string
- Image file name.
- Meta string
- 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.
- Metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- Require
Signed boolUrls - Indicates whether the image requires a signature token for the access.
- Uploaded string
- When the media item was uploaded.
- Url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- Variants List<string>
- Object specifying available variants for an image.
- Account
Id string - Account identifier tag.
- File string
- An image binary data. Only needed when type is uploading a file.
- Filename string
- Image file name.
- Meta string
- 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.
- Metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- Require
Signed boolUrls - Indicates whether the image requires a signature token for the access.
- Uploaded string
- When the media item was uploaded.
- Url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- Variants []string
- Object specifying available variants for an image.
- account
Id String - Account identifier tag.
- file String
- An image binary data. Only needed when type is uploading a file.
- filename String
- Image file name.
- meta String
- 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.
- metadata String
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed BooleanUrls - Indicates whether the image requires a signature token for the access.
- uploaded String
- When the media item was uploaded.
- url String
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- variants List<String>
- Object specifying available variants for an image.
- account
Id string - Account identifier tag.
- file string
- An image binary data. Only needed when type is uploading a file.
- filename string
- Image file name.
- meta string
- 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.
- metadata string
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed booleanUrls - Indicates whether the image requires a signature token for the access.
- uploaded string
- When the media item was uploaded.
- url string
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- variants string[]
- Object specifying available variants for an image.
- account_
id str - Account identifier tag.
- file str
- An image binary data. Only needed when type is uploading a file.
- filename str
- Image file name.
- meta str
- 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.
- metadata str
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require_
signed_ boolurls - Indicates whether the image requires a signature token for the access.
- uploaded str
- When the media item was uploaded.
- url str
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- variants Sequence[str]
- Object specifying available variants for an image.
- account
Id String - Account identifier tag.
- file String
- An image binary data. Only needed when type is uploading a file.
- filename String
- Image file name.
- meta String
- 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.
- metadata String
- User modifiable key-value store. Can use used for keeping references to another system of record for managing images.
- require
Signed BooleanUrls - Indicates whether the image requires a signature token for the access.
- uploaded String
- When the media item was uploaded.
- url String
- A URL to fetch an image from origin. Only needed when type is uploading from a URL.
- variants List<String>
- Object specifying available variants for an image.
Import
$ pulumi import cloudflare:index/image:Image example '<account_id>/<image_id>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.