alicloud.cdn.FcTrigger
Explore with Pulumi AI
Provides a CDN Fc Trigger resource.
For information about CDN Fc Trigger and how to use it, see What is Fc Trigger.
NOTE: Available in v1.165.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.getAccount({});
const defaultGetRegions = alicloud.getRegions({
    current: true,
});
const example = new alicloud.cdn.FcTrigger("example", {
    eventMetaName: "LogFileCreated",
    eventMetaVersion: "1.0.0",
    notes: "example_value",
    roleArn: _default.then(_default => `acs:ram::${_default.id}:role/aliyuncdneventnotificationrole`),
    sourceArn: _default.then(_default => `acs:cdn:*:${_default.id}:domain/example.com`),
    triggerArn: Promise.all([defaultGetRegions, _default]).then(([defaultGetRegions, _default]) => `acs:fc:${defaultGetRegions.regions?.[0]?.id}:${_default.id}:services/FCTestService/functions/printEvent/triggers/testtrigger`),
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.get_account()
default_get_regions = alicloud.get_regions(current=True)
example = alicloud.cdn.FcTrigger("example",
    event_meta_name="LogFileCreated",
    event_meta_version="1.0.0",
    notes="example_value",
    role_arn=f"acs:ram::{default.id}:role/aliyuncdneventnotificationrole",
    source_arn=f"acs:cdn:*:{default.id}:domain/example.com",
    trigger_arn=f"acs:fc:{default_get_regions.regions[0].id}:{default.id}:services/FCTestService/functions/printEvent/triggers/testtrigger")
package main
import (
	"fmt"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cdn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := alicloud.GetAccount(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		defaultGetRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
			Current: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		_, err = cdn.NewFcTrigger(ctx, "example", &cdn.FcTriggerArgs{
			EventMetaName:    pulumi.String("LogFileCreated"),
			EventMetaVersion: pulumi.String("1.0.0"),
			Notes:            pulumi.String("example_value"),
			RoleArn:          pulumi.Sprintf("acs:ram::%v:role/aliyuncdneventnotificationrole", _default.Id),
			SourceArn:        pulumi.Sprintf("acs:cdn:*:%v:domain/example.com", _default.Id),
			TriggerArn:       pulumi.Sprintf("acs:fc:%v:%v:services/FCTestService/functions/printEvent/triggers/testtrigger", defaultGetRegions.Regions[0].Id, _default.Id),
		})
		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.GetAccount.Invoke();
    var defaultGetRegions = AliCloud.GetRegions.Invoke(new()
    {
        Current = true,
    });
    var example = new AliCloud.Cdn.FcTrigger("example", new()
    {
        EventMetaName = "LogFileCreated",
        EventMetaVersion = "1.0.0",
        Notes = "example_value",
        RoleArn = @default.Apply(@default => $"acs:ram::{@default.Apply(getAccountResult => getAccountResult.Id)}:role/aliyuncdneventnotificationrole"),
        SourceArn = @default.Apply(@default => $"acs:cdn:*:{@default.Apply(getAccountResult => getAccountResult.Id)}:domain/example.com"),
        TriggerArn = Output.Tuple(defaultGetRegions, @default).Apply(values =>
        {
            var defaultGetRegions = values.Item1;
            var @default = values.Item2;
            return $"acs:fc:{defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}:{@default.Apply(getAccountResult => getAccountResult.Id)}:services/FCTestService/functions/printEvent/triggers/testtrigger";
        }),
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
import com.pulumi.alicloud.cdn.FcTrigger;
import com.pulumi.alicloud.cdn.FcTriggerArgs;
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 = AlicloudFunctions.getAccount();
        final var defaultGetRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
            .current(true)
            .build());
        var example = new FcTrigger("example", FcTriggerArgs.builder()
            .eventMetaName("LogFileCreated")
            .eventMetaVersion("1.0.0")
            .notes("example_value")
            .roleArn(String.format("acs:ram::%s:role/aliyuncdneventnotificationrole", default_.id()))
            .sourceArn(String.format("acs:cdn:*:%s:domain/example.com", default_.id()))
            .triggerArn(String.format("acs:fc:%s:%s:services/FCTestService/functions/printEvent/triggers/testtrigger", defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()),default_.id()))
            .build());
    }
}
resources:
  example:
    type: alicloud:cdn:FcTrigger
    properties:
      eventMetaName: LogFileCreated
      eventMetaVersion: 1.0.0
      notes: example_value
      roleArn: acs:ram::${default.id}:role/aliyuncdneventnotificationrole
      sourceArn: acs:cdn:*:${default.id}:domain/example.com
      triggerArn: acs:fc:${defaultGetRegions.regions[0].id}:${default.id}:services/FCTestService/functions/printEvent/triggers/testtrigger
variables:
  default:
    fn::invoke:
      function: alicloud:getAccount
      arguments: {}
  defaultGetRegions:
    fn::invoke:
      function: alicloud:getRegions
      arguments:
        current: true
Create FcTrigger Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FcTrigger(name: string, args: FcTriggerArgs, opts?: CustomResourceOptions);@overload
def FcTrigger(resource_name: str,
              args: FcTriggerArgs,
              opts: Optional[ResourceOptions] = None)
@overload
def FcTrigger(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              event_meta_name: Optional[str] = None,
              event_meta_version: Optional[str] = None,
              notes: Optional[str] = None,
              role_arn: Optional[str] = None,
              source_arn: Optional[str] = None,
              trigger_arn: Optional[str] = None,
              function_arn: Optional[str] = None)func NewFcTrigger(ctx *Context, name string, args FcTriggerArgs, opts ...ResourceOption) (*FcTrigger, error)public FcTrigger(string name, FcTriggerArgs args, CustomResourceOptions? opts = null)
public FcTrigger(String name, FcTriggerArgs args)
public FcTrigger(String name, FcTriggerArgs args, CustomResourceOptions options)
type: alicloud:cdn:FcTrigger
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 FcTriggerArgs
- 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 FcTriggerArgs
- 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 FcTriggerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FcTriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FcTriggerArgs
- 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 fcTriggerResource = new AliCloud.Cdn.FcTrigger("fcTriggerResource", new()
{
    EventMetaName = "string",
    EventMetaVersion = "string",
    Notes = "string",
    RoleArn = "string",
    SourceArn = "string",
    TriggerArn = "string",
    FunctionArn = "string",
});
example, err := cdn.NewFcTrigger(ctx, "fcTriggerResource", &cdn.FcTriggerArgs{
	EventMetaName:    pulumi.String("string"),
	EventMetaVersion: pulumi.String("string"),
	Notes:            pulumi.String("string"),
	RoleArn:          pulumi.String("string"),
	SourceArn:        pulumi.String("string"),
	TriggerArn:       pulumi.String("string"),
	FunctionArn:      pulumi.String("string"),
})
var fcTriggerResource = new FcTrigger("fcTriggerResource", FcTriggerArgs.builder()
    .eventMetaName("string")
    .eventMetaVersion("string")
    .notes("string")
    .roleArn("string")
    .sourceArn("string")
    .triggerArn("string")
    .functionArn("string")
    .build());
fc_trigger_resource = alicloud.cdn.FcTrigger("fcTriggerResource",
    event_meta_name="string",
    event_meta_version="string",
    notes="string",
    role_arn="string",
    source_arn="string",
    trigger_arn="string",
    function_arn="string")
const fcTriggerResource = new alicloud.cdn.FcTrigger("fcTriggerResource", {
    eventMetaName: "string",
    eventMetaVersion: "string",
    notes: "string",
    roleArn: "string",
    sourceArn: "string",
    triggerArn: "string",
    functionArn: "string",
});
type: alicloud:cdn:FcTrigger
properties:
    eventMetaName: string
    eventMetaVersion: string
    functionArn: string
    notes: string
    roleArn: string
    sourceArn: string
    triggerArn: string
FcTrigger 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 FcTrigger resource accepts the following input properties:
- EventMeta stringName 
- The name of the Event.
- EventMeta stringVersion 
- The version of the Event.
- Notes string
- The Note information.
- RoleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- SourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- TriggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- FunctionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- EventMeta stringName 
- The name of the Event.
- EventMeta stringVersion 
- The version of the Event.
- Notes string
- The Note information.
- RoleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- SourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- TriggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- FunctionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- eventMeta StringName 
- The name of the Event.
- eventMeta StringVersion 
- The version of the Event.
- notes String
- The Note information.
- roleArn String
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn String
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn String
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- functionArn String
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- eventMeta stringName 
- The name of the Event.
- eventMeta stringVersion 
- The version of the Event.
- notes string
- The Note information.
- roleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- functionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- event_meta_ strname 
- The name of the Event.
- event_meta_ strversion 
- The version of the Event.
- notes str
- The Note information.
- role_arn str
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- source_arn str
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- trigger_arn str
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- function_arn str
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- eventMeta StringName 
- The name of the Event.
- eventMeta StringVersion 
- The version of the Event.
- notes String
- The Note information.
- roleArn String
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn String
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn String
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- functionArn String
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
Outputs
All input properties are implicitly available as output properties. Additionally, the FcTrigger resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing FcTrigger Resource
Get an existing FcTrigger 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?: FcTriggerState, opts?: CustomResourceOptions): FcTrigger@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        event_meta_name: Optional[str] = None,
        event_meta_version: Optional[str] = None,
        function_arn: Optional[str] = None,
        notes: Optional[str] = None,
        role_arn: Optional[str] = None,
        source_arn: Optional[str] = None,
        trigger_arn: Optional[str] = None) -> FcTriggerfunc GetFcTrigger(ctx *Context, name string, id IDInput, state *FcTriggerState, opts ...ResourceOption) (*FcTrigger, error)public static FcTrigger Get(string name, Input<string> id, FcTriggerState? state, CustomResourceOptions? opts = null)public static FcTrigger get(String name, Output<String> id, FcTriggerState state, CustomResourceOptions options)resources:  _:    type: alicloud:cdn:FcTrigger    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.
