akamai.properties.getActivation

Use the akamai.PropertyActivation data source to retrieve activation information for a property version on staging or production network.

Example Usage

Basic usage

using System.Collections.Generic;
using System.IO;
using Pulumi;
using Akamai = Pulumi.Akamai;

return await Deployment.RunAsync(() => 
{
    var email = "user@example.org";

    var ruleFormat = "v2022-10-18";

    var example = new Akamai.Property("example", new()
    {
        ProductId = "prd_SPM",
        ContractId = @var.Contractid,
        GroupId = @var.Groupid,
        Hostnames = new[]
        {
            new Akamai.Inputs.PropertyHostnameArgs
            {
                CnameTo = "www.example.com.edgekey.net",
                CnameFrom = "www.example.com",
                CertProvisioningType = "DEFAULT",
            },
        },
        RuleFormat = ruleFormat,
        Rules = File.ReadAllText($"{path.Module}/main.json"),
    });

    var exampleStagingPropertyActivation = new Akamai.PropertyActivation("exampleStagingPropertyActivation", new()
    {
        PropertyId = example.Id,
        Contacts = new[]
        {
            email,
        },
        Version = example.LatestVersion,
        Note = "Sample activation",
    });

    var exampleStagingActivation = Akamai.Properties.GetActivation.Invoke(new()
    {
        PropertyId = example.Id,
        Version = example.LatestVersion,
    });

});
package main

import (
	"fmt"
	"os"

	"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai"
	"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai/properties"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := os.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		email := "user@example.org"
		ruleFormat := "v2022-10-18"
		example, err := akamai.NewProperty(ctx, "example", &akamai.PropertyArgs{
			ProductId:  pulumi.String("prd_SPM"),
			ContractId: pulumi.Any(_var.Contractid),
			GroupId:    pulumi.Any(_var.Groupid),
			Hostnames: akamai.PropertyHostnameArray{
				&akamai.PropertyHostnameArgs{
					CnameTo:              pulumi.String("www.example.com.edgekey.net"),
					CnameFrom:            pulumi.String("www.example.com"),
					CertProvisioningType: pulumi.String("DEFAULT"),
				},
			},
			RuleFormat: pulumi.String(ruleFormat),
			Rules:      readFileOrPanic(fmt.Sprintf("%v/main.json", path.Module)),
		})
		if err != nil {
			return err
		}
		_, err = akamai.NewPropertyActivation(ctx, "exampleStagingPropertyActivation", &akamai.PropertyActivationArgs{
			PropertyId: example.ID(),
			Contacts: pulumi.StringArray{
				pulumi.String(email),
			},
			Version: example.LatestVersion,
			Note:    pulumi.String("Sample activation"),
		})
		if err != nil {
			return err
		}
		_ = properties.GetActivationOutput(ctx, properties.GetActivationOutputArgs{
			PropertyId: example.ID(),
			Version:    example.LatestVersion,
		}, nil)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.akamai.Property;
import com.pulumi.akamai.PropertyArgs;
import com.pulumi.akamai.inputs.PropertyHostnameArgs;
import com.pulumi.akamai.PropertyActivation;
import com.pulumi.akamai.PropertyActivationArgs;
import com.pulumi.akamai.properties.PropertiesFunctions;
import com.pulumi.akamai.properties.inputs.GetActivationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var email = "user@example.org";

        final var ruleFormat = "v2022-10-18";

        var example = new Property("example", PropertyArgs.builder()        
            .productId("prd_SPM")
            .contractId(var_.contractid())
            .groupId(var_.groupid())
            .hostnames(PropertyHostnameArgs.builder()
                .cnameTo("www.example.com.edgekey.net")
                .cnameFrom("www.example.com")
                .certProvisioningType("DEFAULT")
                .build())
            .ruleFormat(ruleFormat)
            .rules(Files.readString(Paths.get(String.format("%s/main.json", path.module()))))
            .build());

        var exampleStagingPropertyActivation = new PropertyActivation("exampleStagingPropertyActivation", PropertyActivationArgs.builder()        
            .propertyId(example.id())
            .contacts(email)
            .version(example.latestVersion())
            .note("Sample activation")
            .build());

        final var exampleStagingActivation = PropertiesFunctions.getActivation(GetActivationArgs.builder()
            .propertyId(example.id())
            .version(example.latestVersion())
            .build());

    }
}
import pulumi
import pulumi_akamai as akamai

