1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. ImageTransform
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.esa.ImageTransform

Explore with Pulumi AI

Provides a ESA Image Transform resource.

For information about ESA Image Transform and how to use it, see What is Image Transform.

NOTE: Available since v1.244.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = alicloud.esa.getSites({
    planSubscribeType: "enterpriseplan",
});
const defaultSite = new alicloud.esa.Site("default", {
    siteName: "imagetransform.tf.com",
    instanceId: _default.then(_default => _default.sites?.[0]?.instanceId),
    coverage: "domestic",
    accessType: "NS",
});
const defaultImageTransform = new alicloud.esa.ImageTransform("default", {
    rule: "http.host eq \"video.example.com\"",
    siteVersion: 0,
    ruleName: "rule_example",
    siteId: defaultSite.id,
    ruleEnable: "off",
    enable: "off",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
default_site = alicloud.esa.Site("default",
    site_name="imagetransform.tf.com",
    instance_id=default.sites[0].instance_id,
    coverage="domestic",
    access_type="NS")
default_image_transform = alicloud.esa.ImageTransform("default",
    rule="http.host eq \"video.example.com\"",
    site_version=0,
    rule_name="rule_example",
    site_id=default_site.id,
    rule_enable="off",
    enable="off")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := esa.GetSites(ctx, &esa.GetSitesArgs{
			PlanSubscribeType: pulumi.StringRef("enterpriseplan"),
		}, nil)
		if err != nil {
			return err
		}
		defaultSite, err := esa.NewSite(ctx, "default", &esa.SiteArgs{
			SiteName:   pulumi.String("imagetransform.tf.com"),
			InstanceId: pulumi.String(_default.Sites[0].InstanceId),
			Coverage:   pulumi.String("domestic"),
			AccessType: pulumi.String("NS"),
		})
		if err != nil {
			return err
		}
		_, err = esa.NewImageTransform(ctx, "default", &esa.ImageTransformArgs{
			Rule:        pulumi.String("http.host eq \"video.example.com\""),
			SiteVersion: pulumi.Int(0),
			RuleName:    pulumi.String("rule_example"),
			SiteId:      defaultSite.ID(),
			RuleEnable:  pulumi.String("off"),
			Enable:      pulumi.String("off"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.Esa.GetSites.Invoke(new()
    {
        PlanSubscribeType = "enterpriseplan",
    });

    var defaultSite = new AliCloud.Esa.Site("default", new()
    {
        SiteName = "imagetransform.tf.com",
        InstanceId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.InstanceId)),
        Coverage = "domestic",
        AccessType = "NS",
    });

    var defaultImageTransform = new AliCloud.Esa.ImageTransform("default", new()
    {
        Rule = "http.host eq \"video.example.com\"",
        SiteVersion = 0,
        RuleName = "rule_example",
        SiteId = defaultSite.Id,
        RuleEnable = "off",
        Enable = "off",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.esa.EsaFunctions;
import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
import com.pulumi.alicloud.esa.Site;
import com.pulumi.alicloud.esa.SiteArgs;
import com.pulumi.alicloud.esa.ImageTransform;
import com.pulumi.alicloud.esa.ImageTransformArgs;
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) {
        final var default = EsaFunctions.getSites(GetSitesArgs.builder()
            .planSubscribeType("enterpriseplan")
            .build());

        var defaultSite = new Site("defaultSite", SiteArgs.builder()
            .siteName("imagetransform.tf.com")
            .instanceId(default_.sites()[0].instanceId())
            .coverage("domestic")
            .accessType("NS")
            .build());

        var defaultImageTransform = new ImageTransform("defaultImageTransform", ImageTransformArgs.builder()
            .rule("http.host eq \"video.example.com\"")
            .siteVersion("0")
            .ruleName("rule_example")
            .siteId(defaultSite.id())
            .ruleEnable("off")
            .enable("off")
            .build());

    }
}
Copy
resources:
  defaultSite:
    type: alicloud:esa:Site
    name: default
    properties:
      siteName: imagetransform.tf.com
      instanceId: ${default.sites[0].instanceId}
      coverage: domestic
      accessType: NS
  defaultImageTransform:
    type: alicloud:esa:ImageTransform
    name: default
    properties:
      rule: http.host eq "video.example.com"
      siteVersion: '0'
      ruleName: rule_example
      siteId: ${defaultSite.id}
      ruleEnable: off
      enable: off
variables:
  default:
    fn::invoke:
      function: alicloud:esa:getSites
      arguments:
        planSubscribeType: enterpriseplan
Copy

Create ImageTransform Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ImageTransform(name: string, args: ImageTransformArgs, opts?: CustomResourceOptions);
@overload
def ImageTransform(resource_name: str,
                   args: ImageTransformArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def ImageTransform(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   site_id: Optional[int] = None,
                   enable: Optional[str] = None,
                   rule: Optional[str] = None,
                   rule_enable: Optional[str] = None,
                   rule_name: Optional[str] = None,
                   site_version: Optional[int] = None)
func NewImageTransform(ctx *Context, name string, args ImageTransformArgs, opts ...ResourceOption) (*ImageTransform, error)
public ImageTransform(string name, ImageTransformArgs args, CustomResourceOptions? opts = null)
public ImageTransform(String name, ImageTransformArgs args)
public ImageTransform(String name, ImageTransformArgs args, CustomResourceOptions options)
type: alicloud:esa:ImageTransform
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ImageTransformArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ImageTransformArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ImageTransformArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ImageTransformArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ImageTransformArgs
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 imageTransformResource = new AliCloud.Esa.ImageTransform("imageTransformResource", new()
{
    SiteId = 0,
    Enable = "string",
    Rule = "string",
    RuleEnable = "string",
    RuleName = "string",
    SiteVersion = 0,
});
Copy
example, err := esa.NewImageTransform(ctx, "imageTransformResource", &esa.ImageTransformArgs{
	SiteId:      pulumi.Int(0),
	Enable:      pulumi.String("string"),
	Rule:        pulumi.String("string"),
	RuleEnable:  pulumi.String("string"),
	RuleName:    pulumi.String("string"),
	SiteVersion: pulumi.Int(0),
})
Copy
var imageTransformResource = new ImageTransform("imageTransformResource", ImageTransformArgs.builder()
    .siteId(0)
    .enable("string")
    .rule("string")
    .ruleEnable("string")
    .ruleName("string")
    .siteVersion(0)
    .build());
Copy
image_transform_resource = alicloud.esa.ImageTransform("imageTransformResource",
    site_id=0,
    enable="string",
    rule="string",
    rule_enable="string",
    rule_name="string",
    site_version=0)
Copy
const imageTransformResource = new alicloud.esa.ImageTransform("imageTransformResource", {
    siteId: 0,
    enable: "string",
    rule: "string",
    ruleEnable: "string",
    ruleName: "string",
    siteVersion: 0,
});
Copy
type: alicloud:esa:ImageTransform
properties:
    enable: string
    rule: string
    ruleEnable: string
    ruleName: string
    siteId: 0
    siteVersion: 0
Copy

ImageTransform 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 ImageTransform resource accepts the following input properties:

SiteId
This property is required.
Changes to this property will trigger replacement.
int
The site ID, which can be obtained by calling the ListSites API.
Enable string
Indicates whether the image transformations feature is enabled. Valid values:
Rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
RuleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
RuleName string
Rule name. When adding global configuration, this parameter does not need to be set.
SiteVersion Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
SiteId
This property is required.
Changes to this property will trigger replacement.
int
The site ID, which can be obtained by calling the ListSites API.
Enable string
Indicates whether the image transformations feature is enabled. Valid values:
Rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
RuleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
RuleName string
Rule name. When adding global configuration, this parameter does not need to be set.
SiteVersion Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
siteId
This property is required.
Changes to this property will trigger replacement.
Integer
The site ID, which can be obtained by calling the ListSites API.
enable String
Indicates whether the image transformations feature is enabled. Valid values:
rule String
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable String
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName String
Rule name. When adding global configuration, this parameter does not need to be set.
siteVersion Changes to this property will trigger replacement. Integer
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
siteId
This property is required.
Changes to this property will trigger replacement.
number
The site ID, which can be obtained by calling the ListSites API.
enable string
Indicates whether the image transformations feature is enabled. Valid values:
rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName string
Rule name. When adding global configuration, this parameter does not need to be set.
siteVersion Changes to this property will trigger replacement. number
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
site_id
This property is required.
Changes to this property will trigger replacement.
int
The site ID, which can be obtained by calling the ListSites API.
enable str
Indicates whether the image transformations feature is enabled. Valid values:
rule str
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
rule_enable str
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
rule_name str
Rule name. When adding global configuration, this parameter does not need to be set.
site_version Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
siteId
This property is required.
Changes to this property will trigger replacement.
Number
The site ID, which can be obtained by calling the ListSites API.
enable String
Indicates whether the image transformations feature is enabled. Valid values:
rule String
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable String
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName String
Rule name. When adding global configuration, this parameter does not need to be set.
siteVersion Changes to this property will trigger replacement. Number
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.

Outputs

All input properties are implicitly available as output properties. Additionally, the ImageTransform resource produces the following output properties:

ConfigId int
Config Id
Id string
The provider-assigned unique ID for this managed resource.
ConfigId int
Config Id
Id string
The provider-assigned unique ID for this managed resource.
configId Integer
Config Id
id String
The provider-assigned unique ID for this managed resource.
configId number
Config Id
id string
The provider-assigned unique ID for this managed resource.
config_id int
Config Id
id str
The provider-assigned unique ID for this managed resource.
configId Number
Config Id
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ImageTransform Resource

Get an existing ImageTransform 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?: ImageTransformState, opts?: CustomResourceOptions): ImageTransform
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config_id: Optional[int] = None,
        enable: Optional[str] = None,
        rule: Optional[str] = None,
        rule_enable: Optional[str] = None,
        rule_name: Optional[str] = None,
        site_id: Optional[int] = None,
        site_version: Optional[int] = None) -> ImageTransform
func GetImageTransform(ctx *Context, name string, id IDInput, state *ImageTransformState, opts ...ResourceOption) (*ImageTransform, error)
public static ImageTransform Get(string name, Input<string> id, ImageTransformState? state, CustomResourceOptions? opts = null)
public static ImageTransform get(String name, Output<String> id, ImageTransformState state, CustomResourceOptions options)
resources:  _:    type: alicloud:esa:ImageTransform    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
ConfigId int
Config Id
Enable string
Indicates whether the image transformations feature is enabled. Valid values:
Rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
RuleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
RuleName string
Rule name. When adding global configuration, this parameter does not need to be set.
SiteId Changes to this property will trigger replacement. int
The site ID, which can be obtained by calling the ListSites API.
SiteVersion Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
ConfigId int
Config Id
Enable string
Indicates whether the image transformations feature is enabled. Valid values:
Rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
RuleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
RuleName string
Rule name. When adding global configuration, this parameter does not need to be set.
SiteId Changes to this property will trigger replacement. int
The site ID, which can be obtained by calling the ListSites API.
SiteVersion Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
configId Integer
Config Id
enable String
Indicates whether the image transformations feature is enabled. Valid values:
rule String
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable String
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName String
Rule name. When adding global configuration, this parameter does not need to be set.
siteId Changes to this property will trigger replacement. Integer
The site ID, which can be obtained by calling the ListSites API.
siteVersion Changes to this property will trigger replacement. Integer
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
configId number
Config Id
enable string
Indicates whether the image transformations feature is enabled. Valid values:
rule string
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable string
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName string
Rule name. When adding global configuration, this parameter does not need to be set.
siteId Changes to this property will trigger replacement. number
The site ID, which can be obtained by calling the ListSites API.
siteVersion Changes to this property will trigger replacement. number
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
config_id int
Config Id
enable str
Indicates whether the image transformations feature is enabled. Valid values:
rule str
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
rule_enable str
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
rule_name str
Rule name. When adding global configuration, this parameter does not need to be set.
site_id Changes to this property will trigger replacement. int
The site ID, which can be obtained by calling the ListSites API.
site_version Changes to this property will trigger replacement. int
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
configId Number
Config Id
enable String
Indicates whether the image transformations feature is enabled. Valid values:
rule String
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:

  • Match all incoming requests: value set to true
  • Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
ruleEnable String
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
ruleName String
Rule name. When adding global configuration, this parameter does not need to be set.
siteId Changes to this property will trigger replacement. Number
The site ID, which can be obtained by calling the ListSites API.
siteVersion Changes to this property will trigger replacement. Number
The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.

Import

ESA Image Transform can be imported using the id, e.g.

$ pulumi import alicloud:esa/imageTransform:ImageTransform example <site_id>:<config_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.