akamai.AppSecSecurityPolicy
Scopes: Security configuration
Creates a new security policy. The resource enables you to:
- Create a new, “blank” security policy.
- Create a new policy preconfigured with the default security policy settings.
- Clone an existing security policy.
Related API Endpoint: /appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies
Output Options
The following options can be used to determine the information returned, and how that returned information is formatted:
security_policy_id
. ID of the newly-created security policy.
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 securityPolicyCreateAppSecSecurityPolicy = new Akamai.AppSecSecurityPolicy("securityPolicyCreateAppSecSecurityPolicy", new()
{
ConfigId = configuration.Apply(getAppSecConfigurationResult => getAppSecConfigurationResult.ConfigId),
DefaultSettings = true,
SecurityPolicyName = "Documentation Policy",
SecurityPolicyPrefix = "gms1",
});
return new Dictionary<string, object?>
{
["securityPolicyCreate"] = securityPolicyCreateAppSecSecurityPolicy.SecurityPolicyId,
};
});
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
}
securityPolicyCreateAppSecSecurityPolicy, err := akamai.NewAppSecSecurityPolicy(ctx, "securityPolicyCreateAppSecSecurityPolicy", &akamai.AppSecSecurityPolicyArgs{
ConfigId: *pulumi.Int(configuration.ConfigId),
DefaultSettings: pulumi.Bool(true),
SecurityPolicyName: pulumi.String("Documentation Policy"),
SecurityPolicyPrefix: pulumi.String("gms1"),
})
if err != nil {
return err
}
ctx.Export("securityPolicyCreate", securityPolicyCreateAppSecSecurityPolicy.SecurityPolicyId)
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.AppSecSecurityPolicy;
import com.pulumi.akamai.AppSecSecurityPolicyArgs;
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 securityPolicyCreateAppSecSecurityPolicy = new AppSecSecurityPolicy("securityPolicyCreateAppSecSecurityPolicy", AppSecSecurityPolicyArgs.builder()
.configId(configuration.applyValue(getAppSecConfigurationResult -> getAppSecConfigurationResult.configId()))
.defaultSettings(true)
.securityPolicyName("Documentation Policy")
.securityPolicyPrefix("gms1")
.build());
ctx.export("securityPolicyCreate", securityPolicyCreateAppSecSecurityPolicy.securityPolicyId());
}
}
import pulumi
import pulumi_akamai as akamai
configuration = akamai.get_app_sec_configuration(name="Documentation")
security_policy_create_app_sec_security_policy = akamai.AppSecSecurityPolicy("securityPolicyCreateAppSecSecurityPolicy",
config_id=configuration.config_id,
default_settings=True,
security_policy_name="Documentation Policy",
security_policy_prefix="gms1")
pulumi.export("securityPolicyCreate", security_policy_create_app_sec_security_policy.security_policy_id)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const configuration = akamai.getAppSecConfiguration({
name: "Documentation",
});
const securityPolicyCreateAppSecSecurityPolicy = new akamai.AppSecSecurityPolicy("securityPolicyCreateAppSecSecurityPolicy", {
configId: configuration.then(configuration => configuration.configId),
defaultSettings: true,
securityPolicyName: "Documentation Policy",
securityPolicyPrefix: "gms1",
});
export const securityPolicyCreate = securityPolicyCreateAppSecSecurityPolicy.securityPolicyId;
resources:
securityPolicyCreateAppSecSecurityPolicy:
type: akamai:AppSecSecurityPolicy
properties:
configId: ${configuration.configId}
defaultSettings: true
securityPolicyName: Documentation Policy
securityPolicyPrefix: gms1
variables:
configuration:
fn::invoke:
Function: akamai:getAppSecConfiguration
Arguments:
name: Documentation
outputs:
securityPolicyCreate: ${securityPolicyCreateAppSecSecurityPolicy.securityPolicyId}
Create AppSecSecurityPolicy Resource
new AppSecSecurityPolicy(name: string, args: AppSecSecurityPolicyArgs, opts?: CustomResourceOptions);
@overload
def AppSecSecurityPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
create_from_security_policy_id: Optional[str] = None,
default_settings: Optional[bool] = None,
security_policy_name: Optional[str] = None,
security_policy_prefix: Optional[str] = None)
@overload
def AppSecSecurityPolicy(resource_name: str,
args: AppSecSecurityPolicyArgs,
opts: Optional[ResourceOptions] = None)
func NewAppSecSecurityPolicy(ctx *Context, name string, args AppSecSecurityPolicyArgs, opts ...ResourceOption) (*AppSecSecurityPolicy, error)
public AppSecSecurityPolicy(string name, AppSecSecurityPolicyArgs args, CustomResourceOptions? opts = null)
public AppSecSecurityPolicy(String name, AppSecSecurityPolicyArgs args)
public AppSecSecurityPolicy(String name, AppSecSecurityPolicyArgs args, CustomResourceOptions options)
type: akamai:AppSecSecurityPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecSecurityPolicyArgs
- 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 AppSecSecurityPolicyArgs
- 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 AppSecSecurityPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AppSecSecurityPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AppSecSecurityPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AppSecSecurityPolicy 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 AppSecSecurityPolicy resource accepts the following input properties:
- Config
Id int . Unique identifier of the security configuration to be associated with the new security policy.
- Security
Policy stringName . Name of the new security policy.
- Security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- Create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- Default
Settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- Config
Id int . Unique identifier of the security configuration to be associated with the new security policy.
- Security
Policy stringName . Name of the new security policy.
- Security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- Create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- Default
Settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- config
Id Integer . Unique identifier of the security configuration to be associated with the new security policy.
- security
Policy StringName . Name of the new security policy.
- security
Policy StringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- create
From StringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings Boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- config
Id number . Unique identifier of the security configuration to be associated with the new security policy.
- security
Policy stringName . Name of the new security policy.
- security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- config_
id int . Unique identifier of the security configuration to be associated with the new security policy.
- security_
policy_ strname . Name of the new security policy.
- security_
policy_ strprefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- create_
from_ strsecurity_ policy_ id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default_
settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- config
Id Number . Unique identifier of the security configuration to be associated with the new security policy.
- security
Policy StringName . Name of the new security policy.
- security
Policy StringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- create
From StringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings Boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
Outputs
All input properties are implicitly available as output properties. Additionally, the AppSecSecurityPolicy resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Security
Policy stringId Unique identifier of the new security policy
- Id string
The provider-assigned unique ID for this managed resource.
- Security
Policy stringId Unique identifier of the new security policy
- id String
The provider-assigned unique ID for this managed resource.
- security
Policy StringId Unique identifier of the new security policy
- id string
The provider-assigned unique ID for this managed resource.
- security
Policy stringId Unique identifier of the new security policy
- id str
The provider-assigned unique ID for this managed resource.
- security_
policy_ strid Unique identifier of the new security policy
- id String
The provider-assigned unique ID for this managed resource.
- security
Policy StringId Unique identifier of the new security policy
Look up Existing AppSecSecurityPolicy Resource
Get an existing AppSecSecurityPolicy 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?: AppSecSecurityPolicyState, opts?: CustomResourceOptions): AppSecSecurityPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[int] = None,
create_from_security_policy_id: Optional[str] = None,
default_settings: Optional[bool] = None,
security_policy_id: Optional[str] = None,
security_policy_name: Optional[str] = None,
security_policy_prefix: Optional[str] = None) -> AppSecSecurityPolicy
func GetAppSecSecurityPolicy(ctx *Context, name string, id IDInput, state *AppSecSecurityPolicyState, opts ...ResourceOption) (*AppSecSecurityPolicy, error)
public static AppSecSecurityPolicy Get(string name, Input<string> id, AppSecSecurityPolicyState? state, CustomResourceOptions? opts = null)
public static AppSecSecurityPolicy get(String name, Output<String> id, AppSecSecurityPolicyState 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 to be associated with the new security policy.
- Create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- Default
Settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- Security
Policy stringId Unique identifier of the new security policy
- Security
Policy stringName . Name of the new security policy.
- Security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- Config
Id int . Unique identifier of the security configuration to be associated with the new security policy.
- Create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- Default
Settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- Security
Policy stringId Unique identifier of the new security policy
- Security
Policy stringName . Name of the new security policy.
- Security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- config
Id Integer . Unique identifier of the security configuration to be associated with the new security policy.
- create
From StringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings Boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- security
Policy StringId Unique identifier of the new security policy
- security
Policy StringName . Name of the new security policy.
- security
Policy StringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- config
Id number . Unique identifier of the security configuration to be associated with the new security policy.
- create
From stringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- security
Policy stringId Unique identifier of the new security policy
- security
Policy stringName . Name of the new security policy.
- security
Policy stringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- config_
id int . Unique identifier of the security configuration to be associated with the new security policy.
- create_
from_ strsecurity_ policy_ id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default_
settings bool . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- security_
policy_ strid Unique identifier of the new security policy
- security_
policy_ strname . Name of the new security policy.
- security_
policy_ strprefix . Four-character alphanumeric string prefix used in creating the security policy ID.
- config
Id Number . Unique identifier of the security configuration to be associated with the new security policy.
- create
From StringSecurity Policy Id . Unique identifier of the existing security policy that the new policy will be cloned from.
- default
Settings Boolean . Set to true to assign default setting values to the new policy; set to false to create a “blank” security policy. If not included, the new policy will be created using the default settings.
- security
Policy StringId Unique identifier of the new security policy
- security
Policy StringName . Name of the new security policy.
- security
Policy StringPrefix . Four-character alphanumeric string prefix used in creating the security policy ID.
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.