Akamai

v3.1.1 published on Tuesday, Nov 1, 2022 by Pulumi

getAppSecMalwarePolicies

Scopes: Security configuration; malware protection

Returns information about your malware policies. Malware polices help you control what happens when a request is made to upload files of various types. These policies help you control how your website is protected from malicious uploads.

Output Options

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

  • output_text. Tabular report showing the ID and name of the malware policies.
  • json. JSON-formatted list of the malware policy information.

Example Usage

Basic 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 malwarePolicies = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecMalwarePolicies.InvokeAsync(new Akamai.GetAppSecMalwarePoliciesArgs
        {
            ConfigId = configuration.ConfigId,
        })));
        this.MalwarePoliciesOutput = malwarePolicies.Apply(malwarePolicies => malwarePolicies.OutputText);
        this.MalwarePoliciesJson = malwarePolicies.Apply(malwarePolicies => malwarePolicies.Json);
        var malwarePolicy = configuration.Apply(configuration => Output.Create(Akamai.GetAppSecMalwarePolicies.InvokeAsync(new Akamai.GetAppSecMalwarePoliciesArgs
        {
            ConfigId = configuration.ConfigId,
            MalwarePolicyId = 122149,
        })));
        this.MalwarePolicyJson = malwarePolicy.Apply(malwarePolicy => malwarePolicy.Json);
        this.MalwarePolicyOutput = malwarePolicy.Apply(malwarePolicy => malwarePolicy.OutputText);
    }

    [Output("malwarePoliciesOutput")]
    public Output<string> MalwarePoliciesOutput { get; set; }
    [Output("malwarePoliciesJson")]
    public Output<string> MalwarePoliciesJson { get; set; }
    [Output("malwarePolicyJson")]
    public Output<string> MalwarePolicyJson { get; set; }
    [Output("malwarePolicyOutput")]
    public Output<string> MalwarePolicyOutput { 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
		}
		malwarePolicies, err := akamai.GetAppSecMalwarePolicies(ctx, &GetAppSecMalwarePoliciesArgs{
			ConfigId: configuration.ConfigId,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("malwarePoliciesOutput", malwarePolicies.OutputText)
		ctx.Export("malwarePoliciesJson", malwarePolicies.Json)
		malwarePolicy, err := akamai.GetAppSecMalwarePolicies(ctx, &GetAppSecMalwarePoliciesArgs{
			ConfigId:        configuration.ConfigId,
			MalwarePolicyId: pulumi.IntRef(122149),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("malwarePolicyJson", malwarePolicy.Json)
		ctx.Export("malwarePolicyOutput", malwarePolicy.OutputText)
		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.GetAppSecMalwarePoliciesArgs;
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 malwarePolicies = AkamaiFunctions.getAppSecMalwarePolicies(GetAppSecMalwarePoliciesArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .build());

        ctx.export("malwarePoliciesOutput", malwarePolicies.applyValue(getAppSecMalwarePoliciesResult -> getAppSecMalwarePoliciesResult.outputText()));
        ctx.export("malwarePoliciesJson", malwarePolicies.applyValue(getAppSecMalwarePoliciesResult -> getAppSecMalwarePoliciesResult.json()));
        final var malwarePolicy = AkamaiFunctions.getAppSecMalwarePolicies(GetAppSecMalwarePoliciesArgs.builder()
            .configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
            .malwarePolicyId("122149")
            .build());

        ctx.export("malwarePolicyJson", malwarePolicy.applyValue(getAppSecMalwarePoliciesResult -> getAppSecMalwarePoliciesResult.json()));
        ctx.export("malwarePolicyOutput", malwarePolicy.applyValue(getAppSecMalwarePoliciesResult -> getAppSecMalwarePoliciesResult.outputText()));
    }
}
import pulumi
import pulumi_akamai as akamai

configuration = akamai.get_app_sec_configuration(name="Documentation")
malware_policies = akamai.get_app_sec_malware_policies(config_id=configuration.config_id)
pulumi.export("malwarePoliciesOutput", malware_policies.output_text)
pulumi.export("malwarePoliciesJson", malware_policies.json)
malware_policy = akamai.get_app_sec_malware_policies(config_id=configuration.config_id,
    malware_policy_id=122149)
pulumi.export("malwarePolicyJson", malware_policy.json)
pulumi.export("malwarePolicyOutput", malware_policy.output_text)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const configuration = akamai.getAppSecConfiguration({
    name: "Documentation",
});
const malwarePolicies = configuration.then(configuration => akamai.getAppSecMalwarePolicies({
    configId: configuration.configId,
}));
export const malwarePoliciesOutput = malwarePolicies.then(malwarePolicies => malwarePolicies.outputText);
export const malwarePoliciesJson = malwarePolicies.then(malwarePolicies => malwarePolicies.json);
const malwarePolicy = configuration.then(configuration => akamai.getAppSecMalwarePolicies({
    configId: configuration.configId,
    malwarePolicyId: 122149,
}));
export const malwarePolicyJson = malwarePolicy.then(malwarePolicy => malwarePolicy.json);
export const malwarePolicyOutput = malwarePolicy.then(malwarePolicy => malwarePolicy.outputText);
variables:
  configuration:
    Fn::Invoke:
      Function: akamai:getAppSecConfiguration
      Arguments:
        name: Documentation
  malwarePolicies:
    Fn::Invoke:
      Function: akamai:getAppSecMalwarePolicies
      Arguments:
        configId: ${configuration.configId}
  malwarePolicy:
    Fn::Invoke:
      Function: akamai:getAppSecMalwarePolicies
      Arguments:
        configId: ${configuration.configId}
        malwarePolicyId: 122149
outputs:
  malwarePoliciesOutput: ${malwarePolicies.outputText}
  malwarePoliciesJson: ${malwarePolicies.json} # USE CASE: User wants to see a specific malware policy.
  malwarePolicyJson: ${malwarePolicy.json}
  malwarePolicyOutput: ${malwarePolicy.outputText}

Using getAppSecMalwarePolicies

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 getAppSecMalwarePolicies(args: GetAppSecMalwarePoliciesArgs, opts?: InvokeOptions): Promise<GetAppSecMalwarePoliciesResult>
function getAppSecMalwarePoliciesOutput(args: GetAppSecMalwarePoliciesOutputArgs, opts?: InvokeOptions): Output<GetAppSecMalwarePoliciesResult>
def get_app_sec_malware_policies(config_id: Optional[int] = None,
                                 malware_policy_id: Optional[int] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetAppSecMalwarePoliciesResult
def get_app_sec_malware_policies_output(config_id: Optional[pulumi.Input[int]] = None,
                                 malware_policy_id: Optional[pulumi.Input[int]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetAppSecMalwarePoliciesResult]
func GetAppSecMalwarePolicies(ctx *Context, args *GetAppSecMalwarePoliciesArgs, opts ...InvokeOption) (*GetAppSecMalwarePoliciesResult, error)
func GetAppSecMalwarePoliciesOutput(ctx *Context, args *GetAppSecMalwarePoliciesOutputArgs, opts ...InvokeOption) GetAppSecMalwarePoliciesResultOutput

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

public static class GetAppSecMalwarePolicies 
{
    public static Task<GetAppSecMalwarePoliciesResult> InvokeAsync(GetAppSecMalwarePoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetAppSecMalwarePoliciesResult> Invoke(GetAppSecMalwarePoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAppSecMalwarePoliciesResult> getAppSecMalwarePolicies(GetAppSecMalwarePoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: akamai:index/getAppSecMalwarePolicies:getAppSecMalwarePolicies
  arguments:
    # arguments dictionary

The following arguments are supported:

ConfigId int

. Unique identifier of the security configuration associated with the malware policies.

MalwarePolicyId int

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

ConfigId int

. Unique identifier of the security configuration associated with the malware policies.

MalwarePolicyId int

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

configId Integer

. Unique identifier of the security configuration associated with the malware policies.

malwarePolicyId Integer

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

configId number

. Unique identifier of the security configuration associated with the malware policies.

malwarePolicyId number

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

config_id int

. Unique identifier of the security configuration associated with the malware policies.

malware_policy_id int

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

configId Number

. Unique identifier of the security configuration associated with the malware policies.

malwarePolicyId Number

. Unique identifier of the malware policy you want to return information for. If not included, information is returned for all of your malware policies.

getAppSecMalwarePolicies Result

The following output properties are available:

ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
MalwarePolicyId int
ConfigId int
Id string

The provider-assigned unique ID for this managed resource.

Json string
OutputText string
MalwarePolicyId int
configId Integer
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
malwarePolicyId Integer
configId number
id string

The provider-assigned unique ID for this managed resource.

json string
outputText string
malwarePolicyId number
config_id int
id str

The provider-assigned unique ID for this managed resource.

json str
output_text str
malware_policy_id int
configId Number
id String

The provider-assigned unique ID for this managed resource.

json String
outputText String
malwarePolicyId 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.