email = "user@example.org"
rule_format = "v2022-10-18"
example = akamai.Property("example",
    product_id="prd_SPM",
    contract_id=var["contractid"],
    group_id=var["groupid"],
    hostnames=[akamai.PropertyHostnameArgs(
        cname_to="www.example.com.edgekey.net",
        cname_from="www.example.com",
        cert_provisioning_type="DEFAULT",
    )],
    rule_format=rule_format,
    rules=(lambda path: open(path).read())(f"{path['module']}/main.json"))
example_staging_property_activation = akamai.PropertyActivation("exampleStagingPropertyActivation",
    property_id=example.id,
    contacts=[email],
    version=example.latest_version,
    note="Sample activation")
example_staging_activation = akamai.properties.get_activation_output(property_id=example.id,
    version=example.latest_version)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
import * as fs from "fs";

const email = "user@example.org";
const ruleFormat = "v2022-10-18";
const example = new akamai.Property("example", {
    productId: "prd_SPM",
    contractId: _var.contractid,
    groupId: _var.groupid,
    hostnames: [{
        cnameTo: "www.example.com.edgekey.net",
        cnameFrom: "www.example.com",
        certProvisioningType: "DEFAULT",
    }],
    ruleFormat: ruleFormat,
    rules: fs.readFileSync(`${path.module}/main.json`),
});
const exampleStagingPropertyActivation = new akamai.PropertyActivation("exampleStagingPropertyActivation", {
    propertyId: example.id,
    contacts: [email],
    version: example.latestVersion,
    note: "Sample activation",
});
const exampleStagingActivation = akamai.properties.getActivationOutput({
    propertyId: example.id,
    version: example.latestVersion,
});
resources:
  example:
    type: akamai:Property
    properties:
      productId: prd_SPM
      contractId: ${var.contractid}
      groupId: ${var.groupid}
      hostnames:
        - cnameTo: www.example.com.edgekey.net
          cnameFrom: www.example.com
          certProvisioningType: DEFAULT
      ruleFormat: ${ruleFormat}
      # line below here is assumed to be defined but left out for example brevity
      rules:
        fn::readFile: ${path.module}/main.json
  exampleStagingPropertyActivation:
    type: akamai:PropertyActivation
    properties:
      propertyId: ${example.id}
      contacts:
        - ${email}
      # NOTE: Specifying a version as shown here will target the latest version created. This latest version will always be activated in staging.
      version: ${example.latestVersion}
      # not specifying network will target STAGING
      note: Sample activation
variables:
  email: user@example.org
  ruleFormat: v2022-10-18
  exampleStagingActivation:
    fn::invoke:
      Function: akamai:properties:getActivation
      Arguments:
        propertyId: ${example.id}
        version: ${example.latestVersion}

Using getActivation

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getActivation(args: GetActivationArgs, opts?: InvokeOptions): Promise<GetActivationResult>
function getActivationOutput(args: GetActivationOutputArgs, opts?: InvokeOptions): Output<GetActivationResult>
def get_activation(network: Optional[str] = None,
                   property_id: Optional[str] = None,
                   version: Optional[int] = None,
                   opts: Optional[InvokeOptions] = None) -> GetActivationResult
