getCpCode

Use the akamai.CpCode data source to retrieve the ID for a content provider (CP) code.

Argument reference

This data source supports these arguments:

  • name - (Required) The name of the CP code.
  • group_id - (Required) The group’s unique ID, including the grp_ prefix.
  • contract_id - (Required) A contract’s unique ID, including the ctr_ prefix.

Deprecated arguments

  • contract - (Deprecated) Replaced by contract_id. Maintained for legacy purposes.
  • group - (Deprecated) Replaced by group_id. Maintained for legacy purposes.

Attributes reference

This data source returns these attributes:

  • id - The ID of the CP code, including the cpc_ prefix.
  • product_ids - An array of product IDs associated with this CP code. Each ID returned includes the prd_ prefix.

Example Usage

using Pulumi;
using Akamai = Pulumi.Akamai;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Akamai.GetCpCode.InvokeAsync(new Akamai.GetCpCodeArgs
        {
            ContractId = "ctr_1-AB123",
            GroupId = "grp_123",
            Name = "my cpcode name",
        }));
    }

}
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 {
		opt0 := "ctr_1-AB123"
		opt1 := "grp_123"
		_, err := akamai.LookupCpCode(ctx, &GetCpCodeArgs{
			ContractId: &opt0,
			GroupId:    &opt1,
			Name:       "my cpcode name",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_akamai as akamai

example = akamai.get_cp_code(contract_id="ctr_1-AB123",
    group_id="grp_123",
    name="my cpcode name")
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";

const example = pulumi.output(akamai.getCpCode({
    contractId: "ctr_1-AB123",
    groupId: "grp_123",
    name: "my cpcode name",
}));

Using getCpCode

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 getCpCode(args: GetCpCodeArgs, opts?: InvokeOptions): Promise<GetCpCodeResult>
function getCpCodeOutput(args: GetCpCodeOutputArgs, opts?: InvokeOptions): Output<GetCpCodeResult>
def get_cp_code(contract: Optional[str] = None,
                contract_id: Optional[str] = None,
                group: Optional[str] = None,
                group_id: Optional[str] = None,
                name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetCpCodeResult
def get_cp_code_output(contract: Optional[pulumi.Input[str]] = None,
                contract_id: Optional[pulumi.Input[str]] = None,
                group: Optional[pulumi.Input[str]] = None,
                group_id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetCpCodeResult]
func LookupCpCode(ctx *Context, args *LookupCpCodeArgs, opts ...InvokeOption) (*LookupCpCodeResult, error)
func LookupCpCodeOutput(ctx *Context, args *LookupCpCodeOutputArgs, opts ...InvokeOption) LookupCpCodeResultOutput

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

public static class GetCpCode 
{
    public static Task<GetCpCodeResult> InvokeAsync(GetCpCodeArgs args, InvokeOptions? opts = null)
    public static Output<GetCpCodeResult> Invoke(GetCpCodeInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
Contract string

Deprecated: The setting "contract" has been deprecated.

ContractId string
Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Name string
Contract string

Deprecated: The setting "contract" has been deprecated.

ContractId string
Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
name string
contract string

Deprecated: The setting "contract" has been deprecated.

contractId string
group string

Deprecated: The setting "group" has been deprecated.

groupId string
name str
contract str

Deprecated: The setting "contract" has been deprecated.

contract_id str
group str

Deprecated: The setting "group" has been deprecated.

group_id str

getCpCode Result

The following output properties are available:

Contract string

Deprecated: The setting "contract" has been deprecated.

ContractId string
Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Id string
The provider-assigned unique ID for this managed resource.
Name string
ProductIds List<string>
Contract string

Deprecated: The setting "contract" has been deprecated.

ContractId string
Group string

Deprecated: The setting "group" has been deprecated.

GroupId string
Id string
The provider-assigned unique ID for this managed resource.
Name string
ProductIds []string
contract string

Deprecated: The setting "contract" has been deprecated.

contractId string
group string

Deprecated: The setting "group" has been deprecated.

groupId string
id string
The provider-assigned unique ID for this managed resource.
name string
productIds string[]
contract str

Deprecated: The setting "contract" has been deprecated.

contract_id str
group str

Deprecated: The setting "group" has been deprecated.

group_id str
id str
The provider-assigned unique ID for this managed resource.
name str
product_ids Sequence[str]

Package Details

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