ibm.CisEdgeFunctionsAction
Explore with Pulumi AI
Create, update, or delete an edge functions action for a domain to include in your CIS edge functions action resource. For more information, about CIS edge functions action, see working with Edge functions actions.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as ibm from "@pulumi/ibm";
// Add a Edge Functions Action to the domain
const testAction = new ibm.CisEdgeFunctionsAction("testAction", {
cisId: data.ibm_cis.cis.id,
domainId: data.ibm_cis_domain.cis_domain.domain_id,
actionName: "sample-script",
script: fs.readFileSync("./script.js", "utf8"),
});
import pulumi
import pulumi_ibm as ibm
# Add a Edge Functions Action to the domain
test_action = ibm.CisEdgeFunctionsAction("testAction",
cis_id=data["ibm_cis"]["cis"]["id"],
domain_id=data["ibm_cis_domain"]["cis_domain"]["domain_id"],
action_name="sample-script",
script=(lambda path: open(path).read())("./script.js"))
package main
import (
"os"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a Edge Functions Action to the domain
_, err := ibm.NewCisEdgeFunctionsAction(ctx, "testAction", &ibm.CisEdgeFunctionsActionArgs{
CisId: pulumi.Any(data.Ibm_cis.Cis.Id),
DomainId: pulumi.Any(data.Ibm_cis_domain.Cis_domain.Domain_id),
ActionName: pulumi.String("sample-script"),
Script: pulumi.String(readFileOrPanic("./script.js")),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
// Add a Edge Functions Action to the domain
var testAction = new Ibm.CisEdgeFunctionsAction("testAction", new()
{
CisId = data.Ibm_cis.Cis.Id,
DomainId = data.Ibm_cis_domain.Cis_domain.Domain_id,
ActionName = "sample-script",
Script = File.ReadAllText("./script.js"),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.CisEdgeFunctionsAction;
import com.pulumi.ibm.CisEdgeFunctionsActionArgs;
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) {
// Add a Edge Functions Action to the domain
var testAction = new CisEdgeFunctionsAction("testAction", CisEdgeFunctionsActionArgs.builder()
.cisId(data.ibm_cis().cis().id())
.domainId(data.ibm_cis_domain().cis_domain().domain_id())
.actionName("sample-script")
.script(Files.readString(Paths.get("./script.js")))
.build());
}
}
resources:
# Add a Edge Functions Action to the domain
testAction:
type: ibm:CisEdgeFunctionsAction
properties:
cisId: ${data.ibm_cis.cis.id}
domainId: ${data.ibm_cis_domain.cis_domain.domain_id}
actionName: sample-script
script:
fn::readFile: ./script.js
Create CisEdgeFunctionsAction Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CisEdgeFunctionsAction(name: string, args: CisEdgeFunctionsActionArgs, opts?: CustomResourceOptions);
@overload
def CisEdgeFunctionsAction(resource_name: str,
args: CisEdgeFunctionsActionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CisEdgeFunctionsAction(resource_name: str,
opts: Optional[ResourceOptions] = None,
action_name: Optional[str] = None,
cis_id: Optional[str] = None,
domain_id: Optional[str] = None,
script: Optional[str] = None,
cis_edge_functions_action_id: Optional[str] = None)
func NewCisEdgeFunctionsAction(ctx *Context, name string, args CisEdgeFunctionsActionArgs, opts ...ResourceOption) (*CisEdgeFunctionsAction, error)
public CisEdgeFunctionsAction(string name, CisEdgeFunctionsActionArgs args, CustomResourceOptions? opts = null)
public CisEdgeFunctionsAction(String name, CisEdgeFunctionsActionArgs args)
public CisEdgeFunctionsAction(String name, CisEdgeFunctionsActionArgs args, CustomResourceOptions options)
type: ibm:CisEdgeFunctionsAction
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 CisEdgeFunctionsActionArgs
- 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 CisEdgeFunctionsActionArgs
- 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 CisEdgeFunctionsActionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CisEdgeFunctionsActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CisEdgeFunctionsActionArgs
- 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 cisEdgeFunctionsActionResource = new Ibm.CisEdgeFunctionsAction("cisEdgeFunctionsActionResource", new()
{
ActionName = "string",
CisId = "string",
DomainId = "string",
Script = "string",
CisEdgeFunctionsActionId = "string",
});
example, err := ibm.NewCisEdgeFunctionsAction(ctx, "cisEdgeFunctionsActionResource", &ibm.CisEdgeFunctionsActionArgs{
ActionName: pulumi.String("string"),
CisId: pulumi.String("string"),
DomainId: pulumi.String("string"),
Script: pulumi.String("string"),
CisEdgeFunctionsActionId: pulumi.String("string"),
})
var cisEdgeFunctionsActionResource = new CisEdgeFunctionsAction("cisEdgeFunctionsActionResource", CisEdgeFunctionsActionArgs.builder()
.actionName("string")
.cisId("string")
.domainId("string")
.script("string")
.cisEdgeFunctionsActionId("string")
.build());
cis_edge_functions_action_resource = ibm.CisEdgeFunctionsAction("cisEdgeFunctionsActionResource",
action_name="string",
cis_id="string",
domain_id="string",
script="string",
cis_edge_functions_action_id="string")
const cisEdgeFunctionsActionResource = new ibm.CisEdgeFunctionsAction("cisEdgeFunctionsActionResource", {
actionName: "string",
cisId: "string",
domainId: "string",
script: "string",
cisEdgeFunctionsActionId: "string",
});
type: ibm:CisEdgeFunctionsAction
properties:
actionName: string
cisEdgeFunctionsActionId: string
cisId: string
domainId: string
script: string
CisEdgeFunctionsAction 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 CisEdgeFunctionsAction resource accepts the following input properties:
- Action
Name string - The action name of an edge functions action.
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain to add the edge functions action.
- Script string
- The script of an edge functions action.
- Cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
- Action
Name string - The action name of an edge functions action.
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain to add the edge functions action.
- Script string
- The script of an edge functions action.
- Cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
- action
Name String - The action name of an edge functions action.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain to add the edge functions action.
- script String
- The script of an edge functions action.
- cis
Edge StringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
- action
Name string - The action name of an edge functions action.
- cis
Id string - The ID of the IBM Cloud Internet Services instance.
- domain
Id string - The ID of the domain to add the edge functions action.
- script string
- The script of an edge functions action.
- cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
- action_
name str - The action name of an edge functions action.
- cis_
id str - The ID of the IBM Cloud Internet Services instance.
- domain_
id str - The ID of the domain to add the edge functions action.
- script str
- The script of an edge functions action.
- cis_
edge_ strfunctions_ action_ id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
- action
Name String - The action name of an edge functions action.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain to add the edge functions action.
- script String
- The script of an edge functions action.
- cis
Edge StringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
).
Outputs
All input properties are implicitly available as output properties. Additionally, the CisEdgeFunctionsAction 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 CisEdgeFunctionsAction Resource
Get an existing CisEdgeFunctionsAction 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?: CisEdgeFunctionsActionState, opts?: CustomResourceOptions): CisEdgeFunctionsAction
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action_name: Optional[str] = None,
cis_edge_functions_action_id: Optional[str] = None,
cis_id: Optional[str] = None,
domain_id: Optional[str] = None,
script: Optional[str] = None) -> CisEdgeFunctionsAction
func GetCisEdgeFunctionsAction(ctx *Context, name string, id IDInput, state *CisEdgeFunctionsActionState, opts ...ResourceOption) (*CisEdgeFunctionsAction, error)
public static CisEdgeFunctionsAction Get(string name, Input<string> id, CisEdgeFunctionsActionState? state, CustomResourceOptions? opts = null)
public static CisEdgeFunctionsAction get(String name, Output<String> id, CisEdgeFunctionsActionState state, CustomResourceOptions options)
resources: _: type: ibm:CisEdgeFunctionsAction 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.
- Action
Name string - The action name of an edge functions action.
- Cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain to add the edge functions action.
- Script string
- The script of an edge functions action.
- Action
Name string - The action name of an edge functions action.
- Cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain to add the edge functions action.
- Script string
- The script of an edge functions action.
- action
Name String - The action name of an edge functions action.
- cis
Edge StringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain to add the edge functions action.
- script String
- The script of an edge functions action.
- action
Name string - The action name of an edge functions action.
- cis
Edge stringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - cis
Id string - The ID of the IBM Cloud Internet Services instance.
- domain
Id string - The ID of the domain to add the edge functions action.
- script string
- The script of an edge functions action.
- action_
name str - The action name of an edge functions action.
- cis_
edge_ strfunctions_ action_ id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - cis_
id str - The ID of the IBM Cloud Internet Services instance.
- domain_
id str - The ID of the domain to add the edge functions action.
- script str
- The script of an edge functions action.
- action
Name String - The action name of an edge functions action.
- cis
Edge StringFunctions Action Id - (String) The action ID with a combination of
<action_name>
,<domain_id>
,<cis_id>
attributes concatenate with colon (:
). - cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain to add the edge functions action.
- script String
- The script of an edge functions action.
Import
The ibm_cis_edge_functions_action
resource can be imported by using the ID. The ID is composed from an edge functions action name or script name, the domain ID of the domain and the CRN (Cloud Resource Name) is concatenated with colon (:
).
The domain ID and CRN are located on the overview page of the Internet Services instance in the domain heading of the console, or by using the IBM Cloud CIS command line commands.
Domain ID is a 32 digit character string of the form:
9caf68812ae9b3f0377fdf986751a78f
.CRN is a 120 digit character string of the form:
crn:v1:bluemix:public:internet-svcs:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3::
.Edge functions action name or script name is a string:
sample_script
.
Syntax
$ pulumi import ibm:index/cisEdgeFunctionsAction:CisEdgeFunctionsAction test_action <action_name>:<domain-id>:<crn>
Example
$ pulumi import ibm:index/cisEdgeFunctionsAction:CisEdgeFunctionsAction test_action sample_script:9caf68812ae9b3f0377fdf986751a78f:crn:v1:bluemix:public:internet-svcs:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3::
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.