Property

The akamai.Property resource represents an Akamai property configuration. This resource lets you to create, update, and activate properties on the Akamai platform.

Akamai’s edge network caches your web assets near to servers that request them. A property provides the main way to control how edge servers respond to various kinds of requests for those assets. Properties apply rules to a set of hostnames, and you can only apply one property at a time to any given hostname. Each property is assigned to a product, which determines which behaviors you can use. Each property’s default rule needs a valid content provider (CP) code assigned to bill and report for the service.

NOTE: In version 0.10 and earlier of this resource, it also controlled content provider (CP) codes, origin settings, rules, and hostname associations. Starting with version 1.0.0, this logic is broken out into individual resources.

Argument reference

This resource supports these arguments:

  • name - (Required) The property name.
  • contact - (Required) One or more email addresses to send activation status changes to.
  • contract_id - (Required) A contract’s unique ID, including the ctr_ prefix.
  • group_id - (Required) A group’s unique ID, including the grp_ prefix.
  • product_id - (Required to create, otherwise Optional) A product’s unique ID, including the prd_ prefix.
  • hostnames - (Required) A mapping of public hostnames to edge hostnames. For example: {"example.org" = "example.org.edgesuite.net"}
  • rules - (Required) A JSON-encoded rule tree for a given property. For this argument, you need to enter a complete JSON rule tree, unless you set up a series of JSON templates. See the akamai.getPropertyRules data source.
  • rule_format - (Optional) The rule format to use. Uses the latest rule format by default.
  • contract - (Deprecated) Replaced by contract_id. Maintained for legacy purposes.
  • group - (Deprecated) Replaced by group_id. Maintained for legacy purposes.
  • product - (Deprecated) Optional argument replaced by the now required product_id. Maintained for legacy purposes.

Attribute reference

