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.

  • 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 - (Optional) A mapping of public hostnames to edge hostnames. See the akamai.getPropertyHostnames data source for details on the necessary DNS configuration.

    Note Starting from version 1.5.0, the hostnames argument supports a new block type. If you created your code and state in version 1.4 or earlier, you need to manually update your configuration and replace the previous input for hostnames with the new syntax. This error indicates that the state is outdated: Error: missing expected [. To fix it, remove akamai.Property from the state and import it again.

    Requires these additional arguments:

    * `cname_from` - (Required) A string containing the original origin's hostname. For example, `"example.org"`.
    * `cname_to` - (Required) A string containing the hostname for edge content. For example,  `"example.org.edgesuite.net"`.
    * `cert_provisioning_type` - (Required) The certificate’s provisioning type, either the default `CPS_MANAGED` type for the custom certificates you provision with the [Certificate Provisioning System (CPS)](https://learn.akamai.com/en-us/products/core_features/certificate_provisioning_system.html), or `DEFAULT` for certificates provisioned automatically.
    
  • rules - (Optional) 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:

  • rule_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.

Deprecated attributes

  • rule_warnings - (Deprecated) Rule warnings are no longer maintained in the state file. You can still see the warnings in logs.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Akamai.Property("example", new Akamai.PropertyArgs
        {
            ProductId = "prd_SPM",
            ContractId = @var.Contractid,
            GroupId = @var.Groupid,
            Hostnames = 
            {
                new Akamai.Inputs.PropertyHostnameArgs
                {
                    CnameFrom = "example.com",
                    CnameTo = "example.com.edgekey.net",
                    CertProvisioningType = "DEFAULT",
                },
                new Akamai.Inputs.PropertyHostnameArgs
                {
                    CnameFrom = "www.example.com",
                    CnameTo = "example.com.edgesuite.net",
                    CertProvisioningType = "CPS_MANAGED",
                },
            },
            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{
			ProductId:  pulumi.String("prd_SPM"),
			ContractId: pulumi.Any(_var.Contractid),
			GroupId:    pulumi.Any(_var.Groupid),
			Hostnames: PropertyHostnameArray{
				&PropertyHostnameArgs{
					CnameFrom:            pulumi.String("example.com"),
					CnameTo:              pulumi.String("example.com.edgekey.net"),
					CertProvisioningType: pulumi.String("DEFAULT"),
				},
				&PropertyHostnameArgs{
					CnameFrom:            pulumi.String("www.example.com"),
					CnameTo:              pulumi.String("example.com.edgesuite.net"),
					CertProvisioningType: pulumi.String("CPS_MANAGED"),
				},
			},
			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",
    product_id="prd_SPM",
    contract_id=var["contractid"],
    group_id=var["groupid"],
    hostnames=[
        akamai.PropertyHostnameArgs(
            cname_from="example.com",
            cname_to="example.com.edgekey.net",
            cert_provisioning_type="DEFAULT",
        ),
        akamai.PropertyHostnameArgs(
            cname_from="www.example.com",
            cname_to="example.com.edgesuite.net",
            cert_provisioning_type="CPS_MANAGED",
        ),
    ],
    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", {
    productId: "prd_SPM",
    contractId: _var.contractid,
    groupId: _var.groupid,
    hostnames: [
        {
            cnameFrom: "example.com",
            cnameTo: "example.com.edgekey.net",
            certProvisioningType: "DEFAULT",
        },
        {
            cnameFrom: "www.example.com",
            cnameTo: "example.com.edgesuite.net",
            certProvisioningType: "CPS_MANAGED",
        },
    ],
    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[Sequence[PropertyHostnameArgs]] = 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,
             rule_warnings: Optional[Sequence[PropertyRuleWarningArgs]] = 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 Architecture and Concepts docs.

Inputs

The Property resource accepts the following input properties:

Contacts List<string>

Deprecated: The setting "contact" has been deprecated.

Contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Group ID to be assigned to the Property
Hostnames List<PropertyHostnameArgs>
IsSecure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

Product string

Deprecated: The setting "product" has been deprecated.

ProductId string
Product ID to be assigned to the Property
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings List<PropertyRuleWarningArgs>

Deprecated: Rule warnings will not be set in state anymore

Rules string
Property Rules as JSON
Variables string

Deprecated: The setting "variables" has been deprecated.

Contacts []string

Deprecated: The setting "contact" has been deprecated.

Contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Group ID to be assigned to the Property
Hostnames []PropertyHostnameArgs
IsSecure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

Product string

Deprecated: The setting "product" has been deprecated.

ProductId string
Product ID to be assigned to the Property
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings []PropertyRuleWarningArgs

Deprecated: Rule warnings will not be set in state anymore

Rules string
Property Rules as JSON
Variables string

Deprecated: The setting "variables" has been deprecated.

contacts string[]

Deprecated: The setting "contact" has been deprecated.

contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

group string

Deprecated: The setting "group" has been deprecated.

groupId string
Group ID to be assigned to the Property
hostnames PropertyHostnameArgs[]
isSecure boolean

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

product string

Deprecated: The setting "product" has been deprecated.

productId string
Product ID to be assigned to the Property
ruleFormat string
Specify the rule format version (defaults to latest version available when created)
ruleWarnings PropertyRuleWarningArgs[]

Deprecated: Rule warnings will not be set in state anymore

rules string
Property Rules as JSON
variables string

Deprecated: The setting "variables" has been deprecated.

contacts Sequence[str]

Deprecated: The setting "contact" has been deprecated.

contract str

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

group str

Deprecated: The setting "group" has been deprecated.

group_id str
Group ID to be assigned to the Property
hostnames Sequence[PropertyHostnameArgs]
is_secure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

product str

Deprecated: The setting "product" has been deprecated.

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)
rule_warnings Sequence[PropertyRuleWarningArgs]

Deprecated: Rule warnings will not be set in state anymore

rules str
Property Rules as JSON
variables str

Deprecated: The setting "variables" has been deprecated.

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)
ReadVersion int
Required property’s version to be read
RuleErrors List<PropertyRuleError>
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)
ReadVersion int
Required property’s version to be read
RuleErrors []PropertyRuleError
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)
readVersion number
Required property’s version to be read
ruleErrors PropertyRuleError[]
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)
read_version int
Required property’s version to be read
rule_errors Sequence[PropertyRuleError]
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[Sequence[PropertyHostnameArgs]] = 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,
        read_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: The setting "contact" has been deprecated.

Contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Group ID to be assigned to the Property
Hostnames List<PropertyHostnameArgs>
IsSecure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

Product string

Deprecated: The setting "product" has been deprecated.

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)
ReadVersion int
Required property’s version to be read
RuleErrors List<PropertyRuleErrorArgs>
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings List<PropertyRuleWarningArgs>

Deprecated: Rule warnings will not be set in state anymore

Rules string
Property Rules as JSON
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
Variables string

Deprecated: The setting "variables" has been deprecated.

Contacts []string

Deprecated: The setting "contact" has been deprecated.

Contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Group ID to be assigned to the Property
Hostnames []PropertyHostnameArgs
IsSecure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

Product string

Deprecated: The setting "product" has been deprecated.

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)
ReadVersion int
Required property’s version to be read
RuleErrors []PropertyRuleErrorArgs
RuleFormat string
Specify the rule format version (defaults to latest version available when created)
RuleWarnings []PropertyRuleWarningArgs

Deprecated: Rule warnings will not be set in state anymore

Rules string
Property Rules as JSON
StagingVersion int
Property’s version currently activated in staging (zero when not active in staging)
Variables string

Deprecated: The setting "variables" has been deprecated.

contacts string[]

Deprecated: The setting "contact" has been deprecated.

contract string

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

group string

Deprecated: The setting "group" has been deprecated.

groupId string
Group ID to be assigned to the Property
hostnames PropertyHostnameArgs[]
isSecure boolean

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

product string

Deprecated: The setting "product" has been deprecated.

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)
readVersion number
Required property’s version to be read
ruleErrors PropertyRuleErrorArgs[]
ruleFormat string
Specify the rule format version (defaults to latest version available when created)
ruleWarnings PropertyRuleWarningArgs[]

Deprecated: Rule warnings will not be set in state anymore

rules string
Property Rules as JSON
stagingVersion number
Property’s version currently activated in staging (zero when not active in staging)
variables string

Deprecated: The setting "variables" has been deprecated.

contacts Sequence[str]

Deprecated: The setting "contact" has been deprecated.

contract str

Deprecated: The setting "contract" has been deprecated.

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

Deprecated: The setting "cp_code" has been deprecated.

group str

Deprecated: The setting "group" has been deprecated.

group_id str
Group ID to be assigned to the Property
hostnames Sequence[PropertyHostnameArgs]
is_secure bool

Deprecated: The setting "is_secure" has been deprecated.

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

Deprecated: The setting "origin" has been deprecated.

product str

Deprecated: The setting "product" has been deprecated.

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)
read_version int
Required property’s version to be read
rule_errors Sequence[PropertyRuleErrorArgs]
rule_format str
Specify the rule format version (defaults to latest version available when created)
rule_warnings Sequence[PropertyRuleWarningArgs]

Deprecated: Rule warnings will not be set in state anymore

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: The setting "variables" has been deprecated.

Supporting Types

PropertyHostname

PropertyHostnameCertStatus

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 the latest Akamai property version by 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 To import a specific property version, pass additional parameters, either* LATEST to import the latest version of the property, regardless of whether it’s active or not. This works the same as providing just the property_id or a string of the property, contract, and group IDs, which is the default behavior. * PRODUCTION, PROD, or P to import the latest version activated on the production environment. * STAGING, STAGE, STAG, or S to import the latest version activated on the staging environment. * Version number or version number with the ver_ prefix to import a specific property version. For example 3 and ver_3 correspond to the same version number. Here are some examples for the latest property version

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

Or

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

Here are some examples for the latest active property version on the production network

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

Or

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

Here are some examples for the specific property version

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

Or

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

Package Details

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