alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cdn.FcTrigger

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

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultAccount = AliCloud.GetAccount.Invoke();

    var defaultRegions = AliCloud.GetRegions.Invoke(new()
    {
        Current = true,
    });

    var example = new AliCloud.Cdn.FcTrigger("example", new()
    {
        EventMetaName = "LogFileCreated",
        EventMetaVersion = "1.0.0",
        Notes = "example_value",
        RoleArn = $"acs:ram::{defaultAccount.Apply(getAccountResult => getAccountResult.Id)}:role/aliyuncdneventnotificationrole",
        SourceArn = $"acs:cdn:*:{defaultAccount.Apply(getAccountResult => getAccountResult.Id)}:domain/example.com",
        TriggerArn = Output.Tuple(defaultRegions, defaultAccount).Apply(values =>
        {
            var defaultRegions = values.Item1;
            var defaultAccount = values.Item2;
            return $"acs:fc:{defaultRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)}:{defaultAccount.Apply(getAccountResult => getAccountResult.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 {
		defaultAccount, err := alicloud.GetAccount(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultRegions, 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.String(fmt.Sprintf("acs:ram::%v:role/aliyuncdneventnotificationrole", defaultAccount.Id)),
			SourceArn:        pulumi.String(fmt.Sprintf("acs:cdn:*:%v:domain/example.com", defaultAccount.Id)),
			TriggerArn:       pulumi.String(fmt.Sprintf("acs:fc:%v:%v:services/FCTestService/functions/printEvent/triggers/testtrigger", defaultRegions.Regions[0].Id, defaultAccount.Id)),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 defaultAccount = AlicloudFunctions.getAccount();

        final var defaultRegions = 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", defaultAccount.applyValue(getAccountResult -> getAccountResult.id())))
            .sourceArn(String.format("acs:cdn:*:%s:domain/example.com", defaultAccount.applyValue(getAccountResult -> getAccountResult.id())))
            .triggerArn(String.format("acs:fc:%s:%s:services/FCTestService/functions/printEvent/triggers/testtrigger", defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()),defaultAccount.applyValue(getAccountResult -> getAccountResult.id())))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_account = alicloud.get_account()
default_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_account.id}:role/aliyuncdneventnotificationrole",
    source_arn=f"acs:cdn:*:{default_account.id}:domain/example.com",
    trigger_arn=f"acs:fc:{default_regions.regions[0].id}:{default_account.id}:services/FCTestService/functions/printEvent/triggers/testtrigger")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultAccount = alicloud.getAccount({});
const defaultRegions = alicloud.getRegions({
    current: true,
});
const example = new alicloud.cdn.FcTrigger("example", {
    eventMetaName: "LogFileCreated",
    eventMetaVersion: "1.0.0",
    notes: "example_value",
    roleArn: defaultAccount.then(defaultAccount => `acs:ram::${defaultAccount.id}:role/aliyuncdneventnotificationrole`),
    sourceArn: defaultAccount.then(defaultAccount => `acs:cdn:*:${defaultAccount.id}:domain/example.com`),
    triggerArn: Promise.all([defaultRegions, defaultAccount]).then(([defaultRegions, defaultAccount]) => `acs:fc:${defaultRegions.regions?.[0]?.id}:${defaultAccount.id}:services/FCTestService/functions/printEvent/triggers/testtrigger`),
});
resources:
  example:
    type: alicloud:cdn:FcTrigger
    properties:
      eventMetaName: LogFileCreated
      eventMetaVersion: 1.0.0
      notes: example_value
      roleArn: acs:ram::${defaultAccount.id}:role/aliyuncdneventnotificationrole
      sourceArn: acs:cdn:*:${defaultAccount.id}:domain/example.com
      triggerArn: acs:fc:${defaultRegions.regions[0].id}:${defaultAccount.id}:services/FCTestService/functions/printEvent/triggers/testtrigger
variables:
  defaultAccount:
    fn::invoke:
      Function: alicloud:getAccount
      Arguments: {}
  defaultRegions:
    fn::invoke:
      Function: alicloud:getRegions
      Arguments:
        current: true

Create FcTrigger Resource

new FcTrigger(name: string, args: FcTriggerArgs, opts?: CustomResourceOptions);
@overload
def FcTrigger(resource_name: 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)
@overload
def FcTrigger(resource_name: str,
              args: FcTriggerArgs,
              opts: Optional[ResourceOptions] = 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.

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.

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

The FcTrigger resource accepts the following input properties:

EventMetaName string

The name of the Event.

EventMetaVersion string

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}.

EventMetaName string

The name of the Event.

EventMetaVersion string

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}.

eventMetaName String

The name of the Event.

eventMetaVersion String

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}.

eventMetaName string

The name of the Event.

eventMetaVersion string

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_name str

The name of the Event.

event_meta_version str

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}.

eventMetaName String

The name of the Event.

eventMetaVersion String

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) -> FcTrigger
func 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)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
EventMetaName string

The name of the Event.

EventMetaVersion string

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.

EventMetaName string

The name of the Event.

EventMetaVersion string

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.

eventMetaName String

The name of the Event.

eventMetaVersion String

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.

eventMetaName string

The name of the Event.

eventMetaVersion string

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_name str

The name of the Event.

event_meta_version str

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.

eventMetaName String

The name of the Event.

eventMetaVersion String

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>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.