The resource returns these attributes:

  • warnings - The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.
  • errors - The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.
  • latest_version - The version of the property you’ve created or updated rules for. The Akamai Provider always uses the latest version or creates a new version if latest is not editable.
  • production_version - The current version of the property active on the Akamai production network.
  • staging_version - The current version of the property active on the Akamai staging network.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Akamai.Property("example", new Akamai.PropertyArgs
        {
            Contacts = 
            {
                "user@example.org",
            },
            ProductId = "prd_SPM",
            ContractId = @var.Contractid,
            GroupId = @var.Groupid,
            Hostnames = 
            {
                { "example.org", "example.org.edgesuite.net" },
                { "www.example.org", "example.org.edgesuite.net" },
                { "sub.example.org", "sub.example.org.edgesuite.net" },
            },
            RuleFormat = "v2020-03-04",
            Rules = data.Akamai_property_rules_template.Example.Json,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := akamai.NewProperty(ctx, "example", &akamai.PropertyArgs{
			Contacts: pulumi.StringArray{
				pulumi.String("user@example.org"),
			},
			ProductId:  pulumi.String("prd_SPM"),
			ContractId: pulumi.Any(_var.Contractid),
			GroupId:    pulumi.Any(_var.Groupid),
			Hostnames: pulumi.StringMap{
				"example.org":     pulumi.String("example.org.edgesuite.net"),
				"www.example.org": pulumi.String("example.org.edgesuite.net"),
				"sub.example.org": pulumi.String("sub.example.org.edgesuite.net"),
			},
			RuleFormat: pulumi.String("v2020-03-04"),
			Rules:      pulumi.Any(data.Akamai_property_rules_template.Example.Json),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

example = akamai.Property("example",
    contacts=["user@example.org"],
    product_id="prd_SPM",
    contract_id=var["contractid"],
    group_id=var["groupid"],
    hostnames={
        "example.org": "example.org.edgesuite.net",
        "www.example.org": "example.org.edgesuite.net",
        "sub.example.org": "sub.example.org.edgesuite.net",
    },
    rule_format="v2020-03-04",
    rules=data["akamai_property_rules_template"]["example"]["json"])
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const example = new akamai.Property("example", {
    contacts: ["user@example.org"],
    productId: "prd_SPM",
    contractId: _var.contractid,
    groupId: _var.groupid,
    hostnames: {
        "example.org": "example.org.edgesuite.net",
        "www.example.org": "example.org.edgesuite.net",
        "sub.example.org": "sub.example.org.edgesuite.net",
    },
    ruleFormat: "v2020-03-04",
    rules: data.akamai_property_rules_template.example.json,
});

Create a Property Resource

new Property(name: string, args?: PropertyArgs, opts?: CustomResourceOptions);
@overload
def Property(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             contacts: Optional[Sequence[str]] = None,
             contract: Optional[str] = None,
             contract_id: Optional[str] = None,
             cp_code: Optional[str] = None,
             group: Optional[str] = None,
             group_id: Optional[str] = None,
             hostnames: Optional[Mapping[str, str]] = None,
             is_secure: Optional[bool] = None,
             name: Optional[str] = None,
             origins: Optional[Sequence[PropertyOriginArgs]] = None,
             product: Optional[str] = None,
             product_id: Optional[str] = None,
             rule_format: Optional[str] = None,
             rules: Optional[str] = None,
             variables: Optional[str] = None)
@overload
def Property(resource_name: str,
             args: Optional[PropertyArgs] = None,
             opts: Optional[ResourceOptions] = None)
func NewProperty(ctx *Context, name string, args *PropertyArgs, opts ...ResourceOption) (*Property, error)
public Property(string name, PropertyArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PropertyArgs
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 PropertyArgs
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 PropertyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PropertyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Property Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Property resource accepts the following input properties:

Contacts List<string>

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contract string

Deprecated: use "contract_id" attribute instead

ContractId string
Contract ID to be assigned to the Property
CpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Group string

Deprecated: use "group_id" attribute instead

GroupId string
Group ID to be assigned to the Property
Hostnames Dictionary<string, string>
Mapping of edge hostname CNAMEs to other CNAMEs
IsSecure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Name string
Name to give to the Property (must be unique)
Origins List<PropertyOriginArgs>

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Product string

Deprecated: use "product_id" attribute instead

ProductId string
Product ID to be assigned to the Property
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
Rules string
Property Rules as JSON
Variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contacts []string

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contract string

Deprecated: use "contract_id" attribute instead

ContractId string
Contract ID to be assigned to the Property
CpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Group string

Deprecated: use "group_id" attribute instead

GroupId string
Group ID to be assigned to the Property
Hostnames map[string]string
Mapping of edge hostname CNAMEs to other CNAMEs
IsSecure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Name string
Name to give to the Property (must be unique)
Origins []PropertyOrigin

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Product string

Deprecated: use "product_id" attribute instead

ProductId string
Product ID to be assigned to the Property
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
Rules string
Property Rules as JSON
Variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contacts string[]

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contract string

Deprecated: use "contract_id" attribute instead

contractId string
Contract ID to be assigned to the Property
cpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

group string

Deprecated: use "group_id" attribute instead

groupId string
Group ID to be assigned to the Property
hostnames {[key: string]: string}
Mapping of edge hostname CNAMEs to other CNAMEs
isSecure boolean

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

name string
Name to give to the Property (must be unique)
origins PropertyOriginArgs[]

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

product string

Deprecated: use "product_id" attribute instead

productId string
Product ID to be assigned to the Property
ruleFormat string
Specify the rule format version (defaults to latest version available when created)
rules string
Property Rules as JSON
variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contacts Sequence[str]

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contract str

Deprecated: use "contract_id" attribute instead

contract_id str
Contract ID to be assigned to the Property
cp_code str

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

group str

Deprecated: use "group_id" attribute instead

group_id str
Group ID to be assigned to the Property
hostnames Mapping[str, str]
Mapping of edge hostname CNAMEs to other CNAMEs
is_secure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

name str
Name to give to the Property (must be unique)
origins Sequence[PropertyOriginArgs]

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

product str

Deprecated: use "product_id" attribute instead

product_id str
Product ID to be assigned to the Property
rule_format str
Specify the rule format version (defaults to latest version available when created)
rules str
Property Rules as JSON
variables str

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Outputs

All input properties are implicitly available as output properties. Additionally, the Property resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
LatestVersion int
Property’s current latest version number
ProductionVersion int
Property’s version currently activated in production (zero when not active in production)
RuleErrors List<PropertyRuleError>
RuleWarnings List<PropertyRuleWarning>
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
Id string
The provider-assigned unique ID for this managed resource.
LatestVersion int
Property’s current latest version number
ProductionVersion int
Property’s version currently activated in production (zero when not active in production)
RuleErrors []PropertyRuleError
RuleWarnings []PropertyRuleWarning
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
id string
The provider-assigned unique ID for this managed resource.
latestVersion number
Property’s current latest version number
productionVersion number
Property’s version currently activated in production (zero when not active in production)
ruleErrors PropertyRuleError[]
ruleWarnings PropertyRuleWarning[]
stagingVersion number
Property’s version currently activated in staging (zero when not active in staging)
id str
The provider-assigned unique ID for this managed resource.
latest_version int
Property’s current latest version number
production_version int
Property’s version currently activated in production (zero when not active in production)
rule_errors Sequence[PropertyRuleError]
rule_warnings Sequence[PropertyRuleWarning]
staging_version int
Property’s version currently activated in staging (zero when not active in staging)

Look up an Existing Property Resource

Get an existing Property 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?: PropertyState, opts?: CustomResourceOptions): Property
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        contacts: Optional[Sequence[str]] = None,
        contract: Optional[str] = None,
        contract_id: Optional[str] = None,
        cp_code: Optional[str] = None,
        group: Optional[str] = None,
        group_id: Optional[str] = None,
        hostnames: Optional[Mapping[str, str]] = None,
        is_secure: Optional[bool] = None,
        latest_version: Optional[int] = None,
        name: Optional[str] = None,
        origins: Optional[Sequence[PropertyOriginArgs]] = None,
        product: Optional[str] = None,
        product_id: Optional[str] = None,
        production_version: Optional[int] = None,
        rule_errors: Optional[Sequence[PropertyRuleErrorArgs]] = None,
        rule_format: Optional[str] = None,
        rule_warnings: Optional[Sequence[PropertyRuleWarningArgs]] = None,
        rules: Optional[str] = None,
        staging_version: Optional[int] = None,
        variables: Optional[str] = None) -> Property
func GetProperty(ctx *Context, name string, id IDInput, state *PropertyState, opts ...ResourceOption) (*Property, error)
public static Property Get(string name, Input<string> id, PropertyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Contacts List<string>

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contract string

Deprecated: use "contract_id" attribute instead

ContractId string
Contract ID to be assigned to the Property
CpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Group string

Deprecated: use "group_id" attribute instead

GroupId string
Group ID to be assigned to the Property
Hostnames Dictionary<string, string>
Mapping of edge hostname CNAMEs to other CNAMEs
IsSecure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

LatestVersion int
Property’s current latest version number
Name string
Name to give to the Property (must be unique)
Origins List<PropertyOriginArgs>

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Product string

Deprecated: use "product_id" attribute instead

ProductId string
Product ID to be assigned to the Property
ProductionVersion int
Property’s version currently activated in production (zero when not active in production)
RuleErrors List<PropertyRuleErrorArgs>
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings List<PropertyRuleWarningArgs>
Rules string
Property Rules as JSON
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
Variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contacts []string

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Contract string

Deprecated: use "contract_id" attribute instead

ContractId string
Contract ID to be assigned to the Property
CpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Group string

Deprecated: use "group_id" attribute instead

GroupId string
Group ID to be assigned to the Property
Hostnames map[string]string
Mapping of edge hostname CNAMEs to other CNAMEs
IsSecure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

LatestVersion int
Property’s current latest version number
Name string
Name to give to the Property (must be unique)
Origins []PropertyOrigin

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Product string

Deprecated: use "product_id" attribute instead

ProductId string
Product ID to be assigned to the Property
ProductionVersion int
Property’s version currently activated in production (zero when not active in production)
RuleErrors []PropertyRuleError
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings []PropertyRuleWarning
Rules string
Property Rules as JSON
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
Variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contacts string[]

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contract string

Deprecated: use "contract_id" attribute instead

contractId string
Contract ID to be assigned to the Property
cpCode string

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

group string

Deprecated: use "group_id" attribute instead

groupId string
Group ID to be assigned to the Property
hostnames {[key: string]: string}
Mapping of edge hostname CNAMEs to other CNAMEs
isSecure boolean

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

latestVersion number
Property’s current latest version number
name string
Name to give to the Property (must be unique)
origins PropertyOriginArgs[]

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

product string

Deprecated: use "product_id" attribute instead

productId string
Product ID to be assigned to the Property
productionVersion number
Property’s version currently activated in production (zero when not active in production)
ruleErrors PropertyRuleErrorArgs[]
ruleFormat string
Specify the rule format version (defaults to latest version available when created)
ruleWarnings PropertyRuleWarningArgs[]
rules string
Property Rules as JSON
stagingVersion number
Property’s version currently activated in staging (zero when not active in staging)
variables string

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contacts Sequence[str]

Deprecated: "contact" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

contract str

Deprecated: use "contract_id" attribute instead

contract_id str
Contract ID to be assigned to the Property
cp_code str

Deprecated: "cp_code" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

group str

Deprecated: use "group_id" attribute instead

group_id str
Group ID to be assigned to the Property
hostnames Mapping[str, str]
Mapping of edge hostname CNAMEs to other CNAMEs
is_secure bool

Deprecated: "is_secure" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

latest_version int
Property’s current latest version number
name str
Name to give to the Property (must be unique)
origins Sequence[PropertyOriginArgs]

Deprecated: "origin" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

product str

Deprecated: use "product_id" attribute instead

product_id str
Product ID to be assigned to the Property
production_version int
Property’s version currently activated in production (zero when not active in production)
rule_errors Sequence[PropertyRuleErrorArgs]
rule_format str
Specify the rule format version (defaults to latest version available when created)
rule_warnings Sequence[PropertyRuleWarningArgs]
rules str
Property Rules as JSON
staging_version int
Property’s version currently activated in staging (zero when not active in staging)
variables str

Deprecated: "variables" is no longer supported by this resource type - See Akamai Terraform Upgrade Guide

Supporting Types

PropertyOrigin

PropertyRuleError

BehaviorName string
Detail string
ErrorLocation string
Instance string
StatusCode int
Title string
Type string
BehaviorName string
Detail string
ErrorLocation string
Instance string
StatusCode int
Title string
Type string
behaviorName string
detail string
errorLocation string
instance string
statusCode number
title string
type string

PropertyRuleWarning

BehaviorName string
Detail string
ErrorLocation string
Instance string
StatusCode int
Title string
Type string
BehaviorName string
Detail string
ErrorLocation string
Instance string
StatusCode int
Title string
Type string
behaviorName string
detail string
errorLocation string
instance string
statusCode number
title string
type string

Import

Basic Usagehcl resource “akamai_property” “example” {

(resource arguments)

} You can import Akamai properties using either the property_id or a comma-delimited

string of the property, contract, and group IDs. You’ll need to enter the string of IDs if the property belongs to multiple groups or contracts. If using the string of IDs, you need to enter them in this orderproperty_id,contract_id,group_id Here are some examples

 $ pulumi import akamai:index/property:Property example prp_123

Or

 $ pulumi import akamai:index/property:Property example prp_123,ctr_1-AB123,grp_123

Package Details

Repository
https://github.com/pulumi/pulumi-akamai
License
Apache-2.0
Notes
This Pulumi package is based on the akamai Terraform Provider.