Akamai

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

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

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Akamai.CloudletsPolicy("example", new Akamai.CloudletsPolicyArgs
        {
            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"": true
  },
  {
    ""name"": ""rule2"",
    ""type"": ""erMatchRule"",
    ""matches"": [
      {
        ""matchType"": ""hostname"",
        ""matchValue"": ""3333.dom"",
        ""matchOperator"": ""equals"",
        ""caseSensitive"": true,
        ""negate"": false
      }
    ],
    ""useRelativeUrl"": ""none"",
    ""statusCode"": 301,
    ""redirectURL"": ""https://www.example.com"",
    ""useIncomingQueryString"": false,
    ""useIncomingSchemeAndHost"": true
  }
]
",
        });
    }

}
package main

import (
	"fmt"

	"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 {
		_, err := akamai.NewCloudletsPolicy(ctx, "example", &akamai.CloudletsPolicyArgs{
			CloudletCode: pulumi.String("ER"),
			Description:  pulumi.String("policy description"),
			GroupId:      pulumi.String("grp_123"),
			MatchRules: pulumi.String(fmt.Sprintf(`  [
  {
    "name": "rule1",
    "type": "erMatchRule",
    "useRelativeUrl": "none",
    "statusCode": 301,
    "redirectURL": "https://www.example.com",
    "matchURL": "example.com",
    "useIncomingQueryString": false,
    "useIncomingSchemeAndHost": true
  },
  {
    "name": "rule2",
    "type": "erMatchRule",
    "matches": [
      {
        "matchType": "hostname",
        "matchValue": "3333.dom",
        "matchOperator": "equals",
        "caseSensitive": true,
        "negate": false
      }
    ],
    "useRelativeUrl": "none",
    "statusCode": 301,
    "redirectURL": "https://www.example.com",
    "useIncomingQueryString": false,
    "useIncomingSchemeAndHost": true
  }
]
`)),
		})
		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": true
  },
  {
    "name": "rule2",
    "type": "erMatchRule",
    "matches": [
      {
        "matchType": "hostname",
        "matchValue": "3333.dom",
        "matchOperator": "equals",
        "caseSensitive": true,
        "negate": false
      }
    ],
    "useRelativeUrl": "none",
    "statusCode": 301,
    "redirectURL": "https://www.example.com",
    "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": true
  },
  {
    "name": "rule2",
    "type": "erMatchRule",
    "matches": [
      {
        "matchType": "hostname",
        "matchValue": "3333.dom",
        "matchOperator": "equals",
        "caseSensitive": true,
        "negate": false
      }
    ],
    "useRelativeUrl": "none",
    "statusCode": 301,
    "redirectURL": "https://www.example.com",
    "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": true
  },
  {
    "name": "rule2",
    "type": "erMatchRule",
    "matches": [
      {
        "matchType": "hostname",
        "matchValue": "3333.dom",
        "matchOperator": "equals",
        "caseSensitive": true,
        "negate": false
      }
    ],
    "useRelativeUrl": "none",
    "statusCode": 301,
    "redirectURL": "https://www.example.com",
    "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": true
          },
          {
            "name": "rule2",
            "type": "erMatchRule",
            "matches": [
              {
                "matchType": "hostname",
                "matchValue": "3333.dom",
                "matchOperator": "equals",
                "caseSensitive": true,
                "negate": false
              }
            ],
            "useRelativeUrl": "none",
            "statusCode": 301,
            "redirectURL": "https://www.example.com",
            "useIncomingQueryString": false,
            "useIncomingSchemeAndHost": true
          }
        ]

Create a 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:

CloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

GroupId string

Defines the group association for the policy. You must have edit privileges for the group.

Description string

The description of this specific policy.

MatchRuleFormat string

The version of the Cloudlet-specific match_rules.

MatchRules string

A JSON structure that defines the rules for this policy

Name string

The unique name of the policy.

CloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

GroupId string

Defines the group association for the policy. You must have edit privileges for the group.

Description string

The description of this specific policy.

MatchRuleFormat string

The version of the Cloudlet-specific match_rules.

MatchRules string

A JSON structure that defines the rules for this policy

Name string

The unique name of the policy.

cloudletCode String

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

groupId String

Defines the group association for the policy. You must have edit privileges for the group.

description String

The description of this specific policy.

matchRuleFormat String

The version of the Cloudlet-specific match_rules.

matchRules String

A JSON structure that defines the rules for this policy

name String

The unique name of the policy.

cloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

groupId string

Defines the group association for the policy. You must have edit privileges for the group.

description string

The description of this specific policy.

matchRuleFormat string

The version of the Cloudlet-specific match_rules.

matchRules 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, either ALB for Application Load Balancer or ER for Edge Redirector.

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_format str

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.

cloudletCode String

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

groupId String

Defines the group association for the policy. You must have edit privileges for the group.

description String

The description of this specific policy.

matchRuleFormat String

The version of the Cloudlet-specific match_rules.

matchRules 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:

CloudletId int

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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.

CloudletId int

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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.

cloudletId Integer

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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.

cloudletId number

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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, either 0 for Edge Redirector or 9 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.

cloudletId Number

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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 an 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.
The following state arguments are supported:
CloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

CloudletId int

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 for Application Load Balancer.

Description string

The description of this specific policy.

GroupId string

Defines the group association for the policy. You must have edit privileges for the group.

MatchRuleFormat string

The version of the Cloudlet-specific match_rules.

MatchRules 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.

CloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

CloudletId int

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 for Application Load Balancer.

Description string

The description of this specific policy.

GroupId string

Defines the group association for the policy. You must have edit privileges for the group.

MatchRuleFormat string

The version of the Cloudlet-specific match_rules.

MatchRules 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.

cloudletCode String

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

cloudletId Integer

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 for Application Load Balancer.

description String

The description of this specific policy.

groupId String

Defines the group association for the policy. You must have edit privileges for the group.

matchRuleFormat String

The version of the Cloudlet-specific match_rules.

matchRules 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.

cloudletCode string

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

cloudletId number

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 for Application Load Balancer.

description string

The description of this specific policy.

groupId string

Defines the group association for the policy. You must have edit privileges for the group.

matchRuleFormat string

The version of the Cloudlet-specific match_rules.

matchRules 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, either ALB for Application Load Balancer or ER for Edge Redirector.

cloudlet_id int

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 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_format str

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.

cloudletCode String

The two- or three- character code for the type of Cloudlet, either ALB for Application Load Balancer or ER for Edge Redirector.

cloudletId Number

A unique identifier that corresponds to a Cloudlets policy type, either 0 for Edge Redirector or 9 for Application Load Balancer.

description String

The description of this specific policy.

groupId String

Defines the group association for the policy. You must have edit privileges for the group.

matchRuleFormat String

The version of the Cloudlet-specific match_rules.

matchRules 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
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.