- EventMeta stringName 
- The name of the Event.
- EventMeta stringVersion 
- The version of the Event.
- FunctionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- Notes string
- The Note information.
- RoleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- SourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- TriggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- EventMeta stringName 
- The name of the Event.
- EventMeta stringVersion 
- The version of the Event.
- FunctionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- Notes string
- The Note information.
- RoleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- SourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- TriggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- eventMeta StringName 
- The name of the Event.
- eventMeta StringVersion 
- The version of the Event.
- functionArn String
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- notes String
- The Note information.
- roleArn String
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn String
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn String
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- eventMeta stringName 
- The name of the Event.
- eventMeta stringVersion 
- The version of the Event.
- functionArn string
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- notes string
- The Note information.
- roleArn string
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn string
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn string
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- event_meta_ strname 
- The name of the Event.
- event_meta_ strversion 
- The version of the Event.
- function_arn str
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- notes str
- The Note information.
- role_arn str
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- source_arn str
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- trigger_arn str
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
- eventMeta StringName 
- The name of the Event.
- eventMeta StringVersion 
- The version of the Event.
- functionArn String
- The function arn. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}.
- notes String
- The Note information.
- roleArn String
- The role authorized by RAM. The value formats as acs:ram::{AccountID}:role/{RoleName}.
- sourceArn String
- Resources and filters for event listening. The value formats as acs:cdn:{RegionID}:{AccountID}:{Filter}.
- triggerArn String
- The trigger corresponding to the function Compute Service. The value formats as acs:fc:{RegionID}:{AccountID}:{Filter}. See Create a CDN Fc Trigger for more details.
Import
CDN Fc Trigger can be imported using the id, e.g.
$ pulumi import alicloud:cdn/fcTrigger:FcTrigger example <trigger_arn>
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 alicloudTerraform Provider.