akamai.AppSecApiRequestConstraints
Example Usage
Basic usage
using System.Collections.Generic;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var configuration = Akamai.GetAppSecConfiguration.Invoke(new()
{
Name = "Documentation",
});
var apiEndpoint = Akamai.GetAppSecApiEndpoints.Invoke(new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
SecurityPolicyId = "gms1_134637",
ApiName = "Contracts",
});
var apiRequestConstraints = new Akamai.AppSecApiRequestConstraints("apiRequestConstraints", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
SecurityPolicyId = "gms1_134637",
ApiEndpointId = apiEndpoint.Apply(getAppSecApiEndpointsResult => getAppSecApiEndpointsResult.Id),
Action = "alert",
});
});
package main
import (
"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
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
}
apiEndpoint, err := akamai.GetAppSecApiEndpoints(ctx, &akamai.GetAppSecApiEndpointsArgs{
ConfigId: configuration.ConfigId,
SecurityPolicyId: pulumi.StringRef("gms1_134637"),
ApiName: pulumi.StringRef("Contracts"),
}, nil)
if err != nil {
return err
}
_, err = akamai.NewAppSecApiRequestConstraints(ctx, "apiRequestConstraints", &akamai.AppSecApiRequestConstraintsArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
SecurityPolicyId: pulumi.String("gms1_134637"),
ApiEndpointId: *pulumi.String(apiEndpoint.Id),
Action: pulumi.String("alert"),
})
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.inputs.GetAppSecApiEndpointsArgs;
import com.pulumi.akamai.AppSecApiRequestConstraints;
import com.pulumi.akamai.AppSecApiRequestConstraintsArgs;
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());
final var apiEndpoint = AkamaiFunctions.getAppSecApiEndpoints(GetAppSecApiEndpointsArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.securityPolicyId("gms1_134637")
.apiName("Contracts")
.build());
var apiRequestConstraints = new AppSecApiRequestConstraints("apiRequestConstraints", AppSecApiRequestConstraintsArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.securityPolicyId("gms1_134637")
.apiEndpointId(apiEndpoint.applyValue(getAppSecApiEndpointsResult -> getAppSecApiEndpointsResult.id()))
.action("alert")
.build());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
api_endpoint = akamai.get_app_sec_api_endpoints(config_id=configuration.config_id,
security_policy_id="gms1_134637",
api_name="Contracts")
api_request_constraints = akamai.AppSecApiRequestConstraints("apiRequestConstraints",
config_id=configuration.config_id,
security_policy_id="gms1_134637",
api_endpoint_id=api_endpoint.id,
action="alert")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const apiEndpoint = configuration.then(configuration => akamai.getAppSecApiEndpoints({
configId: configuration.configId,
securityPolicyId: "gms1_134637",
apiName: "Contracts",
}));
const apiRequestConstraints = new akamai.AppSecApiRequestConstraints("apiRequestConstraints", {
configId: configuration.then(configuration => configuration.configId),
securityPolicyId: "gms1_134637",
apiEndpointId: apiEndpoint.then(apiEndpoint => apiEndpoint.id),
action: "alert",
});
resources:
apiRequestConstraints:
type: akamai:AppSecApiRequestConstraints
properties:
configId: ${configuration.configId}
securityPolicyId: gms1_134637
apiEndpointId: ${apiEndpoint.id}
action: alert
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
apiEndpoint:
fn::invoke:
Function: akamai:getAppSecApiEndpoints
Arguments:
configId: ${configuration.configId}
securityPolicyId: gms1_134637
apiName: Contracts
Create AppSecApiRequestConstraints Resource
new AppSecApiRequestConstraints(name: string, args: AppSecApiRequestConstraintsArgs, opts?: CustomResourceOptions);
@overload
def AppSecApiRequestConstraints(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
api_endpoint_id: Optional[int] = None,
config_id: Optional[int] = None,
security_policy_id: Optional[str] = None)
@overload
def AppSecApiRequestConstraints(resource_name: str,
args: AppSecApiRequestConstraintsArgs,
opts: Optional[ResourceOptions] = None)
func NewAppSecApiRequestConstraints(ctx *Context, name string, args AppSecApiRequestConstraintsArgs, opts ...ResourceOption) (*AppSecApiRequestConstraints, error)
public AppSecApiRequestConstraints(string name, AppSecApiRequestConstraintsArgs args, CustomResourceOptions? opts = null)
public AppSecApiRequestConstraints(String name, AppSecApiRequestConstraintsArgs args)
public AppSecApiRequestConstraints(String name, AppSecApiRequestConstraintsArgs args, CustomResourceOptions options)
type: akamai:AppSecApiRequestConstraints
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecApiRequestConstraintsArgs
- 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 AppSecApiRequestConstraintsArgs
- 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 AppSecApiRequestConstraintsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecApiRequestConstraintsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppSecApiRequestConstraintsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppSecApiRequestConstraints 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 AppSecApiRequestConstraints resource accepts the following input properties:
- Action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- Config
Id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- Api
Endpoint intId . ID of the API endpoint the constraint will be assigned to.
- Action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- Config
Id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- Api
Endpoint intId . ID of the API endpoint the constraint will be assigned to.
- action String
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- config
Id Integer . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- api
Endpoint IntegerId . ID of the API endpoint the constraint will be assigned to.
- action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- config
Id number . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- api
Endpoint numberId . ID of the API endpoint the constraint will be assigned to.
- action str
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- config_
id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the API request constraint settings being modified.
- api_
endpoint_ intid . ID of the API endpoint the constraint will be assigned to.
- action String
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- config
Id Number . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- api
Endpoint NumberId . ID of the API endpoint the constraint will be assigned to.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppSecApiRequestConstraints 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 AppSecApiRequestConstraints Resource
Get an existing AppSecApiRequestConstraints 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?: AppSecApiRequestConstraintsState, opts?: CustomResourceOptions): AppSecApiRequestConstraints
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
api_endpoint_id: Optional[int] = None,
config_id: Optional[int] = None,
security_policy_id: Optional[str] = None) -> AppSecApiRequestConstraints
func GetAppSecApiRequestConstraints(ctx *Context, name string, id IDInput, state *AppSecApiRequestConstraintsState, opts ...ResourceOption) (*AppSecApiRequestConstraints, error)
public static AppSecApiRequestConstraints Get(string name, Input<string> id, AppSecApiRequestConstraintsState? state, CustomResourceOptions? opts = null)
public static AppSecApiRequestConstraints get(String name, Output<String> id, AppSecApiRequestConstraintsState 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.
- Action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- Api
Endpoint intId . ID of the API endpoint the constraint will be assigned to.
- Config
Id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- Action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- Api
Endpoint intId . ID of the API endpoint the constraint will be assigned to.
- Config
Id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- Security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- action String
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- api
Endpoint IntegerId . ID of the API endpoint the constraint will be assigned to.
- config
Id Integer . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- action string
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- api
Endpoint numberId . ID of the API endpoint the constraint will be assigned to.
- config
Id number . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy stringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
- action str
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- api_
endpoint_ intid . ID of the API endpoint the constraint will be assigned to.
- config_
id int . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security_
policy_ strid . Unique identifier of the security policy associated with the API request constraint settings being modified.
- action String
. Action to assign to the API request constraint. Allowed values are:
- alert, Record the event.
- deny. Block the request.
- **deny_custom_{custom_deny_id}**. Take the action specified by the custom deny.
- none. Take no action.
- api
Endpoint NumberId . ID of the API endpoint the constraint will be assigned to.
- config
Id Number . Unique identifier of the security configuration associated with the API request constraint settings being modified.
- security
Policy StringId . Unique identifier of the security policy associated with the API request constraint settings being modified.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.