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",
});
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")
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
})
}
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",
});
});
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());
}
}
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
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 string
- The unique name of the resource.
- args ImageTransformArgs
- 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 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 string
- The unique name of the resource.
- args ImageTransformArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ImageTransformArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
var imageTransformResource = new ImageTransform("imageTransformResource", ImageTransformArgs.builder()
.siteId(0)
.enable("string")
.rule("string")
.ruleEnable("string")
.ruleName("string")
.siteVersion(0)
.build());
image_transform_resource = alicloud.esa.ImageTransform("imageTransformResource",
site_id=0,
enable="string",
rule="string",
rule_enable="string",
rule_name="string",
site_version=0)
const imageTransformResource = new alicloud.esa.ImageTransform("imageTransformResource", {
siteId: 0,
enable: "string",
rule: "string",
ruleEnable: "string",
ruleName: "string",
siteVersion: 0,
});
type: alicloud:esa:ImageTransform
properties:
enable: string
rule: string
ruleEnable: string
ruleName: string
siteId: 0
siteVersion: 0
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:
- Site
Id 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")
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Site
Version 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.
- Site
Id 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")
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Site
Version 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.
- site
Id 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")
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Version 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.
- site
Id 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")
- rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Version 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 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 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.
- site
Id 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")
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Version 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:
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
- 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.
- Config
Id 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")
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Site
Version 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.
- Config
Id 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")
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Site
Id int - The site ID, which can be obtained by calling the ListSites API.
- Site
Version 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.
- config
Id 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")
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Id Integer - The site ID, which can be obtained by calling the ListSites API.
- site
Version 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.
- config
Id 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")
- rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Id number - The site ID, which can be obtained by calling the ListSites API.
- site
Version 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 int - The site ID, which can be obtained by calling the ListSites API.
- site_
version 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.
- config
Id 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")
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- site
Id Number - The site ID, which can be obtained by calling the ListSites API.
- site
Version 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>
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.