akamai.AppSecMatchTarget
Scopes: Security configuration
Creates a match target associated with a security configuration. Match targets determine which security policy should apply to an API, hostname or path.
Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/match-targets
Output Options
In addition to the arguments above, the following attribute is exported:
match_target_id
. ID of the match target.
Example Usage
Basic usage
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var configuration = Akamai.GetAppSecConfiguration.Invoke(new()
{
Name = "Documentation",
});
var matchTarget = new Akamai.AppSecMatchTarget("matchTarget", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
MatchTarget = File.ReadAllText($"{path.Module}/match_targets.json"),
});
});
package main
import (
"fmt"
"io/ioutil"
"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := ioutil.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
configuration, err := akamai.LookupAppSecConfiguration(ctx, &akamai.LookupAppSecConfigurationArgs{
Name: pulumi.StringRef("Documentation"),
}, nil)
if err != nil {
return err
}
_, err = akamai.NewAppSecMatchTarget(ctx, "matchTarget", &akamai.AppSecMatchTargetArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
MatchTarget: readFileOrPanic(fmt.Sprintf("%v/match_targets.json", path.Module)),
})
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.akamai.AkamaiFunctions;
import com.pulumi.akamai.inputs.GetAppSecConfigurationArgs;
import com.pulumi.akamai.AppSecMatchTarget;
import com.pulumi.akamai.AppSecMatchTargetArgs;
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 configuration = AkamaiFunctions.getAppSecConfiguration(GetAppSecConfigurationArgs.builder()
.name("Documentation")
.build());
var matchTarget = new AppSecMatchTarget("matchTarget", AppSecMatchTargetArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.matchTarget(Files.readString(Paths.get(String.format("%s/match_targets.json", path.module()))))
.build());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
match_target = akamai.AppSecMatchTarget("matchTarget",
config_id=configuration.config_id,
match_target=(lambda path: open(path).read())(f"{path['module']}/match_targets.json"))
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * as fs from "fs";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const matchTarget = new akamai.AppSecMatchTarget("matchTarget", {
configId: configuration.then(configuration => configuration.configId),
matchTarget: fs.readFileSync(`${path.module}/match_targets.json`),
});
resources:
matchTarget:
type: akamai:AppSecMatchTarget
properties:
configId: ${configuration.configId}
matchTarget:
fn::readFile: ${path.module}/match_targets.json
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
Create AppSecMatchTarget Resource
new AppSecMatchTarget(name: string, args: AppSecMatchTargetArgs, opts?: CustomResourceOptions);
@overload
def AppSecMatchTarget(resource_name: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
match_target: Optional[str] = None)
@overload
def AppSecMatchTarget(resource_name: str,
args: AppSecMatchTargetArgs,
opts: Optional[ResourceOptions] = None)
func NewAppSecMatchTarget(ctx *Context, name string, args AppSecMatchTargetArgs, opts ...ResourceOption) (*AppSecMatchTarget, error)
public AppSecMatchTarget(string name, AppSecMatchTargetArgs args, CustomResourceOptions? opts = null)
public AppSecMatchTarget(String name, AppSecMatchTargetArgs args)
public AppSecMatchTarget(String name, AppSecMatchTargetArgs args, CustomResourceOptions options)
type: akamai:AppSecMatchTarget
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecMatchTargetArgs
- 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 AppSecMatchTargetArgs
- 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 AppSecMatchTargetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecMatchTargetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppSecMatchTargetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppSecMatchTarget 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 AppSecMatchTarget resource accepts the following input properties:
- Config
Id int . Unique identifier of the security configuration associated with the match target being modified.
- Match
Target string . Path to a JSON file containing one or more match target definitions.
- Config
Id int . Unique identifier of the security configuration associated with the match target being modified.
- Match
Target string . Path to a JSON file containing one or more match target definitions.
- config
Id Integer . Unique identifier of the security configuration associated with the match target being modified.
- match
Target String . Path to a JSON file containing one or more match target definitions.
- config
Id number . Unique identifier of the security configuration associated with the match target being modified.
- match
Target string . Path to a JSON file containing one or more match target definitions.
- config_
id int . Unique identifier of the security configuration associated with the match target being modified.
- match_
target str . Path to a JSON file containing one or more match target definitions.
- config
Id Number . Unique identifier of the security configuration associated with the match target being modified.
- match
Target String . Path to a JSON file containing one or more match target definitions.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppSecMatchTarget resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Match
Target intId Unique identifier of the match target
- Id string
The provider-assigned unique ID for this managed resource.
- Match
Target intId Unique identifier of the match target
- id String
The provider-assigned unique ID for this managed resource.
- match
Target IntegerId Unique identifier of the match target
- id string
The provider-assigned unique ID for this managed resource.
- match
Target numberId Unique identifier of the match target
- id str
The provider-assigned unique ID for this managed resource.
- match_
target_ intid Unique identifier of the match target
- id String
The provider-assigned unique ID for this managed resource.
- match
Target NumberId Unique identifier of the match target
Look up Existing AppSecMatchTarget Resource
Get an existing AppSecMatchTarget 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?: AppSecMatchTargetState, opts?: CustomResourceOptions): AppSecMatchTarget
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
match_target: Optional[str] = None,
match_target_id: Optional[int] = None) -> AppSecMatchTarget
func GetAppSecMatchTarget(ctx *Context, name string, id IDInput, state *AppSecMatchTargetState, opts ...ResourceOption) (*AppSecMatchTarget, error)
public static AppSecMatchTarget Get(string name, Input<string> id, AppSecMatchTargetState? state, CustomResourceOptions? opts = null)
public static AppSecMatchTarget get(String name, Output<String> id, AppSecMatchTargetState 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.
- Config
Id int . Unique identifier of the security configuration associated with the match target being modified.
- Match
Target string . Path to a JSON file containing one or more match target definitions.
- Match
Target intId Unique identifier of the match target
- Config
Id int . Unique identifier of the security configuration associated with the match target being modified.
- Match
Target string . Path to a JSON file containing one or more match target definitions.
- Match
Target intId Unique identifier of the match target
- config
Id Integer . Unique identifier of the security configuration associated with the match target being modified.
- match
Target String . Path to a JSON file containing one or more match target definitions.
- match
Target IntegerId Unique identifier of the match target
- config
Id number . Unique identifier of the security configuration associated with the match target being modified.
- match
Target string . Path to a JSON file containing one or more match target definitions.
- match
Target numberId Unique identifier of the match target
- config_
id int . Unique identifier of the security configuration associated with the match target being modified.
- match_
target str . Path to a JSON file containing one or more match target definitions.
- match_
target_ intid Unique identifier of the match target
- config
Id Number . Unique identifier of the security configuration associated with the match target being modified.
- match
Target String . Path to a JSON file containing one or more match target definitions.
- match
Target NumberId Unique identifier of the match target
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.