akamai.CloudletsPolicy
Use the akamai.CloudletsPolicy
resource to create and version a policy. For each Cloudlet instance on your contract, there can be any number of policies. A single policy is associated with a single property configuration. Within a policy version you define the rules that determine when the Cloudlet executes. You may want to create a new version of a policy to support a different business requirement, or to test new functionality.
Example Usage
Basic usage
using System.Collections.Generic;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var example = new Akamai.CloudletsPolicy("example", new()
{
CloudletCode = "ER",
Description = "policy description",
GroupId = "grp_123",
MatchRules = @" [
{
""name"": ""rule1"",
""type"": ""erMatchRule"",
""useRelativeUrl"": ""none"",
""statusCode"": 301,
""redirectURL"": ""https://www.example.com"",
""matchURL"": ""example.com"",
""useIncomingQueryString"": false,
""useIncomingSchemeAndHost"": false
},
{
""name"": ""rule2"",
""type"": ""erMatchRule"",
""matches"": [
{
""matchType"": ""path"",
""matchValue"": ""/example/website.html"",
""matchOperator"": ""equals"",
""caseSensitive"": false,
""negate"": false
}
],
""useRelativeUrl"": ""copy_scheme_hostname"",
""statusCode"": 301,
""redirectURL"": ""/website.html"",
""useIncomingQueryString"": false,
""useIncomingSchemeAndHost"": true
}
]
",
});
});
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 {
_, err := akamai.NewCloudletsPolicy(ctx, "example", &akamai.CloudletsPolicyArgs{
CloudletCode: pulumi.String("ER"),
Description: pulumi.String("policy description"),
GroupId: pulumi.String("grp_123"),
MatchRules: pulumi.String(" [\n {\n \"name\": \"rule1\",\n \"type\": \"erMatchRule\",\n \"useRelativeUrl\": \"none\",\n \"statusCode\": 301,\n \"redirectURL\": \"https://www.example.com\",\n \"matchURL\": \"example.com\",\n \"useIncomingQueryString\": false,\n \"useIncomingSchemeAndHost\": false\n },\n {\n \"name\": \"rule2\",\n \"type\": \"erMatchRule\",\n \"matches\": [\n {\n \"matchType\": \"path\",\n \"matchValue\": \"/example/website.html\",\n \"matchOperator\": \"equals\",\n \"caseSensitive\": false,\n \"negate\": false\n }\n ],\n \"useRelativeUrl\": \"copy_scheme_hostname\",\n \"statusCode\": 301,\n \"redirectURL\": \"/website.html\",\n \"useIncomingQueryString\": false,\n \"useIncomingSchemeAndHost\": true\n }\n]\n"),
})
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.CloudletsPolicy;
import com.pulumi.akamai.CloudletsPolicyArgs;
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) {
var example = new CloudletsPolicy("example", CloudletsPolicyArgs.builder()
.cloudletCode("ER")
.description("policy description")
.groupId("grp_123")
.matchRules("""
[
{
"name": "rule1",
"type": "erMatchRule",
"useRelativeUrl": "none",
"statusCode": 301,
"redirectURL": "https://www.example.com",
"matchURL": "example.com",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": false
},
{
"name": "rule2",
"type": "erMatchRule",
"matches": [
{
"matchType": "path",
"matchValue": "/example/website.html",
"matchOperator": "equals",
"caseSensitive": false,
"negate": false
}
],
"useRelativeUrl": "copy_scheme_hostname",
"statusCode": 301,
"redirectURL": "/website.html",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": true
}
]
""")
.build());
}
}
import pulumi
import pulumi_akamai as akamai
example = akamai.CloudletsPolicy("example",
cloudlet_code="ER",
description="policy description",
group_id="grp_123",
match_rules=""" [
{
"name": "rule1",
"type": "erMatchRule",
"useRelativeUrl": "none",
"statusCode": 301,
"redirectURL": "https://www.example.com",
"matchURL": "example.com",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": false
},
{
"name": "rule2",
"type": "erMatchRule",
"matches": [
{
"matchType": "path",
"matchValue": "/example/website.html",
"matchOperator": "equals",
"caseSensitive": false,
"negate": false
}
],
"useRelativeUrl": "copy_scheme_hostname",
"statusCode": 301,
"redirectURL": "/website.html",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": true
}
]
""")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const example = new akamai.CloudletsPolicy("example", {
cloudletCode: "ER",
description: "policy description",
groupId: "grp_123",
matchRules: ` [
{
"name": "rule1",
"type": "erMatchRule",
"useRelativeUrl": "none",
"statusCode": 301,
"redirectURL": "https://www.example.com",
"matchURL": "example.com",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": false
},
{
"name": "rule2",
"type": "erMatchRule",
"matches": [
{
"matchType": "path",
"matchValue": "/example/website.html",
"matchOperator": "equals",
"caseSensitive": false,
"negate": false
}
],
"useRelativeUrl": "copy_scheme_hostname",
"statusCode": 301,
"redirectURL": "/website.html",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": true
}
]
`,
});
resources:
example:
type: akamai:CloudletsPolicy
properties:
cloudletCode: ER
description: policy description
groupId: grp_123
matchRules: |2
[
{
"name": "rule1",
"type": "erMatchRule",
"useRelativeUrl": "none",
"statusCode": 301,
"redirectURL": "https://www.example.com",
"matchURL": "example.com",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": false
},
{
"name": "rule2",
"type": "erMatchRule",
"matches": [
{
"matchType": "path",
"matchValue": "/example/website.html",
"matchOperator": "equals",
"caseSensitive": false,
"negate": false
}
],
"useRelativeUrl": "copy_scheme_hostname",
"statusCode": 301,
"redirectURL": "/website.html",
"useIncomingQueryString": false,
"useIncomingSchemeAndHost": true
}
]
Create CloudletsPolicy Resource
new CloudletsPolicy(name: string, args: CloudletsPolicyArgs, opts?: CustomResourceOptions);
@overload
def CloudletsPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
cloudlet_code: Optional[str] = None,
description: Optional[str] = None,
group_id: Optional[str] = None,
match_rule_format: Optional[str] = None,
match_rules: Optional[str] = None,
name: Optional[str] = None)
@overload
def CloudletsPolicy(resource_name: str,
args: CloudletsPolicyArgs,
opts: Optional[ResourceOptions] = None)
func NewCloudletsPolicy(ctx *Context, name string, args CloudletsPolicyArgs, opts ...ResourceOption) (*CloudletsPolicy, error)
public CloudletsPolicy(string name, CloudletsPolicyArgs args, CustomResourceOptions? opts = null)
public CloudletsPolicy(String name, CloudletsPolicyArgs args)
public CloudletsPolicy(String name, CloudletsPolicyArgs args, CustomResourceOptions options)
type: akamai:CloudletsPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudletsPolicyArgs
- 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 CloudletsPolicyArgs
- 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 CloudletsPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CloudletsPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CloudletsPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
CloudletsPolicy 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 CloudletsPolicy resource accepts the following input properties:
- Cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- Group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- Description string
The description of this specific policy.
- Match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- Match
Rules string A JSON structure that defines the rules for this policy
- Name string
The unique name of the policy.
- Cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- Group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- Description string
The description of this specific policy.
- Match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- Match
Rules string A JSON structure that defines the rules for this policy
- Name string
The unique name of the policy.
- cloudlet
Code String The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- group
Id String Defines the group association for the policy. You must have edit privileges for the group.
- description String
The description of this specific policy.
- match
Rule StringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules String A JSON structure that defines the rules for this policy
- name String
The unique name of the policy.
- cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- description string
The description of this specific policy.
- match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules string A JSON structure that defines the rules for this policy
- name string
The unique name of the policy.
- cloudlet_
code str The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- group_
id str Defines the group association for the policy. You must have edit privileges for the group.
- description str
The description of this specific policy.
- match_
rule_ strformat The version of the Cloudlet-specific
match_rules
.- match_
rules str A JSON structure that defines the rules for this policy
- name str
The unique name of the policy.
- cloudlet
Code String The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- group
Id String Defines the group association for the policy. You must have edit privileges for the group.
- description String
The description of this specific policy.
- match
Rule StringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules String A JSON structure that defines the rules for this policy
- name String
The unique name of the policy.
Outputs
All input properties are implicitly available as output properties. Additionally, the CloudletsPolicy resource produces the following output properties:
- Cloudlet
Id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- Id string
The provider-assigned unique ID for this managed resource.
- Version int
The version number of the policy.
- Warnings string
A JSON-encoded list of warnings.
- Cloudlet
Id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- Id string
The provider-assigned unique ID for this managed resource.
- Version int
The version number of the policy.
- Warnings string
A JSON-encoded list of warnings.
- cloudlet
Id Integer A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- id String
The provider-assigned unique ID for this managed resource.
- version Integer
The version number of the policy.
- warnings String
A JSON-encoded list of warnings.
- cloudlet
Id number A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- id string
The provider-assigned unique ID for this managed resource.
- version number
The version number of the policy.
- warnings string
A JSON-encoded list of warnings.
- cloudlet_
id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- id str
The provider-assigned unique ID for this managed resource.
- version int
The version number of the policy.
- warnings str
A JSON-encoded list of warnings.
- cloudlet
Id Number A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- id String
The provider-assigned unique ID for this managed resource.
- version Number
The version number of the policy.
- warnings String
A JSON-encoded list of warnings.
Look up Existing CloudletsPolicy Resource
Get an existing CloudletsPolicy 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?: CloudletsPolicyState, opts?: CustomResourceOptions): CloudletsPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cloudlet_code: Optional[str] = None,
cloudlet_id: Optional[int] = None,
description: Optional[str] = None,
group_id: Optional[str] = None,
match_rule_format: Optional[str] = None,
match_rules: Optional[str] = None,
name: Optional[str] = None,
version: Optional[int] = None,
warnings: Optional[str] = None) -> CloudletsPolicy
func GetCloudletsPolicy(ctx *Context, name string, id IDInput, state *CloudletsPolicyState, opts ...ResourceOption) (*CloudletsPolicy, error)
public static CloudletsPolicy Get(string name, Input<string> id, CloudletsPolicyState? state, CustomResourceOptions? opts = null)
public static CloudletsPolicy get(String name, Output<String> id, CloudletsPolicyState 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.
- Cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- Cloudlet
Id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- Description string
The description of this specific policy.
- Group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- Match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- Match
Rules string A JSON structure that defines the rules for this policy
- Name string
The unique name of the policy.
- Version int
The version number of the policy.
- Warnings string
A JSON-encoded list of warnings.
- Cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- Cloudlet
Id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- Description string
The description of this specific policy.
- Group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- Match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- Match
Rules string A JSON structure that defines the rules for this policy
- Name string
The unique name of the policy.
- Version int
The version number of the policy.
- Warnings string
A JSON-encoded list of warnings.
- cloudlet
Code String The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- cloudlet
Id Integer A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- description String
The description of this specific policy.
- group
Id String Defines the group association for the policy. You must have edit privileges for the group.
- match
Rule StringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules String A JSON structure that defines the rules for this policy
- name String
The unique name of the policy.
- version Integer
The version number of the policy.
- warnings String
A JSON-encoded list of warnings.
- cloudlet
Code string The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- cloudlet
Id number A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- description string
The description of this specific policy.
- group
Id string Defines the group association for the policy. You must have edit privileges for the group.
- match
Rule stringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules string A JSON structure that defines the rules for this policy
- name string
The unique name of the policy.
- version number
The version number of the policy.
- warnings string
A JSON-encoded list of warnings.
- cloudlet_
code str The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- cloudlet_
id int A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- description str
The description of this specific policy.
- group_
id str Defines the group association for the policy. You must have edit privileges for the group.
- match_
rule_ strformat The version of the Cloudlet-specific
match_rules
.- match_
rules str A JSON structure that defines the rules for this policy
- name str
The unique name of the policy.
- version int
The version number of the policy.
- warnings str
A JSON-encoded list of warnings.
- cloudlet
Code String The two- or three- character code for the type of Cloudlet. Enter
ALB
for Application Load Balancer,AP
for API Prioritization,AS
for Audience Segmentation,CD
for Phased Release,ER
for Edge Redirector,FR
for Forward Rewrite,IG
for Request Control,IV
for Input Validation, orVP
for Visitor Prioritization.- cloudlet
Id Number A unique identifier that corresponds to a Cloudlets policy type. Enter
0
for Edge Redirector,1
for Visitor Prioritization,3
for Forward Rewrite,4
for Request Control,5
for API Prioritization,6
for Audience Segmentation,7
for Phased Release,8
for Input Validation, or9
for Application Load Balancer.- description String
The description of this specific policy.
- group
Id String Defines the group association for the policy. You must have edit privileges for the group.
- match
Rule StringFormat The version of the Cloudlet-specific
match_rules
.- match
Rules String A JSON structure that defines the rules for this policy
- name String
The unique name of the policy.
- version Number
The version number of the policy.
- warnings String
A JSON-encoded list of warnings.
Import
Basic usagehcl resource “akamai_cloudlets_policy” “example” {
(resource arguments)
} You can import your Akamai Cloudlets policy using a policy name. For example
$ pulumi import akamai:index/cloudletsPolicy:CloudletsPolicy example policy1
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.