def get_activation_output(network: Optional[pulumi.Input[str]] = None,
                   property_id: Optional[pulumi.Input[str]] = None,
                   version: Optional[pulumi.Input[int]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetActivationResult]
func GetActivation(ctx *Context, args *GetActivationArgs, opts ...InvokeOption) (*GetActivationResult, error)
func GetActivationOutput(ctx *Context, args *GetActivationOutputArgs, opts ...InvokeOption) GetActivationResultOutput

> Note: This function is named GetActivation in the Go SDK.

public static class GetActivation 
{
    public static Task<GetActivationResult> InvokeAsync(GetActivationArgs args, InvokeOptions? opts = null)
    public static Output<GetActivationResult> Invoke(GetActivationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetActivationResult> getActivation(GetActivationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: akamai:properties/getActivation:getActivation
  arguments:
    # arguments dictionary

The following arguments are supported:

PropertyId string

The property's unique identifier, including optional prp_ prefix.

Version int

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

Network string

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

PropertyId string

The property's unique identifier, including optional prp_ prefix.

Version int

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

Network string

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

propertyId String

The property's unique identifier, including optional prp_ prefix.

version Integer

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

network String

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

propertyId string

The property's unique identifier, including optional prp_ prefix.

version number

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

network string

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

property_id str

The property's unique identifier, including optional prp_ prefix.

version int

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

network str

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

propertyId String

The property's unique identifier, including optional prp_ prefix.

version Number

The activated property version. The value depends on the akamai.Property resource to identify the latest activated version instead of calculating it locally. To always use the latest version, set the variable to identify the resource you want to use: akamai_property.{resource identifier}.latest_version.

network String

Akamai network to check the activation, either STAGING or PRODUCTION. If not specified, this defaults to STAGING.

getActivation Result

The following output properties are available:

ActivationId string

The activation's unique identifier, including optional atv_ prefix.

Contacts List<string>

The email addresses to notify about the activation status changes.

Errors string

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

Id string

The provider-assigned unique ID for this managed resource.

Note string

Log message assigned to the activation request.

PropertyId string
Status string

The property version's activation status on the selected network.

Version int
Warnings string

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

Network string
ActivationId string

The activation's unique identifier, including optional atv_ prefix.

Contacts []string

The email addresses to notify about the activation status changes.

Errors string

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

Id string

The provider-assigned unique ID for this managed resource.

Note string

Log message assigned to the activation request.

PropertyId string
Status string

The property version's activation status on the selected network.

Version int
Warnings string

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

Network string
activationId String

The activation's unique identifier, including optional atv_ prefix.

contacts List<String>

The email addresses to notify about the activation status changes.

errors String

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

id String

The provider-assigned unique ID for this managed resource.

note String

Log message assigned to the activation request.

propertyId String
status String

The property version's activation status on the selected network.

version Integer
warnings String

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

network String
activationId string

The activation's unique identifier, including optional atv_ prefix.

contacts string[]

The email addresses to notify about the activation status changes.

errors string

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

id string

The provider-assigned unique ID for this managed resource.

note string

Log message assigned to the activation request.

propertyId string
status string

The property version's activation status on the selected network.

version number
warnings string

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

network string
activation_id str

The activation's unique identifier, including optional atv_ prefix.

contacts Sequence[str]

The email addresses to notify about the activation status changes.

errors str

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

id str

The provider-assigned unique ID for this managed resource.

note str

Log message assigned to the activation request.

property_id str
status str

The property version's activation status on the selected network.

version int
warnings str

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

network str
activationId String

The activation's unique identifier, including optional atv_ prefix.

contacts List<String>

The email addresses to notify about the activation status changes.

errors String

The contents of errors field returned by the API. For more information see Errors in the PAPI documentation.

id String

The provider-assigned unique ID for this managed resource.

note String

Log message assigned to the activation request.

propertyId String
status String

The property version's activation status on the selected network.

version Number
warnings String

The contents of warnings field returned by the API. For more information see Errors in the PAPI documentation.

network String

Package Details

Repository
Akamai pulumi/pulumi-akamai
License
Apache-2.0
Notes

This Pulumi package is based on the akamai Terraform Provider.