Akamai

Pulumi Official
Package maintained by Pulumi
v3.0.0 published on Monday, Jul 25, 2022 by Pulumi

getAppSecApiRequestConstraints

Scopes: Security policy; API endpoint

Returns information about API endpoint constraints and actions. The returned information is described in the API Constraints members section of the Application Security API.

Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/api-request-constraints

Output Options

The following options can be used to determine the information returned, and how that returned information is formatted:

  • json. JSON-formatted list of information about the APIs, their constraints, and their actions.
  • output_text. Tabular report of the APIs, their constraints, and their actions.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var configuration = Output.Create(Akamai.GetAppSecConfiguration.InvokeAsync(new Akamai.GetAppSecConfigurationArgs
        {
            Name = "Documentation",
        }));
        var apisRequestConstraints = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecApiRequestConstraints.InvokeAsync(new Akamai.GetAppSecApiRequestConstraintsArgs
        {
            ConfigId = configuration.ConfigId,
            SecurityPolicyId = "gms1_134637",
        })));
        this.ApisConstraintsText = apisRequestConstraints.Apply(apisRequestConstraints => apisRequestConstraints.OutputText);
        this.ApisConstraintsJson = apisRequestConstraints.Apply(apisRequestConstraints => apisRequestConstraints.Json);
        var apiRequestConstraints = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecApiRequestConstraints.InvokeAsync(new Akamai.GetAppSecApiRequestConstraintsArgs
        {
            ConfigId = configuration.ConfigId,
            SecurityPolicyId = "gms1_134637",
            ApiId = 624913,
        })));
        this.ApiConstraintsText = apiRequestConstraints.Apply(apiRequestConstraints => apiRequestConstraints.OutputText);
        this.ApiConstraintsJson = apiRequestConstraints.Apply(apiRequestConstraints => apiRequestConstraints.Json);
    }

    [Output("apisConstraintsText")]
    public Output<string> ApisConstraintsText { get; set; }
    [Output("apisConstraintsJson")]
    public Output<string> ApisConstraintsJson { get; set; }
    [Output("apiConstraintsText")]
    public Output<string> ApiConstraintsText { get; set; }
    [Output("apiConstraintsJson")]
    public Output<string> ApiConstraintsJson { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-akamai/sdk/v3/go/akamai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		configuration, err := akamai.LookupAppSecConfiguration(ctx, &GetAppSecConfigurationArgs{
			Name: pulumi.StringRef("Documentation"),
		}, nil)
		if err != nil {
			return err
		}
		apisRequestConstraints, err := akamai.LookupAppSecApiRequestConstraints(ctx, &GetAppSecApiRequestConstraintsArgs{
			ConfigId:         configuration.ConfigId,
			SecurityPolicyId: "gms1_134637",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("apisConstraintsText", apisRequestConstraints.OutputText)
		ctx.Export("apisConstraintsJson", apisRequestConstraints.Json)
		apiRequestConstraints, err := akamai.LookupAppSecApiRequestConstraints(ctx, &GetAppSecApiRequestConstraintsArgs{
			ConfigId:         configuration.ConfigId,
			SecurityPolicyId: "gms1_134637",
			ApiId:            pulumi.IntRef(624913),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("apiConstraintsText", apiRequestConstraints.OutputText)
		ctx.Export("apiConstraintsJson", apiRequestConstraints.Json)
		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.GetAppSecApiRequestConstraintsArgs;
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 apisRequestConstraints = AkamaiFunctions.getAppSecApiRequestConstraints(GetAppSecApiRequestConstraintsArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .securityPolicyId("gms1_134637")
            .build());

        ctx.export("apisConstraintsText", apisRequestConstraints.applyValue(getAppSecApiRequestConstraintsResult -> getAppSecApiRequestConstraintsResult.outputText()));
        ctx.export("apisConstraintsJson", apisRequestConstraints.applyValue(getAppSecApiRequestConstraintsResult -> getAppSecApiRequestConstraintsResult.json()));
        final var apiRequestConstraints = AkamaiFunctions.getAppSecApiRequestConstraints(GetAppSecApiRequestConstraintsArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .securityPolicyId("gms1_134637")
            .apiId(624913)
            .build());

        ctx.export("apiConstraintsText", apiRequestConstraints.applyValue(getAppSecApiRequestConstraintsResult -> getAppSecApiRequestConstraintsResult.outputText()));
        ctx.export("apiConstraintsJson", apiRequestConstraints.applyValue(getAppSecApiRequestConstraintsResult -> getAppSecApiRequestConstraintsResult.json()));
    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
apis_request_constraints = akamai.get_app_sec_api_request_constraints(config_id=configuration.config_id,
    security_policy_id="gms1_134637")
pulumi.export("apisConstraintsText", apis_request_constraints.output_text)
pulumi.export("apisConstraintsJson", apis_request_constraints.json)
api_request_constraints = akamai.get_app_sec_api_request_constraints(config_id=configuration.config_id,
    security_policy_id="gms1_134637",
    api_id=624913)
pulumi.export("apiConstraintsText", api_request_constraints.output_text)
pulumi.export("apiConstraintsJson", api_request_constraints.json)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const apisRequestConstraints = configuration.then(configuration => akamai.getAppSecApiRequestConstraints({
    configId: configuration.configId,
    securityPolicyId: "gms1_134637",
}));
export const apisConstraintsText = apisRequestConstraints.then(apisRequestConstraints => apisRequestConstraints.outputText);
export const apisConstraintsJson = apisRequestConstraints.then(apisRequestConstraints => apisRequestConstraints.json);
const apiRequestConstraints = configuration.then(configuration => akamai.getAppSecApiRequestConstraints({
    configId: configuration.configId,
    securityPolicyId: "gms1_134637",
    apiId: 624913,
}));
export const apiConstraintsText = apiRequestConstraints.then(apiRequestConstraints => apiRequestConstraints.outputText);
export const apiConstraintsJson = apiRequestConstraints.then(apiRequestConstraints => apiRequestConstraints.json);
variables:
  configuration:
    Fn::Invoke:
      Function: akamai:getAppSecConfiguration
      Arguments:
        name: Documentation
  apisRequestConstraints:
    Fn::Invoke:
      Function: akamai:getAppSecApiRequestConstraints
      Arguments:
        configId: ${configuration.configId}
        securityPolicyId: gms1_134637
  apiRequestConstraints:
    Fn::Invoke:
      Function: akamai:getAppSecApiRequestConstraints
      Arguments:
        configId: ${configuration.configId}
        securityPolicyId: gms1_134637
        apiId: 624913
outputs:
  apisConstraintsText: ${apisRequestConstraints.outputText}
  apisConstraintsJson: ${apisRequestConstraints.json} # USE CASE: User wants to view the action associated with an API request constraint.
  apiConstraintsText: ${apiRequestConstraints.outputText}
  apiConstraintsJson: ${apiRequestConstraints.json}

Using getAppSecApiRequestConstraints

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAppSecApiRequestConstraints(args: GetAppSecApiRequestConstraintsArgs, opts?: InvokeOptions): Promise<GetAppSecApiRequestConstraintsResult>
function getAppSecApiRequestConstraintsOutput(args: GetAppSecApiRequestConstraintsOutputArgs, opts?: InvokeOptions): Output<GetAppSecApiRequestConstraintsResult>
def get_app_sec_api_request_constraints(api_id: Optional[int] = None,
                                        config_id: Optional[int] = None,
                                        security_policy_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetAppSecApiRequestConstraintsResult
def get_app_sec_api_request_constraints_output(api_id: Optional[pulumi.Input[int]] = None,
                                        config_id: Optional[pulumi.Input[int]] = None,
                                        security_policy_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetAppSecApiRequestConstraintsResult]
func LookupAppSecApiRequestConstraints(ctx *Context, args *LookupAppSecApiRequestConstraintsArgs, opts ...InvokeOption) (*LookupAppSecApiRequestConstraintsResult, error)
func LookupAppSecApiRequestConstraintsOutput(ctx *Context, args *LookupAppSecApiRequestConstraintsOutputArgs, opts ...InvokeOption) LookupAppSecApiRequestConstraintsResultOutput

> Note: This function is named LookupAppSecApiRequestConstraints in the Go SDK.

public static class GetAppSecApiRequestConstraints 
{
    public static Task<GetAppSecApiRequestConstraintsResult> InvokeAsync(GetAppSecApiRequestConstraintsArgs args, InvokeOptions? opts = null)
    public static Output<GetAppSecApiRequestConstraintsResult> Invoke(GetAppSecApiRequestConstraintsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAppSecApiRequestConstraintsResult> getAppSecApiRequestConstraints(GetAppSecApiRequestConstraintsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: akamai:index/getAppSecApiRequestConstraints:getAppSecApiRequestConstraints
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ConfigId int

. Unique identifier of the security configuration associated with the API constraints.

SecurityPolicyId string

. Unique identifier of the security policy associated with the API constraints.

ApiId int

. Unique identifier of the API endpoint you want to return constraint information for.

ConfigId int

. Unique identifier of the security configuration associated with the API constraints.

SecurityPolicyId string

. Unique identifier of the security policy associated with the API constraints.

ApiId int

. Unique identifier of the API endpoint you want to return constraint information for.

configId Integer

. Unique identifier of the security configuration associated with the API constraints.

securityPolicyId String

. Unique identifier of the security policy associated with the API constraints.

apiId Integer

. Unique identifier of the API endpoint you want to return constraint information for.

configId number

. Unique identifier of the security configuration associated with the API constraints.

securityPolicyId string

. Unique identifier of the security policy associated with the API constraints.

apiId number

. Unique identifier of the API endpoint you want to return constraint information for.

config_id int

. Unique identifier of the security configuration associated with the API constraints.

security_policy_id str

. Unique identifier of the security policy associated with the API constraints.

api_id int

. Unique identifier of the API endpoint you want to return constraint information for.

configId Number

. Unique identifier of the security configuration associated with the API constraints.

securityPolicyId String

. Unique identifier of the security policy associated with the API constraints.

apiId Number

. Unique identifier of the API endpoint you want to return constraint information for.

getAppSecApiRequestConstraints Result

The following output properties are available:

ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
SecurityPolicyId string
ApiId int
ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
SecurityPolicyId string
ApiId int
configId Integer
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
securityPolicyId String
apiId Integer
configId number
id string

The provider-assigned unique ID for this managed resource.

json string
outputText string
securityPolicyId string
apiId number
config_id int
id str

The provider-assigned unique ID for this managed resource.

json str
output_text str
security_policy_id str
api_id int
configId Number
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
securityPolicyId String
apiId Number

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.