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
using System.Collections.Generic;
using System.Linq;
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:
- Event
Meta stringName The name of the Event.
- Event
Meta stringVersion The version of the Event.
- Notes string
The Note information.
- Role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- Source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- Trigger
Arn 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.- Function
Arn string The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.
- Event
Meta stringName The name of the Event.
- Event
Meta stringVersion The version of the Event.
- Notes string
The Note information.
- Role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- Source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- Trigger
Arn 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.- Function
Arn string The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.
- event
Meta StringName The name of the Event.
- event
Meta StringVersion The version of the Event.
- notes String
The Note information.
- role
Arn String The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn String Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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.- function
Arn String The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.
- event
Meta stringName The name of the Event.
- event
Meta stringVersion The version of the Event.
- notes string
The Note information.
- role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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.- function
Arn 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}
.
- event
Meta StringName The name of the Event.
- event
Meta StringVersion The version of the Event.
- notes String
The Note information.
- role
Arn String The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn String Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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.- function
Arn 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.
- Event
Meta stringName The name of the Event.
- Event
Meta stringVersion The version of the Event.
- Function
Arn string The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.- Notes string
The Note information.
- Role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- Source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- Trigger
Arn 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 stringName The name of the Event.
- Event
Meta stringVersion The version of the Event.
- Function
Arn string The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.- Notes string
The Note information.
- Role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- Source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- Trigger
Arn 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 StringName The name of the Event.
- event
Meta StringVersion The version of the Event.
- function
Arn String The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.- notes String
The Note information.
- role
Arn String The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn String Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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 stringName The name of the Event.
- event
Meta stringVersion The version of the Event.
- function
Arn string The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.- notes string
The Note information.
- role
Arn string The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn string Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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.
- event
Meta StringName The name of the Event.
- event
Meta StringVersion The version of the Event.
- function
Arn String The function arn. The value formats as
acs:fc:{RegionID}:{AccountID}:{Filter}
.- notes String
The Note information.
- role
Arn String The role authorized by RAM. The value formats as
acs:ram::{AccountID}:role/{RoleName}
.- source
Arn String Resources and filters for event listening. The value formats as
acs:cdn:{RegionID}:{AccountID}:{Filter}
.- trigger
Arn 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.